diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-05-18 21:10:15 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-05-18 21:10:15 +0000 |
commit | 29c63ef6d35795f4c719db2ca80e7f798ba3f8fb (patch) | |
tree | 1c3cfc486f10d465ca13fedbbc96548ec7f03021 /sys/netinet/if_ether.h | |
parent | 115c621ea42047bf46657a98f92285f17096586a (diff) |
if_ether.h
add ETHER_MAX_LEN_JUMBO, ETHER_VLAN_ENCAP_LEN, ETHER_ALIGN, and
ETHERMTU_JUMBO constants.
if.h
add a few more interface capabilities flags.
Some from NetBSD, some from FreeBSD.
ok markus@
Diffstat (limited to 'sys/netinet/if_ether.h')
-rw-r--r-- | sys/netinet/if_ether.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 5dc68254f7f..4f236c0d77c 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.h,v 1.29 2003/06/02 23:28:13 millert Exp $ */ +/* $OpenBSD: if_ether.h,v 1.30 2004/05/18 21:10:14 brad Exp $ */ /* $NetBSD: if_ether.h,v 1.22 1996/05/11 13:00:00 mycroft Exp $ */ /* @@ -44,6 +44,17 @@ #define ETHER_HDR_LEN ((ETHER_ADDR_LEN * 2) + ETHER_TYPE_LEN) #define ETHER_MIN_LEN 64 /* Minimum frame length, CRC included */ #define ETHER_MAX_LEN 1518 /* Maximum frame length, CRC included */ +#define ETHER_MAX_LEN_JUMBO 9018 /* max jumbo frame len, including CRC */ + +#define ETHER_VLAN_ENCAP_LEN 4 /* len of 802.1Q VLAN encapsulation */ + +/* + * Mbuf adjust factor to force 32-bit alignment of IP header. + * Drivers should do m_adj(m, ETHER_ALIGN) when setting up a + * receive so the upper layers get the IP header properly aligned + * past the 14-byte Ethernet header. + */ +#define ETHER_ALIGN 2 /* driver adjust for IP hdr alignment */ /* * Ethernet address - 6 octets @@ -55,7 +66,6 @@ struct ether_addr { /* * The length of the combined header. */ - struct ether_header { u_int8_t ether_dhost[ETHER_ADDR_LEN]; u_int8_t ether_shost[ETHER_ADDR_LEN]; @@ -68,6 +78,7 @@ struct ether_header { #define ETHERMTU (ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) #define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) +#define ETHERMTU_JUMBO (ETHER_MAX_LEN_JUMBO - ETHER_HDR_LEN - ETHER_CRC_LEN) /* * Ethernet CRC32 polynomials (big- and little-endian verions). |