odhcp6c: add option to ignore Server Unicast option
[project/odhcp6c.git] / src / odhcp6c.h
index f17b43de67512f5d2ac324a27ccc26d6f3a58991..ad4f7937b3fd2c462d4556052f74a3b2de0e628d 100644 (file)
@@ -51,6 +51,7 @@ enum dhcvp6_opt {
        DHCPV6_OPT_RAPID_COMMIT = 14,
        DHCPV6_OPT_USER_CLASS = 15,
        DHCPV6_OPT_VENDOR_CLASS = 16,
+       DHCPV6_OPT_INTERFACE_ID = 18,
        DHCPV6_OPT_RECONF_MESSAGE = 19,
        DHCPV6_OPT_RECONF_ACCEPT = 20,
        DHCPV6_OPT_DNS_SERVERS = 23,
@@ -118,6 +119,7 @@ enum dhcpv6_config {
        DHCPV6_STRICT_OPTIONS = 1,
        DHCPV6_CLIENT_FQDN = 2,
        DHCPV6_ACCEPT_RECONFIGURE = 4,
+       DHCPV6_IGNORE_OPT_UNICAST = 8,
 };
 
 typedef int(reply_handler)(enum dhcpv6_msg orig, const int rc,
@@ -260,8 +262,7 @@ enum odhcp6c_state {
        STATE_RA_DNS,
        STATE_RA_SEARCH,
        STATE_AFTR_NAME,
-       STATE_VENDORCLASS,
-       STATE_USERCLASS,
+       STATE_OPTS,
        STATE_CER,
        STATE_S46_MAPT,
        STATE_S46_MAPE,
@@ -322,6 +323,24 @@ struct odhcp6c_request_prefix {
        uint16_t length;
 };
 
+enum odhcp6c_opt_flags {
+       OPT_U8 = 0,
+       OPT_IP6,
+       OPT_STR,
+       OPT_DNS_STR,
+       OPT_USER_CLASS,
+       OPT_MASK_SIZE = 0x0F,
+       OPT_ARRAY = 0x10,
+       OPT_INTERNAL = 0x20,
+       OPT_NO_PASSTHRU = 0x40,
+};
+
+struct odhcp6c_opt {
+       uint16_t code;
+       uint8_t flags;
+       const char *str;
+};
+
 int init_dhcpv6(const char *ifname, unsigned int client_options, int sol_timeout);
 int dhcpv6_set_ia_mode(enum odhcp6c_ia_mode na, enum odhcp6c_ia_mode pd);
 int dhcpv6_request(enum dhcpv6_msg type);
@@ -332,10 +351,10 @@ 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 ra_get_hoplimit(void);
+int ra_get_mtu(void);
+int ra_get_reachable(void);
+int ra_get_retransmit(void);
 
 int script_init(const char *path, const char *ifname);
 ssize_t script_unhexlify(uint8_t *dst, size_t len, const char *src);
@@ -362,3 +381,4 @@ bool odhcp6c_update_entry(enum odhcp6c_state state, struct odhcp6c_entry *new,
 
 void odhcp6c_expire(void);
 uint32_t odhcp6c_elapsed(void);
+struct odhcp6c_opt *odhcp6c_find_opt(const uint16_t code);