]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/odhcp6c.h
odhcp6c: message retransmission count support
[odhcp6c.git] / src / odhcp6c.h
index 669b33d4149172b8240b3c90aedc422e92e546c2..5b9b78fd1faa200c73e9f6f8e4ca9dbf70158bdc 100644 (file)
@@ -85,7 +85,7 @@ enum dhcpv6_status {
        DHCPV6_NoPrefixAvail = 6,
 };
 
-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 +93,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;
@@ -250,8 +250,8 @@ 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);
-void odhcp6c_update_entry(enum odhcp6c_state state, struct odhcp6c_entry *new);
-void 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);
+bool odhcp6c_update_entry_safe(enum odhcp6c_state state, struct odhcp6c_entry *new, uint32_t safe);
 
 void odhcp6c_expire(void);
 uint32_t odhcp6c_elapsed(void);