Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: fusl/include/net/ethernet.h

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/include/mqueue.h ('k') | fusl/include/net/if.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef _NET_ETHERNET_H
2 #define _NET_ETHERNET_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <stdint.h>
9 #include <sys/types.h>
10 #include <netinet/if_ether.h>
11
12 struct ether_addr {
13 uint8_t ether_addr_octet[ETH_ALEN];
14 };
15
16 struct ether_header {
17 uint8_t ether_dhost[ETH_ALEN];
18 uint8_t ether_shost[ETH_ALEN];
19 uint16_t ether_type;
20 };
21
22 #define ETHERTYPE_PUP 0x0200
23 #define ETHERTYPE_SPRITE 0x0500
24 #define ETHERTYPE_IP 0x0800
25 #define ETHERTYPE_ARP 0x0806
26 #define ETHERTYPE_REVARP 0x8035
27 #define ETHERTYPE_AT 0x809B
28 #define ETHERTYPE_AARP 0x80F3
29 #define ETHERTYPE_VLAN 0x8100
30 #define ETHERTYPE_IPX 0x8137
31 #define ETHERTYPE_IPV6 0x86dd
32 #define ETHERTYPE_LOOPBACK 0x9000
33
34
35 #define ETHER_ADDR_LEN ETH_ALEN
36 #define ETHER_TYPE_LEN 2
37 #define ETHER_CRC_LEN 4
38 #define ETHER_HDR_LEN ETH_HLEN
39 #define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN)
40 #define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN)
41
42 #define ETHER_IS_VALID_LEN(foo) \
43 ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
44
45 #define ETHERTYPE_TRAIL 0x1000
46 #define ETHERTYPE_NTRAILER 16
47
48 #define ETHERMTU ETH_DATA_LEN
49 #define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 #endif
OLDNEW
« no previous file with comments | « fusl/include/mqueue.h ('k') | fusl/include/net/if.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698