aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r--networking/udhcp/common.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index 60255eefa..81c1dcbdc 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -78,7 +78,7 @@ struct BUG_bad_sizeof_struct_ip_udp_dhcp_packet {
78/*** Options ***/ 78/*** Options ***/
79 79
80enum { 80enum {
81 OPTION_IP = 1, 81 OPTION_IP = 0,
82 OPTION_IP_PAIR, 82 OPTION_IP_PAIR,
83 OPTION_STRING, 83 OPTION_STRING,
84 /* Opts of STRING_HOST type will be sanitized before they are passed 84 /* Opts of STRING_HOST type will be sanitized before they are passed
@@ -107,6 +107,12 @@ enum {
107 OPTION_LIST = 0x20, 107 OPTION_LIST = 0x20,
108}; 108};
109 109
110struct dhcp_scan_state {
111 int overload;
112 int rem;
113 uint8_t *optionptr;
114};
115
110/* DHCP option codes (partial list). See RFC 2132 and 116/* DHCP option codes (partial list). See RFC 2132 and
111 * http://www.iana.org/assignments/bootp-dhcp-parameters/ 117 * http://www.iana.org/assignments/bootp-dhcp-parameters/
112 * Commented out options are handled by common option machinery, 118 * Commented out options are handled by common option machinery,
@@ -206,6 +212,8 @@ extern const uint8_t dhcp_option_lengths[] ALIGN1;
206 212
207unsigned FAST_FUNC udhcp_option_idx(const char *name, const char *option_strings); 213unsigned FAST_FUNC udhcp_option_idx(const char *name, const char *option_strings);
208 214
215void init_scan_state(struct dhcp_packet *packet, struct dhcp_scan_state *scan_state) FAST_FUNC;
216uint8_t *udhcp_scan_options(struct dhcp_packet *packet, struct dhcp_scan_state *scan_state) FAST_FUNC;
209uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC; 217uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC;
210/* Same as above + ensures that option length is 4 bytes 218/* Same as above + ensures that option length is 4 bytes
211 * (returns NULL if size is different) 219 * (returns NULL if size is different)
@@ -218,7 +226,7 @@ void udhcp_add_simple_option(struct dhcp_packet *packet, uint8_t code, uint32_t
218#endif 226#endif
219#if ENABLE_FEATURE_UDHCP_RFC3397 || ENABLE_FEATURE_UDHCPC6_RFC3646 || ENABLE_FEATURE_UDHCPC6_RFC4704 227#if ENABLE_FEATURE_UDHCP_RFC3397 || ENABLE_FEATURE_UDHCPC6_RFC3646 || ENABLE_FEATURE_UDHCPC6_RFC4704
220char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC; 228char *dname_dec(const uint8_t *cstr, int clen, const char *pre) FAST_FUNC;
221uint8_t *dname_enc(const uint8_t *cstr, int clen, const char *src, int *retlen) FAST_FUNC; 229uint8_t *dname_enc(/*const uint8_t *cstr, int clen,*/ const char *src, int *retlen) FAST_FUNC;
222#endif 230#endif
223struct option_set *udhcp_find_option(struct option_set *opt_list, uint8_t code) FAST_FUNC; 231struct option_set *udhcp_find_option(struct option_set *opt_list, uint8_t code) FAST_FUNC;
224 232