aboutsummaryrefslogtreecommitdiff
path: root/contrib/isc-dhcp/includes/netinet
diff options
context:
space:
mode:
authorMurray Stokely <murray@FreeBSD.org>2002-02-19 11:04:34 +0000
committerMurray Stokely <murray@FreeBSD.org>2002-02-19 11:04:34 +0000
commitce99b771f886a2c842db7aa803c9a5a5918f42c8 (patch)
tree229464d9b3244ab78e2784c9a0a1f78de317089a /contrib/isc-dhcp/includes/netinet
parent7657fb140fbd218ea326d55bd3c43c4077f03d9a (diff)
downloadsrc-ce99b771f886a2c842db7aa803c9a5a5918f42c8.tar.gz
src-ce99b771f886a2c842db7aa803c9a5a5918f42c8.zip
Import ISC DHCP 3.0.1 RC6 client.
Notes
Notes: svn path=/vendor/isc-dhcp/dist/; revision=90908
Diffstat (limited to 'contrib/isc-dhcp/includes/netinet')
-rw-r--r--contrib/isc-dhcp/includes/netinet/if_ether.h22
-rw-r--r--contrib/isc-dhcp/includes/netinet/ip.h24
-rw-r--r--contrib/isc-dhcp/includes/netinet/udp.h2
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 f61b18b62fee..e53b4c7f66bc 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 233abd6e69b5..0a1e35840443 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 c7964dfd30fc..95bc044f7d90 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 */
};