ndp: code cleanup
[project/odhcpd.git] / src / odhcpd.h
index fd43dfe..043360b 100644 (file)
@@ -43,6 +43,9 @@
 
 #define RELAYD_BUFFER_SIZE 8192
 #define RELAYD_MAX_PREFIXES 8
+#define RELAYD_MAX_ADDRS 8
+
+#define INFINITE_VALID(x) ((x) == 0)
 
 #define _unused __attribute__((unused))
 #define _packed __attribute__((packed))
@@ -82,6 +85,11 @@ enum odhcpd_mode {
 };
 
 
+enum odhcpd_assignment_flags {
+       OAF_BOUND       = (1 << 0),
+       OAF_STATIC      = (1 << 1),
+};
+
 struct config {
        bool legacy;
        char *dhcp_cb;
@@ -96,6 +104,7 @@ struct lease {
        struct ether_addr mac;
        uint16_t duid_len;
        uint8_t *duid;
+       uint32_t dhcpv4_leasetime;
        char hostname[];
 };
 
@@ -110,9 +119,8 @@ struct interface {
        // Runtime data
        struct uloop_timeout timer_rs;
        struct list_head ia_assignments;
-       struct odhcpd_ipaddr ia_addr[8];
+       struct odhcpd_ipaddr ia_addr[RELAYD_MAX_ADDRS];
        size_t ia_addr_len;
-       bool ia_reconf;
 
        // DHCPv4
        struct odhcpd_event dhcpv6_event;