]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netinet/dhcp.h
6ce2c61c73567a38aaac495354ce9c496d69b962
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_HEADER_START@
11 * The contents of this file constitute Original Code as defined in and
12 * are subject to the Apple Public Source License Version 1.1 (the
13 * "License"). You may not use this file except in compliance with the
14 * License. Please obtain a copy of the License at
15 * http://www.apple.com/publicsource and read it before using this file.
17 * This Original Code and all software distributed under the License are
18 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
22 * License for the specific language governing rights and limitations
25 * @APPLE_LICENSE_HEADER_END@
29 * - definitions for DHCP (as specified in RFC2132)
31 #include <sys/types.h>
32 #include <netinet/in.h>
33 #include <netinet/in_systm.h>
34 #include <netinet/ip.h>
35 #include <netinet/udp.h>
38 u_char dp_op
; /* packet opcode type */
39 u_char dp_htype
; /* hardware addr type */
40 u_char dp_hlen
; /* hardware addr length */
41 u_char dp_hops
; /* gateway hops */
42 u_int32_t dp_xid
; /* transaction ID */
43 u_int16_t dp_secs
; /* seconds since boot began */
44 u_int16_t dp_flags
; /* flags */
45 struct in_addr dp_ciaddr
; /* client IP address */
46 struct in_addr dp_yiaddr
; /* 'your' IP address */
47 struct in_addr dp_siaddr
; /* server IP address */
48 struct in_addr dp_giaddr
; /* gateway IP address */
49 u_char dp_chaddr
[16]; /* client hardware address */
50 u_char dp_sname
[64]; /* server host name */
51 u_char dp_file
[128]; /* boot file name */
52 u_char dp_options
[0]; /* variable-length options field */
61 #define DHCP_PACKET_OPTIONS_MIN 312
62 #define DHCP_PACKET_MIN (sizeof(struct dhcp) + DHCP_PACKET_OPTIONS_MIN)
64 /* dhcp message types */
65 #define DHCPDISCOVER 1
74 typedef int32_t dhcp_time_secs_t
; /* absolute time */
75 typedef int32_t dhcp_lease_t
; /* relative time */
76 #define dhcp_time_hton htonl
77 #define dhcp_time_ntoh ntohl
78 #define dhcp_lease_hton htonl
79 #define dhcp_lease_ntoh ntohl
81 #define DHCP_INFINITE_LEASE ((dhcp_lease_t)-1)
82 #define DHCP_INFINITE_TIME ((dhcp_time_secs_t)-1)
84 #define DHCP_FLAGS_BROADCAST ((u_short)0x0001)
86 #endif _NETINET_DHCP_H