X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fdhcpv6.h;h=b38ae829616f8bfff9547ce56ceb6c82e64bd4a6;hp=09aa6f13eb77602fb677ee227419d659be372ec5;hb=9268ca65d6e000b6cd4ed72d4a8fa427dada6f06;hpb=c6e1e5f0f977d5e921fa5a6e34a3299019e4fc8a diff --git a/src/dhcpv6.h b/src/dhcpv6.h index 09aa6f1..b38ae82 100644 --- a/src/dhcpv6.h +++ b/src/dhcpv6.h @@ -14,6 +14,7 @@ #pragma once #include +#include "odhcpd.h" #define ALL_DHCPV6_RELAYS {{{0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02}}} @@ -154,6 +155,9 @@ struct dhcpv6_assignment { ssize_t managed_size; struct ustream_fd managed_sock; + uint32_t leasetime; + unsigned int flags; + uint8_t clid_len; uint8_t clid_data[]; }; @@ -167,7 +171,9 @@ struct dhcpv6_cer_id { struct in6_addr addr; }; - +typedef void (*dhcpv6_binding_cb_handler_t)(struct in6_addr *addr, int prefix, + uint32_t pref, uint32_t valid, + void *arg); #define dhcpv6_for_each_option(start, end, otype, olen, odata)\ for (uint8_t *_o = (uint8_t*)(start); _o + 4 <= (end) &&\ @@ -180,4 +186,8 @@ ssize_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct interface *iface, const struct sockaddr_in6 *addr, const void *data, const uint8_t *end); int dhcpv6_ia_init(void); int setup_dhcpv6_ia_interface(struct interface *iface, bool enable); +void dhcpv6_enum_ia_addrs(struct interface *iface, struct dhcpv6_assignment *c, time_t now, + dhcpv6_binding_cb_handler_t func, void *arg); void dhcpv6_write_statefile(void); +void dhcpv6_ia_preupdate(struct interface *iface); +void dhcpv6_ia_postupdate(struct interface *iface, time_t now);