common/options.c File Reference

#include "dhcpd.h"
#include <omapip/omapip_p.h>
#include <limits.h>

Go to the source code of this file.

Data Structures

struct  vsio_state

Defines

#define DHCP_OPTION_DATA
#define PRIORITY_COUNT   300

Functions

int parse_options (struct packet *packet)
int parse_option_buffer (struct option_state *options, const unsigned char *buffer, unsigned length, struct universe *universe)
struct universefind_option_universe (struct option *eopt, const char *uname)
int parse_encapsulated_suboptions (struct option_state *options, struct option *eopt, const unsigned char *buffer, unsigned len, struct universe *eu, const char *uname)
int fqdn_universe_decode (struct option_state *options, const unsigned char *buffer, unsigned length, struct universe *u)
int cons_options (struct packet *inpacket, struct dhcp_packet *outpacket, struct lease *lease, struct client_state *client_state, int mms, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, int overload_avail, int terminate, int bootpp, struct data_string *prl, const char *vuname)
int store_options6 (char *buf, int buflen, struct option_state *opt_state, struct packet *packet, const int *required_opts, struct data_string *oro)
int store_options (int *ocount, unsigned char *buffer, unsigned index, unsigned buflen, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, unsigned *priority_list, int priority_len, unsigned first_cutoff, int second_cutoff, int terminate, const char *vuname)
int format_has_text (char *format) const
int format_min_length (char *format, struct option_cache *oc) const
const char * pretty_print_option (struct option *option, const unsigned char *data, unsigned len, int emit_commas, int emit_quotes)
int get_option (struct data_string *result, struct universe *universe, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct option_state *options, struct binding_scope **scope, unsigned code, const char *file, int line)
void set_option (struct universe *universe, struct option_state *options, struct option_cache *option, enum statement_op op)
struct option_cachelookup_option (struct universe *universe, struct option_state *options, unsigned code)
struct option_cachelookup_hashed_option (struct universe *universe, struct option_state *options, unsigned code)
int save_option_buffer (struct universe *universe, struct option_state *options, struct buffer *bp, unsigned char *buffer, unsigned length, unsigned code, int terminatep)
int append_option_buffer (struct universe *universe, struct option_state *options, struct buffer *bp, unsigned char *buffer, unsigned length, unsigned code, int terminatep)
void build_server_oro (struct data_string *server_oro, struct option_state *options, const char *file, int line)
void save_option (struct universe *universe, struct option_state *options, struct option_cache *oc)
void also_save_option (struct universe *universe, struct option_state *options, struct option_cache *oc)
void save_hashed_option (struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
void delete_option (struct universe *universe, struct option_state *options, int code)
void delete_hashed_option (struct universe *universe, struct option_state *options, int code)
int option_cache_dereference (struct option_cache **ptr, const char *file, int line)
int hashed_option_state_dereference (struct universe *universe, struct option_state *state, const char *file, int line)
int append_option (struct data_string *dst, struct universe *universe, struct option *option, struct data_string *src)
int store_option (struct data_string *result, struct universe *universe, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct option_cache *oc)
int option_space_encapsulate (struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct data_string *name)
int hashed_option_space_encapsulate (struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
int nwip_option_space_encapsulate (struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
int fqdn_option_space_encapsulate (struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
struct option_cachelookup_fqdn6_option (struct universe *universe, struct option_state *options, unsigned code)
void save_fqdn6_option (struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
void delete_fqdn6_option (struct universe *universe, struct option_state *options, int code)
void fqdn6_option_space_foreach (struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
int fqdn6_option_space_encapsulate (struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
int fqdn6_universe_decode (struct option_state *options, const unsigned char *buffer, unsigned length, struct universe *u)
void option_space_foreach (struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
void suboption_foreach (struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *), struct option_cache *oc, const char *vsname)
void hashed_option_space_foreach (struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
void save_linked_option (struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
int linked_option_space_encapsulate (struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
void delete_linked_option (struct universe *universe, struct option_state *options, int code)
struct option_cachelookup_linked_option (struct universe *universe, struct option_state *options, unsigned code)
int linked_option_state_dereference (struct universe *universe, struct option_state *state, const char *file, int line)
void linked_option_space_foreach (struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
void do_packet (struct interface_info *interface, struct dhcp_packet *packet, unsigned len, unsigned int from_port, struct iaddr from, struct hardware *hfrom)
int packet6_len_okay (const char *packet, int len)
int pretty_escape (char **dst, char *dend, const unsigned char **src, const unsigned char *send)
int add_option (struct option_state *options, unsigned int option_num, void *data, unsigned int data_len)
int validate_packet (struct packet *packet)

Variables

struct optionvendor_cfg_option
struct option_cachefree_option_caches

Define Documentation

#define DHCP_OPTION_DATA

Definition at line 29 of file options.c.

#define PRIORITY_COUNT   300

Function Documentation

int add_option ( struct option_state options,
unsigned int  option_num,
void *  data,
unsigned int  data_len 
)

Definition at line 4145 of file options.c.

void also_save_option ( struct universe universe,
struct option_state options,
struct option_cache oc 
)

Definition at line 2575 of file options.c.

int append_option ( struct data_string dst,
struct universe universe,
struct option option,
struct data_string src 
)

Definition at line 2787 of file options.c.

int append_option_buffer ( struct universe universe,
struct option_state options,
struct buffer bp,
unsigned char *  buffer,
unsigned  length,
unsigned  code,
int  terminatep 
)

Definition at line 2315 of file options.c.

void build_server_oro ( struct data_string server_oro,
struct option_state options,
const char *  file,
int  line 
)

Definition at line 2499 of file options.c.

int cons_options ( struct packet inpacket,
struct dhcp_packet outpacket,
struct lease lease,
struct client_state client_state,
int  mms,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
int  overload_avail,
int  terminate,
int  bootpp,
struct data_string prl,
const char *  vuname 
)

Definition at line 523 of file options.c.

void delete_fqdn6_option ( struct universe universe,
struct option_state options,
int  code 
)

Definition at line 3302 of file options.c.

void delete_hashed_option ( struct universe universe,
struct option_state options,
int  code 
)

Definition at line 2664 of file options.c.

void delete_linked_option ( struct universe universe,
struct option_state options,
int  code 
)

Definition at line 3693 of file options.c.

void delete_option ( struct universe universe,
struct option_state options,
int  code 
)

Definition at line 2652 of file options.c.

void do_packet ( struct interface_info interface,
struct dhcp_packet packet,
unsigned  len,
unsigned int  from_port,
struct iaddr  from,
struct hardware hfrom 
)

Definition at line 3789 of file options.c.

struct universe* find_option_universe ( struct option eopt,
const char *  uname 
) [read]

Definition at line 277 of file options.c.

int format_has_text ( char *  format  )  const

Definition at line 1509 of file options.c.

int format_min_length ( char *  format,
struct option_cache oc 
) const

Definition at line 1571 of file options.c.

int fqdn6_option_space_encapsulate ( struct data_string result,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe universe 
)

Definition at line 3338 of file options.c.

void fqdn6_option_space_foreach ( struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe u,
void *  stuff,
void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *)  func 
)

Definition at line 3316 of file options.c.

int fqdn6_universe_decode ( struct option_state options,
const unsigned char *  buffer,
unsigned  length,
struct universe u 
)

Definition at line 3438 of file options.c.

int fqdn_option_space_encapsulate ( struct data_string result,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe universe 
)

Definition at line 3163 of file options.c.

int fqdn_universe_decode ( struct option_state options,
const unsigned char *  buffer,
unsigned  length,
struct universe u 
)

Definition at line 351 of file options.c.

int get_option ( struct data_string result,
struct universe universe,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct option_state options,
struct binding_scope **  scope,
unsigned  code,
const char *  file,
int  line 
)

Definition at line 2144 of file options.c.

int hashed_option_space_encapsulate ( struct data_string result,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe universe 
)

Definition at line 2995 of file options.c.

void hashed_option_space_foreach ( struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe u,
void *  stuff,
void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *)  func 
)

Definition at line 3576 of file options.c.

int hashed_option_state_dereference ( struct universe universe,
struct option_state state,
const char *  file,
int  line 
)

Definition at line 2749 of file options.c.

int linked_option_space_encapsulate ( struct data_string result,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe universe 
)

Definition at line 3657 of file options.c.

void linked_option_space_foreach ( struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe u,
void *  stuff,
void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *)  func 
)

Definition at line 3758 of file options.c.

int linked_option_state_dereference ( struct universe universe,
struct option_state state,
const char *  file,
int  line 
)

Definition at line 3747 of file options.c.

struct option_cache* lookup_fqdn6_option ( struct universe universe,
struct option_state options,
unsigned  code 
) [read]

Definition at line 3281 of file options.c.

struct option_cache* lookup_hashed_option ( struct universe universe,
struct option_state options,
unsigned  code 
) [read]

Definition at line 2264 of file options.c.

struct option_cache* lookup_linked_option ( struct universe universe,
struct option_state options,
unsigned  code 
) [read]

Definition at line 3722 of file options.c.

struct option_cache* lookup_option ( struct universe universe,
struct option_state options,
unsigned  code 
) [read]

Definition at line 2249 of file options.c.

int nwip_option_space_encapsulate ( struct data_string result,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe universe 
)

Definition at line 3038 of file options.c.

int option_cache_dereference ( struct option_cache **  ptr,
const char *  file,
int  line 
)

Definition at line 2699 of file options.c.

int option_space_encapsulate ( struct data_string result,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct data_string name 
)

Definition at line 2907 of file options.c.

void option_space_foreach ( struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe u,
void *  stuff,
void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *)  func 
)

Definition at line 3533 of file options.c.

int packet6_len_okay ( const char *  packet,
int  len 
)

Definition at line 3875 of file options.c.

int parse_encapsulated_suboptions ( struct option_state options,
struct option eopt,
const unsigned char *  buffer,
unsigned  len,
struct universe eu,
const char *  uname 
)

Definition at line 322 of file options.c.

int parse_option_buffer ( struct option_state options,
const unsigned char *  buffer,
unsigned  length,
struct universe universe 
)

Definition at line 123 of file options.c.

int parse_options ( struct packet packet  ) 

Definition at line 47 of file options.c.

int pretty_escape ( char **  dst,
char *  dend,
const unsigned char **  src,
const unsigned char *  send 
)

Definition at line 4002 of file options.c.

const char* pretty_print_option ( struct option option,
const unsigned char *  data,
unsigned  len,
int  emit_commas,
int  emit_quotes 
)

Definition at line 1670 of file options.c.

void save_fqdn6_option ( struct universe universe,
struct option_state options,
struct option_cache oc,
isc_boolean_t  appendp 
)

Definition at line 3292 of file options.c.

void save_hashed_option ( struct universe universe,
struct option_state options,
struct option_cache oc,
isc_boolean_t  appendp 
)

Definition at line 2585 of file options.c.

void save_linked_option ( struct universe universe,
struct option_state options,
struct option_cache oc,
isc_boolean_t  appendp 
)

Definition at line 3613 of file options.c.

void save_option ( struct universe universe,
struct option_state options,
struct option_cache oc 
)

Definition at line 2564 of file options.c.

int save_option_buffer ( struct universe universe,
struct option_state options,
struct buffer bp,
unsigned char *  buffer,
unsigned  length,
unsigned  code,
int  terminatep 
)

Definition at line 2291 of file options.c.

void set_option ( struct universe universe,
struct option_state options,
struct option_cache option,
enum statement_op  op 
)

Definition at line 2173 of file options.c.

int store_option ( struct data_string result,
struct universe universe,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct option_cache oc 
)

Definition at line 2837 of file options.c.

int store_options ( int ocount,
unsigned char *  buffer,
unsigned  index,
unsigned  buflen,
struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
unsigned *  priority_list,
int  priority_len,
unsigned  first_cutoff,
int  second_cutoff,
int  terminate,
const char *  vuname 
)

Definition at line 1117 of file options.c.

int store_options6 ( char *  buf,
int  buflen,
struct option_state opt_state,
struct packet packet,
const int required_opts,
struct data_string oro 
)

Definition at line 925 of file options.c.

void suboption_foreach ( struct packet packet,
struct lease lease,
struct client_state client_state,
struct option_state in_options,
struct option_state cfg_options,
struct binding_scope **  scope,
struct universe u,
void *  stuff,
void(*)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *)  func,
struct option_cache oc,
const char *  vsname 
)

Definition at line 3552 of file options.c.

int validate_packet ( struct packet packet  ) 

Checks if received BOOTP/DHCPv4 packet is sane

Parameters:
packet received, decoded packet
Returns:
1 if packet is sane, 0 if it is not

Definition at line 4196 of file options.c.


Variable Documentation

Definition at line 615 of file alloc.c.

Definition at line 34 of file options.c.


Generated on 5 Apr 2014 for ISC DHCP by  doxygen 1.6.1