Go to the source code of this file.
Data Structures | |
struct | vsio_state |
Macros | |
#define | DHCP_OPTION_DATA |
#define | PRIORITY_COUNT 300 |
#define | MAX_OUTPUT_SIZE 32*1024 |
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 universe * | find_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) |
int | get_option_int (int *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_cache * | lookup_option (struct universe *universe, struct option_state *options, unsigned code) |
struct option_cache * | lookup_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_cache * | lookup_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_cache * | lookup_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) |
void | parse_vendor_option (struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *out_options, struct binding_scope **scope) |
Parse a vendor option (option 43) | |
Variables | |
struct option * | vendor_cfg_option |
struct option_cache * | free_option_caches |
#define PRIORITY_COUNT 300 |
int add_option | ( | struct option_state * | options, |
unsigned int | option_num, | ||
void * | data, | ||
unsigned int | data_len ) |
void also_save_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
struct option_cache * | oc ) |
int append_option | ( | struct data_string * | dst, |
struct universe * | universe, | ||
struct option * | option, | ||
struct data_string * | src ) |
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 ) |
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 ) |
void delete_fqdn6_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
int | code ) |
void delete_hashed_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
int | code ) |
void delete_linked_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
int | code ) |
void delete_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
int | code ) |
void do_packet | ( | struct interface_info * | interface, |
struct dhcp_packet * | packet, | ||
unsigned | len, | ||
unsigned int | from_port, | ||
struct iaddr | from, | ||
struct hardware * | hfrom ) |
int format_min_length | ( | char * | format, |
struct option_cache * | oc ) const |
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 ) |
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_universe_decode | ( | struct option_state * | options, |
const unsigned char * | buffer, | ||
unsigned | length, | ||
struct universe * | u ) |
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 ) |
int fqdn_universe_decode | ( | struct option_state * | options, |
const unsigned char * | buffer, | ||
unsigned | length, | ||
struct universe * | u ) |
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 ) |
int get_option_int | ( | int * | 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 ) |
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 ) |
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 *) ) |
int hashed_option_state_dereference | ( | struct universe * | universe, |
struct option_state * | state, | ||
const char * | file, | ||
int | line ) |
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 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 *) ) |
int linked_option_state_dereference | ( | struct universe * | universe, |
struct option_state * | state, | ||
const char * | file, | ||
int | line ) |
struct option_cache * lookup_fqdn6_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
unsigned | code ) |
struct option_cache * lookup_hashed_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
unsigned | code ) |
struct option_cache * lookup_linked_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
unsigned | code ) |
struct option_cache * lookup_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
unsigned | code ) |
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 option_cache_dereference | ( | struct option_cache ** | ptr, |
const char * | file, | ||
int | line ) |
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 ) |
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 *) ) |
int parse_encapsulated_suboptions | ( | struct option_state * | options, |
struct option * | eopt, | ||
const unsigned char * | buffer, | ||
unsigned | len, | ||
struct universe * | eu, | ||
const char * | uname ) |
int parse_option_buffer | ( | struct option_state * | options, |
const unsigned char * | buffer, | ||
unsigned | length, | ||
struct universe * | universe ) |
void parse_vendor_option | ( | struct packet * | packet, |
struct lease * | lease, | ||
struct client_state * | client_state, | ||
struct option_state * | in_options, | ||
struct option_state * | out_options, | ||
struct binding_scope ** | scope ) |
Parse a vendor option (option 43)
After the server has parsed most of the options and presented the result to the user the user can set the proper vendor option space using vendor-option-space in the config file and then cause this routine to be called via parse-vendor-option in the config file. This routine will then try and find the proper universe for the vendor-option-space and parse the vendor option string based on that universe.
If the information isn't available (no vendor space, no universe for the vendor space, no vendor option in the options) or the decode fails we simply ignore the option and continue processing.
packet | - structure to hold information about the packet being processed |
lease | - lease structure |
client_state | |
in_options | - The incoming options, we expect to find the vendor-option (option 43, containing the string to parse) there. We shall attach decoded options there. |
out_options | - The options we have added as we process the packet. We expect to find the vendor-option-space there and use that to find the name of the vendor universe to use |
scope |
int pretty_escape | ( | char ** | dst, |
char * | dend, | ||
const unsigned char ** | src, | ||
const unsigned char * | send ) |
void save_fqdn6_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
struct option_cache * | oc, | ||
isc_boolean_t | appendp ) |
void save_hashed_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
struct option_cache * | oc, | ||
isc_boolean_t | appendp ) |
void save_linked_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
struct option_cache * | oc, | ||
isc_boolean_t | appendp ) |
void save_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
struct option_cache * | oc ) |
int save_option_buffer | ( | struct universe * | universe, |
struct option_state * | options, | ||
struct buffer * | bp, | ||
unsigned char * | buffer, | ||
unsigned | length, | ||
unsigned | code, | ||
int | terminatep ) |
void set_option | ( | struct universe * | universe, |
struct option_state * | options, | ||
struct option_cache * | option, | ||
enum statement_op | op ) |
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 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 store_options6 | ( | char * | buf, |
int | buflen, | ||
struct option_state * | opt_state, | ||
struct packet * | packet, | ||
const int * | required_opts, | ||
struct data_string * | oro ) |
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 ) |
|
extern |