⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 if_tr.h

📁 This directory contains source code for tcpdump, a tool for network monitoring and data acquisition
💻 H
字号:
/*
 * INET        An implementation of the TCP/IP protocol suite for the LINUX
 *     operating system.  INET is implemented using the  BSD Socket
 *     interface as the means of communication with the user level.
 *
 *     Global definitions for the Token-Ring IEEE 802.5 interface.
 *
 * Version:    @(#)if_tr.h 0.0 07/11/94
 *
 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
 *     Donald Becker, <becker@super.org>
 *    Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
 *
 *     This program is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License
 *     as published by the Free Software Foundation; either version
 *     2 of the License, or (at your option) any later version.
 */
#ifndef _LINUX_IF_TR_H
#define _LINUX_IF_TR_H

/* IEEE 802.5 Token-Ring magic constants.  The frame sizes omit the
 * preamble and FCS/CRC (frame check sequence).
 */
#define TR_ALEN   6       /* Octets in one ethernet addr */
#define TR_HLEN   (sizeof(struct trh_hdr)+sizeof(struct trllc))
#define AC        0x10
#define LLC_FRAME 0x40

/* LLC and SNAP constants
 */
#define EXTENDED_SAP 0xAA
#define UI_CMD       0x03

/* This is an Token-Ring frame header.
 */
struct trh_hdr {
       BYTE ac;                 /* access control field */
       BYTE fc;                 /* frame control field */
       BYTE daddr[TR_ALEN];     /* destination address */
       BYTE saddr[TR_ALEN];     /* source address */
       WORD rcf;                /* route control field */
       WORD rseg[8];            /* routing registers */
     };

/* This is an Token-Ring LLC structure
 */
struct trllc {
       BYTE dsap;               /* destination SAP */
       BYTE ssap;               /* source SAP */
       BYTE llc;                /* LLC control field */
       BYTE protid[3];          /* protocol id */
       WORD ethertype;          /* ether type field */
     };

/* Token-Ring statistics collection data.
 */
struct tr_statistics {
       DWORD rx_packets;        /* total packets received*/
       DWORD tx_packets;        /* total packets transmitted */
       DWORD rx_errors;         /* bad packets received  */
       DWORD tx_errors;         /* packet transmit problems */
       DWORD rx_dropped;        /* no space in linux buffers */
       DWORD tx_dropped;        /* no space available in linux  */
       DWORD multicast;         /* multicast packets received*/
       DWORD transmit_collision;

       /* detailed Token-Ring errors. See IBM Token-Ring Network
        * Architecture for more info
        */      
       DWORD line_errors;
       DWORD internal_errors;
       DWORD burst_errors;
       DWORD A_C_errors;
       DWORD abort_delimiters;
       DWORD lost_frames;
       DWORD recv_congest_count;
       DWORD frame_copied_errors;
       DWORD frequency_errors;
       DWORD token_errors;
       DWORD dummy1;
     };

/* source routing stuff
 */
#define TR_RII                   0x80
#define TR_RCF_DIR_BIT           0x80
#define TR_RCF_LEN_MASK          0x1f00
#define TR_RCF_BROADCAST         0x8000  /* all-routes broadcast */
#define TR_RCF_LIMITED_BROADCAST 0xC000  /* single-route broadcast */
#define TR_RCF_FRAME2K           0x20
#define TR_RCF_BROADCAST_MASK    0xC000

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -