summaryrefslogtreecommitdiff
path: root/libopie2/opienet/dhcp.h
Unidiff
Diffstat (limited to 'libopie2/opienet/dhcp.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/dhcp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opienet/dhcp.h b/libopie2/opienet/dhcp.h
index 368e375..6ba4c53 100644
--- a/libopie2/opienet/dhcp.h
+++ b/libopie2/opienet/dhcp.h
@@ -21,48 +21,49 @@
21 * 21 *
22 * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND 22 * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
23 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 23 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR 26 * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * This software has been written for the Internet Software Consortium 36 * This software has been written for the Internet Software Consortium
37 * by Ted Lemon in cooperation with Vixie Enterprises. To learn more 37 * by Ted Lemon in cooperation with Vixie Enterprises. To learn more
38 * about the Internet Software Consortium, see ``http://www.isc.org''. 38 * about the Internet Software Consortium, see ``http://www.isc.org''.
39 * To learn more about Vixie Enterprises, see ``http://www.vix.com''. 39 * To learn more about Vixie Enterprises, see ``http://www.vix.com''.
40 */ 40 */
41 41
42#ifndef DHCP_H 42#ifndef DHCP_H
43#define DHCP_H 43#define DHCP_H
44 44
45
45 #define DHCP_UDP_OVERHEAD (14 + /* Ethernet header */ \ 46 #define DHCP_UDP_OVERHEAD (14 + /* Ethernet header */ \
46 20 + /* IP header */ \ 47 20 + /* IP header */ \
47 8) /* UDP header */ 48 8) /* UDP header */
48 #define DHCP_SNAME_LEN 64 49 #define DHCP_SNAME_LEN 64
49 #define DHCP_FILE_LEN 128 50 #define DHCP_FILE_LEN 128
50 #define DHCP_FIXED_NON_UDP236 51 #define DHCP_FIXED_NON_UDP236
51 #define DHCP_FIXED_LEN (DHCP_FIXED_NON_UDP + DHCP_UDP_OVERHEAD) 52 #define DHCP_FIXED_LEN (DHCP_FIXED_NON_UDP + DHCP_UDP_OVERHEAD)
52 /* Everything but options. */ 53 /* Everything but options. */
53 #define DHCP_MTU_MAX 1500 54 #define DHCP_MTU_MAX 1500
54 #define DHCP_OPTION_LEN (DHCP_MTU_MAX - DHCP_FIXED_LEN) 55 #define DHCP_OPTION_LEN (DHCP_MTU_MAX - DHCP_FIXED_LEN)
55 56
56 #define BOOTP_MIN_LEN 300 57 #define BOOTP_MIN_LEN 300
57#define DHCP_MIN_LEN 548 58#define DHCP_MIN_LEN 548
58 59
59struct dhcp_packet { 60struct dhcp_packet {
60 u_int8_t op; /* 0: Message opcode/type */ 61 u_int8_t op; /* 0: Message opcode/type */
61 u_int8_t htype;/* 1: Hardware addr type (net/if_types.h) */ 62 u_int8_t htype;/* 1: Hardware addr type (net/if_types.h) */
62 u_int8_t hlen; /* 2: Hardware addr length */ 63 u_int8_t hlen; /* 2: Hardware addr length */
63 u_int8_t hops; /* 3: Number of relay agent hops from client */ 64 u_int8_t hops; /* 3: Number of relay agent hops from client */
64 u_int32_t xid; /* 4: Transaction ID */ 65 u_int32_t xid; /* 4: Transaction ID */
65 u_int16_t secs; /* 8: Seconds since client started looking */ 66 u_int16_t secs; /* 8: Seconds since client started looking */
66 u_int16_t flags;/* 10: Flag bits */ 67 u_int16_t flags;/* 10: Flag bits */
67 struct in_addr ciaddr;/* 12: Client IP address (if already in use) */ 68 struct in_addr ciaddr;/* 12: Client IP address (if already in use) */
68 struct in_addr yiaddr;/* 16: Client IP address */ 69 struct in_addr yiaddr;/* 16: Client IP address */
@@ -176,26 +177,27 @@ struct dhcp_packet {
176 #define DHCPOFFER2 177 #define DHCPOFFER2
177 #define DHCPREQUEST3 178 #define DHCPREQUEST3
178 #define DHCPDECLINE4 179 #define DHCPDECLINE4
179 #define DHCPACK 5 180 #define DHCPACK 5
180 #define DHCPNAK 6 181 #define DHCPNAK 6
181 #define DHCPRELEASE7 182 #define DHCPRELEASE7
182 #define DHCPINFORM8 183 #define DHCPINFORM8
183 184
184/* Relay Agent Information option subtypes: */ 185/* Relay Agent Information option subtypes: */
185 #define RAI_CIRCUIT_ID1 186 #define RAI_CIRCUIT_ID1
186 #define RAI_REMOTE_ID2 187 #define RAI_REMOTE_ID2
187 #define RAI_AGENT_ID3 188 #define RAI_AGENT_ID3
188 189
189/* FQDN suboptions: */ 190/* FQDN suboptions: */
190 #define FQDN_NO_CLIENT_UPDATE 1 191 #define FQDN_NO_CLIENT_UPDATE 1
191 #define FQDN_SERVER_UPDATE 2 192 #define FQDN_SERVER_UPDATE 2
192 #define FQDN_ENCODED 3 193 #define FQDN_ENCODED 3
193 #define FQDN_RCODE1 4 194 #define FQDN_RCODE1 4
194 #define FQDN_RCODE2 5 195 #define FQDN_RCODE2 5
195 #define FQDN_HOSTNAME 6 196 #define FQDN_HOSTNAME 6
196 #define FQDN_DOMAINNAME 7 197 #define FQDN_DOMAINNAME 7
197 #define FQDN_FQDN 8 198 #define FQDN_FQDN 8
198 #define FQDN_SUBOPTION_COUNT 8 199 #define FQDN_SUBOPTION_COUNT 8
199 200
201
200#endif 202#endif
201 203