dhcp-agent-commits Mailing List for dhcp-agent (Page 13)
Status: Alpha
Brought to you by:
actmodern
You can subscribe to this list here.
2002 |
Jan
|
Feb
(33) |
Mar
|
Apr
|
May
(19) |
Jun
(61) |
Jul
(12) |
Aug
|
Sep
(5) |
Oct
(31) |
Nov
(24) |
Dec
(56) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(9) |
Feb
|
Mar
(16) |
Apr
(4) |
May
(68) |
Jun
(70) |
Jul
(100) |
Aug
(54) |
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(7) |
Jun
(12) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(8) |
Oct
(5) |
Nov
(6) |
Dec
(4) |
2008 |
Jan
(9) |
Feb
(20) |
Mar
(32) |
Apr
(18) |
May
(19) |
Jun
(12) |
Jul
(23) |
Aug
(7) |
Sep
(15) |
Oct
(22) |
Nov
(50) |
Dec
(68) |
2009 |
Jan
(63) |
Feb
(23) |
Mar
(43) |
Apr
(50) |
May
(110) |
Jun
(103) |
Jul
(71) |
Aug
(26) |
Sep
(16) |
Oct
(31) |
Nov
(8) |
Dec
(13) |
2010 |
Jan
(6) |
Feb
(6) |
Mar
(36) |
Apr
(57) |
May
(67) |
Jun
(70) |
Jul
(44) |
Aug
(46) |
Sep
(27) |
Oct
(2) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: <act...@us...> - 2003-07-15 10:57:24
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv2990/src Modified Files: dhcp-server.c Log Message: setting interactive to 0 now before forking Index: dhcp-server.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dhcp-server.c 13 Jul 2003 04:53:30 -0000 1.7 --- dhcp-server.c 15 Jul 2003 10:57:18 -0000 1.8 *************** *** 102,105 **** --- 102,106 ---- INFO_MESSAGE("going into the background"); + set_interactive(0); go_background(work_dir); |
From: <act...@us...> - 2003-07-15 10:56:38
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv2901/src Modified Files: dhcp-server-conf.c dhcp-server-conf.h dhcp-server-defaults.h Log Message: added poll timeout conf variable Index: dhcp-server-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dhcp-server-conf.c 14 Jul 2003 05:58:17 -0000 1.7 --- dhcp-server-conf.c 15 Jul 2003 10:56:34 -0000 1.8 *************** *** 41,44 **** --- 41,45 ---- "default-renew-percent", "default-rebind-percent", + "poll-timeout" }; *************** *** 46,49 **** --- 47,51 ---- SERVER_VAR_RENEW_PERCENT, SERVER_VAR_REBIND_PERCENT, + SERVER_VAR_POLL_TIMEOUT, }; *************** *** 145,148 **** --- 147,158 ---- }; + /* accessors. */ + + uint16_t server_conf_get_poll_timeout(server_conf_t *sc) + { + return sc->poll_timeout; + } + + /* * * * * * * * * * * * utility routines. * *************** *** 206,210 **** case SERVER_VAR_REBIND_PERCENT: - if(!is_unsigned_numeric(var_value)) { ERROR_MESSAGE("value not unsigned numeric as expected : %s", var_value); --- 216,219 ---- *************** *** 220,223 **** --- 229,242 ---- break; + case SERVER_VAR_POLL_TIMEOUT: + + if(!is_unsigned_numeric(var_value)) { + ERROR_MESSAGE("value not unsigned numeric as expected : %s\n", var_value); + return 1; + } + + sscanf(var_value, "%"SCNu16, &server_conf->poll_timeout); + break; + default: *************** *** 485,488 **** --- 504,508 ---- sc->default_rebind_percent = SERVER_DEFAULT_REBIND_PERCENT; sc->default_renew_percent = SERVER_DEFAULT_RENEW_PERCENT; + sc->poll_timeout = SERVER_DEFAULT_POLL_TIMEOUT; if(server_conf_load_options(sc)) { Index: dhcp-server-conf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dhcp-server-conf.h 14 Jul 2003 05:58:17 -0000 1.6 --- dhcp-server-conf.h 15 Jul 2003 10:56:34 -0000 1.7 *************** *** 37,40 **** --- 37,41 ---- uint16_t default_rebind_percent; /* percent of expiry to assign as rebind time. */ uint16_t default_renew_percent; /* percent of expiry to assign as renew time. */ + uint16_t poll_timeout; /* poll timeout -- used in server event processing. */ } server_conf_t; *************** *** 44,48 **** /* constants. */ ! enum var_symbols { SERVER_VAR_RENEW_PERCENT = 0, SERVER_VAR_REBIND_PERCENT }; enum directive_types { DIRECTIVE_SET = 0, DIRECTIVE_RANGE_LEASE, DIRECTIVE_HOSTNAME_LEASE, DIRECTIVE_MAC_LEASE, DIRECTIVE_OPTION }; enum group_types { GROUP_NULL = 0, GROUP_LEASE_DEF }; --- 45,49 ---- /* constants. */ ! enum var_symbols { SERVER_VAR_RENEW_PERCENT = 0, SERVER_VAR_REBIND_PERCENT, SERVER_VAR_POLL_TIMEOUT }; enum directive_types { DIRECTIVE_SET = 0, DIRECTIVE_RANGE_LEASE, DIRECTIVE_HOSTNAME_LEASE, DIRECTIVE_MAC_LEASE, DIRECTIVE_OPTION }; enum group_types { GROUP_NULL = 0, GROUP_LEASE_DEF }; *************** *** 52,55 **** --- 53,58 ---- extern server_conf_t *server_conf_create(const char *interface); extern void server_conf_destroy(server_conf_t *sc); + + extern uint16_t server_conf_get_poll_timeout(server_conf_t *sc); #endif /* DHCP_SERVER_CONF_H */ Index: dhcp-server-defaults.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-defaults.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dhcp-server-defaults.h 6 Jul 2003 17:10:23 -0000 1.1 --- dhcp-server-defaults.h 15 Jul 2003 10:56:34 -0000 1.2 *************** *** 39,41 **** --- 39,47 ---- #define SERVER_DEFAULT_REBIND_PERCENT 80 + /* Poll timeout. Set this to a higher value if you want the + * server to poll for events less frequently. This only really + * affects signals for now. */ + + #define SERVER_DEFAULT_POLL_TIMEOUT 5 + #endif /* DHCP_SERVER_DEFAULTS_H */ |
From: <act...@us...> - 2003-07-15 10:56:38
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf/dhcp-server In directory sc8-pr-cvs1:/tmp/cvs-serv2901/conf/dhcp-server Modified Files: lease.conf.example Log Message: added poll timeout conf variable Index: lease.conf.example =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/dhcp-server/lease.conf.example,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lease.conf.example 14 Jul 2003 05:58:17 -0000 1.4 --- lease.conf.example 15 Jul 2003 10:56:34 -0000 1.5 *************** *** 12,15 **** --- 12,16 ---- set default-renew-percent = 75; set default-rebind-percent = 90; + set poll-timeout = 5; # order is try hostname leases before mac-lease |
From: <act...@us...> - 2003-07-14 05:58:25
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv23680/src Modified Files: dhcp-lease.c dhcp-server-conf.c dhcp-server-conf.h Log Message: added more lease def options Index: dhcp-lease.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-lease.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-lease.c 13 Jul 2003 05:44:30 -0000 1.5 --- dhcp-lease.c 14 Jul 2003 05:58:17 -0000 1.6 *************** *** 112,117 **** case LEASE_RANGE_ADDRESS: addr_range = data; ! lease_def->address_info.address_range.bottom_range = *(ip_addr_t *)list_first(addr_range); ! lease_def->address_info.address_range.top_range = *(ip_addr_t *)list_second(addr_range); break; --- 112,117 ---- case LEASE_RANGE_ADDRESS: addr_range = data; ! lease_def->address_info.address_range.top_range = *(ip_addr_t *)list_first(addr_range); ! lease_def->address_info.address_range.bottom_range = *(ip_addr_t *)list_second(addr_range); break; Index: dhcp-server-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dhcp-server-conf.c 13 Jul 2003 05:44:30 -0000 1.6 --- dhcp-server-conf.c 14 Jul 2003 05:58:17 -0000 1.7 *************** *** 60,63 **** --- 60,67 ---- static const arg_symbol_t *hostname_lease_arg_symbols[] = { NULL, NULL, NULL }; + static const arg_type_t mac_lease_arg_types[] = { CONF_MAC_ADDRESS, CONF_ADDRESS, CONF_GROUP}; + static const char **mac_lease_arg_strings[] = { NULL, NULL, NULL }; + static const arg_symbol_t *mac_lease_arg_symbols[] = { NULL, NULL, NULL }; + static const arg_type_t option_arg_types[] = { CONF_STRING, CONF_ASSIGNMENT, CONF_STRING_LIST }; static const char **option_arg_strings[] = { NULL, NULL, NULL }; *************** *** 86,90 **** }; ! /* range-lease command. */ static const command_t command_hostname_lease = { DIRECTIVE_HOSTNAME_LEASE, --- 90,94 ---- }; ! /* hostname-lease command. */ static const command_t command_hostname_lease = { DIRECTIVE_HOSTNAME_LEASE, *************** *** 96,99 **** --- 100,113 ---- }; + /* mac-lease command. */ + static const command_t command_mac_lease = { + DIRECTIVE_MAC_LEASE, + "mac-lease", + 3, + mac_lease_arg_strings, + mac_lease_arg_types, + mac_lease_arg_symbols, + }; + static const command_t command_option = { DIRECTIVE_OPTION, *************** *** 108,113 **** &command_set, &command_range_lease, - &command_option, &command_hostname_lease, NULL, }; --- 122,128 ---- &command_set, &command_range_lease, &command_hostname_lease, + &command_mac_lease, + &command_option, NULL, }; *************** *** 119,122 **** --- 134,138 ---- static int directive_option_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); static int directive_hostname_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); + static int directive_hw_address_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); /* indexed by directive types in dhcp-client-conf.h . */ *************** *** 124,129 **** directive_set_handler, directive_range_handler, - directive_option_handler, directive_hostname_handler, }; --- 140,146 ---- directive_set_handler, directive_range_handler, directive_hostname_handler, + directive_hw_address_handler, + directive_option_handler, }; *************** *** 283,287 **** case DIRECTIVE_OPTION: ! if(directive_option_handler(server_conf, lower_directive, GROUP_LEASE_DEF, option_list)) return 1; --- 300,304 ---- case DIRECTIVE_OPTION: ! if(directive_option_handler(server_conf, lower_directive, group_type, option_list)) return 1; *************** *** 325,329 **** /* create option handler by calling the general lease handler. */ option_list = list_create(); ! directive_lease_handler_proc(server_conf, directive, group_type, group_data, option_list); lease_def = lease_definition_create(NULL, LEASE_RANGE_ADDRESS, address_pair, option_list, lease_expiry, renew_time, rebind_time); --- 342,346 ---- /* create option handler by calling the general lease handler. */ option_list = list_create(); ! directive_lease_handler_proc(server_conf, directive, GROUP_LEASE_DEF, group_data, option_list); lease_def = lease_definition_create(NULL, LEASE_RANGE_ADDRESS, address_pair, option_list, lease_expiry, renew_time, rebind_time); *************** *** 336,344 **** } static int directive_hostname_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) { - uint32_t lease_expiry = 0; - uint32_t renew_time = 0; - uint32_t rebind_time = 0; lease_constraint_t *constraint; list_t *args, *option_list; --- 353,359 ---- } + /* hostname handler. */ static int directive_hostname_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) { lease_constraint_t *constraint; list_t *args, *option_list; *************** *** 346,349 **** --- 361,367 ---- ip_addr_t *ip_address; lease_definition_t *lease_def; + uint32_t lease_expiry = 0; + uint32_t renew_time = 0; + uint32_t rebind_time = 0; /* arguments. */ *************** *** 360,364 **** ip_address = list_second(args); option_list = list_create(); ! directive_lease_handler_proc(server_conf, directive, group_type, group_data, option_list); lease_def = lease_definition_create(constraint, LEASE_SINGLE_ADDRESS, ip_address, option_list, --- 378,382 ---- ip_address = list_second(args); option_list = list_create(); ! directive_lease_handler_proc(server_conf, directive, GROUP_LEASE_DEF, group_data, option_list); lease_def = lease_definition_create(constraint, LEASE_SINGLE_ADDRESS, ip_address, option_list, *************** *** 369,372 **** --- 387,426 ---- } + /* hardware address handler. */ + static int directive_hw_address_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) + { + lease_constraint_t *constraint; + list_t *args, *option_list; + eth_addr_t *eth_addr; + char *eth_addr_string; + ip_addr_t *ip_address; + lease_definition_t *lease_def; + uint32_t lease_expiry = 0; + uint32_t renew_time = 0; + uint32_t rebind_time = 0; + + /* arguments. */ + args = directive->arguments; + + /* first argument is the hostname. */ + eth_addr = list_first(args); + + if((constraint = lease_constraint_create(LEASE_CONSTRAINT_HARDWARE_ADDRESS, eth_addr)) == NULL) { + eth_addr_string = eth_addr_to_string(*eth_addr); + ERROR_MESSAGE("illegal mac address constraint specified: %s", eth_addr_string); + xfree(eth_addr_string); + return 1; + } + + ip_address = list_second(args); + option_list = list_create(); + directive_lease_handler_proc(server_conf, directive, GROUP_LEASE_DEF, group_data, option_list); + + lease_def = lease_definition_create(constraint, LEASE_SINGLE_ADDRESS, ip_address, option_list, + lease_expiry, renew_time, rebind_time); + list_add(server_conf->lease_defs, lease_def); + + return 0; + } /* lease option handler. */ *************** *** 380,384 **** if(group_type == GROUP_NULL) { ! ERROR_MESSAGE("dhcp option setting found outside of lease defintion"); return 1; } --- 434,438 ---- if(group_type == GROUP_NULL) { ! ERROR_MESSAGE("dhcp option setting found outside of lease definition"); return 1; } Index: dhcp-server-conf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-server-conf.h 13 Jul 2003 05:44:30 -0000 1.5 --- dhcp-server-conf.h 14 Jul 2003 05:58:17 -0000 1.6 *************** *** 45,49 **** enum var_symbols { SERVER_VAR_RENEW_PERCENT = 0, SERVER_VAR_REBIND_PERCENT }; ! enum directive_types { DIRECTIVE_SET = 0, DIRECTIVE_RANGE_LEASE, DIRECTIVE_OPTION, DIRECTIVE_HOSTNAME_LEASE }; enum group_types { GROUP_NULL = 0, GROUP_LEASE_DEF }; --- 45,49 ---- enum var_symbols { SERVER_VAR_RENEW_PERCENT = 0, SERVER_VAR_REBIND_PERCENT }; ! enum directive_types { DIRECTIVE_SET = 0, DIRECTIVE_RANGE_LEASE, DIRECTIVE_HOSTNAME_LEASE, DIRECTIVE_MAC_LEASE, DIRECTIVE_OPTION }; enum group_types { GROUP_NULL = 0, GROUP_LEASE_DEF }; |
From: <act...@us...> - 2003-07-14 05:58:24
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf/dhcp-server In directory sc8-pr-cvs1:/tmp/cvs-serv23680/conf/dhcp-server Modified Files: lease.conf.example Log Message: added more lease def options Index: lease.conf.example =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/dhcp-server/lease.conf.example,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** lease.conf.example 13 Jul 2003 05:44:45 -0000 1.3 --- lease.conf.example 14 Jul 2003 05:58:17 -0000 1.4 *************** *** 42,50 **** # lease locked down on mac ! # mac-lease "00:ca:fe:ba:be:00" 10.0.0.51 { ! # ! # option domain-name = "whitefang.com"; ! # option domain-name-servers = 10.0.0.1, 10.0.0.5; ! # option routers = 10.0.0.1; ! # option ip-address-lease-time = 86400; ! # }; --- 42,50 ---- # lease locked down on mac ! mac-lease "00:ca:fe:ba:be:00" 10.0.0.51 { ! ! option domain-name = "whitefang.com"; ! option domain-name-servers = 10.0.0.1, 10.0.0.5; ! option routers = 10.0.0.1; ! option ip-address-lease-time = 86400; ! }; |
From: <act...@us...> - 2003-07-13 05:44:48
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf/dhcp-server In directory sc8-pr-cvs1:/tmp/cvs-serv7623/conf/dhcp-server Modified Files: lease.conf.example Log Message: updated example to reflect reality Index: lease.conf.example =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/dhcp-server/lease.conf.example,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lease.conf.example 6 Jul 2003 05:36:35 -0000 1.2 --- lease.conf.example 13 Jul 2003 05:44:45 -0000 1.3 *************** *** 13,16 **** --- 13,20 ---- set default-rebind-percent = 90; + # order is try hostname leases before mac-lease + + # set lease-order = hostname, mac-lease; + # a lease defined on a range of IPs # this is passed to everyone who does not *************** *** 38,51 **** # lease locked down on mac ! mac-lease "00:ca:fe:ba:be:00" 10.0.0.51 { ! ! option domain-name = "whitefang.com"; ! option domain-name-servers = 10.0.0.1, 10.0.0.5; ! option routers = 10.0.0.1; ! option ip-address-lease-time = 86400; ! }; ! ! ! # order is try hostname leases before mac-lease ! ! set lease-order = hostname, mac-lease; --- 42,50 ---- # lease locked down on mac ! # mac-lease "00:ca:fe:ba:be:00" 10.0.0.51 { ! # ! # option domain-name = "whitefang.com"; ! # option domain-name-servers = 10.0.0.1, 10.0.0.5; ! # option routers = 10.0.0.1; ! # option ip-address-lease-time = 86400; ! # }; |
From: <act...@us...> - 2003-07-13 05:44:33
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv7594/src Modified Files: dhcp-lease.c dhcp-lease.h dhcp-server-conf.c dhcp-server-conf.h Log Message: added lease by hostname Index: dhcp-lease.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-lease.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-lease.c 13 Jul 2003 04:53:30 -0000 1.4 --- dhcp-lease.c 13 Jul 2003 05:44:30 -0000 1.5 *************** *** 92,96 **** uint32_t rebind_time) { - dhcp_opt_t *opt, *opt_copy; lease_definition_t *lease_def; list_t *addr_range; --- 92,95 ---- *************** *** 98,101 **** --- 97,103 ---- lease_def = xcalloc(sizeof(lease_definition_t)); + /* assign type. */ + lease_def->lease_type = lease_type; + /* assign constraint. */ lease_def->constraint = constraint; *************** *** 118,131 **** } ! /* copy our dhcp options we'll pass. */ ! lease_def->options = list_create(); ! ! list_rewind(options); ! while((opt = list_next(options)) != NULL) { ! ! opt_copy = dhcp_option_copy(opt); ! ! list_add_to_end(lease_def->options, opt_copy); ! } /* FIXME: set renew/rebind to defaults if they are passed as zero. */ --- 120,125 ---- } ! /* options we'll pass. */ ! lease_def->options = options; /* FIXME: set renew/rebind to defaults if they are passed as zero. */ *************** *** 218,221 **** --- 212,230 ---- } + ip_addr_t lease_definition_get_bottom_addr(lease_definition_t *lease) + { + return lease->address_info.address_range.bottom_range; + } + + ip_addr_t lease_definition_get_top_addr(lease_definition_t *lease) + { + return lease->address_info.address_range.top_range; + } + + ip_addr_t lease_definition_get_addr(lease_definition_t *lease) + { + return lease->address_info.address; + } + /* * * * * * * * * * * misc utilities. * *************** *** 228,238 **** char *opt_val; dhcp_opt_t *option; INFO_MESSAGE("Lease type: %s", lease_type_to_string(lease_def)); if(lease_def->constraint == NULL) { INFO_MESSAGE("Lease constraint type: None."); } else { ! INFO_MESSAGE("Lease constraint type: ", lease_constraint_type_to_string(lease_def->constraint)); --- 237,271 ---- char *opt_val; dhcp_opt_t *option; + char *bottom_addr, *top_addr; INFO_MESSAGE("Lease type: %s", lease_type_to_string(lease_def)); + switch(lease_definition_get_type(lease_def)) { + + case LEASE_SINGLE_ADDRESS: + top_addr = ip_addr_to_string(lease_definition_get_addr(lease_def)); + + INFO_MESSAGE("Address: %s", top_addr); + xfree(top_addr); + break; + + case LEASE_RANGE_ADDRESS: + + bottom_addr = ip_addr_to_string(lease_definition_get_bottom_addr(lease_def)); + top_addr = ip_addr_to_string(lease_definition_get_top_addr(lease_def)); + + INFO_MESSAGE("Address Range: %s to %s", bottom_addr, top_addr); + xfree(bottom_addr); + xfree(top_addr); + break; + + default: + FATAL_MESSAGE("illegal lease type specified. this is a bug. report me."); + } + if(lease_def->constraint == NULL) { INFO_MESSAGE("Lease constraint type: None."); } else { ! INFO_MESSAGE("Lease constraint type: %s", lease_constraint_type_to_string(lease_def->constraint)); Index: dhcp-lease.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-lease.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-lease.h 13 Jul 2003 04:53:30 -0000 1.4 --- dhcp-lease.h 13 Jul 2003 05:44:30 -0000 1.5 *************** *** 104,108 **** extern lease_constraint_t *lease_definition_get_constraint(lease_definition_t *lease); extern const char *lease_constraint_get_hostname(lease_constraint_t *constraint); ! extern eth_addr_t lease_constraint_get_hw_address(lease_constraint_t *constraint); extern void pretty_print_lease_def(lease_definition_t *lease_def); --- 104,110 ---- extern lease_constraint_t *lease_definition_get_constraint(lease_definition_t *lease); extern const char *lease_constraint_get_hostname(lease_constraint_t *constraint); ! extern ip_addr_t lease_definition_get_bottom_addr(lease_definition_t *lease); ! extern ip_addr_t lease_definition_get_top_addr(lease_definition_t *lease); ! extern ip_addr_t lease_definition_get_addr(lease_definition_t *lease); extern void pretty_print_lease_def(lease_definition_t *lease_def); Index: dhcp-server-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-server-conf.c 13 Jul 2003 04:52:48 -0000 1.5 --- dhcp-server-conf.c 13 Jul 2003 05:44:30 -0000 1.6 *************** *** 56,59 **** --- 56,63 ---- static const arg_symbol_t *range_lease_arg_symbols[] = { NULL, NULL, NULL }; + static const arg_type_t hostname_lease_arg_types[] = { CONF_STRING, CONF_ADDRESS, CONF_GROUP}; + static const char **hostname_lease_arg_strings[] = { NULL, NULL, NULL }; + static const arg_symbol_t *hostname_lease_arg_symbols[] = { NULL, NULL, NULL }; + static const arg_type_t option_arg_types[] = { CONF_STRING, CONF_ASSIGNMENT, CONF_STRING_LIST }; static const char **option_arg_strings[] = { NULL, NULL, NULL }; *************** *** 82,85 **** --- 86,99 ---- }; + /* range-lease command. */ + static const command_t command_hostname_lease = { + DIRECTIVE_HOSTNAME_LEASE, + "hostname-lease", + 3, + hostname_lease_arg_strings, + hostname_lease_arg_types, + hostname_lease_arg_symbols, + }; + static const command_t command_option = { DIRECTIVE_OPTION, *************** *** 95,98 **** --- 109,113 ---- &command_range_lease, &command_option, + &command_hostname_lease, NULL, }; *************** *** 103,106 **** --- 118,122 ---- static int directive_range_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); static int directive_option_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); + static int directive_hostname_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); /* indexed by directive types in dhcp-client-conf.h . */ *************** *** 109,112 **** --- 125,129 ---- directive_range_handler, directive_option_handler, + directive_hostname_handler, }; *************** *** 247,262 **** } /* lease range handler */ static int directive_range_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) { lease_definition_t *lease_def; - ip_addr_t bottom_address, top_address; ! directive_t *lower_directive; uint32_t lease_expiry = 0; uint32_t renew_time = 0; uint32_t rebind_time = 0; - list_t *args, *address_pair, *lease_directives; - list_t *option_list; /* arguments. */ --- 264,308 ---- } + static int directive_lease_handler_proc(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data, + list_t *option_list) + { + directive_t *lower_directive; + list_t *lease_directives, *args; + + /* arguments. */ + args = directive->arguments; + + /* parse lower directives. */ + lease_directives = list_get_by_index(args, 2); + + list_rewind(lease_directives); + while((lower_directive = list_next(lease_directives)) != NULL) { + + switch(lower_directive->command_code) { + + case DIRECTIVE_OPTION: + + if(directive_option_handler(server_conf, lower_directive, GROUP_LEASE_DEF, option_list)) + return 1; + + break; + + default: + ERROR_MESSAGE("illegal directive specified in a range lease definition"); + } + } + + return 0; + } + /* lease range handler */ static int directive_range_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) { lease_definition_t *lease_def; ip_addr_t bottom_address, top_address; ! list_t *args, *address_pair, *option_list; uint32_t lease_expiry = 0; uint32_t renew_time = 0; uint32_t rebind_time = 0; /* arguments. */ *************** *** 277,313 **** list_add_to_end(address_pair, &bottom_address); ! /* create option list. */ option_list = list_create(); ! /* parse lower directives. */ ! lease_directives = list_get_by_index(args, 2); ! list_rewind(lease_directives); ! while((lower_directive = list_next(lease_directives)) != NULL) { ! switch(lower_directive->command_code) { ! case DIRECTIVE_OPTION: ! if(directive_option_handler(server_conf, lower_directive, GROUP_LEASE_DEF, option_list)) ! return 1; ! break; ! default: ! ERROR_MESSAGE("illegal directive specified in a range lease definition"); ! } } ! lease_def = lease_definition_create(NULL, LEASE_RANGE_ADDRESS, address_pair, option_list, lease_expiry, renew_time, rebind_time); list_add(server_conf->lease_defs, lease_def); - /* clean up. */ - list_destroy(address_pair, NULL); - dhcp_opt_destroy_option_list(option_list); - return 0; } /* lease option handler. */ --- 323,372 ---- list_add_to_end(address_pair, &bottom_address); ! /* create option handler by calling the general lease handler. */ option_list = list_create(); + directive_lease_handler_proc(server_conf, directive, group_type, group_data, option_list); ! lease_def = lease_definition_create(NULL, LEASE_RANGE_ADDRESS, address_pair, option_list, lease_expiry, renew_time, rebind_time); ! list_add(server_conf->lease_defs, lease_def); ! /* clean up. */ ! list_destroy(address_pair, NULL); ! return 0; ! } ! static int directive_hostname_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) ! { ! uint32_t lease_expiry = 0; ! uint32_t renew_time = 0; ! uint32_t rebind_time = 0; ! lease_constraint_t *constraint; ! list_t *args, *option_list; ! char *hostname; ! ip_addr_t *ip_address; ! lease_definition_t *lease_def; ! /* arguments. */ ! args = directive->arguments; ! /* first argument is the hostname. */ ! hostname = list_first(args); ! if((constraint = lease_constraint_create(LEASE_CONSTRAINT_HOSTNAME, hostname)) == NULL) { ! ERROR_MESSAGE("illegal hostname constraint specified: %s", hostname); ! return 1; } ! ip_address = list_second(args); ! option_list = list_create(); ! directive_lease_handler_proc(server_conf, directive, group_type, group_data, option_list); + lease_def = lease_definition_create(constraint, LEASE_SINGLE_ADDRESS, ip_address, option_list, + lease_expiry, renew_time, rebind_time); list_add(server_conf->lease_defs, lease_def); return 0; } + /* lease option handler. */ Index: dhcp-server-conf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-server-conf.h 12 Jul 2003 17:42:36 -0000 1.4 --- dhcp-server-conf.h 13 Jul 2003 05:44:30 -0000 1.5 *************** *** 45,49 **** enum var_symbols { SERVER_VAR_RENEW_PERCENT = 0, SERVER_VAR_REBIND_PERCENT }; ! enum directive_types { DIRECTIVE_SET = 0, DIRECTIVE_RANGE_LEASE, DIRECTIVE_OPTION }; enum group_types { GROUP_NULL = 0, GROUP_LEASE_DEF }; --- 45,49 ---- enum var_symbols { SERVER_VAR_RENEW_PERCENT = 0, SERVER_VAR_REBIND_PERCENT }; ! enum directive_types { DIRECTIVE_SET = 0, DIRECTIVE_RANGE_LEASE, DIRECTIVE_OPTION, DIRECTIVE_HOSTNAME_LEASE }; enum group_types { GROUP_NULL = 0, GROUP_LEASE_DEF }; |
From: <act...@us...> - 2003-07-13 04:53:33
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv2813/src Modified Files: dhcp-lease.c dhcp-lease.h dhcp-server.c dhcp-server.h Log Message: server allows config check now Index: dhcp-lease.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-lease.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-lease.c 12 Jul 2003 17:42:36 -0000 1.3 --- dhcp-lease.c 13 Jul 2003 04:53:30 -0000 1.4 *************** *** 31,34 **** --- 31,35 ---- #include "dhcp-lease.h" #include "dhcp-option.h" + #include "dhcp-options-strings.h" /* * * * * * * * * * * *************** *** 149,150 **** --- 150,284 ---- } + /* 2string arrays: all indexed against enums in dhcp-lease.h */ + + /* constraint type to string. */ + static const char *lease_constraint2string[] = { + "None", + "Hardware Address", + "Hostname", + }; + + /* lease type to string. */ + static const char *lease_type2string[] = { + "Single Address", + "Range Address", + }; + + /* * * * * * * * + * accessors. * + * * * * * * * */ + + /* lease constraint. */ + + const char *lease_constraint_type_to_string(lease_constraint_t *constraint) + { + int constraint_type = constraint->constraint_type; + + if(constraint_type >= NELMS(lease_constraint2string)) + return "Out of bounds."; + + return lease_constraint2string[constraint_type]; + } + + int lease_constraint_get_type(lease_constraint_t *constraint) + { + return constraint->constraint_type; + } + + const char *lease_constraint_get_hostname(lease_constraint_t *constraint) + { + return constraint->data.hostname; + } + + eth_addr_t lease_constraint_get_hw_address(lease_constraint_t *constraint) + { + return constraint->data.hw_address; + } + + /* lease definition. */ + + const char *lease_type_to_string(lease_definition_t *lease) + { + int lease_type = lease->lease_type; + + if(lease_type >= NELMS(lease_type2string)) + return "Out of bounds."; + + return lease_type2string[lease_type]; + } + + int lease_definition_get_type(lease_definition_t *lease) + { + return lease->lease_type; + } + + lease_constraint_t *lease_definition_get_constraint(lease_definition_t *lease) + { + return lease->constraint; + } + + /* * * * * * * * * * + * misc utilities. * + * * * * * * * * * */ + + void pretty_print_lease_def(lease_definition_t *lease_def) + { + char *hw_address; + const char *opt_name; + char *opt_val; + dhcp_opt_t *option; + + INFO_MESSAGE("Lease type: %s", lease_type_to_string(lease_def)); + + if(lease_def->constraint == NULL) { + INFO_MESSAGE("Lease constraint type: None."); + } else { + INFO_MESSAGE("Lease constraint type: ", + lease_constraint_type_to_string(lease_def->constraint)); + + switch(lease_def->constraint->constraint_type) { + + case LEASE_CONSTRAINT_NONE: + break; + + case LEASE_CONSTRAINT_HARDWARE_ADDRESS: + hw_address = eth_addr_to_string(lease_def->constraint->data.hw_address); + INFO_MESSAGE("Hardware Address: %s", hw_address); + xfree(hw_address); + break; + + case LEASE_CONSTRAINT_HOSTNAME: + INFO_MESSAGE("Hostname: %s", lease_def->constraint->data.hostname); + break; + + default: + FATAL_MESSAGE("illegal constraint type specified. this is a bug. report me."); + } + + } + + INFO_MESSAGE(" "); + INFO_MESSAGE("Lease options:"); + INFO_MESSAGE(" "); + + if(list_get_len(lease_def->options) == 0) { + + INFO_MESSAGE("No options specified."); + + } else { + + list_rewind(lease_def->options); + while((option = list_next(lease_def->options)) != NULL) { + + opt_name = dhcp_option_printable_string_get(dhcp_opt_get_tag(option)); + opt_val = dhcp_opt_get_user_string(option); + + INFO_MESSAGE("%s = %s", opt_name, opt_val); + xfree(opt_val); + + } + } + + INFO_MESSAGE(" "); + return; + } Index: dhcp-lease.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-lease.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-lease.h 12 Jul 2003 17:42:36 -0000 1.3 --- dhcp-lease.h 13 Jul 2003 04:53:30 -0000 1.4 *************** *** 93,95 **** --- 93,110 ---- extern void lease_definition_destroy(lease_definition_t *lease_def); + extern const char *lease_constraint_type_to_string(lease_constraint_t *constraint); + extern int lease_constraint_get_type(lease_constraint_t *constraint); + extern const char *lease_constraint_get_hostname(lease_constraint_t *constraint); + extern eth_addr_t lease_constraint_get_hw_address(lease_constraint_t *constraint); + extern const char *lease_constraint_get_hostname(lease_constraint_t *constraint); + extern eth_addr_t lease_constraint_get_hw_address(lease_constraint_t *constraint); + + extern const char *lease_type_to_string(lease_definition_t *lease); + extern int lease_definition_get_type(lease_definition_t *lease); + extern lease_constraint_t *lease_definition_get_constraint(lease_definition_t *lease); + extern const char *lease_constraint_get_hostname(lease_constraint_t *constraint); + extern eth_addr_t lease_constraint_get_hw_address(lease_constraint_t *constraint); + + extern void pretty_print_lease_def(lease_definition_t *lease_def); + #endif /* DHCP_LEASE_H */ Index: dhcp-server.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dhcp-server.c 12 Jul 2003 17:44:10 -0000 1.6 --- dhcp-server.c 13 Jul 2003 04:53:30 -0000 1.7 *************** *** 47,53 **** static void do_kill(char *interface_name); static void do_server(char *interface_name); static const char *command_string[] = { ! "version", "kill", "status", "do server" }; --- 47,54 ---- static void do_kill(char *interface_name); static void do_server(char *interface_name); + static void do_check_config(char *interface_name); static const char *command_string[] = { ! "version", "kill", "status", "do server", "checkconfig" }; *************** *** 58,61 **** --- 59,63 ---- do_status, /* do status. */ do_server, /* do server. */ + do_check_config, /* check configuration. */ }; *************** *** 68,72 **** static void usage(char *s) { ! printf("usage: %s [-aks]\n", s); exit(0); } --- 70,74 ---- static void usage(char *s) { ! INFO_MESSAGE("usage: %s [-caks] [-l verbosity level]\n", s); exit(0); } *************** *** 114,117 **** --- 116,147 ---- } + static void do_check_config(char *interface) + { + server_conf_t *server_conf; + lease_definition_t *lease_def; + + server_conf = server_conf_create(interface); + if(server_conf == NULL) { + FATAL_MESSAGE("error while reading server conf."); + } + + /* dump out configuration information. */ + + INFO_MESSAGE("Server configuration:"); + INFO_MESSAGE(" "); + + INFO_MESSAGE("default-rebind-percent: %d", server_conf->default_rebind_percent); + INFO_MESSAGE("default-renew-percent: %d", server_conf->default_renew_percent); + INFO_MESSAGE(" "); + + INFO_MESSAGE("Lease definitions:"); + INFO_MESSAGE(" "); + + list_rewind(server_conf->lease_defs); + while((lease_def = list_next(server_conf->lease_defs)) != NULL) { + pretty_print_lease_def(lease_def); + } + } + /* main function: called from scm_boot_guile */ static void real_main(void *closure, int argc, char *argv[]) *************** *** 125,129 **** INFO_MESSAGE(" "); ! while((c = getopt(argc, argv, "vskai:l:")) != -1) { switch(c) { --- 155,159 ---- INFO_MESSAGE(" "); ! while((c = getopt(argc, argv, "cvskai:l:")) != -1) { switch(c) { *************** *** 135,138 **** --- 165,172 ---- case 's': command_code = DO_STATUS; + break; + + case 'c': + command_code = DO_CHECK_CONFIG; break; Index: dhcp-server.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-server.h 8 Jul 2003 07:03:33 -0000 1.3 --- dhcp-server.h 13 Jul 2003 04:53:30 -0000 1.4 *************** *** 40,44 **** /* constants. */ ! enum command_codes { DO_VERSION = 0, DO_KILL, DO_STATUS, DO_SERVER }; enum server_states { STATE_LISTEN, STATE_SHUTDOWN = 0 }; --- 40,44 ---- /* constants. */ ! enum command_codes { DO_VERSION = 0, DO_KILL, DO_STATUS, DO_SERVER, DO_CHECK_CONFIG }; enum server_states { STATE_LISTEN, STATE_SHUTDOWN = 0 }; |
From: <act...@us...> - 2003-07-13 04:52:51
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv2741/src Modified Files: dhcp-conf.c dhcp-server-conf.c Log Message: finished range lease definition config Index: dhcp-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-conf.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dhcp-conf.c 12 Jul 2003 17:42:36 -0000 1.11 --- dhcp-conf.c 13 Jul 2003 04:52:48 -0000 1.12 *************** *** 76,79 **** --- 76,80 ---- xfree, xfree, + xfree, destroy_arg_string_list, destroy_arg_group, Index: dhcp-server-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-server-conf.c 12 Jul 2003 17:42:36 -0000 1.4 --- dhcp-server-conf.c 13 Jul 2003 04:52:48 -0000 1.5 *************** *** 52,58 **** static const arg_symbol_t *var_arg_symbols[] = { var_symbols, NULL, NULL }; ! static const arg_type_t range_lease_arg_types[] = { CONF_IDENTIFIER, CONF_ADDRESS, CONF_ADDRESS, CONF_GROUP}; ! static const char **range_lease_arg_strings[] = { var_strings, NULL, NULL, NULL }; ! static const arg_symbol_t *range_lease_arg_symbols[] = { var_symbols, NULL, NULL, NULL }; static const arg_type_t option_arg_types[] = { CONF_STRING, CONF_ASSIGNMENT, CONF_STRING_LIST }; --- 52,58 ---- static const arg_symbol_t *var_arg_symbols[] = { var_symbols, NULL, NULL }; ! static const arg_type_t range_lease_arg_types[] = { CONF_ADDRESS, CONF_ADDRESS, CONF_GROUP}; ! static const char **range_lease_arg_strings[] = { NULL, NULL, NULL }; ! static const arg_symbol_t *range_lease_arg_symbols[] = { NULL, NULL, NULL }; static const arg_type_t option_arg_types[] = { CONF_STRING, CONF_ASSIGNMENT, CONF_STRING_LIST }; *************** *** 76,80 **** DIRECTIVE_RANGE_LEASE, "range-lease", ! 4, range_lease_arg_strings, range_lease_arg_types, --- 76,80 ---- DIRECTIVE_RANGE_LEASE, "range-lease", ! 3, range_lease_arg_strings, range_lease_arg_types, *************** *** 267,270 **** --- 267,276 ---- top_address = *(ip_addr_t *)list_second(args); + /* make sure address range is correct. */ + if(ntohl(bottom_address) >= ntohl(top_address)) { + ERROR_MESSAGE("range lease defined with bottom address higher or equal to top address."); + return 1; + } + address_pair = list_create(); list_add(address_pair, &top_address); *************** *** 284,288 **** case DIRECTIVE_OPTION: ! if(directive_option_handler(server_conf, lower_directive, GROUP_LEASE_DEF, &option_list)) return 1; --- 290,294 ---- case DIRECTIVE_OPTION: ! if(directive_option_handler(server_conf, lower_directive, GROUP_LEASE_DEF, option_list)) return 1; *************** *** 295,298 **** --- 301,305 ---- lease_def = lease_definition_create(NULL, LEASE_RANGE_ADDRESS, address_pair, option_list, lease_expiry, renew_time, rebind_time); + list_add(server_conf->lease_defs, lease_def); *************** *** 310,314 **** list_t *option_list, *option_data_list; char *option_name; ! int i; const char **option_strings; --- 317,321 ---- list_t *option_list, *option_data_list; char *option_name; ! uint8_t i; const char **option_strings; *************** *** 326,330 **** if(!strcmp(option_strings[i], option_name)) { ! option = dhcp_opt_create_from_user_string(i, option_data_list); break; } --- 333,341 ---- if(!strcmp(option_strings[i], option_name)) { ! if((option = dhcp_opt_create_from_user_string(i, option_data_list)) == NULL) { ! ERROR_MESSAGE("illegal specification for option %s", option_name); ! return 1; ! } ! break; } *************** *** 335,338 **** --- 346,350 ---- return 1; } + option_list = group_data; |
From: <act...@us...> - 2003-07-12 17:44:15
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv10158/src Modified Files: dhcp-server.c Log Message: added verbosity level setting to server Index: dhcp-server.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-server.c 8 Jul 2003 07:07:24 -0000 1.5 --- dhcp-server.c 12 Jul 2003 17:44:10 -0000 1.6 *************** *** 125,129 **** INFO_MESSAGE(" "); ! while((c = getopt(argc, argv, "vskai:")) != -1) { switch(c) { --- 125,129 ---- INFO_MESSAGE(" "); ! while((c = getopt(argc, argv, "vskai:l:")) != -1) { switch(c) { *************** *** 147,150 **** --- 147,159 ---- case 'a': /* don't fork into the background. */ want_background = 0; + break; + + case 'l': + + if(!is_signed_numeric(optarg) || set_verbosity_level(atoi(optarg))) { + ERROR_MESSAGE("illegal verbosity level: %s", optarg); + exit(1); + } + break; |
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv9986/src Modified Files: Makefile.am dhcp-conf.c dhcp-conf.h dhcp-lease.h dhcp-lease.c dhcp-server-conf.c dhcp-server-conf.h Log Message: added lease-range directive to dhcp server conf Index: Makefile.am =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/Makefile.am,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Makefile.am 8 Jul 2003 07:02:12 -0000 1.30 --- Makefile.am 12 Jul 2003 17:42:36 -0000 1.31 *************** *** 17,21 **** ! noinst_HEADERS = dhcp-align.h dhcp-client-cache.h dhcp-client.h dhcp-daemon.h dhcp-interface.h \ dhcp-libutil.h dhcp-local.h dhcp-options-strings.h dhcp-print.h dhcp-cache-entry.h \ dhcp-client-conf.h dhcp-librawnet.h dhcp-limits.h dhcp-log.h dhcp-tokenizer.h \ --- 17,21 ---- ! noinst_HEADERS = dhcp-align.h dhcp-client-cache.h dhcp-client.h dhcp-interface.h \ dhcp-libutil.h dhcp-local.h dhcp-options-strings.h dhcp-print.h dhcp-cache-entry.h \ dhcp-client-conf.h dhcp-librawnet.h dhcp-limits.h dhcp-log.h dhcp-tokenizer.h \ *************** *** 52,56 **** dhcp-option.c \ dhcp-option-convert.c \ ! dhcp-daemon.c dhcp_sniff_SOURCES = dhcp-sniff.c \ --- 52,58 ---- dhcp-option.c \ dhcp-option-convert.c \ ! dhcp-daemon.c \ ! dhcp-options-strings.c ! dhcp_sniff_SOURCES = dhcp-sniff.c \ *************** *** 64,68 **** dhcp-client-conf.c \ dhcp-client-states.c \ - dhcp-options-strings.c \ dhcp-sysconf.c \ dhcp-client-guile.c --- 66,69 ---- *************** *** 80,82 **** install-exec-am: ! mkdir -p ${dhcplocalstatedir} ${dhcplocalstate_clientdir} --- 81,83 ---- install-exec-am: ! mkdir -p ${dhcplocalstatedir} ${dhcplocalstate_clientdir} ${dhcplocalstate_serverdir} Index: dhcp-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-conf.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dhcp-conf.c 3 Jan 2003 21:29:22 -0000 1.10 --- dhcp-conf.c 12 Jul 2003 17:42:36 -0000 1.11 *************** *** 41,45 **** static void *compile_arg_identifier(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); ! static void *compile_arg_address(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); static void *compile_arg_assignment(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); static void *compile_arg_boolean(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); --- 41,46 ---- static void *compile_arg_identifier(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); ! static void *compile_arg_ip_address(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); ! static void *compile_arg_hw_address(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); static void *compile_arg_assignment(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); static void *compile_arg_boolean(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols); *************** *** 58,62 **** argument_compiler_t argument_compilers[] = { compile_arg_identifier, ! compile_arg_address, compile_arg_assignment, compile_arg_boolean, --- 59,64 ---- argument_compiler_t argument_compilers[] = { compile_arg_identifier, ! compile_arg_ip_address, ! compile_arg_hw_address, compile_arg_assignment, compile_arg_boolean, *************** *** 221,228 **** } ! static void *compile_arg_address(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols) { ip_addr_t *ip_addr = NULL; - eth_addr_t *eth_addr = NULL; const char *string; token_t token; --- 223,229 ---- } ! static void *compile_arg_ip_address(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols) { ip_addr_t *ip_addr = NULL; const char *string; token_t token; *************** *** 234,256 **** string = tokenizer_get_data(conf->tokenizer); ! if(strchr(string, '.') != NULL) { ! ! /* ip addr. */ ! ip_addr = string_ip_to_ip_addr(string); ! return ip_addr; ! ! } else if(strchr(string, ':') != NULL) { ! ! /* eth addr. */ ! eth_addr = string_eth_addr_to_eth_addr(string); ! return eth_addr; ! } else { ! ERROR_MESSAGE("unable to parse: %s into address", string); return NULL; ! } ! } --- 235,256 ---- string = tokenizer_get_data(conf->tokenizer); + ip_addr = string_ip_to_ip_addr(string); + return ip_addr; + } ! static void *compile_arg_hw_address(conf_t *conf, const char **argument_strings, const arg_symbol_t *argument_symbols) ! { ! eth_addr_t *eth_addr = NULL; ! const char *string; ! token_t token; ! token = tokenizer_get_next_token_ignore_newlines(conf->tokenizer); ! if(token != TOKEN_STRING) return NULL; ! ! string = tokenizer_get_data(conf->tokenizer); ! eth_addr = string_eth_addr_to_eth_addr(string); ! return eth_addr; } Index: dhcp-conf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-conf.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-conf.h 16 Dec 2002 07:20:42 -0000 1.3 --- dhcp-conf.h 12 Jul 2003 17:42:36 -0000 1.4 *************** *** 34,38 **** /* conf argument types -- these index the argument drivers. */ ! enum conf_argument_type { CONF_IDENTIFIER = 0, CONF_ADDRESS, CONF_ASSIGNMENT, CONF_BOOLEAN, CONF_STRING, CONF_STRING_LIST, CONF_GROUP }; --- 34,38 ---- /* conf argument types -- these index the argument drivers. */ ! enum conf_argument_type { CONF_IDENTIFIER = 0, CONF_ADDRESS, CONF_MAC_ADDRESS, CONF_ASSIGNMENT, CONF_BOOLEAN, CONF_STRING, CONF_STRING_LIST, CONF_GROUP }; Index: dhcp-lease.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-lease.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dhcp-lease.h 6 Jul 2003 05:37:44 -0000 1.2 --- dhcp-lease.h 12 Jul 2003 17:42:36 -0000 1.3 *************** *** 35,42 **** eth_addr_t hw_address; /* hardware address. */ char *hostname; /* hostname. */ - struct { - ip_addr_t bottom_range; - ip_addr_t top_range; - } range; /* range of addresses. */ } data; --- 35,38 ---- *************** *** 46,53 **** typedef struct { ! lease_constraint_t *constraint; /* constraints if any. */ ! ip_addr_t addr_net; /* network_address. */ ! ip_addr_t netmask; /* network netmask. */ list_t *options; /* options to be passed. */ --- 42,58 ---- typedef struct { ! int lease_type; ! lease_constraint_t *constraint; /* constraints if any. */ ! union { ! ! ip_addr_t address; /* single ip address. */ ! ! struct { ! ip_addr_t bottom_range; ! ip_addr_t top_range; ! } address_range; /* range of addresses. */ ! ! } address_info; list_t *options; /* options to be passed. */ *************** *** 62,66 **** typedef struct { ! lease_definition_t *defintion; /* lease definition. */ time_t ini_assigned; /* initially assigned timestamp. */ --- 67,71 ---- typedef struct { ! lease_definition_t *definition; /* lease definition. */ time_t ini_assigned; /* initially assigned timestamp. */ *************** *** 71,75 **** /* constants. */ ! enum lease_constraint_type { LEASE_CONSTRAINT_NONE = 0, LEASE_CONSTRAINT_HARDWARE_ADDRESS, LEASE_CONSTRAINT_HOSTNAME, LEASE_CONSTRAINT_ADDRESS_RANGE }; /* prototypes. */ --- 76,81 ---- /* constants. */ ! enum lease_constraint_type { LEASE_CONSTRAINT_NONE = 0, LEASE_CONSTRAINT_HARDWARE_ADDRESS, LEASE_CONSTRAINT_HOSTNAME }; ! enum lease_type { LEASE_SINGLE_ADDRESS = 0, LEASE_RANGE_ADDRESS }; /* prototypes. */ *************** *** 78,86 **** extern void lease_constraint_destroy(lease_constraint_t *lease_constraint); extern lease_definition_t *lease_definition_create(lease_constraint_t *constraint, ! ip_addr_t ip_addr_range, list_t *options, uint32_t lease_expiry, uint32_t renew_time, uint32_t rebind_time); extern void lease_definition_destroy(lease_definition_t *lease_def); --- 84,94 ---- extern void lease_constraint_destroy(lease_constraint_t *lease_constraint); extern lease_definition_t *lease_definition_create(lease_constraint_t *constraint, ! int lease_type, ! void *data, list_t *options, uint32_t lease_expiry, uint32_t renew_time, uint32_t rebind_time); + extern void lease_definition_destroy(lease_definition_t *lease_def); Index: dhcp-lease.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-lease.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dhcp-lease.c 6 Jul 2003 05:37:44 -0000 1.2 --- dhcp-lease.c 12 Jul 2003 17:42:36 -0000 1.3 *************** *** 36,46 **** * * * * * * * * * * */ lease_constraint_t *lease_constraint_create(int constraint_type, void *data) { - lease_constraint_t *constraint = xcalloc(sizeof(lease_constraint_t)); char *hostname; ! list_t *address_range; ! // ip_addr_t range_top, range_bottom; constraint->constraint_type = constraint_type; --- 36,46 ---- * * * * * * * * * * */ + /* create a constraint for a lease based on constraint type, and data passed. */ lease_constraint_t *lease_constraint_create(int constraint_type, void *data) { char *hostname; ! lease_constraint_t *constraint; + constraint = xcalloc(sizeof(lease_constraint_t)); constraint->constraint_type = constraint_type; *************** *** 56,66 **** break; - case LEASE_CONSTRAINT_ADDRESS_RANGE: - address_range = data; - - hostname = data; - constraint->data.hostname = xstrdup(hostname); - break; - default: FATAL_MESSAGE("illegal constraint type passed. this is a bug report me."); --- 56,59 ---- *************** *** 70,73 **** --- 63,67 ---- } + /* destroy a lease constraint. */ void lease_constraint_destroy(lease_constraint_t *constraint) { *************** *** 78,82 **** break; - case LEASE_CONSTRAINT_ADDRESS_RANGE: /* fall through. */ case LEASE_CONSTRAINT_HARDWARE_ADDRESS: /* fall through. */ case LEASE_CONSTRAINT_NONE: /* fall through. */ --- 72,75 ---- *************** *** 91,95 **** lease_definition_t *lease_definition_create(lease_constraint_t *constraint, ! ip_addr_t ip_addr_range, list_t *options, uint32_t lease_expiry, --- 84,89 ---- lease_definition_t *lease_definition_create(lease_constraint_t *constraint, ! int lease_type, ! void *data, list_t *options, uint32_t lease_expiry, *************** *** 99,110 **** dhcp_opt_t *opt, *opt_copy; lease_definition_t *lease_def; lease_def = xcalloc(sizeof(lease_definition_t)); lease_def->constraint = constraint; - // lease_def->addr_range = ip_addr_range; ! /* copy our dhcp options we'll pass. */ lease_def->options = list_create(); --- 93,121 ---- dhcp_opt_t *opt, *opt_copy; lease_definition_t *lease_def; + list_t *addr_range; lease_def = xcalloc(sizeof(lease_definition_t)); + /* assign constraint. */ lease_def->constraint = constraint; ! /* setup addresses. */ ! switch(lease_type) { ! ! case LEASE_SINGLE_ADDRESS: ! lease_def->address_info.address = *(ip_addr_t *)data; ! break; ! ! case LEASE_RANGE_ADDRESS: ! addr_range = data; ! lease_def->address_info.address_range.bottom_range = *(ip_addr_t *)list_first(addr_range); ! lease_def->address_info.address_range.top_range = *(ip_addr_t *)list_second(addr_range); ! break; ! ! default: ! FATAL_MESSAGE("invalid lease type specified for creation. this is a bug. report me."); ! } + /* copy our dhcp options we'll pass. */ lease_def->options = list_create(); *************** *** 137,138 **** --- 148,150 ---- return; } + Index: dhcp-server-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-server-conf.c 8 Jul 2003 07:03:52 -0000 1.3 --- dhcp-server-conf.c 12 Jul 2003 17:42:36 -0000 1.4 *************** *** 30,33 **** --- 30,34 ---- #include "dhcp-librawnet.h" #include "dhcp-option.h" + #include "dhcp-lease.h" #include "dhcp-conf.h" *************** *** 35,38 **** --- 36,40 ---- #include "dhcp-server-conf.h" #include "dhcp-server-defaults.h" + #include "dhcp-options-strings.h" static const char *var_strings[] = { *************** *** 51,56 **** static const arg_type_t range_lease_arg_types[] = { CONF_IDENTIFIER, CONF_ADDRESS, CONF_ADDRESS, CONF_GROUP}; ! static const char **range_lease_arg_strings[] = { var_strings, NULL, NULL }; ! static const arg_symbol_t *range_lease_arg_symbols[] = { var_symbols, NULL, NULL }; /* command structures. */ --- 53,62 ---- static const arg_type_t range_lease_arg_types[] = { CONF_IDENTIFIER, CONF_ADDRESS, CONF_ADDRESS, CONF_GROUP}; ! static const char **range_lease_arg_strings[] = { var_strings, NULL, NULL, NULL }; ! static const arg_symbol_t *range_lease_arg_symbols[] = { var_symbols, NULL, NULL, NULL }; ! ! static const arg_type_t option_arg_types[] = { CONF_STRING, CONF_ASSIGNMENT, CONF_STRING_LIST }; ! static const char **option_arg_strings[] = { NULL, NULL, NULL }; ! static const arg_symbol_t *option_arg_symbols[] = { NULL, NULL, NULL }; /* command structures. */ *************** *** 66,71 **** }; ! /* set command. */ ! static const command_t range_lease = { DIRECTIVE_RANGE_LEASE, "range-lease", --- 72,77 ---- }; ! /* range-lease command. */ ! static const command_t command_range_lease = { DIRECTIVE_RANGE_LEASE, "range-lease", *************** *** 76,82 **** }; static const command_t *commands[] = { &command_set, ! &range_lease, NULL, }; --- 82,98 ---- }; + static const command_t command_option = { + DIRECTIVE_OPTION, + "option", + 3, + option_arg_strings, + option_arg_types, + option_arg_symbols, + }; + static const command_t *commands[] = { &command_set, ! &command_range_lease, ! &command_option, NULL, }; *************** *** 84,89 **** /* forward declaration of directive handlers. */ ! static int directive_set_handler(server_conf_t *server_conf, directive_t *directive); ! static int directive_range_handler(server_conf_t *server_conf, directive_t *directive); /* indexed by directive types in dhcp-client-conf.h . */ --- 100,106 ---- /* forward declaration of directive handlers. */ ! static int directive_set_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); ! static int directive_range_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); ! static int directive_option_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data); /* indexed by directive types in dhcp-client-conf.h . */ *************** *** 91,94 **** --- 108,112 ---- directive_set_handler, directive_range_handler, + directive_option_handler, }; *************** *** 198,202 **** /* read in the compiled directives. */ ! if(directive_handlers[directive->command_code](sc, directive)) return 1; } --- 216,220 ---- /* read in the compiled directives. */ ! if(directive_handlers[directive->command_code](sc, directive, GROUP_NULL, NULL)) return 1; } *************** *** 209,213 **** * * * * * * * * * * * */ ! static int directive_set_handler(server_conf_t *server_conf, directive_t *directive) { list_t *args; --- 227,232 ---- * * * * * * * * * * * */ ! /* variable set handler. */ ! static int directive_set_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) { list_t *args; *************** *** 228,233 **** } ! static int directive_range_handler(server_conf_t *server_conf, directive_t *directive) { return 0; } --- 247,342 ---- } ! /* lease range handler */ ! static int directive_range_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) { + lease_definition_t *lease_def; + + ip_addr_t bottom_address, top_address; + directive_t *lower_directive; + uint32_t lease_expiry = 0; + uint32_t renew_time = 0; + uint32_t rebind_time = 0; + list_t *args, *address_pair, *lease_directives; + list_t *option_list; + + /* arguments. */ + args = directive->arguments; + + /* get address pair, and create pair. */ + bottom_address = *(ip_addr_t *)list_first(args); + top_address = *(ip_addr_t *)list_second(args); + + address_pair = list_create(); + list_add(address_pair, &top_address); + list_add_to_end(address_pair, &bottom_address); + + /* create option list. */ + option_list = list_create(); + + /* parse lower directives. */ + lease_directives = list_get_by_index(args, 2); + + list_rewind(lease_directives); + while((lower_directive = list_next(lease_directives)) != NULL) { + + switch(lower_directive->command_code) { + + case DIRECTIVE_OPTION: + + if(directive_option_handler(server_conf, lower_directive, GROUP_LEASE_DEF, &option_list)) + return 1; + + break; + + default: + ERROR_MESSAGE("illegal directive specified in a range lease definition"); + } + } + + lease_def = lease_definition_create(NULL, LEASE_RANGE_ADDRESS, address_pair, option_list, lease_expiry, renew_time, rebind_time); + list_add(server_conf->lease_defs, lease_def); + + /* clean up. */ + list_destroy(address_pair, NULL); + dhcp_opt_destroy_option_list(option_list); + + return 0; + } + + /* lease option handler. */ + static int directive_option_handler(server_conf_t *server_conf, directive_t *directive, int group_type, void *group_data) + { + dhcp_opt_t *option = NULL; /* get rid of compiler warning. */ + list_t *option_list, *option_data_list; + char *option_name; + int i; + const char **option_strings; + + if(group_type == GROUP_NULL) { + ERROR_MESSAGE("dhcp option setting found outside of lease defintion"); + return 1; + } + + option_name = list_first(directive->arguments); + option_data_list = list_get_by_index(directive->arguments, 2); + option_strings = dhcp_option_conf_string_get_array(); + + for(i = 0; i < MAX_OPTIONS_HANDLED; i++) { + + if(!strcmp(option_strings[i], option_name)) { + + option = dhcp_opt_create_from_user_string(i, option_data_list); + break; + } + } + + if(i == MAX_OPTIONS_HANDLED) { + ERROR_MESSAGE("unrecognized dhcp option specified by user config: %s", option_name); + return 1; + } + + option_list = group_data; + list_add_to_end(option_list, option); + return 0; } Index: dhcp-server-conf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-server-conf.h 8 Jul 2003 07:03:52 -0000 1.3 --- dhcp-server-conf.h 12 Jul 2003 17:42:36 -0000 1.4 *************** *** 40,49 **** } server_conf_t; ! typedef int (*directive_handler_t)(server_conf_t *server_conf, directive_t *directive_data); /* constants. */ enum var_symbols { SERVER_VAR_RENEW_PERCENT = 0, SERVER_VAR_REBIND_PERCENT }; ! enum directive_types { DIRECTIVE_SET = 0, DIRECTIVE_RANGE_LEASE }; /* prototypes. */ --- 40,50 ---- } server_conf_t; ! typedef int (*directive_handler_t)(server_conf_t *server_conf, directive_t *directive_data, int group_type, void *group_data); /* constants. */ enum var_symbols { SERVER_VAR_RENEW_PERCENT = 0, SERVER_VAR_REBIND_PERCENT }; ! enum directive_types { DIRECTIVE_SET = 0, DIRECTIVE_RANGE_LEASE, DIRECTIVE_OPTION }; ! enum group_types { GROUP_NULL = 0, GROUP_LEASE_DEF }; /* prototypes. */ |
From: <act...@us...> - 2003-07-10 23:18:56
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory sc8-pr-cvs1:/tmp/cvs-serv6968 Modified Files: TODO Log Message: less todo Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TODO 6 Jul 2003 05:38:15 -0000 1.20 --- TODO 10 Jul 2003 23:18:53 -0000 1.21 *************** *** 13,20 **** -- make dhcpclient relay agent friendly -- check rfcs for any catch 22s -- write dhcpserver ! -- write dhcpstat ! a command line utility to perform pretty output on ! the dhcp client's cache and status. -- write dhcpdiscover a scanner to output information on servers/relay agents --- 13,19 ---- -- make dhcpclient relay agent friendly -- check rfcs for any catch 22s + -- write dhcpserver ! -- write dhcpdiscover a scanner to output information on servers/relay agents *************** *** 40,45 **** -- document output from dhcpsniff -- especially how brief mode is layed out. - - -- check if we handle 0xffffffff timers right. -- in dhcp-tokenizer use mmap() to implement nicer peeking. --- 39,42 ---- |
From: <act...@us...> - 2003-07-10 23:18:25
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf/dhcp-client In directory sc8-pr-cvs1:/tmp/cvs-serv6889/conf/dhcp-client Modified Files: default.sysconf Log Message: fix to resolv.conf not being truncated properly Index: default.sysconf =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/dhcp-client/default.sysconf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** default.sysconf 5 Jul 2003 19:30:51 -0000 1.1 --- default.sysconf 10 Jul 2003 23:18:22 -0000 1.2 *************** *** 70,74 **** (lambda () (if (do-configure) ! (let ((resolv-conf-file-port (open "/etc/resolv.conf" O_WRONLY 0644))) (client-info-message "configuring resolver") (map-in-order --- 70,74 ---- (lambda () (if (do-configure) ! (let ((resolv-conf-file-port (open "/etc/resolv.conf" (logior O_WRONLY O_TRUNC) 0644))) (client-info-message "configuring resolver") (map-in-order |
From: <act...@us...> - 2003-07-08 17:49:00
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory sc8-pr-cvs1:/tmp/cvs-serv20951 Modified Files: README Log Message: added mention of errata and manual in README Index: README =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/README,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** README 6 Jul 2003 17:28:32 -0000 1.10 --- README 8 Jul 2003 17:48:55 -0000 1.11 *************** *** 22,25 **** --- 22,29 ---- Read the INSTALL file for instructions on compiling and installing dhcp-agent. + The project's website is: + + http://dhcp-agent.sf.net/ + Supported Platforms ------------------- *************** *** 58,61 **** --- 62,75 ---- am slower than a greater collective of users. + In addition to this you can always check the ERRATA file which is + updated whenever bugs are fixed in between releases: + + http://dhcp-agent.sf.net/ERRATA + + The purpose of the ERRATA file is to cull down on release + inflation -- to prevent me from cutting a new release everytime a + bug is found -- while allowing you, the user, to get any quick + fixes, patches, and workarounds for known issues. + Documentation ------------- *************** *** 64,72 **** reference documentation, and a texinfo manual. The texinfo manual is installed in your systems info directory and can be read with ! info reads such as "info" or "emacs." See the INSTALL file to find which "configure" option you should pass to convert the info manual into HTML if you prefer it in that format. About the license --- 78,92 ---- reference documentation, and a texinfo manual. The texinfo manual is installed in your systems info directory and can be read with ! info readers such as "info" or "emacs." See the INSTALL file to find which "configure" option you should pass to convert the info manual into HTML if you prefer it in that format. + + In addition to that, if generating the HTML pages is too much + work for you, you can browse the manual for the very latest + release at: + + http://dhcp-agent.sourceforge.net/manual/dhcp-agent_toc.html About the license |
From: <act...@us...> - 2003-07-08 07:07:27
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv18784a/src Modified Files: dhcp-server.c Log Message: no longer using dhcp-daemon.h Index: dhcp-server.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-server.c 8 Jul 2003 07:01:42 -0000 1.4 --- dhcp-server.c 8 Jul 2003 07:07:24 -0000 1.5 *************** *** 28,32 **** #include "dhcp-libutil.h" #include "dhcp-librawnet.h" - #include "dhcp-daemon.h" #include "dhcp-lease.h" --- 28,31 ---- |
From: <act...@us...> - 2003-07-08 07:06:43
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv18650/src Modified Files: dhcp-server-states.c Log Message: eek, fixed comment from client to server Index: dhcp-server-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-states.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dhcp-server-states.c 8 Jul 2003 07:03:33 -0000 1.1 --- dhcp-server-states.c 8 Jul 2003 07:06:40 -0000 1.2 *************** *** 21,25 **** * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * ! * These are the individual client state functions, * along with their utility routines. * --- 21,25 ---- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * ! * These are the individual server state functions, * along with their utility routines. * |
From: <act...@us...> - 2003-07-08 07:05:11
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv18457/src Modified Files: dhcp-server-control.c Log Message: added destroy function for dhcp-server-control.c Index: dhcp-server-control.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-control.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dhcp-server-control.c 6 Jul 2003 05:37:44 -0000 1.2 --- dhcp-server-control.c 8 Jul 2003 07:05:07 -0000 1.3 *************** *** 40,44 **** dhcp_server_control = xcalloc(sizeof(dhcp_server_control_t)); ! dhcp_server_control->interface_name = xstrdup(interface); /* read configuration information. */ --- 40,44 ---- dhcp_server_control = xcalloc(sizeof(dhcp_server_control_t)); ! dhcp_server_control->interface = xstrdup(interface); /* read configuration information. */ *************** *** 78,84 **** } ! void dhcp_server_control_destroy(dhcp_server_control_t *dhcp_server_control) { ! INFO_MESSAGE("not implemented yet."); return; } --- 78,94 ---- } ! void dhcp_server_control_destroy(dhcp_server_control_t *sc) { ! if(sc->interface) ! xfree(sc->interface); ! ! if(sc->server_conf) ! server_conf_destroy(sc->server_conf); ! ! if(sc->rawnet) ! rawnet_destroy(sc->rawnet); ! ! xfree(sc); ! return; } |
From: <act...@us...> - 2003-07-08 07:03:55
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv18248/src Modified Files: dhcp-server-conf.c dhcp-server-conf.h Log Message: more incomplete server conf code Index: dhcp-server-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dhcp-server-conf.c 6 Jul 2003 05:37:44 -0000 1.2 --- dhcp-server-conf.c 8 Jul 2003 07:03:52 -0000 1.3 *************** *** 84,92 **** /* forward declaration of directive handlers. */ ! static int directive_set_handler(server_conf_t *server_conf, directive_t *directive, void *group_data); /* indexed by directive types in dhcp-client-conf.h . */ directive_handler_t directive_handlers[] = { directive_set_handler, }; --- 84,94 ---- /* forward declaration of directive handlers. */ ! static int directive_set_handler(server_conf_t *server_conf, directive_t *directive); ! static int directive_range_handler(server_conf_t *server_conf, directive_t *directive); /* indexed by directive types in dhcp-client-conf.h . */ directive_handler_t directive_handlers[] = { directive_set_handler, + directive_range_handler, }; *************** *** 196,200 **** /* read in the compiled directives. */ ! if(directive_handlers[directive->command_code](sc, directive, NULL)) return 1; } --- 198,202 ---- /* read in the compiled directives. */ ! if(directive_handlers[directive->command_code](sc, directive)) return 1; } *************** *** 207,211 **** * * * * * * * * * * * */ ! static int directive_set_handler(server_conf_t *server_conf, directive_t *directive, void *group_data) { list_t *args; --- 209,213 ---- * * * * * * * * * * * */ ! static int directive_set_handler(server_conf_t *server_conf, directive_t *directive) { list_t *args; *************** *** 223,226 **** --- 225,233 ---- } + return 0; + } + + static int directive_range_handler(server_conf_t *server_conf, directive_t *directive) + { return 0; } Index: dhcp-server-conf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-conf.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dhcp-server-conf.h 6 Jul 2003 05:37:44 -0000 1.2 --- dhcp-server-conf.h 8 Jul 2003 07:03:52 -0000 1.3 *************** *** 40,44 **** } server_conf_t; ! typedef int (*directive_handler_t)(server_conf_t *server_conf, directive_t *directive_data, void *group_data); /* constants. */ --- 40,44 ---- } server_conf_t; ! typedef int (*directive_handler_t)(server_conf_t *server_conf, directive_t *directive_data); /* constants. */ |
From: <act...@us...> - 2003-07-08 07:03:36
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv18210/src Modified Files: dhcp-server.h Added Files: dhcp-server-states.c Log Message: server code now has states --- NEW FILE: dhcp-server-states.c --- /* $Header: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-states.c,v 1.1 2003/07/08 07:03:33 actmodern Exp $ * * Copyright 2002 Thamer Alharbash <tm...@wh...> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. The names of the authors may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * These are the individual client state functions, * along with their utility routines. * */ #define MODULE_NAME "dhcp-server-states" #include "dhcp-local.h" #include "dhcp-limits.h" #include "dhcp-libutil.h" #include "dhcp-librawnet.h" #include "dhcp-server-conf.h" #include "dhcp-server.h" /*************************** * server states * ***************************/ int server_shutdown(dhcp_server_control_t *sc) { if(sc) { /* only cleanup if we can. */ INFO_MESSAGE("shutting down"); /* delete the PID file. */ file_delete_pid(sc->interface); } exit(0); } Index: dhcp-server.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dhcp-server.h 5 Jul 2003 19:17:48 -0000 1.2 --- dhcp-server.h 8 Jul 2003 07:03:33 -0000 1.3 *************** *** 1,5 **** /* $Header$ * ! * Copyright 2002 Thamer Alharbash <tm...@wh...> * * Redistribution and use in source and binary forms, with or without --- 1,5 ---- /* $Header$ * ! * Copyright 2003 Thamer Alharbash <tm...@wh...> * * Redistribution and use in source and binary forms, with or without *************** *** 26,36 **** #define DHCP_SERVER_H - /* type definitions. */ - typedef void (*server_command) (char *interface); - typedef struct { rawnet_t *rawnet; /* raw network handle */ ! char *interface_name; /* name of interface */ server_conf_t *server_conf; /* server configuration. */ --- 26,33 ---- #define DHCP_SERVER_H typedef struct { rawnet_t *rawnet; /* raw network handle */ ! char *interface; /* name of interface */ server_conf_t *server_conf; /* server configuration. */ *************** *** 38,47 **** --- 35,52 ---- } dhcp_server_control_t; + /* type definitions. */ + typedef void (*server_command) (char *interface); + typedef int (*server_state) (dhcp_server_control_t *); + /* constants. */ enum command_codes { DO_VERSION = 0, DO_KILL, DO_STATUS, DO_SERVER }; + enum server_states { STATE_LISTEN, STATE_SHUTDOWN = 0 }; /* prototypes. */ extern dhcp_server_control_t *dhcp_server_control_create(const char *interface); + extern void dhcp_server_control_destroy(dhcp_server_control_t *sc); + + extern int server_shutdown(dhcp_server_control_t *sc); #endif /* DHCP_SERVER_H */ |
From: <act...@us...> - 2003-07-08 07:02:18
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv18027/src Modified Files: Makefile.am Log Message: daemon code moved to utility library Index: Makefile.am =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/Makefile.am,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Makefile.am 6 Jul 2003 17:49:57 -0000 1.29 --- Makefile.am 8 Jul 2003 07:02:12 -0000 1.30 *************** *** 51,55 **** dhcp-conf-var.c \ dhcp-option.c \ ! dhcp-option-convert.c dhcp_sniff_SOURCES = dhcp-sniff.c \ --- 51,56 ---- dhcp-conf-var.c \ dhcp-option.c \ ! dhcp-option-convert.c \ ! dhcp-daemon.c dhcp_sniff_SOURCES = dhcp-sniff.c \ *************** *** 58,62 **** dhcp_client_SOURCES = dhcp-client.c \ - dhcp-daemon.c \ dhcp-client-cache.c \ dhcp-cache-entry.c \ --- 59,62 ---- *************** *** 71,75 **** dhcp-lease.c \ dhcp-server-conf.c \ ! dhcp-server-control.c dhcp_client_LDADD = -ldhcputil ${GUILE_LIB} --- 71,76 ---- dhcp-lease.c \ dhcp-server-conf.c \ ! dhcp-server-control.c \ ! dhcp-server-states.c dhcp_client_LDADD = -ldhcputil ${GUILE_LIB} |
From: <act...@us...> - 2003-07-08 07:01:45
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv17895/src Modified Files: dhcp-client.c dhcp-libutil.h dhcp-server.c Removed Files: dhcp-daemon.h Log Message: daemon prototypes moved to dhcp-libutil.h Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** dhcp-client.c 6 Jul 2003 17:14:43 -0000 1.35 --- dhcp-client.c 8 Jul 2003 07:01:41 -0000 1.36 *************** *** 35,39 **** #include "dhcp-client.h" #include "dhcp-client-guile.h" - #include "dhcp-daemon.h" /* forward declarations of do_ routines. */ --- 35,38 ---- Index: dhcp-libutil.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-libutil.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dhcp-libutil.h 2 Jul 2003 15:18:22 -0000 1.28 --- dhcp-libutil.h 8 Jul 2003 07:01:42 -0000 1.29 *************** *** 305,308 **** --- 305,313 ---- extern int conf_get_line_no(conf_t *conf); + /* daemon routines. */ + + extern void go_background(char *dir); + extern void setup_interrupt_handlers(void); + /* constants. */ Index: dhcp-server.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-server.c 6 Jul 2003 05:37:44 -0000 1.3 --- dhcp-server.c 8 Jul 2003 07:01:42 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- #include "dhcp-libutil.h" #include "dhcp-librawnet.h" + #include "dhcp-daemon.h" #include "dhcp-lease.h" *************** *** 60,63 **** --- 61,69 ---- }; + server_state server_states[] = { + NULL, + server_shutdown, + }; + /* print usage info. */ static void usage(char *s) *************** *** 85,96 **** } ! static void do_server(char *interface_name) { dhcp_server_control_t *dhcp_server_control; ! dhcp_server_control = dhcp_server_control_create(interface_name); ! INFO_MESSAGE("not implemented yet."); ! return; } --- 91,116 ---- } ! static void do_server(char *interface) { dhcp_server_control_t *dhcp_server_control; ! INFO_MESSAGE("DHCP server starting"); ! /* we go into the background immediately. */ ! if(want_background) { ! ! INFO_MESSAGE("going into the background"); ! go_background(work_dir); ! ! } ! ! dhcp_server_control = dhcp_server_control_create(interface); ! ! if(file_create_pid(interface)) { ! ERROR_MESSAGE("could not create PID file for interface: %s", interface); ! server_states[STATE_SHUTDOWN](dhcp_server_control); ! } ! ! server_states[STATE_SHUTDOWN](dhcp_server_control); } *************** *** 154,157 **** --- 174,179 ---- list_destroy(interface_list, xfree); } + + do_change_work_dir(work_dir); /* now that we have an active interface name, go ahead --- dhcp-daemon.h DELETED --- |
From: <act...@us...> - 2003-07-06 17:49:59
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv5637/src Modified Files: Makefile.am Log Message: fixed up mistakes in Makefile.am Index: Makefile.am =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/Makefile.am,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Makefile.am 5 Jul 2003 19:37:43 -0000 1.28 --- Makefile.am 6 Jul 2003 17:49:57 -0000 1.29 *************** *** 22,26 **** dhcp-sysconf.h dhcp-conf.h dhcp-conf-var.h dhcp-option.h dhcp-option-convert.h \ dhcp-client-guile.h dhcp-sniff-defaults.h dhcp-client-defaults.h dhcp-lease.h \ ! dhcp-server.h dhcp-server-guile.h dhcp-server-conf.h libdhcputil_la_SOURCES = dhcp-util.c \ --- 22,26 ---- dhcp-sysconf.h dhcp-conf.h dhcp-conf-var.h dhcp-option.h dhcp-option-convert.h \ dhcp-client-guile.h dhcp-sniff-defaults.h dhcp-client-defaults.h dhcp-lease.h \ ! dhcp-server.h dhcp-server-guile.h dhcp-server-conf.h dhcp-server-defaults.h libdhcputil_la_SOURCES = dhcp-util.c \ |
From: <act...@us...> - 2003-07-06 17:49:59
|
Update of /cvsroot/dhcp-agent/dhcp-agent/doc In directory sc8-pr-cvs1:/tmp/cvs-serv5637/doc Modified Files: Makefile.am Log Message: fixed up mistakes in Makefile.am Index: Makefile.am =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/doc/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 5 Jul 2003 19:16:23 -0000 1.4 --- Makefile.am 6 Jul 2003 17:49:56 -0000 1.5 *************** *** 5,9 **** info_TEXINFOS = dhcp-agent.texi ! dhcp_agent_TEXINFOS = dhcp-client.texi dhcp-relay.texi dhcp-server.texi dhcp-server.texi introduction.texi if HTMLDOC --- 5,9 ---- info_TEXINFOS = dhcp-agent.texi ! dhcp_agent_TEXINFOS = dhcp-client.texi dhcp-relay.texi dhcp-sniff.texi dhcp-server.texi introduction.texi if HTMLDOC |
From: <act...@us...> - 2003-07-06 17:28:35
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory sc8-pr-cvs1:/tmp/cvs-serv3424 Modified Files: README Log Message: updated README for new release Index: README =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/README,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** README 28 Jun 2003 02:21:29 -0000 1.9 --- README 6 Jul 2003 17:28:32 -0000 1.10 *************** *** 9,13 **** number of tools for network troubleshooting, and configuration. In its current state a simple dhcp sniffer and an beta-quality dhcp ! client have been implemented. Your help in building and testing this suite will be much --- 9,16 ---- number of tools for network troubleshooting, and configuration. In its current state a simple dhcp sniffer and an beta-quality dhcp ! client have been implemented. ! ! The current implementation of the dhcp-server is just skeleton ! code. Expect a complete server in the next month (hopefully). Your help in building and testing this suite will be much *************** *** 24,31 **** dhcp-agent has been tested on: ! Linux 2.4.x (i386) ! FreeBSD 4.x (i386) ! NetBSD-1.6.1 (i386) ! Solaris 2.8 (SPARC) Support --- 27,34 ---- dhcp-agent has been tested on: ! GNU/Linux 2.4.x (i386) ! FreeBSD 4.x (i386) ! NetBSD-1.6.1 (i386) ! Solaris 2.8 (SPARC) Support |
From: <act...@us...> - 2003-07-06 17:28:25
|
Update of /cvsroot/dhcp-agent/dhcp-agent/man In directory sc8-pr-cvs1:/tmp/cvs-serv3398/man Modified Files: dhcp-client.1.in Log Message: updated documentation to reflect command line changes; fixed up some wording Index: dhcp-client.1.in =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/man/dhcp-client.1.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dhcp-client.1.in 29 Jun 2003 01:33:34 -0000 1.2 --- dhcp-client.1.in 6 Jul 2003 17:28:22 -0000 1.3 *************** *** 27,31 **** .B dhcp-client [ ! .B -ackpwv ] [ --- 27,31 ---- .B dhcp-client [ ! .B -ackpwvs ] [ *************** *** 83,86 **** --- 83,90 ---- either rebind, or renew earlier depending on which timer is next. Use this to force the client to reacquire a lease. + .TP + .B -s + Print out status information on the most recent lease acquired by + the client. .TP .B -i interface |