00001
00013 #ifndef _LLC_H_
00014 #define _LLC_H_
00015
00022
00023
00024
00025
00026
00027 #include "co_int.h"
00028
00029
00030
00031
00032
00033
00038 #define LLC_LLC_LEN 3
00039 #define LLC_DSAP 0xAA
00040 #define LLC_SSAP 0xAA
00041 #define LLC_CTRL 0x03
00042
00046 #define LLC_SNAP_LEN 5
00047 #define LLC_OUI_LEN 3
00048
00052 #define LLC_802_2_HDR_LEN (LLC_LLC_LEN + LLC_SNAP_LEN)
00053
00054
00056
00057 #define LLC_ETHER_MTU 1500
00059 #define LLC_ETHER_HDR_LEN 14
00061 #define LLC_ETHERTYPE_LEN 2
00063 #define LLC_ETHERTYPE_LEN_OFT 12
00065 #define LLC_802_2_ETHERTYPE_OFT 6
00067 #define LLC_FRAMELENGTH_MAXVALUE 0x600
00068
00070 #define LLC_ETHERTYPE_APPLETALK 0x809B
00071 #define LLC_ETHERTYPE_IPX 0x8137
00072 #define LLC_ETHERTYPE_AARP 0x80F3
00073 #define LLC_ETHERTYPE_EAP_T 0x888E
00074 #define LLC_ETHERTYPE_802_1Q 0x8100
00075 #define LLC_ETHERTYPE_IP 0x0800
00076 #define LLC_ETHERTYPE_ARP 0x0806
00077
00079 #define LLC_802_1Q_TCI_VID_MASK 0x0FFF
00080 #define LLC_802_1Q_TCI_PRI_MASK 0xE000
00081 #define LLC_802_1Q_TCI_CFI_MASK 0x1000
00082 #define LLC_802_1Q_HDR_LEN 4
00083 #define LLC_802_1Q_VID_NULL 0
00084 #define LLC_OFFSET_ETHERTYPE 12
00085 #define LLC_OFFSET_IPV4_PRIO 15
00086 #define LLC_OFFSET_802_1Q_TCI 14
00088
00089
00090
00091
00092
00093
00094
00096 struct llc_snap_short
00097 {
00099 uint16_t dsap_ssap;
00101 uint16_t control_oui0;
00103 uint16_t oui1_2;
00104 };
00105
00107 struct llc_snap
00108 {
00110 uint16_t dsap_ssap;
00112 uint16_t control_oui0;
00114 uint16_t oui1_2;
00116 uint16_t proto_id;
00117 };
00118
00119
00120
00121
00122
00124 extern const struct llc_snap_short llc_rfc1042_hdr;
00125
00127 extern const struct llc_snap_short llc_bridge_tunnel_hdr;
00128
00130
00131 #endif // _LLC_H_