From: Guy Harris Date: Sat, 30 Jun 2012 22:59:18 +0000 (-0700) Subject: Add "radius" as an option for -T. X-Git-Tag: tcpdump-4.4.0~41 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/42ab2e753f85fff7f8c974c2f8c93716fa101897?ds=sidebyside;hp=-c Add "radius" as an option for -T. This allows tcpdump to handle RADIUS running on non-standard ports. Submitted-By: ssb@sourceforge.net Man page also updated by me. --- 42ab2e753f85fff7f8c974c2f8c93716fa101897 diff --git a/interface.h b/interface.h index fc049032..8602d470 100644 --- a/interface.h +++ b/interface.h @@ -71,6 +71,7 @@ extern char *strsep(char **, const char *); #define PT_TFTP 8 /* trivial file transfer protocol */ #define PT_AODV 9 /* Ad-hoc On-demand Distance Vector Protocol */ #define PT_CARP 10 /* Common Address Redundancy Protocol */ +#define PT_RADIUS 11 /* RADIUS authentication Protocol */ #ifndef min #define min(a,b) ((a)>(b)?(b):(a)) diff --git a/netdissect.h b/netdissect.h index d396fc72..26df79cb 100644 --- a/netdissect.h +++ b/netdissect.h @@ -177,6 +177,10 @@ struct netdissect_options { #define PT_RTCP 5 /* Real-Time Applications control protocol */ #define PT_SNMP 6 /* Simple Network Management Protocol */ #define PT_CNFP 7 /* Cisco NetFlow protocol */ +#define PT_TFTP 8 /* trivial file transfer protocol */ +#define PT_AODV 9 /* Ad-hoc On-demand Distance Vector Protocol */ +#define PT_CARP 10 /* Common Address Redundancy Protocol */ +#define PT_RADIUS 11 /* RADIUS authentication Protocol */ #ifndef min #define min(a,b) ((a)>(b)?(b):(a)) diff --git a/print-udp.c b/print-udp.c index 885d42e4..e321f218 100644 --- a/print-udp.c +++ b/print-udp.c @@ -469,6 +469,11 @@ udp_print(register const u_char *bp, u_int length, 0); #endif break; + + case PT_RADIUS: + udpipaddr_print(ip, sport, dport); + radius_print(cp, length); + break; } return; } diff --git a/tcpdump.1.in b/tcpdump.1.in index fad4304a..a5a2fc81 100644 --- a/tcpdump.1.in +++ b/tcpdump.1.in @@ -511,6 +511,7 @@ Currently known types are \fBaodv\fR (Ad-hoc On-demand Distance Vector protocol), \fBcarp\fR (Common Address Redundancy Protocol), \fBcnfp\fR (Cisco NetFlow protocol), +\fBradius\fR (RADIUS), \fBrpc\fR (Remote Procedure Call), \fBrtp\fR (Real-Time Applications protocol), \fBrtcp\fR (Real-Time Applications control protocol), diff --git a/tcpdump.c b/tcpdump.c index f6b3f34b..f21ec355 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -465,7 +465,9 @@ show_dlts_and_exit(const char *device, pcap_t *pd) dlts[n_dlts]); } } +#ifdef HAVE_PCAP_FREE_DATALINKS pcap_free_datalinks(dlts); +#endif exit(0); } @@ -959,6 +961,8 @@ main(int argc, char **argv) packettype = PT_AODV; else if (strcasecmp(optarg, "carp") == 0) packettype = PT_CARP; + else if (strcasecmp(optarg, "radius") == 0) + packettype = PT_RADIUS; else error("unknown packet type `%s'", optarg); break;