[Dhcp-agent-commits] dhcp-agent dhcp-convert.c,1.13,1.14 dhcp-globconf.c,1.4,1.5 dhcp-globconf.h,1.1
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2002-06-15 17:07:11
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv28754 Modified Files: dhcp-convert.c dhcp-globconf.c dhcp-globconf.h Log Message: added hostname to config options; fixed dhcp-client.h -- no idea how it got truncated Index: dhcp-convert.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-convert.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dhcp-convert.c 6 Jun 2002 23:59:00 -0000 1.13 --- dhcp-convert.c 15 Jun 2002 17:07:08 -0000 1.14 *************** *** 396,399 **** --- 396,409 ---- } + /* validate internal strings -- e.g. conf and cache file. */ + char *validate_string_to_string(const unsigned char *data, int len) + { + /* we don't validate or do much with internal strings. + * however we need to maintain the prototype to plug this + * into the right places. */ + + return strdup(data); + } + /* just copy. wrapper needed to be nice to the compiler. */ void *strdup_wrap(const char *s) Index: dhcp-globconf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-globconf.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-globconf.c 6 Jun 2002 23:59:00 -0000 1.4 --- dhcp-globconf.c 15 Jun 2002 17:07:08 -0000 1.5 *************** *** 35,39 **** /* change this before... */ ! #define GLOBAL_OPTIONS_LEN 2 /* ... changing size of this */ --- 35,39 ---- /* change this before... */ ! #define GLOBAL_OPTIONS_LEN 3 /* ... changing size of this */ *************** *** 43,46 **** --- 43,47 ---- { "client-dhcp-retries", string_to_int32, int32_to_string, sizeof(int32_t), DHCP_CLIENT_RETRIES_S, NULL }, { "client-icmp-retries", string_to_int32, int32_to_string, sizeof(int32_t), DHCP_CLIENT_RETRIES_S, NULL }, + { "client-hostname", strdup_wrap, validate_network_string_to_string, 0, NULL, NULL }, }; *************** *** 59,62 **** --- 60,66 ---- for(i = 0;i < GLOBAL_OPTIONS_LEN; i++) { + if(global_config_options[i].val == NULL) + continue; + var_string = global_config_options[i].convert_option_to_string(global_config_options[i].val, global_config_options[i].size); if(var_string == NULL) *************** *** 76,79 **** --- 80,87 ---- for(i = 0;i < GLOBAL_OPTIONS_LEN;i++) { + + if(global_config_options[i].default_val == NULL) + continue; + if(global_config_options[i].val == NULL) { global_config_options[i].val = global_config_options[i].convert_option_to_internal(global_config_options[i].default_val); Index: dhcp-globconf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-globconf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dhcp-globconf.h 25 May 2002 15:18:01 -0000 1.1 --- dhcp-globconf.h 15 Jun 2002 17:07:08 -0000 1.2 *************** *** 44,47 **** --- 44,48 ---- #define CLIENT_DHCP_RETRIES 0 #define CLIENT_ICMP_RETRIES 1 + #define CLIENT_HOSTNAME 2 /* default string values. */ |