diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-06-28 19:18:17 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-06-28 19:18:17 +0200 |
commit | ba4fbca8a81d765f81aefc74db7f73ec9ded3550 (patch) | |
tree | 3790acaa5ef3c682831aa15428beb313eea5dcb7 /networking/udhcp/common.h | |
parent | ae2b9f286c985394410aec19b12c1ebecfbe20f6 (diff) | |
download | busybox-w32-ba4fbca8a81d765f81aefc74db7f73ec9ded3550.tar.gz busybox-w32-ba4fbca8a81d765f81aefc74db7f73ec9ded3550.tar.bz2 busybox-w32-ba4fbca8a81d765f81aefc74db7f73ec9ded3550.zip |
udhcpc6: make -O OPT work
Patch is based on work by tiggerswelt.net.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r-- | networking/udhcp/common.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index ee12cf91b..6907e7f60 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h | |||
@@ -93,8 +93,10 @@ enum { | |||
93 | OPTION_BIN, | 93 | OPTION_BIN, |
94 | OPTION_STATIC_ROUTES, | 94 | OPTION_STATIC_ROUTES, |
95 | OPTION_6RD, | 95 | OPTION_6RD, |
96 | #if ENABLE_FEATURE_UDHCP_RFC3397 | 96 | #if ENABLE_FEATURE_UDHCP_RFC3397 || ENABLE_FEATURE_UDHCPC6_RFC3646 || ENABLE_FEATURE_UDHCPC6_RFC4704 |
97 | OPTION_DNS_STRING, /* RFC1035 compressed domain name list */ | 97 | OPTION_DNS_STRING, /* RFC1035 compressed domain name list */ |
98 | #endif | ||
99 | #if ENABLE_FEATURE_UDHCP_RFC3397 | ||
98 | OPTION_SIP_SERVERS, | 100 | OPTION_SIP_SERVERS, |
99 | #endif | 101 | #endif |
100 | 102 | ||
@@ -189,17 +191,21 @@ struct option_set { | |||
189 | struct option_set *next; | 191 | struct option_set *next; |
190 | }; | 192 | }; |
191 | 193 | ||
194 | #if ENABLE_UDHCPC || ENABLE_UDHCPD | ||
192 | extern const struct dhcp_optflag dhcp_optflags[]; | 195 | extern const struct dhcp_optflag dhcp_optflags[]; |
193 | extern const char dhcp_option_strings[] ALIGN1; | 196 | extern const char dhcp_option_strings[] ALIGN1; |
197 | #endif | ||
194 | extern const uint8_t dhcp_option_lengths[] ALIGN1; | 198 | extern const uint8_t dhcp_option_lengths[] ALIGN1; |
195 | 199 | ||
196 | unsigned FAST_FUNC udhcp_option_idx(const char *name); | 200 | unsigned FAST_FUNC udhcp_option_idx(const char *name, const char *option_strings); |
197 | 201 | ||
198 | uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC; | 202 | uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC; |
199 | int udhcp_end_option(uint8_t *optionptr) FAST_FUNC; | 203 | int udhcp_end_option(uint8_t *optionptr) FAST_FUNC; |
200 | void udhcp_add_binary_option(struct dhcp_packet *packet, uint8_t *addopt) FAST_FUNC; | 204 | void udhcp_add_binary_option(struct dhcp_packet *packet, uint8_t *addopt) FAST_FUNC; |
205 | #if ENABLE_UDHCPC || ENABLE_UDHCPD | ||
201 | void udhcp_add_simple_option(struct dhcp_packet *packet, uint8_t code, uint32_t data) FAST_FUNC; | 206 | void udhcp_add_simple_option(struct dhcp_packet *packet, uint8_t code, uint32_t data) FAST_FUNC; |
202 | #if ENABLE_FEATURE_UDHCP_RFC3397 | 207 | #endif |
208 | #if ENABLE_FEATURE_UDHCP_RFC3397 || ENABLE_FEATURE_UDHCPC6_RFC3646 || ENABLE_FEATURE_UDHCPC6_RFC4704 | ||
203 | char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC; | 209 | char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC; |
204 | uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC; | 210 | uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC; |
205 | #endif | 211 | #endif |
@@ -284,7 +290,10 @@ void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC; | |||
284 | /* 2nd param is "uint32_t*" */ | 290 | /* 2nd param is "uint32_t*" */ |
285 | int FAST_FUNC udhcp_str2nip(const char *str, void *arg); | 291 | int FAST_FUNC udhcp_str2nip(const char *str, void *arg); |
286 | /* 2nd param is "struct option_set**" */ | 292 | /* 2nd param is "struct option_set**" */ |
287 | int FAST_FUNC udhcp_str2optset(const char *str, void *arg); | 293 | int FAST_FUNC udhcp_str2optset(const char *str, |
294 | void *arg, | ||
295 | const struct dhcp_optflag *optflags, | ||
296 | const char *option_strings); | ||
288 | 297 | ||
289 | void udhcp_init_header(struct dhcp_packet *packet, char type) FAST_FUNC; | 298 | void udhcp_init_header(struct dhcp_packet *packet, char type) FAST_FUNC; |
290 | 299 | ||