]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netinet/dhcp.h
2 #ifndef _NETINET_DHCP_H
3 #define _NETINET_DHCP_H
4 #include <sys/appleapiopts.h>
7 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
9 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
11 * This file contains Original Code and/or Modifications of Original Code
12 * as defined in and that are subject to the Apple Public Source License
13 * Version 2.0 (the 'License'). You may not use this file except in
14 * compliance with the License. The rights granted to you under the
15 * License may not be used to create, or enable the creation or
16 * redistribution of, unlawful or unlicensed copies of an Apple operating
17 * system, or to circumvent, violate, or enable the circumvention or
18 * violation of, any terms of an Apple operating system software license
21 * Please obtain a copy of the License at
22 * http://www.opensource.apple.com/apsl/ and read it before using this
25 * The Original Code and all software distributed under the License are
26 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
27 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
28 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
29 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
30 * Please see the License for the specific language governing rights and
31 * limitations under the License.
33 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
37 * - definitions for DHCP (as specified in RFC2132)
39 #include <sys/types.h>
40 #include <netinet/in.h>
41 #include <netinet/in_systm.h>
42 #include <netinet/ip.h>
43 #include <netinet/udp.h>
46 u_char dp_op
; /* packet opcode type */
47 u_char dp_htype
; /* hardware addr type */
48 u_char dp_hlen
; /* hardware addr length */
49 u_char dp_hops
; /* gateway hops */
50 u_int32_t dp_xid
; /* transaction ID */
51 u_int16_t dp_secs
; /* seconds since boot began */
52 u_int16_t dp_flags
; /* flags */
53 struct in_addr dp_ciaddr
; /* client IP address */
54 struct in_addr dp_yiaddr
; /* 'your' IP address */
55 struct in_addr dp_siaddr
; /* server IP address */
56 struct in_addr dp_giaddr
; /* gateway IP address */
57 u_char dp_chaddr
[16]; /* client hardware address */
58 u_char dp_sname
[64]; /* server host name */
59 u_char dp_file
[128]; /* boot file name */
60 u_char dp_options
[0]; /* variable-length options field */
69 #define DHCP_PACKET_OPTIONS_MIN 312
70 #define DHCP_PACKET_MIN (sizeof(struct dhcp) + DHCP_PACKET_OPTIONS_MIN)
72 /* dhcp message types */
73 #define DHCPDISCOVER 1
82 typedef int32_t dhcp_time_secs_t
; /* absolute time */
83 typedef int32_t dhcp_lease_t
; /* relative time */
84 #define dhcp_time_hton htonl
85 #define dhcp_time_ntoh ntohl
86 #define dhcp_lease_hton htonl
87 #define dhcp_lease_ntoh ntohl
89 #define DHCP_INFINITE_LEASE ((dhcp_lease_t)-1)
90 #define DHCP_INFINITE_TIME ((dhcp_time_secs_t)-1)
92 #define DHCP_FLAGS_BROADCAST ((u_short)0x0001)
94 #endif /* _NETINET_DHCP_H */