From 7724c766bdfba5f3af5cdf5d869bcf03f45149e3 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 26 Mar 2010 09:32:09 +0100 Subject: udhcp: pass pointer to whole packet to "add option" functions This is needed for "overflow option" support function old new delta udhcp_find_option - 34 +34 udhcp_add_binary_option 94 106 +12 write_leases 227 223 -4 udhcp_init_header 86 82 -4 send_release 104 99 -5 init_packet 87 81 -6 add_client_options 160 154 -6 add_server_options 100 92 -8 udhcpd_main 1964 1954 -10 udhcpc_main 2859 2837 -22 find_option 34 - -34 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/8 up/down: 46/-99) Total: -53 bytes Signed-off-by: Denys Vlasenko --- networking/udhcp/common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'networking/udhcp/common.h') diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index cc0cab6e4..bb7541f6e 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h @@ -172,13 +172,13 @@ extern const uint8_t dhcp_option_lengths[]; uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC; int udhcp_end_option(uint8_t *optionptr) FAST_FUNC; -void udhcp_add_binary_option(uint8_t *optionptr, uint8_t *addopt) FAST_FUNC; -void udhcp_add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data) FAST_FUNC; +void udhcp_add_binary_option(struct dhcp_packet *packet, uint8_t *addopt) FAST_FUNC; +void udhcp_add_simple_option(struct dhcp_packet *packet, uint8_t code, uint32_t data) FAST_FUNC; #if ENABLE_FEATURE_UDHCP_RFC3397 char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC; uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC; #endif -struct option_set *find_option(struct option_set *opt_list, uint8_t code) FAST_FUNC; +struct option_set *udhcp_find_option(struct option_set *opt_list, uint8_t code) FAST_FUNC; // RFC 2131 Table 5: Fields and options used by DHCP clients -- cgit v1.2.3