summaryrefslogtreecommitdiff
path: root/src/odhcp6c.h
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2013-12-01 18:57:06 +0100
committerHans Dedecker <dedeckeh@gmail.com>2013-12-01 21:07:04 +0100
commit3d85fddacbbb0eebd33997382997af442b408b04 (patch)
treebac67977e24ad47903711d7dabe284b03c776204 /src/odhcp6c.h
parent1234ab04386fd63eafb19ecf245b730d6461e869 (diff)
downloadodhcp6c-3d85fddacbbb0eebd33997382997af442b408b04.tar.gz
Fine tune server candidate selection logic
DHCPv6 server info from ADVERTISE messages is inserted in the server candidate list sorted according to the preference value (highest values first in the list). Server candidate list can only contain one entry from a given server. Server with highest preference value is selected; in case the server does not respond the next server is selected from the list. When the server candidate list is empty and no servers responded; the client restarts the DHCPv6 server discovery process
Diffstat (limited to 'src/odhcp6c.h')
-rw-r--r--src/odhcp6c.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/odhcp6c.h b/src/odhcp6c.h
index cf8ff74..2c28c80 100644
--- a/src/odhcp6c.h
+++ b/src/odhcp6c.h
@@ -203,12 +203,11 @@ struct icmp6_opt {
enum dhcpv6_mode {
- DHCPV6_UNKNOWN,
+ DHCPV6_UNKNOWN = -1,
DHCPV6_STATELESS,
DHCPV6_STATEFUL
};
-
enum odhcp6c_ia_mode {
IA_MODE_NONE,
IA_MODE_TRY,
@@ -233,6 +232,8 @@ int init_dhcpv6(const char *ifname, int request_pd, int sol_timeout);
void dhcpv6_set_ia_mode(enum odhcp6c_ia_mode na, enum odhcp6c_ia_mode pd);
int dhcpv6_request(enum dhcpv6_msg type);
int dhcpv6_poll_reconfigure(void);
+int dhcpv6_promote_server_cand(void);
+void dhcpv6_clear_all_server_cand(void);
int init_rtnetlink(void);
int set_rtnetlink_addr(int ifindex, const struct in6_addr *addr,
@@ -252,6 +253,7 @@ bool odhcp6c_addr_in_scope(const struct in6_addr *addr);
// State manipulation
void odhcp6c_clear_state(enum odhcp6c_state state);
void odhcp6c_add_state(enum odhcp6c_state state, const void *data, size_t len);
+void odhcp6c_insert_state(enum odhcp6c_state state, size_t offset, const void *data, size_t len);
size_t odhcp6c_remove_state(enum odhcp6c_state state, size_t offset, size_t len);
void* odhcp6c_move_state(enum odhcp6c_state state, size_t *len);
void* odhcp6c_get_state(enum odhcp6c_state state, size_t *len);