• Home
  • Raw
  • Download

Lines Matching refs:options

63 dhcp_option ( struct dhcp_options *options, unsigned int offset ) {  in dhcp_option()  argument
64 return ( ( struct dhcp_option * ) ( options->data + offset ) ); in dhcp_option()
75 dhcp_option_offset ( struct dhcp_options *options, in dhcp_option_offset() argument
77 return ( ( ( void * ) option ) - options->data ); in dhcp_option_offset()
114 static int find_dhcp_option_with_encap ( struct dhcp_options *options, in find_dhcp_option_with_encap() argument
120 ssize_t remaining = options->len; in find_dhcp_option_with_encap()
133 option = dhcp_option ( options, offset ); in find_dhcp_option_with_encap()
150 DBGC ( options, "DHCPOPT %p found %s (length %d)\n", in find_dhcp_option_with_encap()
151 options, dhcp_tag_name ( original_tag ), in find_dhcp_option_with_encap()
183 static int resize_dhcp_option ( struct dhcp_options *options, in resize_dhcp_option() argument
199 DBGC ( options, "DHCPOPT %p overlength option\n", options ); in resize_dhcp_option()
202 new_options_len = ( options->len + delta ); in resize_dhcp_option()
203 if ( new_options_len > options->max_len ) { in resize_dhcp_option()
206 new_data = realloc ( options->data, new_options_len ); in resize_dhcp_option()
208 DBGC ( options, "DHCPOPT %p could not " in resize_dhcp_option()
209 "reallocate to %zd bytes\n", options, in resize_dhcp_option()
213 options->data = new_data; in resize_dhcp_option()
214 options->max_len = new_options_len; in resize_dhcp_option()
216 DBGC ( options, "DHCPOPT %p out of space\n", options ); in resize_dhcp_option()
221 encapsulator = dhcp_option ( options, encap_offset ); in resize_dhcp_option()
224 DBGC ( options, "DHCPOPT %p overlength encapsulator\n", in resize_dhcp_option()
225 options ); in resize_dhcp_option()
230 options->len = new_options_len; in resize_dhcp_option()
233 option = dhcp_option ( options, offset ); in resize_dhcp_option()
236 end = ( options->data + options->max_len ); in resize_dhcp_option()
260 static int set_dhcp_option ( struct dhcp_options *options, unsigned int tag, in set_dhcp_option() argument
277 creation_offset = find_dhcp_option_with_encap ( options, DHCP_END, in set_dhcp_option()
280 creation_offset = options->len; in set_dhcp_option()
282 offset = find_dhcp_option_with_encap ( options, tag, &encap_offset ); in set_dhcp_option()
284 old_len = dhcp_option_len ( dhcp_option ( options, offset ) ); in set_dhcp_option()
285 DBGC ( options, "DHCPOPT %p resizing %s from %zd to %zd\n", in set_dhcp_option()
286 options, dhcp_tag_name ( tag ), old_len, new_len ); in set_dhcp_option()
288 DBGC ( options, "DHCPOPT %p creating %s (length %zd)\n", in set_dhcp_option()
289 options, dhcp_tag_name ( tag ), new_len ); in set_dhcp_option()
295 encap_offset = set_dhcp_option ( options, encap_tag, in set_dhcp_option()
308 if ( ( rc = resize_dhcp_option ( options, offset, encap_offset, in set_dhcp_option()
315 option = dhcp_option ( options, offset ); in set_dhcp_option()
323 option = dhcp_option ( options, encap_offset ); in set_dhcp_option()
325 set_dhcp_option ( options, encap_tag, NULL, 0, 0 ); in set_dhcp_option()
340 int dhcpopt_store ( struct dhcp_options *options, unsigned int tag, in dhcpopt_store() argument
344 offset = set_dhcp_option ( options, tag, data, len, 0 ); in dhcpopt_store()
359 int dhcpopt_extensible_store ( struct dhcp_options *options, unsigned int tag, in dhcpopt_extensible_store() argument
363 offset = set_dhcp_option ( options, tag, data, len, 1 ); in dhcpopt_extensible_store()
378 int dhcpopt_fetch ( struct dhcp_options *options, unsigned int tag, in dhcpopt_fetch() argument
384 offset = find_dhcp_option_with_encap ( options, tag, NULL ); in dhcpopt_fetch()
388 option = dhcp_option ( options, offset ); in dhcpopt_fetch()
405 static void dhcpopt_update_len ( struct dhcp_options *options ) { in dhcpopt_update_len() argument
408 ssize_t remaining = options->max_len; in dhcpopt_update_len()
412 options->len = 0; in dhcpopt_update_len()
414 option = dhcp_option ( options, offset ); in dhcpopt_update_len()
421 options->len = offset; in dhcpopt_update_len()
435 void dhcpopt_init ( struct dhcp_options *options, void *data, in dhcpopt_init() argument
439 options->data = data; in dhcpopt_init()
440 options->max_len = max_len; in dhcpopt_init()
443 dhcpopt_update_len ( options ); in dhcpopt_init()
445 DBGC ( options, "DHCPOPT %p created (data %p len %#zx max_len %#zx)\n", in dhcpopt_init()
446 options, options->data, options->len, options->max_len ); in dhcpopt_init()