diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-26 08:35:24 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-26 08:35:24 +0100 |
commit | a8f6b9998727ad67db4b812270a1bbceea011dde (patch) | |
tree | fbe3633852270c9fd33674513fdb289a617697ad /networking/udhcp/common.h | |
parent | 7e6add1dfca95183bf409820066fab975979bf06 (diff) | |
download | busybox-w32-a8f6b9998727ad67db4b812270a1bbceea011dde.tar.gz busybox-w32-a8f6b9998727ad67db4b812270a1bbceea011dde.tar.bz2 busybox-w32-a8f6b9998727ad67db4b812270a1bbceea011dde.zip |
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 <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r-- | networking/udhcp/common.h | 14 |
1 files changed, 9 insertions, 5 deletions
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 { | |||
74 | #if ENABLE_FEATURE_UDHCP_RFC3397 | 74 | #if ENABLE_FEATURE_UDHCP_RFC3397 |
75 | OPTION_STR1035, /* RFC1035 compressed domain name list */ | 75 | OPTION_STR1035, /* RFC1035 compressed domain name list */ |
76 | #endif | 76 | #endif |
77 | OPTION_BOOLEAN, | 77 | // OPTION_BOOLEAN, |
78 | OPTION_U8, | 78 | OPTION_U8, |
79 | OPTION_U16, | 79 | OPTION_U16, |
80 | OPTION_S16, | 80 | // OPTION_S16, |
81 | OPTION_U32, | 81 | OPTION_U32, |
82 | OPTION_S32, | 82 | OPTION_S32, |
83 | OPTION_STATIC_ROUTES, | 83 | OPTION_STATIC_ROUTES, |
@@ -172,14 +172,13 @@ extern const uint8_t dhcp_option_lengths[]; | |||
172 | 172 | ||
173 | uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC; | 173 | uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC; |
174 | int udhcp_end_option(uint8_t *optionptr) FAST_FUNC; | 174 | int udhcp_end_option(uint8_t *optionptr) FAST_FUNC; |
175 | void udhcp_add_option_string(uint8_t *optionptr, uint8_t *string) FAST_FUNC; | 175 | void udhcp_add_binary_option(uint8_t *optionptr, uint8_t *addopt) FAST_FUNC; |
176 | void udhcp_add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data) FAST_FUNC; | 176 | void udhcp_add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data) FAST_FUNC; |
177 | #if ENABLE_FEATURE_UDHCP_RFC3397 | 177 | #if ENABLE_FEATURE_UDHCP_RFC3397 |
178 | char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC; | 178 | char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC; |
179 | uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC; | 179 | uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC; |
180 | #endif | 180 | #endif |
181 | /* 2nd param is actually "struct option_set**" */ | 181 | struct option_set *find_option(struct option_set *opt_list, uint8_t code) FAST_FUNC; |
182 | int FAST_FUNC udhcp_str2optset(const char *const_line, void *arg); | ||
183 | 182 | ||
184 | 183 | ||
185 | // RFC 2131 Table 5: Fields and options used by DHCP clients | 184 | // 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; | |||
255 | 254 | ||
256 | /*** Other shared functions ***/ | 255 | /*** Other shared functions ***/ |
257 | 256 | ||
257 | /* 2nd param is "uint32_t*" */ | ||
258 | int FAST_FUNC udhcp_str2nip(const char *str, void *arg); | ||
259 | /* 2nd param is "struct option_set**" */ | ||
260 | int FAST_FUNC udhcp_str2optset(const char *str, void *arg); | ||
261 | |||
258 | uint16_t udhcp_checksum(void *addr, int count) FAST_FUNC; | 262 | uint16_t udhcp_checksum(void *addr, int count) FAST_FUNC; |
259 | 263 | ||
260 | void udhcp_init_header(struct dhcp_packet *packet, char type) FAST_FUNC; | 264 | void udhcp_init_header(struct dhcp_packet *packet, char type) FAST_FUNC; |