Changeset 87e5658c in mainline for uspace/srv/ethip/std.h
- Timestamp:
- 2012-02-27T00:03:26Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 962f03b
- Parents:
- 081971b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ethip/std.h
r081971b r87e5658c 40 40 #include <sys/types.h> 41 41 42 #define ETH_ADDR_SIZE 6 43 #define IPV4_ADDR_SIZE 4 44 #define ETH_FRAME_MIN_SIZE 60 45 42 46 /** Ethernet frame header */ 43 47 typedef struct { 44 48 /** Destination Address */ 45 uint8_t dest[ 6];49 uint8_t dest[ETH_ADDR_SIZE]; 46 50 /** Source Address */ 47 uint8_t src[ 6];51 uint8_t src[ETH_ADDR_SIZE]; 48 52 /** Ethertype or Length */ 49 53 uint16_t etype_len; 50 54 } eth_header_t; 51 55 56 /** ARP packet format (for 48-bit MAC addresses and IPv4) */ 57 typedef struct { 58 /** Hardware address space */ 59 uint16_t hw_addr_space; 60 /** Protocol address space */ 61 uint16_t proto_addr_space; 62 /** Hardware address size */ 63 uint8_t hw_addr_size; 64 /** Protocol address size */ 65 uint8_t proto_addr_size; 66 /** Opcode */ 67 uint16_t opcode; 68 /** Sender hardware address */ 69 uint8_t sender_hw_addr[ETH_ADDR_SIZE]; 70 /** Sender protocol address */ 71 uint32_t sender_proto_addr; 72 /** Target hardware address */ 73 uint8_t target_hw_addr[ETH_ADDR_SIZE]; 74 /** Target protocol address */ 75 uint32_t target_proto_addr; 76 } __attribute__((packed)) arp_eth_packet_fmt_t; 77 78 enum arp_opcode_fmt { 79 AOP_REQUEST = 1, 80 AOP_REPLY = 2 81 }; 82 83 enum arp_hw_addr_space { 84 AHRD_ETHERNET = 1 85 }; 86 52 87 /** IP Ethertype */ 53 #define ETYPE_IP 0x0800 88 enum ether_type { 89 ETYPE_ARP = 0x0806, 90 ETYPE_IP = 0x0800 91 }; 54 92 55 #define ETH_FRAME_MIN_SIZE 6056 93 57 94 #endif
Note:
See TracChangeset
for help on using the changeset viewer.