dhcp-agent-commits Mailing List for dhcp-agent (Page 18)
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-06-08 22:15:27
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf In directory sc8-pr-cvs1:/tmp/cvs-serv22796/conf Modified Files: default.sysconf Log Message: sysconf now does latency checking before adding default route Index: default.sysconf =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/default.sysconf,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** default.sysconf 25 May 2003 03:01:20 -0000 1.5 --- default.sysconf 8 Jun 2003 22:15:24 -0000 1.6 *************** *** 139,146 **** (real-configure-default-route (lambda() ! (begin ! (client-info-message (string-append "adding default route to: " (car dhcp-routers))) ! (client-set-default-route client-control (car dhcp-routers)) ! (set! configured-default-route (car dhcp-routers))))) (real-unconfigure-default-route --- 139,162 ---- (real-configure-default-route (lambda() ! ! ; we need to check for latency so we can call client-discovery-icmp-latency ! ; which sends out icmp echo messages and the latency value associated with it ! ; ! ! (let ((routers (sort (client-discover-icmp-latency client-control dhcp-routers) ! (lambda (x y) (< (car x) (car y)))))) ! ! (if (null? routers) ! (begin ! (client-error-message "default routes not responding. defaulting to first one in list") ! (client-set-default-route client-control (car (dhcp-routers))) ! (set! configured-default-route (car dhcp-routers))) ! ! (let ((default-route (car (cdr (car routers))))) ! (display default-route) ! (newline) ! (client-info-message (string-append "adding default route to: " default-route)) ! (client-set-default-route client-control default-route) ! (set! configured-default-route default-route)))))) (real-unconfigure-default-route *************** *** 169,173 **** (real-unconfigure-default-route))))) - ; After everything is defined set to hooks ; --- 185,188 ---- *************** *** 196,198 **** (add-hook! dhcp-release-hook unconfigure-dns) (add-hook! dhcp-release-hook unconfigure-default-route) ! (add-hook! dhcp-release-hook reconfigure-interface) \ No newline at end of file --- 211,213 ---- (add-hook! dhcp-release-hook unconfigure-dns) (add-hook! dhcp-release-hook unconfigure-default-route) ! (add-hook! dhcp-release-hook reconfigure-interface) |
From: <act...@us...> - 2003-06-08 22:14:54
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv22567/src Modified Files: dhcp-client-conf.c dhcp-client-conf.h dhcp-client-defaults.h Log Message: configuration options to fine tune more protocol settings Index: dhcp-client-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-conf.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** dhcp-client-conf.c 15 May 2003 06:53:47 -0000 1.25 --- dhcp-client-conf.c 8 Jun 2003 22:14:51 -0000 1.26 *************** *** 54,58 **** * parsing in the future. */ - /* string arrays for commands. */ --- 54,57 ---- *************** *** 60,65 **** static const char *var_strings[] = { "hostname", ! "dhcp-discovery-retries", "icmp-retries", "default-interface-mtu", "default-subnet-mask", --- 59,78 ---- static const char *var_strings[] = { "hostname", ! ! /* protocol related. */ ! ! /* timeout thresholds. */ ! "dhcp-discover-timeout-threshold", ! "dhcp-request-timeout-threshold", ! "arp-timeout-threshold", ! "icmp-echo-timeout-threshold", ! "icmp-subnet-timeout-threshold", ! ! /* retries. */ ! "dhcp-discover-retries", ! "dhcp-request-retries", "icmp-retries", + "arp-retries", + "default-interface-mtu", "default-subnet-mask", *************** *** 81,86 **** static const arg_symbol_t var_symbols[] = { CLIENT_VAR_HOSTNAME, ! CLIENT_VAR_DHCP_DISCOVERY_RETRIES, CLIENT_VAR_ICMP_RETRIES, CLIENT_VAR_INTERFACE_MTU, CLIENT_VAR_SUBNET_MASK, --- 94,106 ---- static const arg_symbol_t var_symbols[] = { CLIENT_VAR_HOSTNAME, ! CLIENT_VAR_DHCP_DISCOVER_TIMEOUT, ! CLIENT_VAR_DHCP_REQUEST_TIMEOUT, ! CLIENT_VAR_ARP_TIMEOUT, ! CLIENT_VAR_ICMP_ECHO_TIMEOUT, ! CLIENT_VAR_ICMP_SUBNET_TIMEOUT, ! CLIENT_VAR_DHCP_DISCOVER_RETRIES, ! CLIENT_VAR_DHCP_REQUEST_RETRIES, CLIENT_VAR_ICMP_RETRIES, + CLIENT_VAR_ARP_RETRIES, CLIENT_VAR_INTERFACE_MTU, CLIENT_VAR_SUBNET_MASK, *************** *** 466,470 **** * to prevent negative values. */ ! case CLIENT_VAR_DHCP_DISCOVERY_RETRIES: case CLIENT_VAR_ICMP_RETRIES: --- 486,497 ---- * to prevent negative values. */ ! case CLIENT_VAR_DHCP_DISCOVER_TIMEOUT: ! case CLIENT_VAR_DHCP_REQUEST_TIMEOUT: ! case CLIENT_VAR_ICMP_ECHO_TIMEOUT: ! case CLIENT_VAR_ICMP_SUBNET_TIMEOUT: ! case CLIENT_VAR_ARP_TIMEOUT: ! case CLIENT_VAR_DHCP_DISCOVER_RETRIES: ! case CLIENT_VAR_DHCP_REQUEST_RETRIES: ! case CLIENT_VAR_ARP_RETRIES: case CLIENT_VAR_ICMP_RETRIES: *************** *** 707,711 **** int client_conf_get_dhcp_discovery_retries(client_conf_t *cc) { ! return get_conf_int_var(cc->params, CLIENT_VAR_DHCP_DISCOVERY_RETRIES, CLIENT_DEFAULT_DHCP_DISCOVERY_RETRIES); } --- 734,744 ---- int client_conf_get_dhcp_discovery_retries(client_conf_t *cc) { ! return get_conf_int_var(cc->params, CLIENT_VAR_DHCP_DISCOVER_RETRIES, CLIENT_DEFAULT_DHCP_DISCOVER_RETRIES); ! } ! ! /* get number of retries for dhcp: this is always from the top level. */ ! int client_conf_get_dhcp_request_retries(client_conf_t *cc) ! { ! return get_conf_int_var(cc->params, CLIENT_VAR_DHCP_REQUEST_RETRIES, CLIENT_DEFAULT_DHCP_REQUEST_RETRIES); } *************** *** 717,721 **** } ! /* get required options */ uint8_t *client_conf_get_opt_configure_bit_array(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr) { --- 750,754 ---- } ! /* get configure options */ uint8_t *client_conf_get_opt_configure_bit_array(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr) { *************** *** 729,732 **** --- 762,793 ---- client_conf_params_t *params = find_best_params_for(cc, ip_addr, eth_addr); return get_conf_int_var(params, CLIENT_VAR_ICMP_RETRIES, CLIENT_DEFAULT_ICMP_RETRIES); + } + + /* get number of times to attempt arp operations where applicable */ + int client_conf_get_arp_retries(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr) + { + client_conf_params_t *params = find_best_params_for(cc, ip_addr, eth_addr); + return get_conf_int_var(params, CLIENT_VAR_ARP_RETRIES, CLIENT_DEFAULT_ARP_RETRIES); + } + + /* get timeout threshold for arp operations. */ + int client_conf_get_arp_timeout(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr) + { + client_conf_params_t *params = find_best_params_for(cc, ip_addr, eth_addr); + return get_conf_int_var(params, CLIENT_VAR_ARP_TIMEOUT, CLIENT_DEFAULT_ARP_TIMEOUT); + } + + /* get timeout threshold for icmp echo operations. */ + int client_conf_get_icmp_echo_timeout(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr) + { + client_conf_params_t *params = find_best_params_for(cc, ip_addr, eth_addr); + return get_conf_int_var(params, CLIENT_VAR_ICMP_ECHO_TIMEOUT, CLIENT_DEFAULT_ICMP_ECHO_TIMEOUT); + } + + /* get timeout threshold for icmp subnet operations. */ + int client_conf_get_icmp_subnet_timeout(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr) + { + client_conf_params_t *params = find_best_params_for(cc, ip_addr, eth_addr); + return get_conf_int_var(params, CLIENT_VAR_ICMP_SUBNET_TIMEOUT, CLIENT_DEFAULT_ICMP_SUBNET_TIMEOUT); } Index: dhcp-client-conf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-conf.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dhcp-client-conf.h 15 May 2003 06:53:47 -0000 1.15 --- dhcp-client-conf.h 8 Jun 2003 22:14:51 -0000 1.16 *************** *** 77,83 **** DIRECTIVE_CONFIGURE, DIRECTIVE_APPEND, DIRECTIVE_PREPEND, DIRECTIVE_OVERRIDE }; ! /* symbols for variable substitution. */ ! enum var_symbols { CLIENT_VAR_HOSTNAME = 0, CLIENT_VAR_DHCP_DISCOVERY_RETRIES, CLIENT_VAR_ICMP_RETRIES, ! CLIENT_VAR_INTERFACE_MTU, CLIENT_VAR_DO_MEASURE_ROUTER_LATENCY_ICMP, CLIENT_VAR_REQUEST_OPTIONS, CLIENT_VAR_REQUIRE_OPTIONS, CLIENT_VAR_CONFIGURE_OPTIONS, CLIENT_VAR_APPEND_OPTIONS, CLIENT_VAR_PREPEND_OPTIONS, CLIENT_VAR_OVERRIDE_OPTIONS, CLIENT_VAR_SUBNET_MASK }; --- 77,84 ---- DIRECTIVE_CONFIGURE, DIRECTIVE_APPEND, DIRECTIVE_PREPEND, DIRECTIVE_OVERRIDE }; ! /* symbols for configuration variables. */ ! enum var_symbols { CLIENT_VAR_HOSTNAME = 0, CLIENT_VAR_DHCP_DISCOVER_TIMEOUT, CLIENT_VAR_DHCP_REQUEST_TIMEOUT, CLIENT_VAR_ICMP_ECHO_TIMEOUT, ! CLIENT_VAR_ICMP_SUBNET_TIMEOUT, CLIENT_VAR_ARP_TIMEOUT, CLIENT_VAR_DHCP_DISCOVER_RETRIES, CLIENT_VAR_DHCP_REQUEST_RETRIES, ! CLIENT_VAR_ICMP_RETRIES, CLIENT_VAR_ARP_RETRIES, CLIENT_VAR_INTERFACE_MTU, CLIENT_VAR_DO_MEASURE_ROUTER_LATENCY_ICMP, CLIENT_VAR_REQUEST_OPTIONS, CLIENT_VAR_REQUIRE_OPTIONS, CLIENT_VAR_CONFIGURE_OPTIONS, CLIENT_VAR_APPEND_OPTIONS, CLIENT_VAR_PREPEND_OPTIONS, CLIENT_VAR_OVERRIDE_OPTIONS, CLIENT_VAR_SUBNET_MASK }; *************** *** 96,106 **** extern uint8_t *client_conf_get_request_opt_bit_array(client_conf_t *cc); extern int client_conf_get_dhcp_discovery_retries(client_conf_t *cc); ! extern const char *client_conf_get_hostname(client_conf_t *cc); ! extern int client_conf_get_default_mtu(client_conf_t *cc); ! extern uint8_t *client_conf_get_opt_required_bit_array(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); extern uint8_t *client_conf_get_opt_configure_bit_array(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); extern int client_conf_get_icmp_retries(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); extern uint8_t client_conf_get_do_measure_router_latency_icmp(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); extern const char *client_conf_get_default_subnet_mask(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); --- 97,111 ---- extern uint8_t *client_conf_get_request_opt_bit_array(client_conf_t *cc); extern int client_conf_get_dhcp_discovery_retries(client_conf_t *cc); ! extern int client_conf_get_dhcp_request_retries(client_conf_t *cc); extern uint8_t *client_conf_get_opt_required_bit_array(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); extern uint8_t *client_conf_get_opt_configure_bit_array(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); extern int client_conf_get_icmp_retries(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); + extern int client_conf_get_arp_retries(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); + extern int client_conf_get_icmp_echo_timeout(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); + extern int client_conf_get_icmp_subnet_timeout(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); + extern int client_conf_get_arp_timeout(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); + extern const char *client_conf_get_hostname(client_conf_t *cc); extern uint8_t client_conf_get_do_measure_router_latency_icmp(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); + extern int client_conf_get_default_mtu(client_conf_t *cc); extern const char *client_conf_get_default_subnet_mask(client_conf_t *cc, ip_addr_t ip_addr, eth_addr_t eth_addr); Index: dhcp-client-defaults.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-defaults.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-client-defaults.h 15 May 2003 06:53:48 -0000 1.3 --- dhcp-client-defaults.h 8 Jun 2003 22:14:51 -0000 1.4 *************** *** 26,29 **** --- 26,65 ---- #define DHCP_CLIENT_DEFAULTS_H + /* max timeout threshold for DHCP discover messages. */ + + #define CLIENT_DEFAULT_DHCP_DISCOVER_TIMEOUT RECOMMENDED_MAX_SECS_WAIT + + /* max timeout threshold for DHCP request messages. */ + + #define CLIENT_DEFAULT_DHCP_REQUEST_TIMEOUT RECOMMENDED_MAX_SECS_WAIT + + /* max timeout threshold for ARP messages. */ + + #define CLIENT_DEFAULT_ARP_TIMEOUT RECOMMENDED_MAX_SECS_WAIT + + /* max timeout threshold for ICMP ECHO messages. */ + + #define CLIENT_DEFAULT_ICMP_ECHO_TIMEOUT RECOMMENDED_MAX_SECS_WAIT + + /* max timeout threshold for ICMP subnet discovery messages. */ + + #define CLIENT_DEFAULT_ICMP_SUBNET_TIMEOUT RECOMMENDED_MAX_SECS_WAIT + + /* amount of retry for dhcp DISCOVER messages. */ + + #define CLIENT_DEFAULT_DHCP_DISCOVER_RETRIES RECOMMENDED_MAX_SECS_WAIT + + /* amount of retry for dhcp REQUEST messages. */ + + #define CLIENT_DEFAULT_DHCP_REQUEST_RETRIES RECOMMENDED_MAX_SECS_WAIT + + /* amount of retry for ICMP messages. */ + + #define CLIENT_DEFAULT_ICMP_RETRIES RECOMMENDED_MAX_SECS_WAIT + + /* amount of retry for ARP messages. */ + + #define CLIENT_DEFAULT_ARP_RETRIES RECOMMENDED_MAX_SECS_WAIT + /* default MTU to use on interface during initialization * and if none is provided and used from the server. */ *************** *** 39,62 **** #define CLIENT_DEFAULT_HOSTNAME NULL - - /* Default DHCP timeout per operation. */ - - #define CLIENT_DEFAULT_DHCP_TIMEOUT 64 /* recommended by RFC2131 */ - - /* Number of times a DHCP operation should retry: this does not - * affect the timeout on a per operation basis. The client will - * still wait as long as CLIENT_DEFAULT_DHCP_TIMEOUT for each - * individual operation (e.g. DISCOVER). The setting below will - * affect how many times discover/offer will be attempted before - * giving up. */ - - #define CLIENT_DEFAULT_DHCP_DISCOVERY_RETRIES 3 - - /* Retries per ICMP operation. This defines how many times ICMP - * should be retried if failure occurs. For averaging it also - * defines how many times an ICMP operation should be performed - * altogether. */ - - #define CLIENT_DEFAULT_ICMP_RETRIES 3 /* Whether or not to use ICMP to measure latency to specified --- 75,78 ---- |
From: <act...@us...> - 2003-06-08 22:14:19
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv22402/src Modified Files: dhcp-librawnet.h dhcp-route.c dhcp-arp-discovery.c dhcp-icmp-discovery.c Log Message: updated discovery routines to accept fine tuning Index: dhcp-librawnet.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-librawnet.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dhcp-librawnet.h 25 May 2003 03:37:36 -0000 1.13 --- dhcp-librawnet.h 8 Jun 2003 22:14:15 -0000 1.14 *************** *** 577,588 **** /* ICMP discovery routines. */ extern int icmp_subnet_mask_discovery(rawnet_t *net, int retries, uint32_t *subnet_mask); ! extern list_t *icmp_rtt_discovery(rawnet_t *net, list_t *addresses, int sends); /* ARP discovery routines. */ ! extern int arp_discover_hardware_address(rawnet_t *net, int retries, uint32_t address, eth_addr_t *mac_addr); /* Routing routines. */ ! extern int route_find(rawnet_t *net, ip_addr_t addr, eth_addr_t *dest_mac); /* Misc. */ --- 577,588 ---- /* ICMP discovery routines. */ extern int icmp_subnet_mask_discovery(rawnet_t *net, int retries, uint32_t *subnet_mask); ! extern list_t *icmp_rtt_discovery(rawnet_t *net, int timeout, int sends, int arp_retries, int arp_timeout, list_t *addresses); /* ARP discovery routines. */ ! extern int arp_discover_hardware_address(rawnet_t *net, int retries, int timeout, uint32_t address, eth_addr_t *mac_addr); /* Routing routines. */ ! extern int route_find(rawnet_t *net, int sends, int timeout, ip_addr_t addr, eth_addr_t *dest_mac); /* Misc. */ Index: dhcp-route.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-route.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-route.c 16 Nov 2002 00:23:44 -0000 1.3 --- dhcp-route.c 8 Jun 2003 22:14:16 -0000 1.4 *************** *** 35,39 **** #include "dhcp-librawnet.h" ! int route_find(rawnet_t *net, ip_addr_t addr, eth_addr_t *dest_mac) { route_t *rt; --- 35,39 ---- #include "dhcp-librawnet.h" ! int route_find(rawnet_t *net, int retries, int timeout, ip_addr_t addr, eth_addr_t *dest_mac) { route_t *rt; *************** *** 55,59 **** if(route_get(rt, &entry)) { /* not in routing table. do an arp for it then. */ ! return (arp_discover_hardware_address(net, 3, entry.route_dst.addr_ip, dest_mac)); } --- 55,59 ---- if(route_get(rt, &entry)) { /* not in routing table. do an arp for it then. */ ! return (arp_discover_hardware_address(net, retries, timeout, entry.route_dst.addr_ip, dest_mac)); } *************** *** 61,64 **** /* arp for gateway address. */ ! return (arp_discover_hardware_address(net, 3, entry.route_gw.addr_ip, dest_mac)); } --- 61,64 ---- /* arp for gateway address. */ ! return (arp_discover_hardware_address(net, retries, timeout, entry.route_gw.addr_ip, dest_mac)); } Index: dhcp-arp-discovery.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-arp-discovery.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-arp-discovery.c 2 Jan 2003 04:23:01 -0000 1.4 --- dhcp-arp-discovery.c 8 Jun 2003 22:14:16 -0000 1.5 *************** *** 68,72 **** } ! int arp_discover_hardware_address(rawnet_t *net, int retries, uint32_t address, eth_addr_t *mac_addr) { --- 68,72 ---- } ! int arp_discover_hardware_address(rawnet_t *net, int retries, int timeout, uint32_t address, eth_addr_t *mac_addr) { *************** *** 88,92 **** retval = rawnet_packet_transact(net, arg_list, NULL, check_for_arp_reply, ! RECOMMENDED_MAX_SECS_WAIT); switch (retval) { --- 88,92 ---- retval = rawnet_packet_transact(net, arg_list, NULL, check_for_arp_reply, ! timeout); switch (retval) { *************** *** 112,115 **** --- 112,118 ---- list_destroy(arg_list, NULL); return 1; + + case RAWNET_USER_INTERRUPT: + FATAL_MESSAGE("user interrupt. bailing out!"); default: Index: dhcp-icmp-discovery.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-icmp-discovery.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-icmp-discovery.c 2 Jan 2003 04:23:01 -0000 1.4 --- dhcp-icmp-discovery.c 8 Jun 2003 22:14:16 -0000 1.5 *************** *** 93,96 **** --- 93,99 ---- return 0; + case RAWNET_USER_INTERRUPT: + FATAL_MESSAGE("user interrupt. bailing out!"); + default: FATAL_MESSAGE("invalid return value from raw network handler -- this a bug report it."); *************** *** 141,154 **** /* ! * ICMP Round Trip Time (RTT) Discovery: ! * Here we're interested in how long it takes to ! * get a response from a list of addresses. ! * We return a list of alternating unsigned integers ! * and IP addresses, the uint giving the rtt for the ! * following address. * */ ! list_t *icmp_rtt_discovery(rawnet_t *net, list_t *addresses, int sends) { list_t *rtts; --- 144,155 ---- /* ! * ICMP Round Trip Time (RTT) Discovery: Here we're interested in ! * how long it takes to get a response from a list of addresses. ! * We return a list of unsigned integers representing the latency ! * of each host followed by the address of the host. * */ ! list_t *icmp_rtt_discovery(rawnet_t *net, int sends, int timeout, int arp_retries, int arp_timeout, list_t *addresses) { list_t *rtts; *************** *** 174,178 **** * arp_discover_hardware_address for that. */ ! if(route_find(net, *host_addr, &dest_mac)) { WARN_MESSAGE("could not find route for address for %s -- skipping", rawnet_network_address_to_string_static(*host_addr)); --- 175,179 ---- * arp_discover_hardware_address for that. */ ! if(route_find(net, arp_retries, arp_timeout, *host_addr, &dest_mac)) { WARN_MESSAGE("could not find route for address for %s -- skipping", rawnet_network_address_to_string_static(*host_addr)); *************** *** 241,259 **** xfree(latency); /* free our latency array. */ ! list_add(rtts, average_latency); ! ! /* we need to copy the host address so ! when this list is purged it doesn't affect ! the list we were passed. */ ! host_addr_copy = xmalloc(sizeof(ip_addr_t)); ! memcpy(host_addr_copy, host_addr, sizeof(ip_addr_t)); ! list_add(rtts, host_addr_copy); } ! if(list_get_len(rtts) == 0) { ! list_destroy(rtts, NULL); ! return NULL; ! } else ! return rtts; } --- 242,252 ---- xfree(latency); /* free our latency array. */ ! list_add_to_end(rtts, average_latency); ! host_addr_copy = xmalloc(sizeof(IP_ADDR_LEN)); ! memcpy(host_addr_copy, host_addr, IP_ADDR_LEN); ! list_add_to_end(rtts, host_addr_copy); } ! return rtts; } |
From: <act...@us...> - 2003-05-25 16:24:13
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv3931 Modified Files: dhcp-client.c Log Message: info_message corrected to INFO_MESSAGE Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dhcp-client.c 25 May 2003 03:16:18 -0000 1.28 --- dhcp-client.c 25 May 2003 16:24:10 -0000 1.29 *************** *** 274,278 **** pid_t pid; ! info_message("killing %s running on interface: %s", getprogname(), interface); if(file_get_pid(interface, &pid)) { --- 274,278 ---- pid_t pid; ! INFO_MESSAGE("killing %s running on interface: %s", getprogname(), interface); if(file_get_pid(interface, &pid)) { |
From: <act...@us...> - 2003-05-25 03:39:49
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory sc8-pr-cvs1:/tmp/cvs-serv6567 Modified Files: TODO Log Message: updated TODO Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TODO 23 May 2003 03:31:15 -0000 1.12 --- TODO 25 May 2003 03:39:46 -0000 1.13 *************** *** 43,49 **** -- document output from dhcpsniff -- especially how brief mode is layed out. - -- change uint32_t to ip_addr_t for ipv4 addresses. (this looks - almost done) - -- check for race condition -- even if it is tiny -- in client_wait --- 43,46 ---- *************** *** 51,63 **** single client_request_ack routine - -- write dhcp-sysconf to allow configuration via a guile - -- check if we handle 0xffffffff timers right. -- in dhcp-tokenizer use mmap() to implement nicer peeking. - -- check types used in client conf code. fix problem assignments - where necessary. - -- find out why dnet is acting a little silly with aliased interfaces. --- 48,55 ---- *************** *** 71,80 **** arbitrary characters with sentinels. ! -- our configure script can handle define our own PRI C99 format ! definitions. We need ones for scanning -- SCN. ! ! -- if during a rebind or renew we received a wrong ip address we ! must exit as an error and notify the user (RFC2131). Honor ! NACKs on renew and rebind as well. ! ! -- fix message levels to have default of info. --- 63,66 ---- arbitrary characters with sentinels. ! -- make sure dhcp-client and dhcp-sniff work on 10mbit and ! 100mbit data links. |
From: <act...@us...> - 2003-05-25 03:37:55
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv6138/src Modified Files: dhcp-rawnet.c Log Message: added user interrupt catching Index: dhcp-rawnet.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-rawnet.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dhcp-rawnet.c 3 Jan 2003 21:29:22 -0000 1.6 --- dhcp-rawnet.c 25 May 2003 03:37:52 -0000 1.7 *************** *** 648,651 **** --- 648,656 ---- } + if(user_interrupt()) { + rtt_destroy(rtt); + return RAWNET_USER_INTERRUPT; + } + timeout = rtt_get_timeout(rtt); retval = rawnet_get_packet(net, &timeout); |
From: <act...@us...> - 2003-05-25 03:37:39
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv6064/src Modified Files: dhcp-client-states.c dhcp-client.h dhcp-interrupt.c dhcp-librawnet.h dhcp-libutil.h Log Message: added user interrupt catching Index: dhcp-client-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-states.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** dhcp-client-states.c 25 May 2003 03:01:20 -0000 1.32 --- dhcp-client-states.c 25 May 2003 03:37:36 -0000 1.33 *************** *** 559,562 **** --- 559,566 ---- return STATE_FATAL_ERROR; + case RAWNET_USER_INTERRUPT: + ERROR_MESSAGE("caught user interrupt."); + return STATE_FATAL_ERROR; + default: FATAL_MESSAGE("invalid return value from raw network handler -- this a bug report it."); *************** *** 648,651 **** --- 652,659 ---- return STATE_FATAL_ERROR; + case RAWNET_USER_INTERRUPT: + ERROR_MESSAGE("caught user interrupt."); + return STATE_FATAL_ERROR; + default: FATAL_MESSAGE("invalid return value from raw network handler -- this a bug report it."); *************** *** 807,812 **** if(dc) { /* only do clean up if we can. */ ! /* send our a release. */ ! client_release(dc); /* unconfigure everything including our interface. */ --- 815,821 ---- if(dc) { /* only do clean up if we can. */ ! /* send our a release only if we have a cache. */ ! if(!client_cache_is_empty(dc->cache)) ! client_release(dc); /* unconfigure everything including our interface. */ *************** *** 862,865 **** --- 871,878 ---- return STATE_FATAL_ERROR; + case RAWNET_USER_INTERRUPT: + ERROR_MESSAGE("caught user interrupt."); + return STATE_FATAL_ERROR; + default: FATAL_MESSAGE *************** *** 920,923 **** --- 933,940 ---- case RAWNET_ERROR: ERROR_MESSAGE("received error from raw network handler."); + return STATE_FATAL_ERROR; + + case RAWNET_USER_INTERRUPT: + ERROR_MESSAGE("caught user interrupt."); return STATE_FATAL_ERROR; Index: dhcp-client.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dhcp-client.h 25 May 2003 02:18:28 -0000 1.15 --- dhcp-client.h 25 May 2003 03:37:36 -0000 1.16 *************** *** 88,92 **** #define STATE_DO_SHUTDOWN 8 - /* timer IDs. */ --- 88,91 ---- Index: dhcp-interrupt.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-interrupt.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-interrupt.c 25 Mar 2003 03:02:53 -0000 1.4 --- dhcp-interrupt.c 25 May 2003 03:37:36 -0000 1.5 *************** *** 209,210 **** --- 209,225 ---- return; } + + int user_interrupt(void) + { + sigset_t signal_mask; + + sigemptyset(&signal_mask); + sigpending(&signal_mask); + + if(sigismember(&signal_mask, SIGQUIT) || + sigismember(&signal_mask, SIGINT) || + sigismember(&signal_mask, SIGTERM)) + return 1; + + return 0; + } Index: dhcp-librawnet.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-librawnet.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dhcp-librawnet.h 4 May 2003 18:53:11 -0000 1.12 --- dhcp-librawnet.h 25 May 2003 03:37:36 -0000 1.13 *************** *** 243,246 **** --- 243,247 ---- #define RAWNET_UNHANDLED -4 #define RAWNET_TIMEOUT -5 + #define RAWNET_USER_INTERRUPT -6 /* DHCP Type messages */ Index: dhcp-libutil.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-libutil.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** dhcp-libutil.h 28 Apr 2003 22:21:52 -0000 1.25 --- dhcp-libutil.h 25 May 2003 03:37:36 -0000 1.26 *************** *** 167,170 **** --- 167,171 ---- extern void remove_interrupt(int sig); extern int peek_interrupt_type(void); + extern int user_interrupt(void); /* alarm handlers. */ |
From: <act...@us...> - 2003-05-25 03:16:55
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv1600/src Modified Files: dhcp-client.c dhcp-util.c Log Message: added checking for verbosity level Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** dhcp-client.c 25 May 2003 02:18:28 -0000 1.27 --- dhcp-client.c 25 May 2003 03:16:18 -0000 1.28 *************** *** 518,522 **** case 'l': ! if(set_verbosity_level(atoi(optarg))) { ERROR_MESSAGE("illegal verbosity level: %s", optarg); exit(1); --- 518,522 ---- case 'l': ! if(!is_signed_numeric(optarg) || set_verbosity_level(atoi(optarg))) { ERROR_MESSAGE("illegal verbosity level: %s", optarg); exit(1); Index: dhcp-util.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-util.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dhcp-util.c 25 Mar 2003 03:03:58 -0000 1.13 --- dhcp-util.c 25 May 2003 03:16:18 -0000 1.14 *************** *** 33,37 **** static uint8_t interactive = 1; ! static int verbosity_level = DEBUG_VERBOSITY_LEVEL; /* * * * * * * * * * * --- 33,37 ---- static uint8_t interactive = 1; ! static int verbosity_level = NORMAL_VERBOSITY_LEVEL; /* * * * * * * * * * * *************** *** 150,154 **** va_list ap; ! if(get_verbosity_level() <= NORMAL_VERBOSITY_LEVEL) return; --- 150,154 ---- va_list ap; ! if(get_verbosity_level() < NORMAL_VERBOSITY_LEVEL) return; *************** *** 167,171 **** va_list ap; ! if(get_verbosity_level() <= WARNING_VERBOSITY_LEVEL) return; --- 167,171 ---- va_list ap; ! if(get_verbosity_level() < WARNING_VERBOSITY_LEVEL) return; |
From: <act...@us...> - 2003-05-25 03:13:36
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv30900/src Modified Files: dhcp-client-states.c Log Message: added reconfigure-interface and code to handle it from rebind/renew Index: dhcp-client-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-states.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** dhcp-client-states.c 25 May 2003 02:18:28 -0000 1.31 --- dhcp-client-states.c 25 May 2003 03:01:20 -0000 1.32 *************** *** 204,208 **** } - /****************** * check routines * --- 204,207 ---- *************** *** 482,485 **** --- 481,514 ---- } + /* reconfigure: this should be called from rebind or renew. */ + static void client_reconfigure(dhcp_client_control_t *dc, int state) + { + list_t *dump_options; + + /* before dumping options strip options we never want to dump */ + + dump_options = client_remove_protocol_only_options(dc->rawnet->dhcp_p->options); + + /* dump cache file. */ + if(client_cache_dump_options(dc->cache, dump_options)) { + FATAL_MESSAGE("could not create temporary cache."); + exit(1); /* get rid of compiler warning. */ + } + + /* update from temp to perm cache. */ + client_cache_update(dc->cache); + client_cache_delete_tmp_cache(dc->cache); + + /* set server address in case we just did a rebind. */ + dhcp_client_set_server_ip_address(dc, ip_get_src_addr(dc->rawnet->ip_p)); + dhcp_client_set_server_hw_address(dc, eth_get_src_addr(dc->rawnet->ether_p)); + + client_setup_timers(dc); + do_sysconf(dump_options, dc, state); + + dhcp_opt_destroy_option_list(dump_options); + return; + } + /****************************** * DHCP client state routines * *************** *** 841,845 **** if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPACK_TM)) { ! client_setup_timers(dc); return STATE_WAIT; --- 870,874 ---- if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPACK_TM)) { ! client_reconfigure(dc, STATE_RENEW); return STATE_WAIT; *************** *** 897,909 **** } ! /* if we got a pack we need to setup our timers. */ if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPACK_TM)) { ! client_setup_timers(dc); ! ! /* since we did a rebind our server's ip address and mac address may be different. */ ! dhcp_client_set_server_ip_address(dc, ip_get_src_addr(dc->rawnet->ip_p)); ! dhcp_client_set_server_hw_address(dc, eth_get_src_addr(dc->rawnet->ether_p)); ! return STATE_WAIT; --- 926,933 ---- } ! /* if we got a pack we need to setup our timers and do a reconfigure. */ if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPACK_TM)) { ! client_reconfigure(dc, STATE_REBIND); return STATE_WAIT; *************** *** 935,937 **** return 0; } - --- 959,960 ---- |
From: <act...@us...> - 2003-05-25 03:13:34
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf In directory sc8-pr-cvs1:/tmp/cvs-serv30900/conf Modified Files: default.sysconf Log Message: added reconfigure-interface and code to handle it from rebind/renew Index: default.sysconf =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/default.sysconf,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** default.sysconf 25 May 2003 02:15:59 -0000 1.4 --- default.sysconf 25 May 2003 03:01:20 -0000 1.5 *************** *** 9,38 **** ; all since it relies on it to configure the interface. ; - ; This only gets called on a new lease. We should _never_ get a - ; different IP on any of the other hooks. ! (define configure-interface ! (lambda () ! (if (defined? 'dhcp-requested-ip-address) ! (let ; if the mtu wasn't passed by the server, get the user configured one ! ((mtu ! (if (defined? 'dhcp-interface-mtu) ! dhcp-interface-mtu ! (client-get-default-mtu client-control))) ; if the subnet mask wasn't specified, get the user configured one ! (subnet-mask ! (if (defined? 'dhcp-subnet-mask) ! dhcp-subnet-mask ! (client-get-default-subnet-mask client-control)))) ; that's it we're ready to bring up the interface ! (client-info-message "bringing up interface...") ! (if (not (client-interface-up client-control dhcp-requested-ip-address subnet-mask mtu)) ! (client-fatal-message "could not bring up interface... exiting.")))))) ; XXX --- 9,51 ---- ; all since it relies on it to configure the interface. ; + (define configure-interface #f) + (define reconfigure-interface #f) ! (let* ((configured-ip-address #f)) ! ! (set! configure-interface ! (lambda () ! (if (defined? 'dhcp-requested-ip-address) ! (let ; if the mtu wasn't passed by the server, get the user configured one ! ((mtu ! (if (defined? 'dhcp-interface-mtu) ! dhcp-interface-mtu ! (client-get-default-mtu client-control))) ; if the subnet mask wasn't specified, get the user configured one ! (subnet-mask ! (if (defined? 'dhcp-subnet-mask) ! dhcp-subnet-mask ! (client-get-default-subnet-mask client-control)))) ; that's it we're ready to bring up the interface ! (client-info-message "bringing up interface...") ! (if (not (client-interface-up client-control dhcp-requested-ip-address subnet-mask mtu)) ! (client-fatal-message "could not bring up interface... exiting.") ! (set! configured-ip-address dhcp-requested-ip-address)))))) ! ! (set! reconfigure-interface ! (lambda () ! ! (if configured-ip-address ! (if (not (string=? configured-ip-address dhcp-requested-ip-address)) ! (begin ! (client-info-message "ip address changed during reconfiguration:") ! (client-info-message (string-append "using new address: " dhcp-requested-ip-address)) ! (configure-interface))))))) ; XXX *************** *** 149,154 **** (begin (real-unconfigure-default-route) ! (real-configure-default-route)) ! (real-configure-default-route))))) (set! unconfigure-default-route --- 162,166 ---- (begin (real-unconfigure-default-route) ! (real-configure-default-route)))))) (set! unconfigure-default-route *************** *** 178,181 **** --- 190,194 ---- (add-hook! dhcp-renew-hook reconfigure-dns) (add-hook! dhcp-renew-hook reconfigure-default-route) + (add-hook! dhcp-renew-hook reconfigure-interface) ; unconfigure options on dhcp-release-hook *************** *** 183,184 **** --- 196,198 ---- (add-hook! dhcp-release-hook unconfigure-dns) (add-hook! dhcp-release-hook unconfigure-default-route) + (add-hook! dhcp-release-hook reconfigure-interface) \ No newline at end of file |
From: <act...@us...> - 2003-05-25 02:18:49
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv22375/src Modified Files: dhcp-daemon.c Log Message: pretty up a bit Index: dhcp-daemon.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-daemon.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-daemon.c 16 Nov 2002 00:23:43 -0000 1.4 --- dhcp-daemon.c 25 May 2003 02:18:46 -0000 1.5 *************** *** 97,101 **** #ifdef RLIMIT_NOFILES struct rlimit usage_limit; ! #endif /* If we have daemon() use it. */ --- 97,101 ---- #ifdef RLIMIT_NOFILES struct rlimit usage_limit; ! #endif /* RLIMIT_NOFILES */ /* If we have daemon() use it. */ *************** *** 125,129 **** do_fork_and_return_as_child(); ! #endif /* --- 125,129 ---- do_fork_and_return_as_child(); ! #endif /* HAVE_DAEMON */ /* *************** *** 180,184 **** max_descriptors = SENSIBLE_DESCRIPTOR_MAX; ! #endif /* _SC_OPEN_MAX */ for(i = 0; i < max_descriptors; i++) { --- 180,184 ---- max_descriptors = SENSIBLE_DESCRIPTOR_MAX; ! #endif /* HAVE_SYSCONF */ for(i = 0; i < max_descriptors; i++) { |
From: <act...@us...> - 2003-05-25 02:18:31
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv22288/src Modified Files: dhcp-client-control.c dhcp-client-states.c dhcp-client.c dhcp-client.h Log Message: dhcp-client now properly clears or downs the interface where appropriate Index: dhcp-client-control.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-control.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** dhcp-client-control.c 5 May 2003 01:26:49 -0000 1.16 --- dhcp-client-control.c 25 May 2003 02:18:27 -0000 1.17 *************** *** 313,330 **** } - /* Utility routine to bring down interface. we need this because - * we have to be explicit about bringing down the interface. We - * can't do this at the time we destroy the control object -- for - * example we destroy the control object through forks to clean - * out our environment but we don't want to down the interface - * necessarily. This routine just makes it explicit so we call it - * when we mean it. */ - - void dhcp_client_interface_down(dhcp_client_control_t *dc) - { - rawnet_interface_down(dc->rawnet); - return; - } - /* set the server address. */ --- 313,316 ---- Index: dhcp-client-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-states.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** dhcp-client-states.c 23 May 2003 03:31:16 -0000 1.30 --- dhcp-client-states.c 25 May 2003 02:18:28 -0000 1.31 *************** *** 449,452 **** --- 449,485 ---- } + /* utility routine that should zap our configuration and leave us + * with an interface with no real address on it. */ + static void client_unconfigure(dhcp_client_control_t *dc) + { + list_t *options; + ip_addr_t ip_addr; + + /* load our cache and call sysconf with DO_SHUTDOWN to + * unconfigure us. */ + + options = client_cache_load_options(dc->cache, 0); + do_sysconf(options, dc, STATE_DO_SHUTDOWN); + dhcp_opt_destroy_option_list(options); + + /* get what our current IP address is. */ + if(rawnet_get_ip_addr(dc->rawnet, &ip_addr)) { + FATAL_MESSAGE("could not get ip address from interface."); + } + + /* check if we have a real address or not. */ + if(ip_addr != 0) { + + /* call UNARP first. */ + client_broadcast_unarp(dc); + + /* zap our ip address. */ + rawnet_interface_up(dc->rawnet, 0, 0, CLIENT_DEFAULT_MTU, 1); + } + + /* we're done. */ + return; + } + /****************************** * DHCP client state routines * *************** *** 557,561 **** if(list_get_len(cache_options) == 0) { ! ERROR_MESSAGE("could not load cache."); return STATE_FATAL_ERROR; } --- 590,595 ---- if(list_get_len(cache_options) == 0) { ! ERROR_MESSAGE("could not load cache, or cache is empty."); ! ERROR_MESSAGE("try running with -c option to delete cache."); return STATE_FATAL_ERROR; } *************** *** 621,644 **** } - client_cache_delete_cache(dc->cache); - - /* We should still have our interface up, so go ahead and send UNARP before - * bringing it down later. */ - - if(client_broadcast_unarp(dc) < 0) { - return STATE_FATAL_ERROR; - } - - /* create an empty list of options since this is a release. */ - options = list_create(); - - /* run the release hook. */ - do_sysconf(options, dc, STATE_DO_SHUTDOWN); - - list_destroy(options, NULL); - - /* since we're releasing the lease we should down the interface */ - dhcp_client_interface_down(dc); - /* called from do_shutdown() so no real state returned. * however if we do take the return value into consideration --- 655,658 ---- *************** *** 760,778 **** int client_do_shutdown(dhcp_client_control_t *dc) { ! list_t *cached_options; ! ! INFO_MESSAGE("shutting down"); if(dc) { /* only do clean up if we can. */ ! /* load what we can from the cache. */ ! cached_options = client_cache_load_options(dc->cache, 0); ! do_sysconf(cached_options, dc, STATE_DO_SHUTDOWN); ! dhcp_opt_destroy_option_list(cached_options); ! client_release(dc); file_delete_pid(dc->interface); dhcp_client_control_destroy(dc); } --- 774,799 ---- int client_do_shutdown(dhcp_client_control_t *dc) { ! INFO_MESSAGE("shutting down."); if(dc) { /* only do clean up if we can. */ ! /* send our a release. */ ! client_release(dc); ! /* unconfigure everything including our interface. */ ! client_unconfigure(dc); ! /* since we're releasing the lease we should down the interface */ ! INFO_MESSAGE("bringing down interface."); ! rawnet_down(dc->rawnet); ! rawnet_interface_down(dc->rawnet); ! ! /* delete the PID file. */ file_delete_pid(dc->interface); + + /* delete our cache. */ + client_cache_delete_cache(dc->cache); + dhcp_client_control_destroy(dc); } *************** *** 819,830 **** /* if we got a pack we only need to setup our timers. */ if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPACK_TM)) { client_setup_timers(dc); ! } ! /* in the end we return to waiting. if we didn't get an ACK ! * here we'll fall into rebind time at the next timer ! * trigger. */ - return STATE_WAIT; } --- 840,866 ---- /* if we got a pack we only need to setup our timers. */ if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPACK_TM)) { + client_setup_timers(dc); ! return STATE_WAIT; ! } else if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPNAK_TM)) { ! ! /* we've been told our lease is no good. */ ! ! /* unconfigure everything including our interface. */ ! client_unconfigure(dc); ! ! /* delete our cache. */ ! client_cache_delete_cache(dc->cache); ! ! return STATE_DISCOVER_OFFER; ! ! } else { ! ! ERROR_MESSAGE("received neither NACK nor ACK -- this should never happen because of higher filters."); ! FATAL_MESSAGE("I shouldn't be here. this is a bug report me."); ! exit(1); /* get rid of compiler warning. */ ! } } *************** *** 870,876 **** dhcp_client_set_server_hw_address(dc, eth_get_src_addr(dc->rawnet->ether_p)); ! } ! return STATE_WAIT; } --- 906,929 ---- dhcp_client_set_server_hw_address(dc, eth_get_src_addr(dc->rawnet->ether_p)); ! return STATE_WAIT; ! } else if(dhcp_is_type(dc->rawnet->dhcp_p, DHCP_DHCPNAK_TM)) { ! ! /* we've been told our lease is no good. */ ! ! /* unconfigure everything including our interface. */ ! client_unconfigure(dc); ! ! /* delete our cache. */ ! client_cache_delete_cache(dc->cache); ! ! return STATE_DISCOVER_OFFER; ! ! } else { ! ! ERROR_MESSAGE("received neither NACK nor ACK -- this should never happen because of higher filters."); ! FATAL_MESSAGE("I shouldn't be here. this is a bug report me."); ! exit(1); /* get rid of compiler warning. */ ! } } *************** *** 882,883 **** --- 935,937 ---- return 0; } + Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** dhcp-client.c 20 May 2003 01:43:42 -0000 1.26 --- dhcp-client.c 25 May 2003 02:18:28 -0000 1.27 *************** *** 454,458 **** if(file_create_pid(interface)) { ERROR_MESSAGE("could not create PID file for interface: %s", interface); ! client_states[STATE_DO_SHUTDOWN] (NULL); } --- 454,458 ---- if(file_create_pid(interface)) { ERROR_MESSAGE("could not create PID file for interface: %s", interface); ! client_states[STATE_DO_SHUTDOWN](NULL); } Index: dhcp-client.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dhcp-client.h 11 May 2003 07:49:26 -0000 1.14 --- dhcp-client.h 25 May 2003 02:18:28 -0000 1.15 *************** *** 119,124 **** extern void dhcp_client_control_use_fake_hw_addr(dhcp_client_control_t *dc, char *fake_hw_addr); - extern void dhcp_client_interface_down(dhcp_client_control_t *dc); - extern void dhcp_client_set_server_ip_address(dhcp_client_control_t *dc, ip_addr_t ip_addr); extern void dhcp_client_set_server_hw_address(dhcp_client_control_t *dc, eth_addr_t eth_addr); --- 119,122 ---- |
From: <act...@us...> - 2003-05-25 02:16:02
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf In directory sc8-pr-cvs1:/tmp/cvs-serv21820/conf Modified Files: default.sysconf Log Message: fixes to unconfigure routers Index: default.sysconf =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/default.sysconf,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** default.sysconf 23 May 2003 03:31:15 -0000 1.3 --- default.sysconf 25 May 2003 02:15:59 -0000 1.4 *************** *** 134,138 **** (lambda() (begin ! (client-info-message (string-append "removing default route to: " (car dhcp-routers))) (client-remove-default-route client-control configured-default-route))))) --- 134,138 ---- (lambda() (begin ! (client-info-message (string-append "removing default route to: " configured-default-route)) (client-remove-default-route client-control configured-default-route))))) |
From: <act...@us...> - 2003-05-23 03:31:18
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv3864/src Modified Files: dhcp-client-guile.c dhcp-client-states.c Log Message: redid sysconf to use closures; hooks now in place for reconfigure and unconfigure Index: dhcp-client-guile.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-guile.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-client-guile.c 20 May 2003 01:43:40 -0000 1.5 --- dhcp-client-guile.c 23 May 2003 03:31:16 -0000 1.6 *************** *** 140,144 **** } ! /* get the default subnet mask. FIXME: todo. */ static SCM dhcp_scm_get_default_subnet_mask(SCM scm_dc) { --- 140,144 ---- } ! /* get the default subnet mask. */ static SCM dhcp_scm_get_default_subnet_mask(SCM scm_dc) { *************** *** 222,227 **** } ! /* add a default route. */ ! static SCM dhcp_scm_client_set_default_route(SCM scm_dc, SCM scm_default_router) { client_control_smob_t *client_control_smob; --- 222,227 ---- } ! /* add or remove a default route depending on set_route. */ ! static SCM dhcp_scm_client_default_route_proc(SCM scm_dc, SCM scm_default_router, SCM set_route) { client_control_smob_t *client_control_smob; *************** *** 267,274 **** } ! if(route_add(rt, &r_entry) < 0) { ! ERROR_MESSAGE("unable to add route: %s", strerror(errno)); ! route_close(rt); ! return SCM_BOOL_F; } --- 267,285 ---- } ! if(SCM_NFALSEP(set_route)) { ! ! if(route_add(rt, &r_entry) < 0) { ! ERROR_MESSAGE("unable to add route: %s", strerror(errno)); ! route_close(rt); ! return SCM_BOOL_F; ! } ! ! } else { ! ! if(route_delete(rt, &r_entry) < 0) { ! ERROR_MESSAGE("unable to add remove: %s", strerror(errno)); ! route_close(rt); ! return SCM_BOOL_F; ! } } *************** *** 277,280 **** --- 288,303 ---- } + /* add a default route. */ + static SCM dhcp_scm_client_set_default_route(SCM scm_dc, SCM scm_default_router) + { + return dhcp_scm_client_default_route_proc(scm_dc, scm_default_router, SCM_BOOL_T); + } + + /* remove a default route. */ + static SCM dhcp_scm_client_remove_default_route(SCM scm_dc, SCM scm_default_router) + { + return dhcp_scm_client_default_route_proc(scm_dc, scm_default_router, SCM_BOOL_F); + } + SCM scm_client_shutdown(SCM scm_dc) { *************** *** 625,628 **** --- 648,652 ---- scm_c_define_gsubr("client-interface-up", 4, 0, 0, dhcp_scm_interface_up); scm_c_define_gsubr("client-set-default-route", 2, 0, 0, dhcp_scm_client_set_default_route); + scm_c_define_gsubr("client-remove-default-route", 2, 0, 0, dhcp_scm_client_remove_default_route); scm_c_define_gsubr("client-get-default-mtu", 1, 0, 0, dhcp_scm_get_default_mtu); scm_c_define_gsubr("client-get-default-subnet-mask", 1, 0, 0, dhcp_scm_get_default_subnet_mask); Index: dhcp-client-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-states.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dhcp-client-states.c 20 May 2003 01:43:41 -0000 1.29 --- dhcp-client-states.c 23 May 2003 03:31:16 -0000 1.30 *************** *** 630,633 **** --- 630,641 ---- } + /* create an empty list of options since this is a release. */ + options = list_create(); + + /* run the release hook. */ + do_sysconf(options, dc, STATE_DO_SHUTDOWN); + + list_destroy(options, NULL); + /* since we're releasing the lease we should down the interface */ dhcp_client_interface_down(dc); |
From: <act...@us...> - 2003-05-23 03:31:18
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory sc8-pr-cvs1:/tmp/cvs-serv3864 Modified Files: TODO Log Message: redid sysconf to use closures; hooks now in place for reconfigure and unconfigure Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TODO 20 May 2003 00:34:29 -0000 1.11 --- TODO 23 May 2003 03:31:15 -0000 1.12 *************** *** 78,82 **** NACKs on renew and rebind as well. - -- may start using guile hooks instead of loading a guile script. - -- fix message levels to have default of info. --- 78,80 ---- |
From: <act...@us...> - 2003-05-23 03:31:18
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf In directory sc8-pr-cvs1:/tmp/cvs-serv3864/conf Modified Files: default.sysconf Log Message: redid sysconf to use closures; hooks now in place for reconfigure and unconfigure Index: default.sysconf =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/default.sysconf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** default.sysconf 20 May 2003 01:43:39 -0000 1.2 --- default.sysconf 23 May 2003 03:31:15 -0000 1.3 *************** *** 4,11 **** ; ! ; XXX ! ; IMPORTANT: You should not need to edit the interface setup below. ! ; Without this the client may not function properly at all. ; (define configure-interface --- 4,15 ---- ; ! ; XXX IMPORTANT: ! ; You should not need to edit the interface setup ! ; below. Without this the client may not function properly at ! ; all since it relies on it to configure the interface. ; + ; This only gets called on a new lease. We should _never_ get a + ; different IP on any of the other hooks. + (define configure-interface *************** *** 28,52 **** ; that's it we're ready to bring up the interface - (begin (client-info-message "bringing up interface...") (if (not (client-interface-up client-control dhcp-requested-ip-address subnet-mask mtu)) ! (client-fatal-message "could not bring up interface... exiting."))))))) ; XXX ; Add option handling here. ; ; Domain and domain-name servers ; ! (define configure-dns ! (lambda () ! (if (and (client-configure? client-control 'dhcp-domain-name-servers) ! (client-configure? client-control 'dhcp-domain-name) ! (defined? 'dhcp-domain-name-servers) ! (defined? 'dhcp-domain-name)) ! (let ((resolv-conf-file-port (open "/etc/resolv.conf" O_WRONLY 0644))) ! (begin (client-info-message "configuring resolver") (map-in-order --- 32,71 ---- ; that's it we're ready to bring up the interface (client-info-message "bringing up interface...") (if (not (client-interface-up client-control dhcp-requested-ip-address subnet-mask mtu)) ! (client-fatal-message "could not bring up interface... exiting.")))))) ; XXX ; Add option handling here. + ; All configure-* functions are placed inside of closures. This + ; allows seemless persistantance of old values and thus + ; reconfigure-* can be written easily. ; + ; reconfigure-* is called during rebind or renew. + ; Domain and domain-name servers ; ! (define configure-dns #f) ! (define reconfigure-dns #f) ! (define unconfigure-dns #f) ! (let* ((configured-domain-name #f) ! (configured-domain-name-servers #f) ! ! ; check to see if we really need to configure ! (do-configure ! (lambda() ! (and (client-configure? client-control 'dhcp-domain-name-servers) ! (client-configure? client-control 'dhcp-domain-name) ! (defined? 'dhcp-domain-name-servers) ! (defined? 'dhcp-domain-name)))) ! ! ; define this here since we'll be calling it from reconfigure as well. ! ! (real-configure-dns ! (lambda() ! (let ((resolv-conf-file-port (open "/etc/resolv.conf" O_WRONLY 0644))) (client-info-message "configuring resolver") (map-in-order *************** *** 54,80 **** (simple-format resolv-conf-file-port "nameserver ~A\n" dns-server)) dhcp-domain-name-servers) (simple-format resolv-conf-file-port "search ~A\n" dhcp-domain-name) ! (close-port resolv-conf-file-port)))))) ; Routers. We use client-set-default-route to add the route. ; ! (define configure-default-route ! (lambda() ! (if (and (client-configure? client-control 'dhcp-routers) ! (defined? 'dhcp-routers)) ! (begin ! (client-info-message (string-append "adding default route to: " (car dhcp-routers))) ! (client-set-default-route client-control (car dhcp-routers)))))) ; After everything is defined set to hooks ; ! ; We have four hooks. dhcp-bound, dhcp-rebind, dhcp-renew, dhcp-release ; setup options on dhcp-bound - ; (add-hook! dhcp-bound-hook configure-dns) (add-hook! dhcp-bound-hook configure-default-route) (add-hook! dhcp-bound-hook configure-interface) --- 73,184 ---- (simple-format resolv-conf-file-port "nameserver ~A\n" dns-server)) dhcp-domain-name-servers) (simple-format resolv-conf-file-port "search ~A\n" dhcp-domain-name) ! (close-port resolv-conf-file-port) ! ! ; now setup the options so we can use them again. ! (set! configured-domain-name dhcp-domain-name) ! (set! configured-domain-name-servers dhcp-domain-name-servers))))) ! ! ! ; configure dns options ! (set! configure-dns ! ! (lambda () ! (if (do-configure) ! (real-configure-dns)))) ! ! ; unconfigure dns options ! (set! unconfigure-dns ! (lambda() ! ! ; We shouldn't really be doing anything. Any name server ! ; is a good server :-) ! ! #t)) ! ! (set! reconfigure-dns ! (lambda() ! (if (do-configure) ! (if (and configured-domain-name configured-domain-name-servers) ! (if (not (or (string=? configured-domain-name dhcp-domain-name) ! (string=? configured-domain-name-servers dhcp-domain-name-servers))) ! (begin ! (client-info-message "domain name options have changed. reconfiguring...") ! (real-configure-dns)))) + ; otherwise this is the first time we've received this option + (real-configure-dns))))) ; Routers. We use client-set-default-route to add the route. ; ! (define configure-default-route #f) ! (define unconfigure-default-route #f) ! (define reconfigure-default-route #f) ! ! (let* ((configured-default-route #f) ! ! ; check to see if really need to configure ! (do-configure ! (lambda() ! (and (client-configure? client-control 'dhcp-routers) ! (defined? 'dhcp-routers)))) ! ! (real-configure-default-route ! (lambda() ! (begin ! (client-info-message (string-append "adding default route to: " (car dhcp-routers))) ! (client-set-default-route client-control (car dhcp-routers)) ! (set! configured-default-route (car dhcp-routers))))) ! ! (real-unconfigure-default-route ! (lambda() ! (begin ! (client-info-message (string-append "removing default route to: " (car dhcp-routers))) ! (client-remove-default-route client-control configured-default-route))))) ! ! (set! configure-default-route ! (lambda() ! (if (do-configure) ! (real-configure-default-route)))) ! ! ! (set! reconfigure-default-route ! (lambda() ! (if (do-configure) ! (if configured-default-route ! (begin ! (real-unconfigure-default-route) ! (real-configure-default-route)) ! (real-configure-default-route))))) ! ! (set! unconfigure-default-route ! (lambda() ! (if configured-default-route ! (real-unconfigure-default-route))))) ; After everything is defined set to hooks ; ! ; We have four hooks. dhcp-bound-hook, dhcp-rebind-hook, ! ; dhcp-renew-hook, dhcp-release-hook ! ; ; setup options on dhcp-bound (add-hook! dhcp-bound-hook configure-dns) (add-hook! dhcp-bound-hook configure-default-route) (add-hook! dhcp-bound-hook configure-interface) + + ; on rebind and renew call reconfigure to check if + ; reconfiguration is necessary. + + (add-hook! dhcp-rebind-hook reconfigure-dns) + (add-hook! dhcp-rebind-hook reconfigure-default-route) + + (add-hook! dhcp-renew-hook reconfigure-dns) + (add-hook! dhcp-renew-hook reconfigure-default-route) + + ; unconfigure options on dhcp-release-hook + + (add-hook! dhcp-release-hook unconfigure-dns) + (add-hook! dhcp-release-hook unconfigure-default-route) |
From: <act...@us...> - 2003-05-23 03:30:30
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv3582/src Modified Files: dhcp-timer.c Log Message: removed erronous timer logging Index: dhcp-timer.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-timer.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dhcp-timer.c 2 Jan 2003 04:23:02 -0000 1.9 --- dhcp-timer.c 23 May 2003 03:30:27 -0000 1.10 *************** *** 152,156 **** set_alarm(trigger->seconds); timer->current_id = trigger->id; - INFO_MESSAGE("%ld\n", trigger->id); list_remove_by_datum(timer->triggers, trigger); destroy_trigger(trigger); --- 152,155 ---- |
From: <act...@us...> - 2003-05-20 01:44:13
|
Update of /cvsroot/dhcp-agent/dhcp-agent/conf In directory sc8-pr-cvs1:/tmp/cvs-serv8131/conf Modified Files: default.sysconf Log Message: now using hooks for guile extension Index: default.sysconf =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/conf/default.sysconf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** default.sysconf 11 May 2003 17:00:05 -0000 1.1 --- default.sysconf 20 May 2003 01:43:39 -0000 1.2 *************** *** 9,33 **** ; ! (if (defined? 'dhcp-requested-ip-address) ! (let ; if the mtu wasn't passed by the server, get the user configured one ! ((mtu ! (if (defined? 'dhcp-interface-mtu) ! dhcp-interface-mtu ! (client-get-default-mtu client-control))) ; if the subnet mask wasn't specified, get the user configured one ! (subnet-mask ! (if (defined? 'dhcp-subnet-mask) ! dhcp-subnet-mask ! (client-get-default-subnet-mask client-control)))) ; that's it we're ready to bring up the interface ! (begin ! (client-info-message "bringing up interface...") ! (if (not (client-interface-up client-control dhcp-requested-ip-address subnet-mask mtu)) ! (client-fatal-message "could not bring up interface... exiting."))))) ; XXX --- 9,35 ---- ; ! (define configure-interface ! (lambda () ! (if (defined? 'dhcp-requested-ip-address) ! (let ; if the mtu wasn't passed by the server, get the user configured one ! ((mtu ! (if (defined? 'dhcp-interface-mtu) ! dhcp-interface-mtu ! (client-get-default-mtu client-control))) ; if the subnet mask wasn't specified, get the user configured one ! (subnet-mask ! (if (defined? 'dhcp-subnet-mask) ! dhcp-subnet-mask ! (client-get-default-subnet-mask client-control)))) ; that's it we're ready to bring up the interface ! (begin ! (client-info-message "bringing up interface...") ! (if (not (client-interface-up client-control dhcp-requested-ip-address subnet-mask mtu)) ! (client-fatal-message "could not bring up interface... exiting."))))))) ; XXX *************** *** 38,54 **** ; ! (if (and (client-configure? client-control 'dhcp-domain-name-servers) ! (client-configure? client-control 'dhcp-domain-name) ! (defined? 'dhcp-domain-name-servers) ! (defined? 'dhcp-domain-name)) ! (let ((resolv-conf-file-port (open "/etc/resolv.conf" O_WRONLY 0644))) ! (begin ! (client-info-message "configuring resolver") ! (map-in-order ! (lambda (dns-server) ! (simple-format resolv-conf-file-port "nameserver ~A\n" dns-server)) dhcp-domain-name-servers) ! (simple-format resolv-conf-file-port "search ~A\n" dhcp-domain-name) ! (close-port resolv-conf-file-port)))) --- 40,58 ---- ; ! (define configure-dns ! (lambda () ! (if (and (client-configure? client-control 'dhcp-domain-name-servers) ! (client-configure? client-control 'dhcp-domain-name) ! (defined? 'dhcp-domain-name-servers) ! (defined? 'dhcp-domain-name)) ! (let ((resolv-conf-file-port (open "/etc/resolv.conf" O_WRONLY 0644))) ! (begin ! (client-info-message "configuring resolver") ! (map-in-order ! (lambda (dns-server) ! (simple-format resolv-conf-file-port "nameserver ~A\n" dns-server)) dhcp-domain-name-servers) ! (simple-format resolv-conf-file-port "search ~A\n" dhcp-domain-name) ! (close-port resolv-conf-file-port)))))) *************** *** 56,62 **** ; ! (if (and (client-configure? client-control 'dhcp-routers) ! (defined? 'dhcp-routers)) ! (begin ! (client-info-message (string-append "adding default route to: " (car dhcp-routers))) ! (client-set-default-route client-control (car dhcp-routers)))) --- 60,80 ---- ; ! (define configure-default-route ! (lambda() ! (if (and (client-configure? client-control 'dhcp-routers) ! (defined? 'dhcp-routers)) ! (begin ! (client-info-message (string-append "adding default route to: " (car dhcp-routers))) ! (client-set-default-route client-control (car dhcp-routers)))))) ! ! ! ; After everything is defined set to hooks ! ; ! ; We have four hooks. dhcp-bound, dhcp-rebind, dhcp-renew, dhcp-release ! ! ; setup options on dhcp-bound ! ; ! ! (add-hook! dhcp-bound-hook configure-dns) ! (add-hook! dhcp-bound-hook configure-default-route) ! (add-hook! dhcp-bound-hook configure-interface) |
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv8131/src Modified Files: dhcp-client-guile.c dhcp-client-guile.h dhcp-client-states.c dhcp-client.c dhcp-sysconf.c dhcp-sysconf.h Log Message: now using hooks for guile extension Index: dhcp-client-guile.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-guile.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-client-guile.c 15 May 2003 06:53:48 -0000 1.4 --- dhcp-client-guile.c 20 May 2003 01:43:40 -0000 1.5 *************** *** 538,543 **** } ! /* run the guile dhcp sysconf script. */ ! static void dhcp_run_guile_sysconf(dhcp_client_control_t *dc) { stringbuffer_t *sb; --- 538,579 ---- } ! /* run the applicable guile hook of state. */ ! static void dhcp_run_guile_sysconf(dhcp_client_control_t *dc, int state) ! { ! SCM hook; ! ! switch(state) { ! ! case STATE_SETUP: ! ! hook = scm_c_eval_string("dhcp-bound-hook"); ! scm_c_run_hook(hook, SCM_EOL); ! break; ! ! case STATE_REBIND: ! ! hook = scm_c_eval_string("dhcp-rebind-hook"); ! scm_c_run_hook(hook, SCM_EOL); ! break; ! ! case STATE_RENEW: ! hook = scm_c_eval_string("dhcp-renew-hook"); ! scm_c_run_hook(hook, SCM_EOL); ! break; ! ! case STATE_DO_SHUTDOWN: ! hook = scm_c_eval_string("dhcp-release-hook"); ! scm_c_run_hook(hook, SCM_EOL); ! break; ! ! default: ! FATAL_MESSAGE("illegal state value passed."); ! } ! ! return; ! } ! ! /* load the guile dhcp sysconf script. */ ! static void load_guile_sysconf(dhcp_client_control_t *dc) { stringbuffer_t *sb; *************** *** 578,583 **** * * * * * * * * * * * * * * * */ ! void dhcp_guile_init(void) { init_client_control_smob(); --- 614,622 ---- * * * * * * * * * * * * * * * */ ! void dhcp_guile_init(dhcp_client_control_t *dc) { + SCM hook; + + /* initialize the client control smob */ init_client_control_smob(); *************** *** 593,604 **** scm_c_define_gsubr("client-fatal-error-message", 1, 0, 0, scm_client_fatal_error_message); scm_c_define_gsubr("client-shutdown", 1, 0, 0, scm_client_shutdown); ! return; } ! void dhcp_sysconf_guile(dhcp_client_control_t *dc, list_t *options) { dhcp_def_guile_options(dc, options); ! dhcp_run_guile_sysconf(dc); dhcp_undef_guile_options(dc, options); --- 632,664 ---- scm_c_define_gsubr("client-fatal-error-message", 1, 0, 0, scm_client_fatal_error_message); scm_c_define_gsubr("client-shutdown", 1, 0, 0, scm_client_shutdown); ! ! /* create hooks. */ ! ! /* bound hook. */ ! hook = scm_make_hook(SCM_MAKINUM(0)); ! scm_c_define("dhcp-bound-hook", hook); ! ! /* rebind. */ ! hook = scm_make_hook(SCM_MAKINUM(0)); ! scm_c_define("dhcp-rebind-hook", hook); ! ! /* renew. */ ! hook = scm_make_hook(SCM_MAKINUM(0)); ! scm_c_define("dhcp-renew-hook", hook); ! ! /* release. */ ! hook = scm_make_hook(SCM_MAKINUM(0)); ! scm_c_define("dhcp-release-hook", hook); ! ! /* load user definitions. */ ! load_guile_sysconf(dc); ! return; } ! void dhcp_sysconf_guile(dhcp_client_control_t *dc, list_t *options, int state) { dhcp_def_guile_options(dc, options); ! dhcp_run_guile_sysconf(dc, state); dhcp_undef_guile_options(dc, options); Index: dhcp-client-guile.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-guile.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dhcp-client-guile.h 11 May 2003 07:48:29 -0000 1.1 --- dhcp-client-guile.h 20 May 2003 01:43:40 -0000 1.2 *************** *** 33,39 **** /* guile interface. */ ! extern void dhcp_sysconf_guile(dhcp_client_control_t *dc, list_t *options); ! extern void dhcp_guile_init(void); #endif /* DHCP_CLIENT_GUILE_H */ - --- 33,38 ---- /* guile interface. */ ! extern void dhcp_sysconf_guile(dhcp_client_control_t *dc, list_t *options, int state); ! extern void dhcp_guile_init(dhcp_client_control_t *dc); #endif /* DHCP_CLIENT_GUILE_H */ Index: dhcp-client-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-states.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dhcp-client-states.c 11 May 2003 07:49:05 -0000 1.28 --- dhcp-client-states.c 20 May 2003 01:43:41 -0000 1.29 *************** *** 660,664 **** do_sysconf_setup_timers(options, dc); ! do_sysconf(options, dc); dhcp_opt_destroy_option_list(options); --- 660,664 ---- do_sysconf_setup_timers(options, dc); ! do_sysconf(options, dc, STATE_SETUP); dhcp_opt_destroy_option_list(options); *************** *** 761,765 **** cached_options = client_cache_load_options(dc->cache, 0); ! do_sysconf_cleanup(cached_options, dc); dhcp_opt_destroy_option_list(cached_options); --- 761,765 ---- cached_options = client_cache_load_options(dc->cache, 0); ! do_sysconf(cached_options, dc, STATE_DO_SHUTDOWN); dhcp_opt_destroy_option_list(cached_options); Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** dhcp-client.c 19 May 2003 23:43:03 -0000 1.25 --- dhcp-client.c 20 May 2003 01:43:42 -0000 1.26 *************** *** 391,394 **** --- 391,397 ---- } + /* load up user guile sysconf script. */ + dhcp_guile_init(dc); + if(fake_hw_addr) /* Marla, you liar, you big tourist, I need this. Now get out! */ dhcp_client_control_use_fake_hw_addr(dc, fake_hw_addr); *************** *** 477,482 **** INFO_MESSAGE("See LICENSE file for details."); INFO_MESSAGE(" "); - - dhcp_guile_init(); while((c = getopt(argc, argv, "tpcdavi:m:kwh:l:H:")) != -1) { --- 480,483 ---- Index: dhcp-sysconf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-sysconf.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** dhcp-sysconf.c 11 May 2003 07:49:05 -0000 1.17 --- dhcp-sysconf.c 20 May 2003 01:43:42 -0000 1.18 *************** *** 45,57 **** * * * * * * * * * * * */ ! void do_sysconf(list_t *options, dhcp_client_control_t *dc) ! { ! return dhcp_sysconf_guile(dc, options); ! } ! ! void do_sysconf_cleanup(list_t *options, dhcp_client_control_t *dc) { ! /* nada :-) */ ! return; } --- 45,51 ---- * * * * * * * * * * * */ ! void do_sysconf(list_t *options, dhcp_client_control_t *dc, int state) { ! return dhcp_sysconf_guile(dc, options, state); } Index: dhcp-sysconf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-sysconf.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-sysconf.h 11 May 2003 07:49:05 -0000 1.5 --- dhcp-sysconf.h 20 May 2003 01:43:42 -0000 1.6 *************** *** 40,45 **** /* System configuration routines. */ ! extern void do_sysconf(list_t *options, dhcp_client_control_t *dc); ! extern void do_sysconf_cleanup(list_t *options, dhcp_client_control_t *dc); extern void do_sysconf_setup_timers(list_t *options, dhcp_client_control_t *dc); --- 40,44 ---- /* System configuration routines. */ ! extern void do_sysconf(list_t *options, dhcp_client_control_t *dc, int state); extern void do_sysconf_setup_timers(list_t *options, dhcp_client_control_t *dc); |
From: <act...@us...> - 2003-05-20 00:34:32
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory sc8-pr-cvs1:/tmp/cvs-serv28236 Modified Files: Makefile.am README TODO Added Files: INSTALL Log Message: updated top level documentation --- NEW FILE: INSTALL --- dhcp-agent ---------- Prerequisites ------------- You can download a copy of dhcp-agent from: http://dhcp-agent.sourceforge.net/ You will also need libdnet, libpcap, and guile from the following locations: * libdnet version 1.7 or higher: http://libdnet.sourceforge.net/ * libpcap version 0.6.2 or higher: http://www.tcpdump.org/ * guile version 1.6.4 or higher: http://www.gnu.org/software/guile/guile.html Some of these libraries may already be installed on your system. You should only upgrade them if necessary. libdnet and guile both come with utilities to tell you which version you have installed. You can check with the following: dnet-config --version guile-config --version libpcap comes with no such tool (at the time of writing). Usually older versions of libpcap will suffice. If you encounter bugs or compile errors you think are related to pcap, then please upgrade. It is recommended that you use GNU make if you encounter any errors during the build process. You can get GNU make and lots of other GNU software from: http://www.gnu.org/ Building and Installing ----------------------- To build simply: "./configure; make;" To install: "make install;" Before installing please uninstall any previous distribution of dhcp-agent, or dhcp suite package. Make sure you also disabled any dhcp client or server running on the host. Additional Configuration Options -------------------------------- The following options are specific to dhcp-agent: --enable-htmldoc: This enables the generation of HTML documentation from the texinfo pages. You will need texi2html installed. If texi2html is not installed you can get a copy from: http://www.mathematik.uni-kl.de/~obachman/Texi2html -- Thamer Alharbash <tm...@wh...> Index: Makefile.am =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 18 May 2003 02:58:25 -0000 1.5 --- Makefile.am 20 May 2003 00:34:29 -0000 1.6 *************** *** 5,9 **** AUTOMAKE_OPTIONS = foreign ! SUBDIRS = src man tests conf ! EXTRA_DIST = CAVEATS LICENSE README THANKS TODO UPGRADING CLEANFILES = stdint_marcos.h --- 5,9 ---- AUTOMAKE_OPTIONS = foreign ! SUBDIRS = src man tests conf doc ! EXTRA_DIST = CAVEATS LICENSE README THANKS TODO UPGRADING INSTALL CLEANFILES = stdint_marcos.h Index: README =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/README,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** README 30 Dec 2002 00:44:15 -0000 1.4 --- README 20 May 2003 00:34:29 -0000 1.5 *************** *** 8,12 **** dhcp-agent will be a complete DHCP client/server suite, with a number of tools for network troubleshooting, and configuration. In ! its current state a simple dhcp sniffer and an alpha-quality dhcp client have been implemented. --- 8,12 ---- dhcp-agent will be a complete DHCP client/server suite, with a 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. *************** *** 17,95 **** client on a production machine. ! Portability ! ----------- ! ! Although the current distribution is in alpha state, we are ! porting it about. You can help too. Tests have been run ! successfully on: ! ! Linux 2.4.x (Heavily pillaged Slackware 8.1) ! Linux 2.2.x (Heavily pillaged Slackware 8.0) ! FreeBSD-4.6 (Stock installation with dhclient killed) ! OpenBSD-3.1 (Stock installation with dhclient killed) ! ! dhcp-agent relies on two portable networking libraries: libpcap and ! libdnet. ! ! You need the latest copy of libpcap, or libpcap 0.6.2. Older libpcap ! distributions may work, but if you encounter any trouble please ! upgrade to 0.6.2 or later. You may find the latest distribution of ! libpcap at: ! ! http://www.tcpdump.org/ ! ! You will also need Dug Song's libdnet (1.5 or higher). ! ! http://libdnet.sourceforge.net/ ! ! Please note that if you wish to get dhcp-agent ported to another ! operating system, you should first check if libdnet and libpcap ! can be ported to that system. dhcp-agent relies on these two ! libraries for a portable raw network layer as well as a portable ! method of setting up networking. ! ! See the CAVEATS file for more known issues. ! ! Building and Installing ! ----------------------- ! ! To build simply: "./configure; make;" ! ! To install: "make install;" ! ! Before installing please uninstall any previous distribution of ! dhcp-agent, or dhcp suite package. Make sure you have also ! disabled any dhcp client or server running on the host. ! ! Uninstalling ! ------------- ! ! To uninstall dhcp-agent just type "make uninstall" ! ! Using dhcp-sniff to sniff for packets. ! ------------------------------------- ! ! Read the man page for dhcp-sniff for command line options. ! ! Simply run dhcp-sniff with no arguments to have it sniff the first ! ethernet interface it finds. You need to run this as root since ! it needs access to a packet capturing device. ! ! Using dhcp-client ! ---------------- ! ! Read the man page for dhcp-client for command line options. ! dhcp-client currently only sets up the interface, routing, and domain ! name system if the appropriate DHCP options are received. More ! options will be added later. ! dhcp-client is still a bit finnicky about which interface it ! picks. Use the -i option to force it to choose an interface. Or ! down the ethernet interface you wish to use and it will ! automatically detect a downed ethernet interface. ! We're still working on a nicer way of making things ! automagic. Feel free to offer your suggestions. Support --- 17,30 ---- client on a production machine. ! Read the INSTALL file for instructions on compiling and installing dhcp-agent. ! Supported Platforms ! ------------------- ! dhcp-agent has been tested on: ! Linux 2.4.x ! FreeBSD 4.x ! Solaris 2.8 (sparc) Support *************** *** 129,131 **** --- 64,67 ---- a warm fuzzy feeling. + -- Thamer Alharbash <sh...@wh...> Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TODO 11 May 2003 07:53:27 -0000 1.10 --- TODO 20 May 2003 00:34:29 -0000 1.11 *************** *** 79,80 **** --- 79,82 ---- -- may start using guile hooks instead of loading a guile script. + + -- fix message levels to have default of info. |
From: <act...@us...> - 2003-05-20 00:32:33
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory sc8-pr-cvs1:/tmp/cvs-serv27139 Modified Files: configure.ac Log Message: added HTML documentation option Index: configure.ac =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/configure.ac,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** configure.ac 18 May 2003 02:58:25 -0000 1.6 --- configure.ac 20 May 2003 00:32:30 -0000 1.7 *************** *** 19,25 **** dnl ! dnl additional arguments to autoconf dnl dnl check for CC, INSTALL, and sane make --- 19,36 ---- dnl ! dnl enable/disable argument settings dnl + dnl allow user to pick HTML documentation + AC_ARG_ENABLE(htmldoc, + [ --enable-htmldoc Create HTML documentation], + [case "${enableval}" in + yes) htmldoc=true ;; + no) htmldoc=false ;; + *) + AC_MSG_ERROR(bad value ${enableval} for --enable-htmldoc) ;; + esac],[debug=false]) + AM_CONDITIONAL(HTMLDOC, test x$htmldoc = xtrue) + dnl check for CC, INSTALL, and sane make *************** *** 161,164 **** --- 172,183 ---- fi + if $htmldoc; then + AC_PATH_PROGS(TEXI2HTML_PATH, [texi2html], [no]) + + if test $TEXI2HTML_PATH = "no"; then + AC_MSG_ERROR([you selected --enable-htmldoc and no texi2html has been found. please install texi2html first.]) + fi; + fi + dnl dnl setup paths so they can be passed to the Makefile.in *************** *** 171,174 **** --- 190,195 ---- dhcplocalstate_clientdir="${dhcplocalstatedir}/dhcp-client" + dhcpdocdir="/doc/dhcp-agent" + AC_SUBST(PCAP_LIB) AC_SUBST(PCAP_INC) *************** *** 181,187 **** AC_SUBST(dhcplocalstatedir) AC_SUBST(dhcplocalstate_clientdir) AM_CONFIG_HEADER([config.h]) ! AC_CONFIG_FILES([Makefile src/Makefile man/Makefile tests/Makefile conf/Makefile]) AC_OUTPUT --- 202,210 ---- AC_SUBST(dhcplocalstatedir) AC_SUBST(dhcplocalstate_clientdir) + AC_SUBST(infodir) + AC_SUBST(dhcpdocdir) AM_CONFIG_HEADER([config.h]) ! AC_CONFIG_FILES([Makefile src/Makefile man/Makefile tests/Makefile conf/Makefile doc/Makefile]) AC_OUTPUT |
From: <act...@us...> - 2003-05-20 00:32:32
|
Update of /cvsroot/dhcp-agent/dhcp-agent/doc In directory sc8-pr-cvs1:/tmp/cvs-serv27139/doc Modified Files: Makefile.am Log Message: added HTML documentation option Index: Makefile.am =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/doc/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 18 May 2003 03:26:08 -0000 1.1 --- Makefile.am 20 May 2003 00:32:30 -0000 1.2 *************** *** 6,7 **** --- 6,18 ---- info_TEXINFOS = dhcp-agent.texi dhcp_agent_TEXINFOS = dhcp-client.texi dhcp-relay.texi dhcp-server.texi dhcp-server.texi introduction.texi + + if HTMLDOC + + htmldir = $(prefix)/${dhcpdocdir} + + html_DATA = index.html $(shell ls dhcp-agent_*.html 2>/dev/null) + + index.html: dhcp-agent.texi $(dhcp_agent_TEXINFOS) + texi2html -toc_file index.html -split chapter dhcp-agent.texi + + endif |
From: <act...@us...> - 2003-05-19 23:43:07
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv28395/src Modified Files: dhcp-client.c Log Message: updated usage Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** dhcp-client.c 15 May 2003 05:08:14 -0000 1.24 --- dhcp-client.c 19 May 2003 23:43:03 -0000 1.25 *************** *** 118,122 **** printf("usage: %s [-cpavkwt] [-l verbosity level] [-d directory]\n", s); printf("usage: %-*s [-i interface name] [ -m mac address ]\n", strlen(s), " "); - printf("usage: %-*s [-H hostname]\n", strlen(s), " "); exit(0); } --- 118,121 ---- *************** *** 502,509 **** break; - case 'd': - work_dir = xstrdup(optarg); - break; - /* setup options. */ --- 501,504 ---- *************** *** 531,541 **** case 'p': promiscuous = 1; - break; - - /* dhcp options which can be set on the command line. */ - case 'H': - /* glob_conf_set_val(optarg, CLIENT_HOSTNAME); */ - /* heh no more globconf -- FIXME: set this in client_conf later. */ - break; --- 526,529 ---- |
From: <act...@us...> - 2003-05-19 23:38:53
|
Update of /cvsroot/dhcp-agent/dhcp-agent/man In directory sc8-pr-cvs1:/tmp/cvs-serv25976 Modified Files: Makefile.am Added Files: dhcp-client.1.in dhcp-sniff.1.in Log Message: new man pages --- NEW FILE: dhcp-client.1.in --- .\" $Header: /cvsroot/dhcp-agent/dhcp-agent/man/dhcp-client.1.in,v 1.1 2003/05/19 23:38:50 actmodern Exp $ .\" .\" Copyright 2003 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. .\" .TH DHCP-CLIENT "8" "May 2003" .SH NAME dhcp-client \- a dhcp client daemon .SH SYNOPSIS .B dhcp-client [ .B -ackpwv ] [ .B -i interface ] [ .B -l level ] [ .B -m mac address ] .SH DESCRIPTION .PP dhcp-client is a highly configurable and extendable DHCP client. Out of the box it has been built to start up and perform DHCP for a basic network setup with minimal fuss. .PP dhcp-client is part of the dhcp-agent package. You should have received a complete manual in texi format which could have been installed as info pages in .B @-infodir-@ or and optionally as HTML pages in .B @-dhcpdocdir-@ The accompanying manual is more expository than the man pages provided. The man pages should be used only as a quick reference. .SH OPTIONS .TP .B -h Print out usage. .TP .B -v Print out version information .TP .B -a Always run in the foreground and do not go into the background. .TP .B -c Clear the cache. This is useful in case a stale cache is left behind by an earlier invocation. .TP .B -k Kill a dhcp-client instance. Coupled with the -i option this will kill a specific instance of dhcp-client. Otherwise the first dhcp-client found on an active ethernet interface is terminated. .TP .B -p Forces dhcp-client to use promiscious mode. This is only useful on systems which are sufficiently broken that require promiscious mode to receive broadcast messages. .TP .B -w Wake a dhcp-client instance. Coupled with the -i option this will wake up a client on a specified interface and cause it to either rebind, or renew earlier depending on which timer is next. Use this to force the client to reacquire a lease. .TP .B -i interface Force dhcp-client to use the interface specified. This is useful to make sure dhcp-client uses a specific interface if the host is multi-homed. .TP .B -l level Generate messages at the level specified. The level should be an integer between 0 \- 4. The levels are no messages, error messages, info messages (default), warnings, diagnostic-messages, respectively. Each level includes all messages below it. The default is info messages which also include error messages. .TP .B -m mac address Fake a mac address during the DHCP operation. This will only affect the DHCP operations and no others. This is useful for debugging a DHCP server that is not behaving itself. .SH USAGE .PP On invocation dhcp-client will look for an ethernet interface which is not up and use the first one it finds to transmit DHCP discovery messages on. It will expect to be able to reach a DHCP server. You can force dhcp-client to pick an interface with the .B -i option. .SH EXIT STATUS Will exit with a non-zero value if an error occured. .SH FILES .TP .B @-dhcplocalstate_clientdir-@ directory where the lease cache is kept. .TP .B @-dhcpsysconf_clientdir-@ directory where the configuration files are kept. .TP .B @-infodir-@ directory where the GNU info manual is kept. .TP .B @-dhcpdocdir-@ directory where the optional HTML documentation is kept. .SH AUTHOR .TP Thamer Alharbash <tm...@wh...> --- NEW FILE: dhcp-sniff.1.in --- .\" $Header: /cvsroot/dhcp-agent/dhcp-agent/man/dhcp-sniff.1.in,v 1.1 2003/05/19 23:38:50 actmodern Exp $ .\" .\" Copyright 2003 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. .\" .TH DHCP-SNIFF "8" "May 2003" .SH NAME dhcp-sniff \- a dhcp sniffer .SH SYNOPSIS . .B dhcp-sniff [ .B -b ] [ .B -i interface ] .SH DESCRIPTION .PP dhcp-sniff is simple DHCP sniffer for diagnostic purposes. It can run in verbose or brief mode. By default the sniffer will use the first interface it finds which is up. .PP dhcp-sniff is part of the dhcp-agent package. You should have received a complete manual in texi format which could have been installed as info pages in .B @-infodir-@ or optionally as HTML pages in .B @-dhcpdocdir-@ The accompanying manual is more expository than the man pages provided. The man pages should be used only as a quick reference. .SH OPTIONS .TP .B -h Print out usage. .TP .B -v Print out version information .TP .B -b Run dhcp-sniff in brief mode. This mode prints everything on on line. .TP .B -i interface Force dhcp-sniff to use the interface specified. This is useful to make sure dhcp-sniff uses a specific interface if the host is multi-homed. .SH USAGE [ TODO: document brief mode ] .SH EXIT STATUS Will exit with a non-zero value if an error occured. .SH AUTHOR .TP Thamer Alharbash <tm...@wh...> Index: Makefile.am =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/man/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.am 29 Oct 2002 17:11:35 -0000 1.1.1.1 --- Makefile.am 19 May 2003 23:38:50 -0000 1.2 *************** *** 7,8 **** --- 7,24 ---- man_MANS = dhcp-sniff.1 dhcp-client.1 EXTRA_DIST = $(man_MANS) + CLEANFILES = dhcp-sniff.1 dhcp-client.1 + + # This part is injected into the Makefile so don't use any + # substitutions that could break on non-GNU make + + dhcp-sniff.1: dhcp-sniff.1.in + sed < dhcp-sniff.1.in > dhcp-sniff.1 \ + -e s:@-infodir-@:${infodir}: \ + -e s:@-dhcpdocdir-@:${dhcpdocdir}: + + dhcp-client.1: dhcp-client.1.in + sed < dhcp-client.1.in > dhcp-client.1 \ + -e s:@-infodir-@:${infodir}: \ + -e s:@-dhcpdocdir-@:${prefix}${dhcpdocdir}: \ + -e s:@-dhcplocalstate_clientdir-@:${dhcplocalstate_clientdir}: \ + -e s:@-dhcpsysconf_clientdir-@:${dhcpsysconf_clientdir}: |
From: <act...@us...> - 2003-05-19 23:38:16
|
Update of /cvsroot/dhcp-agent/dhcp-agent/man In directory sc8-pr-cvs1:/tmp/cvs-serv25504 Removed Files: dhcp-client.1 dhcp-sniff.1 Log Message: no need for old man pages --- dhcp-client.1 DELETED --- --- dhcp-sniff.1 DELETED --- |