[Dhcp-agent-commits] CVS: dhcp-agent TODO,1.5,1.6 dhcp-agent.h,1.20,1.21 dhcp-client-control.c,1.10,
Status: Alpha
Brought to you by:
actmodern
From: Thamer Al-H. <act...@us...> - 2002-02-09 16:34:46
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv5884 Modified Files: TODO dhcp-agent.h dhcp-client-control.c dhcp-client-states.c dhcp-net.c dhcp-sniff.c Log Message: removed promiscious mode from client; Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TODO 9 Feb 2002 15:50:30 -0000 1.5 --- TODO 9 Feb 2002 16:34:42 -0000 1.6 *************** *** 28,34 **** -- proper error handling in packet objects. possibly generic codes with an error buff (?). - -- make splice_string better: make it use stdarg - -- fix rawnet so it doesn't hardcode ports. - -- dhcp packet overloading. -- add a isascii() and a strcasecmp() for portability -- redo dhcp-client-conf to be better. --- 28,31 ---- Index: dhcp-agent.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-agent.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** dhcp-agent.h 9 Feb 2002 15:50:30 -0000 1.20 --- dhcp-agent.h 9 Feb 2002 16:34:42 -0000 1.21 *************** *** 270,274 **** dst_port; /* udp ports for writing packets. */ unsigned char *client_hw_addr; /* used for faking client mac address. */ ! /* * Data objects --- 270,275 ---- dst_port; /* udp ports for writing packets. */ unsigned char *client_hw_addr; /* used for faking client mac address. */ ! int promiscious; /* run in promiscious mode flag. */ ! /* * Data objects *************** *** 469,473 **** extern int resolv(char *address, uint32_t *addr); ! extern rawnet_t *net_create(char *device, char *filter, int sport, int dport); extern void rawnet_destroy(rawnet_t *net); extern int rawnet_get_packet(rawnet_t *net); --- 470,474 ---- extern int resolv(char *address, uint32_t *addr); ! extern rawnet_t *net_create(char *device, char *filter, int sport, int dport, int promiscious); extern void rawnet_destroy(rawnet_t *net); extern int rawnet_get_packet(rawnet_t *net); Index: dhcp-client-control.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client-control.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dhcp-client-control.c 9 Feb 2002 15:50:30 -0000 1.10 --- dhcp-client-control.c 9 Feb 2002 16:34:42 -0000 1.11 *************** *** 146,151 **** "arp or icmp or (udp and (src port %d or dst port %d))", dport, sport); ! ! if((dc->rawnet = net_create(interface, filter_buff, sport, dport)) == NULL) { destroy_dhcp_client_control(dc); return NULL; --- 146,151 ---- "arp or icmp or (udp and (src port %d or dst port %d))", dport, sport); ! ! if((dc->rawnet = net_create(interface, filter_buff, sport, dport, 0)) == NULL) { destroy_dhcp_client_control(dc); return NULL; Index: dhcp-client-states.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client-states.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dhcp-client-states.c 3 Feb 2002 16:56:00 -0000 1.12 --- dhcp-client-states.c 9 Feb 2002 16:34:42 -0000 1.13 *************** *** 265,269 **** add_to_list(dc->rawnet->dhcp_p->options, dhcp_build_server_identifier(dhcp_get_siaddr(dc->rawnet->dhcp_p))); ! /* dump cache file. */ if(client_cache_dump_options(dc->cache, dc->rawnet->dhcp_p->options)) { --- 265,269 ---- add_to_list(dc->rawnet->dhcp_p->options, dhcp_build_server_identifier(dhcp_get_siaddr(dc->rawnet->dhcp_p))); ! p /* dump cache file. */ if(client_cache_dump_options(dc->cache, dc->rawnet->dhcp_p->options)) { Index: dhcp-net.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-net.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dhcp-net.c 8 Feb 2002 01:37:29 -0000 1.11 --- dhcp-net.c 9 Feb 2002 16:34:42 -0000 1.12 *************** *** 171,175 **** rawnet_t *net_create(char *device, char *filter, ! int dhcp_src_port, int dhcp_dst_port) { rawnet_t *net; --- 171,176 ---- rawnet_t *net_create(char *device, char *filter, ! int dhcp_src_port, int dhcp_dst_port, ! int promiscious) { rawnet_t *net; *************** *** 181,184 **** --- 182,186 ---- net->pcap_filter = strdup(filter); net->packet_data = xcalloc(DEFAULT_MTU); /* XXX -- fixme make mtu configurable. */ + net->promiscious = promiscious; /* Get the interface and make sure its an ethernet interface or *************** *** 194,198 **** /* get pcap handler */ ! net->pcap = initialize_pcap_device(device, filter, 1); if(net->pcap == NULL) { rawnet_destroy(net); --- 196,200 ---- /* get pcap handler */ ! net->pcap = initialize_pcap_device(device, filter, promiscious); if(net->pcap == NULL) { rawnet_destroy(net); *************** *** 295,299 **** { ! net->pcap = initialize_pcap_device(net->device, net->pcap_filter, 1); if(net->pcap == NULL) { return -1; --- 297,301 ---- { ! net->pcap = initialize_pcap_device(net->device, net->pcap_filter, net->promiscious); if(net->pcap == NULL) { return -1; Index: dhcp-sniff.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-sniff.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dhcp-sniff.c 8 Feb 2002 01:37:29 -0000 1.4 --- dhcp-sniff.c 9 Feb 2002 16:34:42 -0000 1.5 *************** *** 79,83 **** /* It's ok not to set ports since we're not writing any packets. */ ! net = net_create(interface_name, filter_buff, 0, 0); if(net == NULL) --- 79,83 ---- /* It's ok not to set ports since we're not writing any packets. */ ! net = net_create(interface_name, filter_buff, 0, 0, 1); if(net == NULL) |