]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/odhcp6c.h
Pass ICMP configuration to user-space instead of directly applying it
[odhcp6c.git] / src / odhcp6c.h
index 8abb6311f945ed61b65d39b5b98bfef3eb7464a7..ff5b9e45467045f89c11685740c66706f12096c8 100644 (file)
@@ -37,12 +37,14 @@ enum dhcvp6_opt {
        DHCPV6_OPT_CLIENTID = 1,
        DHCPV6_OPT_SERVERID = 2,
        DHCPV6_OPT_IA_NA = 3,
+       DHCPV6_OPT_IA_TA = 4,
        DHCPV6_OPT_IA_ADDR = 5,
        DHCPV6_OPT_ORO = 6,
        DHCPV6_OPT_PREF = 7,
        DHCPV6_OPT_ELAPSED = 8,
        DHCPV6_OPT_RELAY_MSG = 9,
        DHCPV6_OPT_AUTH = 11,
+       DHCPV6_OPT_UNICAST = 12,
        DHCPV6_OPT_STATUS = 13,
        DHCPV6_OPT_RAPID_COMMIT = 14,
        DHCPV6_OPT_USER_CLASS = 15,
@@ -71,17 +73,15 @@ enum dhcvp6_opt {
        /* draft-donley-dhc-cer-id-option-03 */
        DHCPV6_OPT_CER_ID = EXT_CER_ID,
 #endif
-#ifdef EXT_S46
-       /* draft-ietf-softwire-map-dhcp-07 */
-       DHCPV6_OPT_S46_RULE = EXT_S46,
-       DHCPV6_OPT_S46_BR = EXT_S46 + 1,
-       DHCPV6_OPT_S46_DMR = EXT_S46 + 2,
-       DHCPV6_OPT_S46_V4V6BIND = EXT_S46 + 3,
-       DHCPV6_OPT_S46_PORTPARAMS = EXT_S46 + 4,
-       DHCPV6_OPT_S46_CONT_MAPE = EXT_S46 + 5,
-       DHCPV6_OPT_S46_CONT_MAPT = EXT_S46 + 6,
-       DHCPV6_OPT_S46_CONT_LW = EXT_S46 + 7,
-#endif
+       /* draft-ietf-softwire-map-dhcp-08 */
+       DHCPV6_OPT_S46_RULE = 89,
+       DHCPV6_OPT_S46_BR = 90,
+       DHCPV6_OPT_S46_DMR = 91,
+       DHCPV6_OPT_S46_V4V6BIND = 92,
+       DHCPV6_OPT_S46_PORTPARAMS = 93,
+       DHCPV6_OPT_S46_CONT_MAPE = 94,
+       DHCPV6_OPT_S46_CONT_MAPT = 95,
+       DHCPV6_OPT_S46_CONT_LW = 96,
 };
 
 enum dhcpv6_opt_npt {
@@ -123,7 +123,7 @@ enum dhcpv6_config {
 };
 
 typedef int(reply_handler)(enum dhcpv6_msg orig, const int rc,
-               const void *opt, const void *end);
+               const void *opt, const void *end, const struct sockaddr_in6 *from);
 
 // retransmission strategy
 struct dhcpv6_retx {
@@ -188,9 +188,6 @@ struct dhcpv6_auth_reconfigure {
 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;
 } _packed;
 
@@ -246,6 +243,7 @@ enum odhcp6c_state {
        STATE_CLIENT_ID,
        STATE_SERVER_ID,
        STATE_SERVER_CAND,
+       STATE_SERVER_ADDR,
        STATE_ORO,
        STATE_DNS,
        STATE_SEARCH,
@@ -268,6 +266,7 @@ enum odhcp6c_state {
        STATE_S46_MAPT,
        STATE_S46_MAPE,
        STATE_S46_LW,
+       STATE_PASSTHRU,
        _STATE_MAX
 };
 
@@ -320,14 +319,18 @@ int init_rtnetlink(void);
 int set_rtnetlink_addr(int ifindex, const struct in6_addr *addr,
                uint32_t pref, uint32_t valid);
 
+int ra_conf_hoplimit(int newvalue);
+int ra_conf_mtu(int newvalue);
+int ra_conf_reachable(int newvalue);
+int ra_conf_retransmit(int newvalue);
+
 int script_init(const char *path, const char *ifname);
 ssize_t script_unhexlify(uint8_t *dst, size_t len, const char *src);
 void script_call(const char *status);
-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);
+int odhcp6c_random(void *buf, size_t len);
 bool odhcp6c_is_bound(void);
 
 // State manipulation
@@ -341,8 +344,7 @@ void* odhcp6c_get_state(enum odhcp6c_state state, size_t *len);
 
 // Entry manipulation
 struct odhcp6c_entry* odhcp6c_find_entry(enum odhcp6c_state state, const struct odhcp6c_entry *new);
-bool odhcp6c_update_entry(enum odhcp6c_state state, struct odhcp6c_entry *new);
-bool odhcp6c_update_entry_safe(enum odhcp6c_state state, struct odhcp6c_entry *new, uint32_t safe);
+bool odhcp6c_update_entry(enum odhcp6c_state state, struct odhcp6c_entry *new, uint32_t safe, bool filterexcess);
 
 void odhcp6c_expire(void);
 uint32_t odhcp6c_elapsed(void);