From a8f6b9998727ad67db4b812270a1bbceea011dde Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 26 Mar 2010 08:35:24 +0100 Subject: udhcp: move options.c to common.c; disable unused bool and s16 option code function old new delta udhcp_add_binary_option - 94 +94 udhcp_str2nip - 42 +42 len_of_option_as_string 12 10 -2 dhcp_option_lengths 12 10 -2 udhcpc_main 2859 2851 -8 read_nip 42 - -42 xmalloc_optname_optval 590 536 -54 udhcp_str2optset 443 366 -77 udhcp_add_option_string 86 - -86 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/5 up/down: 136/-271) Total: -135 bytes Signed-off-by: Denys Vlasenko --- networking/udhcp/common.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'networking/udhcp/common.h') diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index 9c3b4960b..cc0cab6e4 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h @@ -74,10 +74,10 @@ enum { #if ENABLE_FEATURE_UDHCP_RFC3397 OPTION_STR1035, /* RFC1035 compressed domain name list */ #endif - OPTION_BOOLEAN, +// OPTION_BOOLEAN, OPTION_U8, OPTION_U16, - OPTION_S16, +// OPTION_S16, OPTION_U32, OPTION_S32, OPTION_STATIC_ROUTES, @@ -172,14 +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_option_string(uint8_t *optionptr, uint8_t *string) 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; #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 -/* 2nd param is actually "struct option_set**" */ -int FAST_FUNC udhcp_str2optset(const char *const_line, void *arg); +struct option_set *find_option(struct option_set *opt_list, uint8_t code) FAST_FUNC; // RFC 2131 Table 5: Fields and options used by DHCP clients @@ -255,6 +254,11 @@ void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC; /*** Other shared functions ***/ +/* 2nd param is "uint32_t*" */ +int FAST_FUNC udhcp_str2nip(const char *str, void *arg); +/* 2nd param is "struct option_set**" */ +int FAST_FUNC udhcp_str2optset(const char *str, void *arg); + uint16_t udhcp_checksum(void *addr, int count) FAST_FUNC; void udhcp_init_header(struct dhcp_packet *packet, char type) FAST_FUNC; -- cgit v1.2.3