📄 trn.h
字号:
/** Copyright (c) 1998-2001 by NETsilicon Inc.** This software is copyrighted by and is the sole property of* NETsilicon. All rights, title, ownership, or other interests* in the software remain the property of NETsilicon. This* software may only be used in accordance with the corresponding* license agreement. Any unauthorized use, duplication, transmission,* distribution, or disclosure of this software is expressly forbidden.** This Copyright notice may not be removed or modified without prior* written consent of NETsilicon.** NETsilicon, reserves the right to modify this software* without notice.** NETsilicon* 411 Waverley Oaks Road USA 781.647.1234* Suite 227 http://www.netsilicon.com* Waltham, MA 02452 AmericaSales@netsilicon.com*************************************************************************** $Name: Fusion 6.52 Fusion 6.51 $* $Date: 2001/09/20 10:19:25 $* $Source: M:/psisrc/stack/incl/rcs/trn.h $* $Revision: 1.8 $*************************************************************************** File Description: Token-Ring layer definitions***************************************************************************/#ifndef _TRN_#define _TRN_#include "config.h"#include "ccdep.h"#define TR_MAX_PACKET 2046 /* max packet for proteon boards */ /* max data for proteon boards */#define TR_MAX_DATA (TR_MAX_PACKET-sizeof(trnh))/* OL: following structures need to be packed *//* trn link layer header */typedef u8 TRNH;#define TRNH_SAC 0 /* access control, 1 byte */#define TRNH_SFC (TRNH_SAC+1) /* frame control, 1 byte */#define TRNH_DEST (TRNH_SFC+1) /* destination tr address, 6 bytes */#define TRNH_SRC (TRNH_DEST+6) /* source tr address with ri (trnh_pad) bit, 6 bytes */#define TRNH_PAD (TRNH_SRC+6) /* token ring routing field, 18 bytes */ /* See RFC 1042 for the following interpretations - SNAP */#define TRNH_DSAP (TRNH_PAD+18) /* 170 = AA, This and SSAP being AA means, 1 byte */#define TRNH_SSAP (TRNH_DSAP+1) /* sub network access protocol, 1 byte */#ifdef RFC1042#define TRNH_CONTROL (TRNH_SSAP+1) /* is 0x03 - unnumbered information, 1 byte */#define TRNH_PIOC (TRNH_CONTROL+1) /* 3 zeros of protocol id or org code, 3 bytes */#define TRNH_TYPE (TRNH_PIOC+3) /* as in ethenet type, 2 bytes */#define SIZEOF_TRNH (TRNH_TYPE+2)#else#define TRNH_DLCTR (TRNH_SSAP+1) /* 2 bytes */#define TRNH_DLFLD (TRNH_DLCTR+2) /* 2 bytes */#define SIZEOF_TRNH (TRNH_DLFLD+2)#endiftypedef u8 TRNP_T;#define TRNH_SAC 0 /* 1 byte */#define TRNH_SFC (TRNH_SAC+1) /* 1 byte */#define TRNH_DEST (TRNH_SFC+1) /* 6 bytes */#define TRNH_SRC (TRNH_DEST+6) /* 6 bytes */#define TRNH_PAD (TRNH_SRC+6) /* 18 bytes */#define TRNH_DSAP (TRNH_PAD+18) /* 1 byte */#define TRNH_SSAP (TRNH_DSAP+1) /* 1 byte */#ifdef RFC1042#define TRNH_CONTROL (TRNH_SSAP+1) /* 1 byte */#define TRNH_PIOC (TRNH_CONTROL+1) /* 3 bytes */#define TRNH_TYPE (TRNH_PIOC+3) /* 2 bytes */#define TRHN_PLACE_HOLDER (TRNH_TYPE+2)#else#define TRNH_DLCTR (TRNH_SSAP+1) /* 2 bytes */#define TRNH_DLFLD (TRNH_DLCTR+2) /* 2 bytes */#define TRHN_PLACE_HOLDER (TRNH_DLFLD+2)#endif#define TR_DATA TRHN_PLACE_HOLDER /* TR_MAX_DATA bytes */#define SIZEOF_TRNP_T (TR_DATA+TR_MAX_DATA)/* End of packed structures */#define TR_AC 0x40#define TR_FC 0x40#ifdef RFC1042/* values for trnh_dsap and trnh_ssap */#define TR_K1 0xAA /* 170 in decimal - means Unnumbered Info */#define TR_SNAP 0x03 /* RFC 1042 SNAP Unnumbered Information */#define TR_K2 0x00 /* three bytes of zeros */#define TR_HDR_SIZE 42/* The protocol codes, using SNAP, are a carry over from Ethernet */#define TR_XNS 0x0600#define TR_IP 0x0800#define TR_ARP 0x0806#define TRN_RAW 0x0000#else#define TR_DLCTR 0x0003#define TR_DLFLD 0x0600#define TR_HDR_SIZE 38#define TR_XNS 0x81 #define TR_IP 0x06 #define TR_ARP 0x84 #define TRN_RAW 0x88 #define TR_MSGS 0x80 #define TR_RARP 0x00 #endif /* RFC1042 */#define TR_RQ_MAX 5 #endif /*_TRN_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -