diff options
author | Denis Vlasenko | 2006-12-27 04:35:09 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-12-27 04:35:09 +0000 |
commit | 7b76233290bd9dead1848f28ed6d0edfcceb8e09 (patch) | |
tree | b963999fc54eddb65f1929b894f868e24851fc9c /networking/udhcp/options.h | |
download | busybox-1_3_0.zip busybox-1_3_0.tar.gz |
Correcting tag name to be like previous ones1_3_0
Diffstat (limited to 'networking/udhcp/options.h')
-rw-r--r-- | networking/udhcp/options.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/networking/udhcp/options.h b/networking/udhcp/options.h new file mode 100644 index 0000000..588504e --- /dev/null +++ b/networking/udhcp/options.h @@ -0,0 +1,37 @@ +/* vi: set sw=4 ts=4: */ +/* options.h */ +#ifndef _OPTIONS_H +#define _OPTIONS_H + +#define TYPE_MASK 0x0F + +enum { + OPTION_IP=1, + OPTION_IP_PAIR, + OPTION_STRING, + OPTION_BOOLEAN, + OPTION_U8, + OPTION_U16, + OPTION_S16, + OPTION_U32, + OPTION_S32 +}; + +#define OPTION_REQ 0x10 /* have the client request this option */ +#define OPTION_LIST 0x20 /* There can be a list of 1 or more of these */ + +struct dhcp_option { + char name[12]; + char flags; + uint8_t code; +}; + +extern const struct dhcp_option dhcp_options[]; +extern const unsigned char option_lengths[]; + +uint8_t *get_option(struct dhcpMessage *packet, int code); +int end_option(uint8_t *optionptr); +int add_option_string(uint8_t *optionptr, uint8_t *string); +int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data); + +#endif |