Rev 4728 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4728 | Rev 4743 | ||
---|---|---|---|
Line 50... | Line 50... | ||
50 | 50 | ||
51 | /** Ethernet header start of frame value. |
51 | /** Ethernet header start of frame value. |
52 | */ |
52 | */ |
53 | #define ETH_SFD 0xD5 |
53 | #define ETH_SFD 0xD5 |
54 | 54 | ||
55 | /** Type definition of the Ethernet header with all the extensions. |
55 | /** IEEE 802.2 unordered information control field. |
56 | * @see eth_header_ex |
- | |
57 | */ |
56 | */ |
58 | typedef struct eth_header_ex eth_header_ex_t; |
57 | #define IEEE_8023_2_UI 0x03 |
59 | 58 | ||
60 | /** Type definition of the Ethernet header with all the extensions pointer. |
59 | /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions. |
61 | * @see eth_header |
60 | * @see eth_header_snap |
62 | */ |
61 | */ |
63 | typedef eth_header_ex_t * eth_header_ex_ref; |
62 | typedef struct eth_header_snap eth_header_snap_t; |
64 | 63 | ||
- | 64 | /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions pointer. |
|
- | 65 | * @see eth_header_snap |
|
- | 66 | */ |
|
- | 67 | typedef eth_header_snap_t * eth_header_snap_ref; |
|
- | 68 | ||
65 | /** Type definition of the Ethernet header LSAP extension. |
69 | /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions. |
66 | * @see eth_header_lsap |
70 | * @see eth_header_lsap |
67 | */ |
71 | */ |
68 | typedef struct eth_header_lsap eth_header_lsap_t; |
72 | typedef struct eth_header_lsap eth_header_lsap_t; |
69 | 73 | ||
70 | /** Type definition of the Ethernet header LSAP extension pointer. |
74 | /** Type definition of the Ethernet header IEEE 802.3 + 802.2 extension pointer. |
71 | * @see eth_header_lsap |
75 | * @see eth_header_lsap |
72 | */ |
76 | */ |
73 | typedef eth_header_lsap_t * eth_header_lsap_ref; |
77 | typedef eth_header_lsap_t * eth_header_lsap_ref; |
74 | 78 | ||
- | 79 | /** Type definition of the Ethernet header LSAP extension. |
|
- | 80 | * @see eth_ieee_lsap |
|
- | 81 | */ |
|
- | 82 | typedef struct eth_ieee_lsap eth_ieee_lsap_t; |
|
- | 83 | ||
- | 84 | /** Type definition of the Ethernet header LSAP extension pointer. |
|
- | 85 | * @see eth_ieee_lsap |
|
- | 86 | */ |
|
- | 87 | typedef eth_ieee_lsap_t * eth_ieee_lsap_ref; |
|
- | 88 | ||
75 | /** Type definition of the Ethernet header SNAP extension. |
89 | /** Type definition of the Ethernet header SNAP extension. |
76 | * @see eth_header_snap |
90 | * @see eth_snap |
77 | */ |
91 | */ |
78 | typedef struct eth_header_snap eth_header_snap_t; |
92 | typedef struct eth_snap eth_snap_t; |
79 | 93 | ||
80 | /** Type definition of the Ethernet header SNAP extension pointer. |
94 | /** Type definition of the Ethernet header SNAP extension pointer. |
81 | * @see eth_header_snap |
95 | * @see eth_snap |
82 | */ |
96 | */ |
83 | typedef eth_header_snap_t * eth_header_snap_ref; |
97 | typedef eth_snap_t * eth_snap_ref; |
84 | 98 | ||
85 | /** Type definition of the Ethernet header preamble. |
99 | /** Type definition of the Ethernet header preamble. |
86 | * @see preamble |
100 | * @see preamble |
87 | */ |
101 | */ |
88 | typedef struct eth_preamble eth_preamble_t; |
102 | typedef struct eth_preamble eth_preamble_t; |
89 | 103 | ||
90 | /** Type definition of the Ethernet header preamble pointer. |
104 | /** Type definition of the Ethernet header preamble pointer. |
91 | * @see eth_preamble |
105 | * @see eth_preamble |
92 | */ |
106 | */ |
93 | typedef eth_preamble_t * eth_preamble_ref; |
107 | typedef eth_preamble_t * eth_preamble_ref; |
94 | 108 | ||
95 | /** Type definition of the Ethernet header. |
109 | /** Type definition of the Ethernet header. |
96 | * @see eth_header |
110 | * @see eth_header |
97 | */ |
111 | */ |
98 | typedef struct eth_header eth_header_t; |
112 | typedef struct eth_header eth_header_t; |
Line 102... | Line 116... | ||
102 | */ |
116 | */ |
103 | typedef eth_header_t * eth_header_ref; |
117 | typedef eth_header_t * eth_header_ref; |
104 | 118 | ||
105 | /** Ethernet header Link Service Access Point extension. |
119 | /** Ethernet header Link Service Access Point extension. |
106 | */ |
120 | */ |
107 | struct eth_header_lsap{ |
121 | struct eth_ieee_lsap{ |
108 | /** Destination Service Access Point identifier. |
122 | /** Destination Service Access Point identifier. |
109 | * The possible values are assigned by an IEEE committee. |
123 | * The possible values are assigned by an IEEE committee. |
110 | */ |
124 | */ |
111 | uint8_t dsap; |
125 | uint8_t dsap; |
112 | /** Source Service Access Point identifier. |
126 | /** Source Service Access Point identifier. |
Line 119... | Line 133... | ||
119 | uint8_t ctrl; |
133 | uint8_t ctrl; |
120 | } __attribute__ ((packed)); |
134 | } __attribute__ ((packed)); |
121 | 135 | ||
122 | /** Ethernet header SNAP extension. |
136 | /** Ethernet header SNAP extension. |
123 | */ |
137 | */ |
124 | struct eth_header_snap{ |
138 | struct eth_snap{ |
125 | /** Protocol identifier or organization code. |
139 | /** Protocol identifier or organization code. |
126 | */ |
140 | */ |
127 | uint8_t protocol[ 3 ]; |
141 | uint8_t protocol[ 3 ]; |
128 | /** Ethernet protocol identifier in the network byte order (big endian). |
142 | /** Ethernet protocol identifier in the network byte order (big endian). |
129 | * @see ethernet_protocols.h |
143 | * @see ethernet_protocols.h |
Line 158... | Line 172... | ||
158 | * @see ethernet_protocols.h |
172 | * @see ethernet_protocols.h |
159 | */ |
173 | */ |
160 | uint16_t ethertype; |
174 | uint16_t ethertype; |
161 | } __attribute__ ((packed)); |
175 | } __attribute__ ((packed)); |
162 | 176 | ||
163 | /** Ethernet header with all the extensions. |
177 | /** Ethernet header IEEE 802.3 + 802.2 extension. |
- | 178 | */ |
|
- | 179 | struct eth_header_lsap{ |
|
- | 180 | /** Ethernet header. |
|
- | 181 | */ |
|
- | 182 | eth_header_t header; |
|
- | 183 | /** LSAP extension. |
|
- | 184 | * If DSAP and SSAP are set to ETH_LSAP_SNAP the SNAP extension is being used. |
|
- | 185 | * If DSAP and SSAP fields are equal to ETH_RAW the raw Ethernet packet without any extensions is being used and the frame content starts rigth after the two fields. |
|
- | 186 | */ |
|
- | 187 | eth_ieee_lsap_t lsap; |
|
- | 188 | } __attribute__ ((packed)); |
|
- | 189 | ||
- | 190 | /** Ethernet header IEEE 802.3 + 802.2 + SNAP extensions. |
|
164 | */ |
191 | */ |
165 | struct eth_header_ex{ |
192 | struct eth_header_snap{ |
166 | /** Ethernet header. |
193 | /** Ethernet header. |
167 | */ |
194 | */ |
168 | eth_header_t header; |
195 | eth_header_t header; |
169 | /** LSAP extension. |
196 | /** LSAP extension. |
170 | * If DSAP and SSAP are set to ETH_LSAP_SNAP the SNAP extension is being used. |
197 | * If DSAP and SSAP are set to ETH_LSAP_SNAP the SNAP extension is being used. |
171 | * If DSAP and SSAP fields are equal to ETH_RAW the raw Ethernet packet without any extensions is being used and the frame content starts rigth after the two fields. |
198 | * If DSAP and SSAP fields are equal to ETH_RAW the raw Ethernet packet without any extensions is being used and the frame content starts rigth after the two fields. |
172 | */ |
199 | */ |
173 | eth_header_lsap_t lsap; |
200 | eth_ieee_lsap_t lsap; |
174 | /** SNAP extension. |
201 | /** SNAP extension. |
175 | */ |
202 | */ |
176 | eth_header_snap_t snap; |
203 | eth_snap_t snap; |
177 | } __attribute__ ((packed)); |
204 | } __attribute__ ((packed)); |
178 | 205 | ||
179 | /** Ethernet Frame Check Sequence. |
206 | /** Ethernet Frame Check Sequence. |
180 | */ |
207 | */ |
181 | typedef uint32_t eth_fcs_t; |
208 | typedef uint32_t eth_fcs_t; |