[Dhcp-agent-commits] dhcp-agent TODO,1.23,1.24 dhcp-agent.h,1.54,1.55 dhcp-client-cache.c,1.9,1.10 d
Status: Alpha
Brought to you by:
actmodern
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv28267 Modified Files: TODO dhcp-agent.h dhcp-client-cache.c dhcp-client-states.c dhcp-com.c dhcp-print.c Log Message: Rename dhcp_option to dhcp_option_t. Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** TODO 11 Jun 2002 02:10:32 -0000 1.23 --- TODO 11 Jun 2002 03:06:39 -0000 1.24 *************** *** 51,55 **** -- add a isascii() and a strcasecmp() for portability - -- dhcp_option should be called dhcp_option_t -- rawnet_is_valid needs more checks. --- 51,54 ---- Index: dhcp-agent.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-agent.h,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** dhcp-agent.h 11 Jun 2002 01:50:27 -0000 1.54 --- dhcp-agent.h 11 Jun 2002 03:06:39 -0000 1.55 *************** *** 216,220 **** unsigned char len; unsigned char *data; ! } dhcp_option; /* DHCP object * --- 216,220 ---- unsigned char len; unsigned char *data; ! } dhcp_option_t; /* DHCP object * *************** *** 647,654 **** extern void dhcp_reset_option_seek(dhcp_obj *dhcp); ! extern dhcp_option *dhcp_get_next_option(dhcp_obj *dhcp); ! extern dhcp_option *create_dhcp_option(const unsigned char *opt_data, unsigned char len, unsigned char tag); ! extern void destroy_dhcp_option(dhcp_option *option); extern uint16_t dhcp_get_options_len(list_t *options); extern int dhcp_valid_magic_cookie(dhcp_obj *dhcp); --- 647,654 ---- extern void dhcp_reset_option_seek(dhcp_obj *dhcp); ! extern dhcp_option_t *dhcp_get_next_option(dhcp_obj *dhcp); ! extern dhcp_option_t *create_dhcp_option(const unsigned char *opt_data, unsigned char len, unsigned char tag); ! extern void destroy_dhcp_option(dhcp_option_t *option); extern uint16_t dhcp_get_options_len(list_t *options); extern int dhcp_valid_magic_cookie(dhcp_obj *dhcp); *************** *** 660,670 **** extern int dhcp_is_sname_overload(dhcp_obj *dhcp); ! extern dhcp_option *dhcp_build_parameter_request_list_option(unsigned char *requested_options); ! extern dhcp_option *dhcp_build_max_message_size_option(uint16_t max); ! extern dhcp_option *dhcp_build_message_type(unsigned char type); ! extern dhcp_option *dhcp_build_class_id(unsigned char *class_id); ! extern dhcp_option *dhcp_build_client_id(unsigned char *client_id, unsigned char len); ! extern dhcp_option *dhcp_build_requested_ip_address(uint32_t address); ! extern dhcp_option *dhcp_build_server_identifier(uint32_t address); extern uint32_t dhcp_gen_xid(void); --- 660,670 ---- extern int dhcp_is_sname_overload(dhcp_obj *dhcp); ! extern dhcp_option_t *dhcp_build_parameter_request_list_option(unsigned char *requested_options); ! extern dhcp_option_t *dhcp_build_max_message_size_option(uint16_t max); ! extern dhcp_option_t *dhcp_build_message_type(unsigned char type); ! extern dhcp_option_t *dhcp_build_class_id(unsigned char *class_id); ! extern dhcp_option_t *dhcp_build_client_id(unsigned char *client_id, unsigned char len); ! extern dhcp_option_t *dhcp_build_requested_ip_address(uint32_t address); ! extern dhcp_option_t *dhcp_build_server_identifier(uint32_t address); extern uint32_t dhcp_gen_xid(void); Index: dhcp-client-cache.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client-cache.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dhcp-client-cache.c 6 Jun 2002 23:59:00 -0000 1.9 --- dhcp-client-cache.c 11 Jun 2002 03:06:39 -0000 1.10 *************** *** 167,171 **** { void *data; ! dhcp_option *opt; unsigned char len; --- 167,171 ---- { void *data; ! dhcp_option_t *opt; unsigned char len; *************** *** 237,241 **** char *name; char *val; ! dhcp_option *opt; name = get_fname_tmp(cc); --- 237,241 ---- char *name; char *val; ! dhcp_option_t *opt; name = get_fname_tmp(cc); Index: dhcp-client-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client-states.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** dhcp-client-states.c 6 Jun 2002 23:59:00 -0000 1.22 --- dhcp-client-states.c 11 Jun 2002 03:06:39 -0000 1.23 *************** *** 57,61 **** { list_t *options = NULL; ! dhcp_option *option; if(opts != NULL) { --- 57,61 ---- { list_t *options = NULL; ! dhcp_option_t *option; if(opts != NULL) { Index: dhcp-com.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-com.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dhcp-com.c 6 Jun 2002 23:59:00 -0000 1.6 --- dhcp-com.c 11 Jun 2002 03:06:39 -0000 1.7 *************** *** 47,51 **** { list_t *list_ptr, *tmp; ! dhcp_option *option; /* Free up options. */ --- 47,51 ---- { list_t *list_ptr, *tmp; ! dhcp_option_t *option; /* Free up options. */ *************** *** 92,100 **** /* create option. */ ! dhcp_option *create_dhcp_option(const unsigned char *opt_data, unsigned char len, unsigned char tag) { ! dhcp_option *option; ! option = xmalloc(sizeof(dhcp_option)); option->tag = tag; option->len = len; --- 92,100 ---- /* create option. */ ! dhcp_option_t *create_dhcp_option(const unsigned char *opt_data, unsigned char len, unsigned char tag) { ! dhcp_option_t *option; ! option = xmalloc(sizeof(dhcp_option_t)); option->tag = tag; option->len = len; *************** *** 107,111 **** /* destroy dhcp option. */ ! void destroy_dhcp_option(dhcp_option *option) { xfree(option->data); --- 107,111 ---- /* destroy dhcp option. */ ! void destroy_dhcp_option(dhcp_option_t *option) { xfree(option->data); *************** *** 116,123 **** /* copy DHCP option safely. */ ! static dhcp_option *process_next_dhcp_option(const unsigned char *opt_data, int len, unsigned char *optlen) { ! dhcp_option *option; /* Check for malformed option. */ --- 116,123 ---- /* copy DHCP option safely. */ ! static dhcp_option_t *process_next_dhcp_option(const unsigned char *opt_data, int len, unsigned char *optlen) { ! dhcp_option_t *option; /* Check for malformed option. */ *************** *** 136,140 **** { unsigned char optlen; ! dhcp_option *option; /* Try and copy all the options. --- 136,140 ---- { unsigned char optlen; ! dhcp_option_t *option; /* Try and copy all the options. *************** *** 332,338 **** /* Return the next option or NULL if at the end. */ ! dhcp_option *dhcp_get_next_option(dhcp_obj *dhcp) { ! dhcp_option *rval; if(dhcp->options_seek == NULL) --- 332,338 ---- /* Return the next option or NULL if at the end. */ ! dhcp_option_t *dhcp_get_next_option(dhcp_obj *dhcp) { ! dhcp_option_t *rval; if(dhcp->options_seek == NULL) *************** *** 362,366 **** int dhcp_is_type(dhcp_obj *dhcp, unsigned char type) { ! dhcp_option *opt; dhcp_reset_option_seek(dhcp); --- 362,366 ---- int dhcp_is_type(dhcp_obj *dhcp, unsigned char type) { ! dhcp_option_t *opt; dhcp_reset_option_seek(dhcp); *************** *** 394,398 **** int dhcp_have_option(dhcp_obj *dhcp, unsigned char tag) { ! dhcp_option *option; /* Check for a option by tag. */ --- 394,398 ---- int dhcp_have_option(dhcp_obj *dhcp, unsigned char tag) { ! dhcp_option_t *option; /* Check for a option by tag. */ *************** *** 410,414 **** static unsigned char dhcp_get_overload_option(dhcp_obj *dhcp) { ! dhcp_option *option; dhcp_reset_option_seek(dhcp); --- 410,414 ---- static unsigned char dhcp_get_overload_option(dhcp_obj *dhcp) { ! dhcp_option_t *option; dhcp_reset_option_seek(dhcp); *************** *** 474,478 **** uint16_t len = 0; list_t *opts; ! dhcp_option *opt; int padding; --- 474,478 ---- uint16_t len = 0; list_t *opts; ! dhcp_option_t *opt; int padding; *************** *** 493,501 **** /* accept bit array telling us which options to build the request option. */ ! dhcp_option *dhcp_build_parameter_request_list_option(unsigned char *requested_options) { unsigned char i, j; unsigned char len = 0; ! dhcp_option *option; /* Grab length so we can just malloc all at once. */ --- 493,501 ---- /* accept bit array telling us which options to build the request option. */ ! dhcp_option_t *dhcp_build_parameter_request_list_option(unsigned char *requested_options) { unsigned char i, j; unsigned char len = 0; ! dhcp_option_t *option; /* Grab length so we can just malloc all at once. */ *************** *** 510,514 **** } ! option = xmalloc(sizeof(dhcp_option)); option->len = len; option->tag = TAG_PARAMETERS; --- 510,514 ---- } ! option = xmalloc(sizeof(dhcp_option_t)); option->len = len; option->tag = TAG_PARAMETERS; *************** *** 526,530 **** } ! dhcp_option *dhcp_build_max_message_size_option(uint16_t max) { max = htons(max); --- 526,530 ---- } ! dhcp_option_t *dhcp_build_max_message_size_option(uint16_t max) { max = htons(max); *************** *** 532,541 **** } ! dhcp_option *dhcp_build_message_type(unsigned char type) { return(create_dhcp_option((unsigned char *)&type, sizeof(unsigned char), TAG_DHCP_MESSAGE_TYPE)); } ! dhcp_option *dhcp_build_class_id(unsigned char *class_id) { unsigned char len = strlen(class_id); --- 532,541 ---- } ! dhcp_option_t *dhcp_build_message_type(unsigned char type) { return(create_dhcp_option((unsigned char *)&type, sizeof(unsigned char), TAG_DHCP_MESSAGE_TYPE)); } ! dhcp_option_t *dhcp_build_class_id(unsigned char *class_id) { unsigned char len = strlen(class_id); *************** *** 543,557 **** } ! dhcp_option *dhcp_build_client_id(unsigned char *client_id, unsigned char len) { return(create_dhcp_option(client_id, len, TAG_DHCP_CLIENT_ID)); } ! dhcp_option *dhcp_build_requested_ip_address(uint32_t address) { return(create_dhcp_option((unsigned char *)&address, IP_ADDR_LEN, TAG_DHCP_REQUEST_IP_ADDRESS)); } ! dhcp_option *dhcp_build_server_identifier(uint32_t address) { return(create_dhcp_option((unsigned char *)&address, IP_ADDR_LEN, TAG_DHCP_SERVER_IDENTIFIER)); --- 543,557 ---- } ! dhcp_option_t *dhcp_build_client_id(unsigned char *client_id, unsigned char len) { return(create_dhcp_option(client_id, len, TAG_DHCP_CLIENT_ID)); } ! dhcp_option_t *dhcp_build_requested_ip_address(uint32_t address) { return(create_dhcp_option((unsigned char *)&address, IP_ADDR_LEN, TAG_DHCP_REQUEST_IP_ADDRESS)); } ! dhcp_option_t *dhcp_build_server_identifier(uint32_t address) { return(create_dhcp_option((unsigned char *)&address, IP_ADDR_LEN, TAG_DHCP_SERVER_IDENTIFIER)); *************** *** 694,698 **** void dhcp_write_options(dhcp_obj *dhcp, unsigned char *packet) { ! dhcp_option *option; int padding, len = 0; --- 694,698 ---- void dhcp_write_options(dhcp_obj *dhcp, unsigned char *packet) { ! dhcp_option_t *option; int padding, len = 0; Index: dhcp-print.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-print.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-print.c 6 Jun 2002 23:59:00 -0000 1.5 --- dhcp-print.c 11 Jun 2002 03:06:39 -0000 1.6 *************** *** 571,575 **** void print_options_verbose(dhcp_obj *dhcp) { ! dhcp_option *option; unsigned char tag; int print_val; --- 571,575 ---- void print_options_verbose(dhcp_obj *dhcp) { ! dhcp_option_t *option; unsigned char tag; int print_val; |