]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add "radius" as an option for -T.
authorGuy Harris <[email protected]>
Sat, 30 Jun 2012 22:59:18 +0000 (15:59 -0700)
committerGuy Harris <[email protected]>
Sat, 30 Jun 2012 22:59:18 +0000 (15:59 -0700)
This allows tcpdump to handle RADIUS running on non-standard ports.

Submitted-By: [email protected]
Man page also updated by me.

interface.h
netdissect.h
print-udp.c
tcpdump.1.in
tcpdump.c

index fc049032e8a7e94932905e0dc064fe1eb76ff6fb..8602d470085c590e1392cd29b1d8ce699a018ab3 100644 (file)
@@ -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_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))
 
 #ifndef min
 #define min(a,b) ((a)>(b)?(b):(a))
index d396fc724bc7518fd10a50971e8716c13157ac40..26df79cb6e10b6adc6b2919b98beccb74715b6f9 100644 (file)
@@ -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_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))
 
 #ifndef min
 #define min(a,b) ((a)>(b)?(b):(a))
index 885d42e4da0c201e1bafa0bdba38d99147cf6de5..e321f2182b0697e75eac4aa0477bb3f943f69d20 100644 (file)
@@ -469,6 +469,11 @@ udp_print(register const u_char *bp, u_int length,
                            0);
 #endif
                        break;
                            0);
 #endif
                        break;
+
+               case PT_RADIUS:
+                       udpipaddr_print(ip, sport, dport);
+                       radius_print(cp, length);
+                       break;
                }
                return;
        }
                }
                return;
        }
index fad4304a06d9a8b25454e9e2b665168946747be0..a5a2fc81f50c655f157cf404987613eeb42a2691 100644 (file)
@@ -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),
 \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),
 \fBrpc\fR (Remote Procedure Call),
 \fBrtp\fR (Real-Time Applications protocol),
 \fBrtcp\fR (Real-Time Applications control protocol),
index f6b3f34b538b351560a9703b3d79389a88c99f81..f21ec355943c8b0d817a801365bfd1ef1aedb037 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -465,7 +465,9 @@ show_dlts_and_exit(const char *device, pcap_t *pd)
                            dlts[n_dlts]);
                }
        }
                            dlts[n_dlts]);
                }
        }
+#ifdef HAVE_PCAP_FREE_DATALINKS
        pcap_free_datalinks(dlts);
        pcap_free_datalinks(dlts);
+#endif
        exit(0);
 }
 
        exit(0);
 }
 
@@ -959,6 +961,8 @@ main(int argc, char **argv)
                                packettype = PT_AODV;
                        else if (strcasecmp(optarg, "carp") == 0)
                                packettype = PT_CARP;
                                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;
                        else
                                error("unknown packet type `%s'", optarg);
                        break;