diff options
author | Ian Moffett <ian@osmora.org> | 2024-03-07 17:28:00 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-03-07 17:28:32 -0500 |
commit | bd5969fc876a10b18613302db7087ef3c40f18e1 (patch) | |
tree | 7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/options/glibc/include/net/ethernet.h | |
parent | a95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff) |
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/glibc/include/net/ethernet.h')
-rw-r--r-- | lib/mlibc/options/glibc/include/net/ethernet.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/mlibc/options/glibc/include/net/ethernet.h b/lib/mlibc/options/glibc/include/net/ethernet.h new file mode 100644 index 0000000..8dac98a --- /dev/null +++ b/lib/mlibc/options/glibc/include/net/ethernet.h @@ -0,0 +1,42 @@ +#ifndef _NET_ETHERNET_H +#define _NET_ETHERNET_H + +#include <bits/ether_addr.h> +#include <stdint.h> +#include <mlibc-config.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if __MLIBC_LINUX_OPTION +# include <linux/if_ether.h> +#endif /* __MLIBC_LINUX_OPTION */ + +#define ETHERTYPE_PUP 0x0200 +#define ETHERTYPE_SPRITE 0x0500 +#define ETHERTYPE_IP 0x0800 +#define ETHERTYPE_ARP 0x0806 +#define ETHERTYPE_REVARP 0x8035 +#define ETHERTYPE_AT 0x809B +#define ETHERTYPE_AARP 0x80F3 +#define ETHERTYPE_VLAN 0x8100 +#define ETHERTYPE_IPX 0x8137 +#define ETHERTYPE_IPV6 0x86dd +#define ETHERTYPE_LOOPBACK 0x9000 + +struct ether_header { + uint8_t ether_dhost[6]; + uint8_t ether_shost[6]; + uint16_t ether_type; +}; + +#define ETHER_ADDR_LEN 6 + +#define ETHERTYPE_IP 0x0800 + +#ifdef __cplusplus +} +#endif + +#endif |