summaryrefslogtreecommitdiffstats
path: root/listen/arpdump.c
diff options
context:
space:
mode:
authorTerry Dawson VK2KTJ <terry@animats.net>2001-09-12 13:18:43 +0000
committerTerry Dawson VK2KTJ <terry@animats.net>2001-09-12 13:18:43 +0000
commit0eb707fdcf1b87e71bb3a9eaa8472d0b05799a3d (patch)
treeb2db8371470b697e3ae8a19b1e78c7805046f2d2 /listen/arpdump.c
parent628edceba5f1485ef7c4ef30fba93b4c0c0dd955 (diff)
updated libtool, uniformly indented source, corrected small ax25mond Makefile bug
Diffstat (limited to 'listen/arpdump.c')
-rw-r--r--listen/arpdump.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/listen/arpdump.c b/listen/arpdump.c
index c399098..ef94c00 100644
--- a/listen/arpdump.c
+++ b/listen/arpdump.c
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/ax25-cvs/ax25-apps/listen/arpdump.c,v 1.1 2001/04/10 01:58:51 csmall Exp $ */
+/* @(#) $Header: /home/ax25-cvs/ax25-apps/listen/arpdump.c,v 1.2 2001/09/12 13:18:43 terry Exp $ */
/* ARP packet tracing routines
* Copyright 1991 Phil Karn, KA9Q
@@ -31,20 +31,18 @@ void arp_dump(unsigned char *data, int length)
lprintf(T_PROTOCOL, "ARP: ");
lprintf(T_IPHDR, "len %d", length);
- if (length < 16)
- {
+ if (length < 16) {
lprintf(T_ERROR, " bad packet\n");
return;
}
- hardware = get16(data + 0);
- protocol = get16(data + 2);
- hwlen = data[4];
- pralen = data[5];
+ hardware = get16(data + 0);
+ protocol = get16(data + 2);
+ hwlen = data[4];
+ pralen = data[5];
operation = get16(data + 6);
-
- if (hardware != ARP_AX25)
- {
+
+ if (hardware != ARP_AX25) {
lprintf(T_IPHDR, " non-AX25 ARP packet\n");
return;
}
@@ -57,18 +55,14 @@ void arp_dump(unsigned char *data, int length)
if (hwlen != AXALEN)
lprintf(T_IPHDR, " hwlen %d", hwlen);
- if (protocol == PID_IP)
- {
+ if (protocol == PID_IP) {
lprintf(T_IPHDR, " prot IP");
is_ip = 1;
- }
- else
- {
+ } else {
lprintf(T_IPHDR, " prot 0x%x prlen %d", protocol, pralen);
}
- switch (operation)
- {
+ switch (operation) {
case ARP_REQUEST:
lprintf(T_IPHDR, " op REQUEST");
break;
@@ -85,21 +79,23 @@ void arp_dump(unsigned char *data, int length)
lprintf(T_IPHDR, " op %d", operation);
break;
}
-
- shwaddr = data + 8;
+
+ shwaddr = data + 8;
sprotaddr = shwaddr + hwlen;
-
- thwaddr = sprotaddr + pralen;
- tprotaddr = thwaddr + hwlen;
-
+
+ thwaddr = sprotaddr + pralen;
+ tprotaddr = thwaddr + hwlen;
+
lprintf(T_IPHDR, "\nsender");
- if (is_ip) lprintf(T_ADDR, " IPaddr %d.%d.%d.%d",
+ if (is_ip)
+ lprintf(T_ADDR, " IPaddr %d.%d.%d.%d",
sprotaddr[0], sprotaddr[1],
sprotaddr[2], sprotaddr[3]);
lprintf(T_IPHDR, " hwaddr %s\n", pax25(tmp, shwaddr));
- lprintf(T_IPHDR,"target");
- if (is_ip) lprintf(T_ADDR, " IPaddr %d.%d.%d.%d",
+ lprintf(T_IPHDR, "target");
+ if (is_ip)
+ lprintf(T_ADDR, " IPaddr %d.%d.%d.%d",
tprotaddr[0], tprotaddr[1],
tprotaddr[2], tprotaddr[3]);
if (*thwaddr != 0)