--- cvs-current/ecos/packages/net/bsd_tcpip/current/Changelog 2004-08-18 03:40:52.000000000 -0600 +++ cvs-devo/ecos/packages/net/bsd_tcpip/current/Changelog 2004-12-21 10:05:07.000000000 -0700 @@ -1,5 +1,10 @@ +2004-11-01 Cameron Taylor + + * include/sys/bsdtypes.h: move #endif to end of file. + * include/net/ethernet.h: definitions for VLAN Tagging (802.1Q) + 2004-08-18 Andrew Lunn * src/ecos/support.c (show_net_times): Removed stats_in_cksum. It does not exist in the FreeBSD stack. Pointed out by Philip Keller. --- cvs-current/ecos/packages/net/bsd_tcpip/current/include/net/ethernet.h 2002-05-20 16:25:00.000000000 -0600 +++ cvs-devo/ecos/packages/net/bsd_tcpip/current/include/net/ethernet.h 2004-07-07 15:43:11.000000000 -0600 @@ -27,10 +27,11 @@ */ #ifndef _NET_ETHERNET_H_ #define _NET_ETHERNET_H_ +#include /* * The number of bytes in an ethernet (MAC) address. */ #define ETHER_ADDR_LEN 6 @@ -43,21 +44,21 @@ * The number of bytes in the trailing CRC field. */ #define ETHER_CRC_LEN 4 /* - * The length of the combined header. + * The length of the combined header (NON VLAN TAGGED). */ #define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN) /* * The minimum packet length. */ #define ETHER_MIN_LEN 64 /* - * The maximum packet length. + * The maximum packet length (NON VLAN TAGGED!). */ #define ETHER_MAX_LEN 1518 /* * A macro to validate a length with @@ -79,16 +80,31 @@ */ struct ether_addr { u_char octet[ETHER_ADDR_LEN]; } __attribute__ ((aligned(1), packed)); +/* + * Structure of an 802.1Q VLAN Tag + */ +struct ether_vlan_tag +{ + u_char vidmsb:4; + u_char cfi:1; + u_char priority:3; + u_char vidlsb; + u_short type; + u_char erifLen:5; /* present iff cfi is set */ +} __attribute__ ((aligned(1), packed)); + #define ETHERTYPE_PUP 0x0200 /* PUP protocol */ #define ETHERTYPE_IP 0x0800 /* IP protocol */ #define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */ #define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */ #define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */ #define ETHERTYPE_IPV6 0x86dd /* IPv6 */ +#define ETHERTYPE_PPPOE_D 0x8863 /* PPP over Ethernet Data Protocol */ +#define ETHERTYPE_PPPOE_S 0x8864 /* PPP over Ethernet Setup Protocol */ #define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */ /* XXX - add more useful types here */ /* * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have @@ -96,11 +112,11 @@ * by an ETHER type (as given above) and then the (variable-length) header. */ #define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */ #define ETHERTYPE_NTRAILER 16 -#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN) +#define ETHERMTU (1500) #define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #ifdef _KERNEL /* --- cvs-current/ecos/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h 2003-02-04 14:55:26.000000000 -0700 +++ cvs-devo/ecos/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h 2004-07-07 15:47:06.000000000 -0600 @@ -73,12 +73,10 @@ #ifndef __time_t_defined // As defined/used by eCos libc #define _BSD_CLOCK_T_ cyg_int64 /* clock() */ #define _BSD_TIME_T_ cyg_count32 /* time() */ #endif -#endif // _MACHINE_TYPES_H_ - // Standard BSD types typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; @@ -97,5 +95,8 @@ */ typedef u_int32_t in_addr_t; /* base type for internet address */ typedef u_int16_t in_port_t; /* IP port type */ typedef u_int8_t sa_family_t; /* sockaddr address family type */ typedef u_int32_t socklen_t; /* length type for network syscalls */ + +#endif +