X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fodhcp6c.h;h=1a4fbcef9d893448375b0329938e4684ac7a6216;hb=7ea97a433c3ce62dab3d99f6dbe72a6cb319cd44;hp=61dee63ffcc9a57b5c918cc5d7e106ca289b4f97;hpb=e1b11c518aded9136b4f44759c6e2a6be4161ee9;p=odhcp6c.git diff --git a/src/odhcp6c.h b/src/odhcp6c.h index 61dee63..1a4fbce 100644 --- a/src/odhcp6c.h +++ b/src/odhcp6c.h @@ -21,10 +21,6 @@ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -#ifndef SOL_NETLINK -#define SOL_NETLINK 270 -#endif - #define ND_OPT_RECURSIVE_DNS 25 #define ND_OPT_DNSSL 31 @@ -81,11 +77,17 @@ enum dhcpv6_msg { }; enum dhcpv6_status { + DHCPV6_Success = 0, + DHCPV6_UnspecFail = 1, DHCPV6_NoAddrsAvail = 2, + DHCPV6_NoBinding = 3, + DHCPV6_NotOnLink = 4, + DHCPV6_UseMulticast = 5, DHCPV6_NoPrefixAvail = 6, + _DHCPV6_Status_Max }; -typedef int(reply_handler)(enum dhcpv6_msg orig, +typedef int(reply_handler)(enum dhcpv6_msg orig, const int rc, const void *opt, const void *end); // retransmission strategy @@ -93,12 +95,12 @@ struct dhcpv6_retx { bool delay; uint8_t init_timeo; uint16_t max_timeo; + uint8_t max_rc; char name[8]; reply_handler *handler_reply; int(*handler_finish)(void); }; - // DHCPv6 Protocol Headers struct dhcpv6_header { uint8_t msg_type; @@ -219,6 +221,8 @@ struct odhcp6c_entry { struct in6_addr target; uint32_t valid; uint32_t preferred; + uint32_t t1; + uint32_t t2; uint16_t class; }; @@ -240,6 +244,7 @@ void script_delay_call(const char *status, int timeout); bool odhcp6c_signal_process(void); uint64_t odhcp6c_get_milli_time(void); void odhcp6c_random(void *buf, size_t len); +bool odhcp6c_is_bound(void); // State manipulation void odhcp6c_clear_state(enum odhcp6c_state state);