]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/dhcp.h
xnu-2782.30.5.tar.gz
[apple/xnu.git] / bsd / netinet / dhcp.h
index d53b1643fa2126074b76d916c9ab46b7da2de2cf..e2868508f497a92ae1529573ef3eb1442c14256a 100644 (file)
@@ -4,7 +4,7 @@
 #include <sys/appleapiopts.h>
 
 /*
 #include <sys/appleapiopts.h>
 
 /*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -64,8 +64,9 @@ struct dhcp_packet {
     struct dhcp        dhcp;
 };
 
     struct dhcp        dhcp;
 };
 
-#define DHCP_PACKET_OPTIONS_MIN        312
-#define DHCP_PACKET_MIN                (sizeof(struct dhcp) + DHCP_PACKET_OPTIONS_MIN)
+#define DHCP_OPTIONS_MIN       312
+#define DHCP_PACKET_MIN                (sizeof(struct dhcp_packet) + DHCP_OPTIONS_MIN)
+#define DHCP_PAYLOAD_MIN       (sizeof(struct dhcp) + DHCP_OPTIONS_MIN)
 
 /* dhcp message types */
 #define DHCPDISCOVER   1
 
 /* dhcp message types */
 #define DHCPDISCOVER   1
@@ -77,6 +78,20 @@ struct dhcp_packet {
 #define DHCPRELEASE    7
 #define DHCPINFORM     8
 
 #define DHCPRELEASE    7
 #define DHCPINFORM     8
 
+enum {
+    dhcp_msgtype_none_e                = 0,
+    dhcp_msgtype_discover_e    = DHCPDISCOVER,
+    dhcp_msgtype_offer_e       = DHCPOFFER,
+    dhcp_msgtype_request_e     = DHCPREQUEST,
+    dhcp_msgtype_decline_e     = DHCPDECLINE,
+    dhcp_msgtype_ack_e         = DHCPACK,
+    dhcp_msgtype_nak_e         = DHCPNAK,
+    dhcp_msgtype_release_e     = DHCPRELEASE,
+    dhcp_msgtype_inform_e      = DHCPINFORM,
+};
+
+typedef uint8_t dhcp_msgtype_t;
+
 typedef int32_t                        dhcp_time_secs_t; /* absolute time */
 typedef int32_t                        dhcp_lease_t;     /* relative time */
 #define dhcp_time_hton         htonl
 typedef int32_t                        dhcp_time_secs_t; /* absolute time */
 typedef int32_t                        dhcp_lease_t;     /* relative time */
 #define dhcp_time_hton         htonl