X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fdhcpv6.h;h=c0775f190c90559f61ffbbe65f68f7a2eb140356;hp=004c3cfa39e465fcfb782d977c7d7eb9c4e5aee3;hb=16cd87e8a76884802896495eb0e39461d8303c0f;hpb=8b19de666e02f24280728938dd985ecb3673b83e diff --git a/src/dhcpv6.h b/src/dhcpv6.h index 004c3cf..c0775f1 100644 --- a/src/dhcpv6.h +++ b/src/dhcpv6.h @@ -13,6 +13,9 @@ */ #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}}} @@ -40,9 +43,11 @@ #define DHCPV6_OPT_SERVERID 2 #define DHCPV6_OPT_IA_NA 3 #define DHCPV6_OPT_IA_ADDR 5 +#define DHCPV6_OPT_ORO 6 #define DHCPV6_OPT_STATUS 13 #define DHCPV6_OPT_RELAY_MSG 9 #define DHCPV6_OPT_AUTH 11 +#define DHCPV6_OPT_USER_CLASS 15 #define DHCPV6_OPT_INTERFACE_ID 18 #define DHCPV6_OPT_RECONF_MSG 19 #define DHCPV6_OPT_RECONF_ACCEPT 20 @@ -52,6 +57,8 @@ #define DHCPV6_OPT_IA_PREFIX 26 #define DHCPV6_OPT_INFO_REFRESH 32 #define DHCPV6_OPT_FQDN 39 +#define DHCPV6_OPT_SOL_MAX_RT 82 +#define DHCPV6_OPT_INF_MAX_RT 83 #define DHCPV6_DUID_VENDOR 2 @@ -59,6 +66,7 @@ #define DHCPV6_STATUS_NOADDRSAVAIL 2 #define DHCPV6_STATUS_NOBINDING 3 #define DHCPV6_STATUS_NOTONLINK 4 +#define DHCPV6_STATUS_USEMULTICAST 5 #define DHCPV6_STATUS_NOPREFIXAVAIL 6 // I just remembered I have an old one lying around... @@ -142,10 +150,27 @@ struct dhcpv6_assignment { uint8_t mac[6]; uint8_t length; // length == 128 -> IA_NA, length <= 64 -> IA_PD bool accept_reconf; + + struct odhcpd_ipaddr *managed; + ssize_t managed_size; + struct ustream_fd managed_sock; + + uint32_t leasetime; + unsigned int flags; + uint8_t clid_len; uint8_t clid_data[]; }; +struct dhcpv6_cer_id { + uint16_t type; + uint16_t len; + uint16_t reserved; + uint16_t auth_type; + uint8_t auth[16]; + struct in6_addr addr; +}; + #define dhcpv6_for_each_option(start, end, otype, olen, odata)\ @@ -155,8 +180,10 @@ struct dhcpv6_assignment { _o += 4 + (_o[2] << 8 | _o[3])) int dhcpv6_init_ia(struct interface *iface, int socket); -size_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct interface *iface, +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(int dhcpv6_socket); +int dhcpv6_ia_init(void); int setup_dhcpv6_ia_interface(struct interface *iface, bool enable); void dhcpv6_write_statefile(void); +void dhcpv6_ia_preupdate(struct interface *iface); +void dhcpv6_ia_postupdate(struct interface *iface, time_t now);