dhcpv6-ia: cleanup prefix delegation routes
[oweals/odhcpd.git] / src / dhcpv4.h
index 57d52dcb1b8059db77357cfedcf5c2815ca3d662..b378bc17165f65f44fa8eb48690f74240e64a10f 100644 (file)
@@ -1,5 +1,6 @@
 /**
  *   Copyright (C) 2012 Steven Barth <steven@midlink.org>
+ *   Copyright (C) 2016 Hans Dedecker <dedeckeh@gmail.com>
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License version 2
@@ -18,6 +19,8 @@
 
 #define DHCPV4_FLAG_BROADCAST  0x8000
 
+#define DHCPV4_MIN_PACKET_SIZE 300
+
 enum dhcpv4_op {
        DHCPV4_BOOTREQUEST = 1,
        DHCPV4_BOOTREPLY = 2
@@ -32,9 +35,11 @@ enum dhcpv4_msg {
        DHCPV4_MSG_NAK = 6,
        DHCPV4_MSG_RELEASE = 7,
        DHCPV4_MSG_INFORM = 8,
+       DHCPV4_MSG_FORCERENEW = 9,
 };
 
 enum dhcpv4_opt {
+       DHCPV4_OPT_PAD = 0,
        DHCPV4_OPT_NETMASK = 1,
        DHCPV4_OPT_ROUTER = 3,
        DHCPV4_OPT_DNSSERVER = 6,
@@ -45,13 +50,16 @@ enum dhcpv4_opt {
        DHCPV4_OPT_LEASETIME = 51,
        DHCPV4_OPT_MESSAGE = 53,
        DHCPV4_OPT_SERVERID = 54,
+       DHCPV4_OPT_REQOPTS = 55,
        DHCPV4_OPT_RENEW = 58,
        DHCPV4_OPT_REBIND = 59,
        DHCPV4_OPT_IPADDRESS = 50,
-       DHCPV4_OPT_HOSTNAME = 10,
+       DHCPV4_OPT_HOSTNAME = 12,
        DHCPV4_OPT_REQUEST = 17,
        DHCPV4_OPT_USER_CLASS = 77,
+       DHCPV4_OPT_AUTHENTICATION = 90,
        DHCPV4_OPT_SEARCH_DOMAIN = 119,
+       DHCPV4_OPT_FORCERENEW_NONCE_CAPABLE = 145,
        DHCPV4_OPT_END = 255,
 };
 
@@ -73,13 +81,14 @@ struct dhcpv4_message {
        uint8_t options[312];
 };
 
-struct dhcpv4_assignment {
-       struct list_head head;
-       uint32_t addr;
-       time_t valid_until;
-       uint8_t hwaddr[6];
-       char hostname[];
-};
+struct dhcpv4_auth_forcerenew {
+       uint8_t protocol;
+       uint8_t algorithm;
+       uint8_t rdm;
+       uint32_t replay[2];
+       uint8_t type;
+       uint8_t key[16];
+} _packed;
 
 struct dhcpv4_option {
        uint8_t type;