ubus: fix invalid ipv6-prefix json
[project/odhcpd.git] / src / odhcpd.h
index a49ab57..9a27708 100644 (file)
@@ -133,8 +133,9 @@ enum odhcpd_mode {
 
 
 enum odhcpd_assignment_flags {
-       OAF_BOUND       = (1 << 0),
-       OAF_STATIC      = (1 << 1),
+       OAF_TENTATIVE   = (1 << 0),
+       OAF_BOUND       = (1 << 1),
+       OAF_STATIC      = (1 << 2),
 };
 
 struct config {
@@ -208,6 +209,8 @@ struct interface {
        bool ra_advrouter;
        bool ra_useleasetime;
        bool no_dynamic_dhcp;
+       uint8_t pio_filter_length;
+       struct in6_addr pio_filter_addr;
 
        // RA
        int learn_routes;
@@ -282,6 +285,7 @@ void odhcpd_run(void);
 time_t odhcpd_time(void);
 ssize_t odhcpd_unhexlify(uint8_t *dst, size_t len, const char *src);
 void odhcpd_hexlify(char *dst, const uint8_t *src, size_t len);
+const char *odhcpd_print_mac(const uint8_t *mac, const size_t len);
 
 int odhcpd_bmemcmp(const void *av, const void *bv, size_t bits);
 void odhcpd_bmemcpy(void *av, const void *bv, size_t bits);
@@ -296,6 +300,8 @@ int ubus_init(void);
 const char* ubus_get_ifname(const char *name);
 void ubus_apply_network(void);
 bool ubus_has_prefix(const char *name, const char *ifname);
+void ubus_bcast_dhcp_event(const char *type, const uint8_t *mac, const size_t mac_len,
+               const struct in_addr *addr, const char *name, const char *interface);
 #endif
 
 int netlink_add_netevent_handler(struct netevent_handler *hdlr);
@@ -315,12 +321,14 @@ void netlink_dump_addr_table(const bool v6);
 int netlink_init(void);
 int router_init(void);
 int dhcpv6_init(void);
-int dhcpv4_init(void);
 int ndp_init(void);
+#ifdef DHCPV4_SUPPORT
+int dhcpv4_init(void);
 
+int dhcpv4_setup_interface(struct interface *iface, bool enable);
+#endif
 int router_setup_interface(struct interface *iface, bool enable);
 int dhcpv6_setup_interface(struct interface *iface, bool enable);
 int ndp_setup_interface(struct interface *iface, bool enable);
-int dhcpv4_setup_interface(struct interface *iface, bool enable);
 
 void odhcpd_reload(void);