summaryrefslogtreecommitdiff
path: root/print-udp.c
diff options
context:
space:
mode:
authorguy <guy>2003-09-12 22:05:56 +0000
committerguy <guy>2003-09-12 22:05:56 +0000
commitcd8e2f4ca0c5efca12721442613b4f70492b7226 (patch)
tree66f762572f23f21ffed36fddaf58429937857369 /print-udp.c
parent88664d9c43dcd170c1195daf69495bfc0eca70e5 (diff)
downloadtcpdump-cd8e2f4ca0c5efca12721442613b4f70492b7226.tar.gz
Updates from Bruce Simpson:
Fix numerous bugs in my AODV submission, red faces all round, mainly due to misunderstanding of EXTRACT_STRING() macro arguments (because these are macros, type checking didn't happen). AODV HELLO extensions are now correctly printed. The code is closer to FreeBSD's style guidelines. Don't use "u_char" and "u_long", use "u_int8_t" and "u_int32_t". "u_long" is definitely wrong as it's 64 bits on some platforms; "u_char" is safe, but the official tcpdump style uses "u_int8_t". At least according to the (long-since-expired) draft-perkins-aodv6-01, the V6 AODV messages have different message type values from the V4 ones in draft-ietf-manet-aodv-13. However, draft-ietf-manet-aodv-13 says that the only differences are in the addresses; we support both. Clean up the way we tell the AODV6 dissector that we're running atop IPv6 a bit. Use "udpipaddr_print()" if we're printing AODV packets as a result of saying "anything that matches this filter is AODV", rather than doing it ourselves under the assumption that it's running over IPv4.
Diffstat (limited to 'print-udp.c')
-rw-r--r--print-udp.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/print-udp.c b/print-udp.c
index 46f66e9e..e289be61 100644
--- a/print-udp.c
+++ b/print-udp.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.120 2003-08-06 06:49:40 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.121 2003-09-12 22:05:57 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -562,15 +562,12 @@ udp_print(register const u_char *bp, u_int length,
break;
case PT_AODV:
- (void)printf("%s.%s > %s.%s: ",
- ipaddr_string(&ip->ip_src),
- udpport_string(sport),
- ipaddr_string(&ip->ip_dst),
- udpport_string(dport));
+ udpipaddr_print(ip, sport, dport);
+ aodv_print((const u_char *)(up + 1), length,
#ifdef INET6
- aodv_print((void *)(up + 1), length, (void *) ip6);
+ ip6 != NULL);
#else
- aodv_print((void *)(up + 1), length, NULL);
+ FALSE);
#endif
break;
}
@@ -651,10 +648,11 @@ udp_print(register const u_char *bp, u_int length,
else if (ISPORT(RIP_PORT))
rip_print((const u_char *)(up + 1), length);
else if (ISPORT(AODV_PORT))
+ aodv_print((const u_char *)(up + 1), length,
#ifdef INET6
- aodv_print((const u_char *)(up + 1), length, (void *) ip6);
+ ip6 != NULL);
#else
- aodv_print((const u_char *)(up + 1), length, NULL);
+ FALSE);
#endif
else if (ISPORT(ISAKMP_PORT))
isakmp_print((const u_char *)(up + 1), length, bp2);