[Dhcp-agent-commits] CVS: dhcp-agent Makefile.am,1.14,1.15 Makefile.in,1.14,1.15 configure,1.10,1.11
Status: Alpha
Brought to you by:
actmodern
|
From: Thamer Al-H. <act...@us...> - 2002-05-19 16:24:40
|
Update of /cvsroot/dhcp-agent/dhcp-agent
In directory usw-pr-cvs1:/tmp/cvs-serv24153
Modified Files:
Makefile.am Makefile.in configure dhcp-agent.h dhcp-align.c
dhcp-arp-discovery.c dhcp-arp.c dhcp-files.c
dhcp-icmp-discovery.c dhcp-net.c
Log Message:
fixed up arp-discovery to work
Index: Makefile.am
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/Makefile.am,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Makefile.am 18 May 2002 18:10:09 -0000 1.14
--- Makefile.am 19 May 2002 16:24:37 -0000 1.15
***************
*** 14,18 ****
dhcpsniff_LDADD = @PCAP_LIB@ @DNET_LIB@
! dhcpclient_SOURCES = dhcp-client.c dhcp-util.c \
dhcp-align.c dhcp-net.c dhcp-list.c dhcp-com.c dhcp-eth.c dhcp-ip.c \
dhcp-udp.c dhcp-arp.c dhcp-icmp.c dhcp-log.c dhcp-daemon.c \
--- 14,18 ----
dhcpsniff_LDADD = @PCAP_LIB@ @DNET_LIB@
! dhcpclient_SOURCES = dhcp-test.c dhcp-util.c \
dhcp-align.c dhcp-net.c dhcp-list.c dhcp-com.c dhcp-eth.c dhcp-ip.c \
dhcp-udp.c dhcp-arp.c dhcp-icmp.c dhcp-log.c dhcp-daemon.c \
***************
*** 21,25 ****
dhcp-client-states.c dhcp-options-strings.c dhcp-convert.c \
dhcp-sysconf.c dhcp-rtt.c dhcp-packet-build.c dhcp-icmp-discovery.c \
! dhcp-arp-discovery.c
dhcpclient_LDADD = @PCAP_LIB@ @DNET_LIB@
--- 21,25 ----
dhcp-client-states.c dhcp-options-strings.c dhcp-convert.c \
dhcp-sysconf.c dhcp-rtt.c dhcp-packet-build.c dhcp-icmp-discovery.c \
! dhcp-arp-discovery.c dhcp-route.c
dhcpclient_LDADD = @PCAP_LIB@ @DNET_LIB@
Index: Makefile.in
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/Makefile.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Makefile.in 18 May 2002 18:10:09 -0000 1.14
--- Makefile.in 19 May 2002 16:24:37 -0000 1.15
***************
*** 83,87 ****
dhcpsniff_LDADD = @PCAP_LIB@ @DNET_LIB@
! dhcpclient_SOURCES = dhcp-client.c dhcp-util.c dhcp-align.c dhcp-net.c dhcp-list.c dhcp-com.c dhcp-eth.c dhcp-ip.c dhcp-udp.c dhcp-arp.c dhcp-icmp.c dhcp-log.c dhcp-daemon.c dhcp-client-cache.c dhcp-cache-entry.c dhcp-client-control.c dhcp-interface.c dhcp-client-conf.c @DHCP_SNPRINTF@ dhcp-files.c dhcp-client-states.c dhcp-options-strings.c dhcp-convert.c dhcp-sysconf.c dhcp-rtt.c dhcp-packet-build.c dhcp-icmp-discovery.c dhcp-arp-discovery.c
--- 83,87 ----
dhcpsniff_LDADD = @PCAP_LIB@ @DNET_LIB@
! dhcpclient_SOURCES = dhcp-test.c dhcp-util.c dhcp-align.c dhcp-net.c dhcp-list.c dhcp-com.c dhcp-eth.c dhcp-ip.c dhcp-udp.c dhcp-arp.c dhcp-icmp.c dhcp-log.c dhcp-daemon.c dhcp-client-cache.c dhcp-cache-entry.c dhcp-client-control.c dhcp-interface.c dhcp-client-conf.c @DHCP_SNPRINTF@ dhcp-files.c dhcp-client-states.c dhcp-options-strings.c dhcp-convert.c dhcp-sysconf.c dhcp-rtt.c dhcp-packet-build.c dhcp-icmp-discovery.c dhcp-arp-discovery.c dhcp-route.c
***************
*** 110,114 ****
dhcpsniff_DEPENDENCIES =
dhcpsniff_LDFLAGS =
! dhcpclient_OBJECTS = dhcp-client.o dhcp-util.o dhcp-align.o dhcp-net.o \
dhcp-list.o dhcp-com.o dhcp-eth.o dhcp-ip.o dhcp-udp.o dhcp-arp.o \
dhcp-icmp.o dhcp-log.o dhcp-daemon.o dhcp-client-cache.o \
--- 110,114 ----
dhcpsniff_DEPENDENCIES =
dhcpsniff_LDFLAGS =
! dhcpclient_OBJECTS = dhcp-test.o dhcp-util.o dhcp-align.o dhcp-net.o \
dhcp-list.o dhcp-com.o dhcp-eth.o dhcp-ip.o dhcp-udp.o dhcp-arp.o \
dhcp-icmp.o dhcp-log.o dhcp-daemon.o dhcp-client-cache.o \
***************
*** 116,120 ****
dhcp-client-conf.o dhcp-files.o dhcp-client-states.o \
dhcp-options-strings.o dhcp-convert.o dhcp-sysconf.o dhcp-rtt.o \
! dhcp-packet-build.o dhcp-icmp-discovery.o dhcp-arp-discovery.o
dhcpclient_DEPENDENCIES =
dhcpclient_LDFLAGS =
--- 116,121 ----
dhcp-client-conf.o dhcp-files.o dhcp-client-states.o \
dhcp-options-strings.o dhcp-convert.o dhcp-sysconf.o dhcp-rtt.o \
! dhcp-packet-build.o dhcp-icmp-discovery.o dhcp-arp-discovery.o \
! dhcp-route.o
dhcpclient_DEPENDENCIES =
dhcpclient_LDFLAGS =
***************
*** 140,151 ****
.deps/dhcp-arp.P .deps/dhcp-cache-entry.P .deps/dhcp-client-cache.P \
.deps/dhcp-client-conf.P .deps/dhcp-client-control.P \
! .deps/dhcp-client-states.P .deps/dhcp-client.P .deps/dhcp-com.P \
! .deps/dhcp-convert.P .deps/dhcp-daemon.P .deps/dhcp-eth.P \
! .deps/dhcp-files.P .deps/dhcp-icmp-discovery.P .deps/dhcp-icmp.P \
! .deps/dhcp-interface.P .deps/dhcp-ip.P .deps/dhcp-list.P \
! .deps/dhcp-log.P .deps/dhcp-net.P .deps/dhcp-options-strings.P \
! .deps/dhcp-packet-build.P .deps/dhcp-print.P .deps/dhcp-rtt.P \
.deps/dhcp-sniff.P .deps/dhcp-sniffer-ohandlers.P .deps/dhcp-sysconf.P \
! .deps/dhcp-udp.P .deps/dhcp-util.P
SOURCES = $(dhcpsniff_SOURCES) $(dhcpclient_SOURCES)
OBJECTS = $(dhcpsniff_OBJECTS) $(dhcpclient_OBJECTS)
--- 141,152 ----
.deps/dhcp-arp.P .deps/dhcp-cache-entry.P .deps/dhcp-client-cache.P \
.deps/dhcp-client-conf.P .deps/dhcp-client-control.P \
! .deps/dhcp-client-states.P .deps/dhcp-com.P .deps/dhcp-convert.P \
! .deps/dhcp-daemon.P .deps/dhcp-eth.P .deps/dhcp-files.P \
! .deps/dhcp-icmp-discovery.P .deps/dhcp-icmp.P .deps/dhcp-interface.P \
! .deps/dhcp-ip.P .deps/dhcp-list.P .deps/dhcp-log.P .deps/dhcp-net.P \
! .deps/dhcp-options-strings.P .deps/dhcp-packet-build.P \
! .deps/dhcp-print.P .deps/dhcp-route.P .deps/dhcp-rtt.P \
.deps/dhcp-sniff.P .deps/dhcp-sniffer-ohandlers.P .deps/dhcp-sysconf.P \
! .deps/dhcp-test.P .deps/dhcp-udp.P .deps/dhcp-util.P
SOURCES = $(dhcpsniff_SOURCES) $(dhcpclient_SOURCES)
OBJECTS = $(dhcpsniff_OBJECTS) $(dhcpclient_OBJECTS)
Index: configure
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/configure,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** configure 14 Feb 2002 10:43:34 -0000 1.10
--- configure 19 May 2002 16:24:37 -0000 1.11
***************
*** 1,5 ****
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
! # Generated by Autoconf 2.50 for dhcp-agent 0.351a.
#
# Report bugs to <tm...@wh...>.
--- 1,5 ----
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
! # Generated by Autoconf 2.50 for dhcp-agent 0.36.
#
# Report bugs to <tm...@wh...>.
***************
*** 145,150 ****
PACKAGE_NAME='dhcp-agent'
PACKAGE_TARNAME='dhcp-agent'
! PACKAGE_VERSION='0.351a'
! PACKAGE_STRING='dhcp-agent 0.351a'
PACKAGE_BUGREPORT='tm...@wh...'
--- 145,150 ----
PACKAGE_NAME='dhcp-agent'
PACKAGE_TARNAME='dhcp-agent'
! PACKAGE_VERSION='0.36'
! PACKAGE_STRING='dhcp-agent 0.36'
PACKAGE_BUGREPORT='tm...@wh...'
***************
*** 554,558 ****
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<EOF
! \`configure' configures dhcp-agent 0.351a to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
--- 554,558 ----
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<EOF
! \`configure' configures dhcp-agent 0.36 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
***************
*** 616,620 ****
if test -n "$ac_init_help"; then
case $ac_init_help in
! short | recursive ) echo "Configuration of dhcp-agent 0.351a:";;
esac
cat <<\EOF
--- 616,620 ----
if test -n "$ac_init_help"; then
case $ac_init_help in
! short | recursive ) echo "Configuration of dhcp-agent 0.36:";;
esac
cat <<\EOF
***************
*** 682,686 ****
if $ac_init_version; then
cat <<\EOF
! dhcp-agent configure 0.351a
generated by GNU Autoconf 2.50
--- 682,686 ----
if $ac_init_version; then
cat <<\EOF
! dhcp-agent configure 0.36
generated by GNU Autoconf 2.50
***************
*** 697,701 ****
running configure, to aid debugging if configure makes a mistake.
! It was created by dhcp-agent $as_me 0.351a, which was
generated by GNU Autoconf 2.50. Invocation command line was
--- 697,701 ----
running configure, to aid debugging if configure makes a mistake.
! It was created by dhcp-agent $as_me 0.36, which was
generated by GNU Autoconf 2.50. Invocation command line was
***************
*** 1103,1107 ****
PACKAGE=dhcp-agent
! VERSION=0.351a
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
--- 1103,1107 ----
PACKAGE=dhcp-agent
! VERSION=0.36
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
***************
*** 3016,3020 ****
cat >>$CONFIG_STATUS <<EOF
ac_cs_version="\\
! dhcp-agent config.status 0.351a
configured by $0, generated by GNU Autoconf 2.50,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
--- 3016,3020 ----
cat >>$CONFIG_STATUS <<EOF
ac_cs_version="\\
! dhcp-agent config.status 0.36
configured by $0, generated by GNU Autoconf 2.50,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
***************
*** 3104,3108 ****
## ----------------------- ##
! This file was extended by $as_me (dhcp-agent 0.351a) 2.50, executed with
> $ac_cs_invocation
on `(hostname || uname -n) 2>/dev/null | sed 1q`
--- 3104,3108 ----
## ----------------------- ##
! This file was extended by $as_me (dhcp-agent 0.36) 2.50, executed with
> $ac_cs_invocation
on `(hostname || uname -n) 2>/dev/null | sed 1q`
Index: dhcp-agent.h
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-agent.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** dhcp-agent.h 19 May 2002 00:34:22 -0000 1.33
--- dhcp-agent.h 19 May 2002 16:24:37 -0000 1.34
***************
*** 552,555 ****
--- 552,559 ----
extern int arp_discover_hardware_address(rawnet_t *net, int retries, uint32_t address, eth_addr_t *mac_addr);
+ /* routing table routines. */
+
+ extern int route_find(rawnet_t *net, ip_addr_t addr, eth_addr_t *dest_mac);
+
/* Daemon routines. */
***************
*** 757,760 ****
--- 761,766 ----
extern unsigned char *arp_get_sender_protocol_address(arp_obj *arp);
+ extern int arp_read_packet_image(arp_obj *arp, const unsigned char *packet, int len);
+
/* UDP obj routines. */
***************
*** 800,803 ****
--- 806,811 ----
extern void align_icmp_mask(const unsigned char *data, struct icmp_msg_mask *header);
extern void align_icmp_echo(const unsigned char *data, struct icmp_msg_echo *header);
+ extern void align_arp_header(const unsigned char *data, struct arp_hdr *header);
+ extern void align_arp_data(const unsigned char *data, struct arp_ethip *arp_data);
/* Linked List routines. */
Index: dhcp-align.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-align.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** dhcp-align.c 12 Feb 2002 15:23:59 -0000 1.4
--- dhcp-align.c 19 May 2002 16:24:37 -0000 1.5
***************
*** 195,196 ****
--- 195,229 ----
return;
}
+
+ void align_arp_header(const unsigned char *data, struct arp_hdr *header)
+ {
+ memcpy(&header->ar_hrd, data, sizeof(header->ar_hrd));
+ data += sizeof(header->ar_hrd);
+
+ memcpy(&header->ar_pro, data, sizeof(header->ar_pro));
+ data += sizeof(header->ar_pro);
+
+ memcpy(&header->ar_hln, data, sizeof(header->ar_hln));
+ data += sizeof(header->ar_hln);
+
+ memcpy(&header->ar_pln, data, sizeof(header->ar_pln));
+ data += sizeof(header->ar_pln);
+
+ memcpy(&header->ar_op, data, sizeof(header->ar_op));
+
+ return;
+ }
+
+ void align_arp_data(const unsigned char *data, struct arp_ethip *arp_data)
+ {
+ memcpy(&arp_data->ar_sha, data, sizeof(arp_data->ar_sha));
+ data += sizeof(arp_data->ar_sha);
+
+ memcpy(&arp_data->ar_spa, data, sizeof(arp_data->ar_spa));
+ data += sizeof(arp_data->ar_spa);
+
+ memcpy(&arp_data->ar_tha, data, sizeof(arp_data->ar_tha));
+ data += sizeof(arp_data->ar_tha);
+
+ memcpy(&arp_data->ar_tpa, data, sizeof(arp_data->ar_tpa));
+ }
Index: dhcp-arp-discovery.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-arp-discovery.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** dhcp-arp-discovery.c 25 Feb 2002 01:39:29 -0000 1.1
--- dhcp-arp-discovery.c 19 May 2002 16:24:37 -0000 1.2
***************
*** 47,50 ****
--- 47,55 ----
* and op type. */
+ info_message("%d %d %d %d %d %d", net->type, arp_get_hardware_type(net->arp_p),
+ arp_get_protocol_type(net->arp_p), arp_get_hardware_len(net->arp_p),
+ arp_get_protocol_len(net->arp_p), arp_get_op(net->arp_p));
+
+
if((net->type == RAWNET_ARP) &&
(arp_get_hardware_type(net->arp_p) == ARP_HRD_ETH) &&
***************
*** 64,68 ****
}
! extern int arp_discover_hardware_address(rawnet_t *net, int retries, uint32_t address, eth_addr_t *mac_addr)
{
list_t *arg_list = NULL;
--- 69,73 ----
}
! int arp_discover_hardware_address(rawnet_t *net, int retries, uint32_t address, eth_addr_t *mac_addr)
{
list_t *arg_list = NULL;
***************
*** 72,77 ****
arg_list = add_to_list(arg_list, net);
! build_arp_request(net, 0, address, net->hw_addr); /* 0 for source ip, address to discover for dest,
! * our hardware address so we get a reply back. */
while(retries--) {
--- 77,82 ----
arg_list = add_to_list(arg_list, net);
! build_arp_request(net, net->ip_addr, address, net->hw_addr); /* 0 for source ip, address to discover for dest,
! * our hardware address so we get a reply back. */
while(retries--) {
Index: dhcp-arp.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-arp.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** dhcp-arp.c 25 Feb 2002 01:39:29 -0000 1.7
--- dhcp-arp.c 19 May 2002 16:24:37 -0000 1.8
***************
*** 100,104 ****
uint16_t arp_get_op(arp_obj *arp)
{
! return(arp->header.ar_op);
}
--- 100,104 ----
uint16_t arp_get_op(arp_obj *arp)
{
! return(ntohs(arp->header.ar_op));
}
***************
*** 164,165 ****
--- 164,179 ----
return;
}
+
+ int arp_read_packet_image(arp_obj *arp, const unsigned char *packet, int len)
+ {
+ if(len < (ARP_HDR_LEN + ARP_ETHIP_LEN))
+ return -1;
+
+ align_arp_header(packet, &arp->header);
+ packet += ARP_HDR_LEN;
+
+ align_arp_data(packet, &arp->arp_data);
+
+ return 0;
+ }
+
Index: dhcp-files.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-files.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** dhcp-files.c 9 Feb 2002 16:22:35 -0000 1.5
--- dhcp-files.c 19 May 2002 16:24:37 -0000 1.6
***************
*** 21,24 ****
--- 21,25 ----
*
* Handles our variable files.
+ *
*/
Index: dhcp-icmp-discovery.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-icmp-discovery.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** dhcp-icmp-discovery.c 25 Feb 2002 01:39:29 -0000 1.2
--- dhcp-icmp-discovery.c 19 May 2002 16:24:37 -0000 1.3
***************
*** 176,180 ****
/* No arp reply. Skip. */
warn_message("icmp rtt discovery: could not ARP for address for %s -- skipping", network_address_to_string_static(*host_addr));
! break;
}
--- 176,180 ----
/* No arp reply. Skip. */
warn_message("icmp rtt discovery: could not ARP for address for %s -- skipping", network_address_to_string_static(*host_addr));
! continue;
}
***************
*** 245,248 ****
--- 245,249 ----
}
+ xfree(latency); /* free our latency array. */
rtts = add_to_list(rtts, average_latency);
}
Index: dhcp-net.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-net.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** dhcp-net.c 19 May 2002 00:34:22 -0000 1.18
--- dhcp-net.c 19 May 2002 16:24:37 -0000 1.19
***************
*** 428,432 ****
case ETH_TYPE_ARP:
! break;
case ETH_TYPE_IP:
--- 428,436 ----
case ETH_TYPE_ARP:
! if(arp_read_packet_image(net->arp_p, packet, pkthdr.caplen) < 0)
! return RAWNET_MALFORMED_PACKET;
!
! net->type = RAWNET_ARP;
! return RAWNET_OK;
case ETH_TYPE_IP:
|