diff options
author | murray <murray@FreeBSD.org> | 2002-02-19 11:04:34 +0000 |
---|---|---|
committer | murray <murray@FreeBSD.org> | 2002-02-19 11:04:34 +0000 |
commit | 57b30d23e7c11fa1a8c8c23f27de40971872952f (patch) | |
tree | 229464d9b3244ab78e2784c9a0a1f78de317089a /contrib/isc-dhcp/includes/netinet | |
parent | 7acb11388cf5d680b16902b8ed6f46c46dc4d47b (diff) | |
download | FreeBSD-src-57b30d23e7c11fa1a8c8c23f27de40971872952f.zip FreeBSD-src-57b30d23e7c11fa1a8c8c23f27de40971872952f.tar.gz |
Import ISC DHCP 3.0.1 RC6 client.
Diffstat (limited to 'contrib/isc-dhcp/includes/netinet')
-rw-r--r-- | contrib/isc-dhcp/includes/netinet/if_ether.h | 22 | ||||
-rw-r--r-- | contrib/isc-dhcp/includes/netinet/ip.h | 24 | ||||
-rw-r--r-- | contrib/isc-dhcp/includes/netinet/udp.h | 2 |
3 files changed, 13 insertions, 35 deletions
diff --git a/contrib/isc-dhcp/includes/netinet/if_ether.h b/contrib/isc-dhcp/includes/netinet/if_ether.h index f61b18b..e53b4c7 100644 --- a/contrib/isc-dhcp/includes/netinet/if_ether.h +++ b/contrib/isc-dhcp/includes/netinet/if_ether.h @@ -48,28 +48,14 @@ struct ether_addr { */ #define ETHER_ADDR_LEN 6 -struct ether_header { +struct isc_ether_header { u_int8_t ether_dhost[ETHER_ADDR_LEN]; u_int8_t ether_shost[ETHER_ADDR_LEN]; u_int16_t ether_type; }; -#define ETHERTYPE_PUP 0x0200 /* PUP protocol */ -#define ETHERTYPE_IP 0x0800 /* IP protocol */ -#define ETHERTYPE_ARP 0x0806 /* address resolution protocol */ -#define ETHERTYPE_REVARP 0x8035 /* reverse addr resolution protocol */ - -/* - * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have - * (type-ETHERTYPE_TRAIL)*512 bytes of data followed - * by an ETHER type (as given above) and then the (variable-length) header. - */ -#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */ -#define ETHERTYPE_NTRAILER 16 - -#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */ - -#define ETHERMTU 1500 -#define ETHERMIN (60-14) +#define ETHERTYPE_PUP 0x0200 /* PUP protocol */ +#define ETHERTYPE_IP 0x0800 /* IP protocol */ +#define ETHERTYPE_ARP 0x0806 /* address resolution protocol */ #define ETHER_HEADER_SIZE (ETHER_ADDR_LEN * 2 + sizeof (u_int16_t)) diff --git a/contrib/isc-dhcp/includes/netinet/ip.h b/contrib/isc-dhcp/includes/netinet/ip.h index 233abd6..0a1e358 100644 --- a/contrib/isc-dhcp/includes/netinet/ip.h +++ b/contrib/isc-dhcp/includes/netinet/ip.h @@ -49,14 +49,7 @@ * against negative integers quite easily, and fail in subtle ways. */ struct ip { -#if BYTE_ORDER == LITTLE_ENDIAN - u_int8_t ip_hl:4, /* header length */ - ip_v:4; /* version */ -#endif -#if BYTE_ORDER == BIG_ENDIAN - u_int8_t ip_v:4, /* version */ - ip_hl:4; /* header length */ -#endif + u_int8_t ip_fvhl; /* header length, version */ u_int8_t ip_tos; /* type of service */ int16_t ip_len; /* total length */ u_int16_t ip_id; /* identification */ @@ -70,6 +63,12 @@ struct ip { struct in_addr ip_src, ip_dst; /* source and dest address */ }; +#define IP_V(iph) ((iph)->ip_fvhl >> 4) +#define IP_HL(iph) (((iph)->ip_fvhl & 0x0F) << 2) +#define IP_V_SET(iph,x) ((iph)->ip_fvhl = ((iph)->ip_fvhl & 0x0F) | ((x) << 4)) +#define IP_HL_SET(iph,x) ((iph)->ip_fvhl = \ + ((iph)->ip_fvhl & 0xF0) | (((x) >> 2) & 0x0F)) + #define IP_MAXPACKET 65535 /* maximum packet size */ /* @@ -129,14 +128,7 @@ struct ip_timestamp { u_int8_t ipt_code; /* IPOPT_TS */ u_int8_t ipt_len; /* size of structure (variable) */ u_int8_t ipt_ptr; /* index of current entry */ -#if BYTE_ORDER == LITTLE_ENDIAN - u_int8_t ipt_flg:4, /* flags, see below */ - ipt_oflw:4; /* overflow counter */ -#endif -#if BYTE_ORDER == BIG_ENDIAN - u_int8_t ipt_oflw:4, /* overflow counter */ - ipt_flg:4; /* flags, see below */ -#endif + u_int8_t ipt_flg_oflw; /* flags, see below, overflow counter */ union ipt_timestamp { u_int32_t ipt_time[1]; struct ipt_ta { diff --git a/contrib/isc-dhcp/includes/netinet/udp.h b/contrib/isc-dhcp/includes/netinet/udp.h index c7964df..95bc044 100644 --- a/contrib/isc-dhcp/includes/netinet/udp.h +++ b/contrib/isc-dhcp/includes/netinet/udp.h @@ -42,6 +42,6 @@ struct udphdr { u_int16_t uh_sport; /* source port */ u_int16_t uh_dport; /* destination port */ - int16_t uh_ulen; /* udp length */ + u_int16_t uh_ulen; /* udp length */ u_int16_t uh_sum; /* udp checksum */ }; |