Changes in uspace/srv/net/nil/eth/eth.h [fe8dfa6:6067284] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.h
rfe8dfa6 r6067284 44 44 #include <adt/measured_strings.h> 45 45 46 /** Ethernet address length. */47 #define ETH_ADDR 648 49 /** Ethernet header preamble value. */50 #define ETH_PREAMBLE 0x5551 52 /** Ethernet header start of frame value. */53 #define ETH_SFD 0xD554 55 /** IEEE 802.2 unordered information control field. */56 #define IEEE_8023_2_UI 0x0357 58 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions.59 * @see eth_header_snap60 */61 typedef struct eth_header_snap eth_header_snap_t;62 63 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions.64 * @see eth_header_lsap65 */66 typedef struct eth_header_lsap eth_header_lsap_t;67 68 /** Type definition of the Ethernet header LSAP extension.69 * @see eth_ieee_lsap70 */71 typedef struct eth_ieee_lsap eth_ieee_lsap_t;72 73 /** Type definition of the Ethernet header SNAP extension.74 * @see eth_snap75 */76 typedef struct eth_snap eth_snap_t;77 78 /** Type definition of the Ethernet header preamble.79 * @see preamble80 */81 typedef struct eth_preamble eth_preamble_t;82 83 /** Type definition of the Ethernet header.84 * @see eth_header85 */86 typedef struct eth_header eth_header_t;87 88 /** Ethernet header Link Service Access Point extension. */89 struct eth_ieee_lsap {90 /**91 * Destination Service Access Point identifier.92 * The possible values are assigned by an IEEE committee.93 */94 uint8_t dsap;95 96 /**97 * Source Service Access Point identifier.98 * The possible values are assigned by an IEEE committee.99 */100 uint8_t ssap;101 102 /**103 * Control parameter.104 * The possible values are assigned by an IEEE committee.105 */106 uint8_t ctrl;107 } __attribute__ ((packed));108 109 /** Ethernet header SNAP extension. */110 struct eth_snap {111 /** Protocol identifier or organization code. */112 uint8_t protocol[3];113 114 /**115 * Ethernet protocol identifier in the network byte order (big endian).116 * @see ethernet_protocols.h117 */118 uint16_t ethertype;119 } __attribute__ ((packed));120 121 /** Ethernet header preamble.122 *123 * Used for dummy devices.124 */125 struct eth_preamble {126 /**127 * Controlling preamble used for the frame transmission synchronization.128 * All should be set to ETH_PREAMBLE.129 */130 uint8_t preamble[7];131 132 /**133 * Start of Frame Delimiter used for the frame transmission134 * synchronization.135 * Should be set to ETH_SFD.136 */137 uint8_t sfd;138 } __attribute__ ((packed));139 140 /** Ethernet header. */141 struct eth_header {142 /** Destination host Ethernet address (MAC address). */143 uint8_t destination_address[ETH_ADDR];144 /** Source host Ethernet address (MAC address). */145 uint8_t source_address[ETH_ADDR];146 147 /**148 * Ethernet protocol identifier in the network byte order (big endian).149 * @see ethernet_protocols.h150 */151 uint16_t ethertype;152 } __attribute__ ((packed));153 154 /** Ethernet header IEEE 802.3 + 802.2 extension. */155 struct eth_header_lsap {156 /** Ethernet header. */157 eth_header_t header;158 159 /**160 * LSAP extension.161 * If DSAP and SSAP are set to ETH_LSAP_SNAP the SNAP extension is being162 * used.163 * If DSAP and SSAP fields are equal to ETH_RAW the raw Ethernet packet164 * without any extensions is being used and the frame content starts165 * rigth after the two fields.166 */167 eth_ieee_lsap_t lsap;168 } __attribute__ ((packed));169 170 /** Ethernet header IEEE 802.3 + 802.2 + SNAP extensions. */171 struct eth_header_snap {172 /** Ethernet header. */173 eth_header_t header;174 175 /**176 * LSAP extension.177 * If DSAP and SSAP are set to ETH_LSAP_SNAP the SNAP extension is being178 * used.179 * If DSAP and SSAP fields are equal to ETH_RAW the raw Ethernet packet180 * without any extensions is being used and the frame content starts181 * rigth after the two fields.182 */183 eth_ieee_lsap_t lsap;184 185 /** SNAP extension. */186 eth_snap_t snap;187 } __attribute__ ((packed));188 189 /** Ethernet Frame Check Sequence. */190 typedef uint32_t eth_fcs_t;191 192 46 /** Type definition of the Ethernet global data. 193 47 * @see eth_globals … … 200 54 typedef struct eth_device eth_device_t; 201 55 56 /** Type definition of the Ethernet device specific data pointer. 57 * @see eth_device 58 */ 59 typedef eth_device_t *eth_device_ref; 60 202 61 /** Type definition of the Ethernet protocol specific data. 203 62 * @see eth_proto 204 63 */ 205 64 typedef struct eth_proto eth_proto_t; 65 66 /** Type definition of the Ethernet protocol specific data pointer. 67 * @see eth_proto 68 */ 69 typedef eth_proto_t *eth_proto_ref; 206 70 207 71 /** Ethernet device map. … … 236 100 237 101 /** Actual device hardware address. */ 238 measured_string_t *addr; 239 102 measured_string_ref addr; 240 103 /** Actual device hardware address data. */ 241 uint8_t*addr_data;104 char *addr_data; 242 105 }; 243 106 … … 270 133 271 134 /** Broadcast device hardware address. */ 272 measured_string_ t *broadcast_addr;135 measured_string_ref broadcast_addr; 273 136 }; 274 137
Note:
See TracChangeset
for help on using the changeset viewer.