udhcpc6: set -x options in request

Last foru commits:

function                                             old     new   delta
option_to_env                                        621     791    +170
.rodata                                           168351  168505    +154
attach_option                                        431     506     +75
add_d6_client_options                                112     167     +55
d6_option_strings                                     30      84     +54
udhcp_str2optset                                     644     660     +16
d6_optflags                                           12      20      +8
udhcpc6_main                                        2590    2596      +6
udhcpc_main                                         2648    2651      +3
read_optset                                           15      18      +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 10/0 up/down: 544/0)            Total: 544 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-05-14 11:06:35 +02:00
parent 30f4d52ed1
commit 6027597fd1
5 changed files with 56 additions and 12 deletions

View File

@@ -164,6 +164,10 @@ enum {
#define OPT_CODE 0
#define OPT_LEN 1
#define OPT_DATA 2
/* Offsets in option byte sequence for DHCPv6 */
#define D6_OPT_CODE 0
#define D6_OPT_LEN 2
#define D6_OPT_DATA 4
/* Bits in "overload" option */
#define OPTION_FIELD 0
#define FILE_FIELD 1
@@ -290,10 +294,15 @@ void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC;
/* 2nd param is "uint32_t*" */
int FAST_FUNC udhcp_str2nip(const char *str, void *arg);
/* 2nd param is "struct option_set**" */
#if !ENABLE_UDHCPC6
#define udhcp_str2optset(str, arg, optflags, option_strings, dhcpv6) \
udhcp_str2optset(str, arg, optflags, option_strings)
#endif
int FAST_FUNC udhcp_str2optset(const char *str,
void *arg,
const struct dhcp_optflag *optflags,
const char *option_strings);
const char *option_strings,
bool dhcpv6);
#if ENABLE_UDHCPC || ENABLE_UDHCPD
void udhcp_init_header(struct dhcp_packet *packet, char type) FAST_FUNC;