aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/common.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-06-28 19:18:17 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-06-28 19:18:17 +0200
commitba4fbca8a81d765f81aefc74db7f73ec9ded3550 (patch)
tree3790acaa5ef3c682831aa15428beb313eea5dcb7 /networking/udhcp/common.h
parentae2b9f286c985394410aec19b12c1ebecfbe20f6 (diff)
downloadbusybox-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.h17
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
192extern const struct dhcp_optflag dhcp_optflags[]; 195extern const struct dhcp_optflag dhcp_optflags[];
193extern const char dhcp_option_strings[] ALIGN1; 196extern const char dhcp_option_strings[] ALIGN1;
197#endif
194extern const uint8_t dhcp_option_lengths[] ALIGN1; 198extern const uint8_t dhcp_option_lengths[] ALIGN1;
195 199
196unsigned FAST_FUNC udhcp_option_idx(const char *name); 200unsigned FAST_FUNC udhcp_option_idx(const char *name, const char *option_strings);
197 201
198uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC; 202uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC;
199int udhcp_end_option(uint8_t *optionptr) FAST_FUNC; 203int udhcp_end_option(uint8_t *optionptr) FAST_FUNC;
200void udhcp_add_binary_option(struct dhcp_packet *packet, uint8_t *addopt) FAST_FUNC; 204void udhcp_add_binary_option(struct dhcp_packet *packet, uint8_t *addopt) FAST_FUNC;
205#if ENABLE_UDHCPC || ENABLE_UDHCPD
201void udhcp_add_simple_option(struct dhcp_packet *packet, uint8_t code, uint32_t data) FAST_FUNC; 206void 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
203char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC; 209char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC;
204uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC; 210uint8_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*" */
285int FAST_FUNC udhcp_str2nip(const char *str, void *arg); 291int FAST_FUNC udhcp_str2nip(const char *str, void *arg);
286/* 2nd param is "struct option_set**" */ 292/* 2nd param is "struct option_set**" */
287int FAST_FUNC udhcp_str2optset(const char *str, void *arg); 293int FAST_FUNC udhcp_str2optset(const char *str,
294 void *arg,
295 const struct dhcp_optflag *optflags,
296 const char *option_strings);
288 297
289void udhcp_init_header(struct dhcp_packet *packet, char type) FAST_FUNC; 298void udhcp_init_header(struct dhcp_packet *packet, char type) FAST_FUNC;
290 299