Some commercial middleware uses PGM for their communication but instead
of sending patckets using the UDP protocol it embeds PGM in UDP packets.

This patch allows tcpdump to decode that information if the option

        -T pgm

is specified.

This patch was posted more than a year ago to the Linux
netdev mailing list.

See 
http://www.gossamer-threads.com/lists/linux/kernel/1207426?do=post_view_threaded#1207426

Signed-off-by: Christoph Lameter <c...@linux.com>

Index: tcpdump/interface.h
===================================================================
--- tcpdump.orig/interface.h    2011-07-05 11:21:58.708809363 -0500
+++ tcpdump/interface.h 2011-07-05 12:01:21.165803777 -0500
@@ -70,6 +70,7 @@
 #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_PGM         10      /* The PGM protocol */

 #ifndef min
 #define min(a,b) ((a)>(b)?(b):(a))
Index: tcpdump/print-udp.c
===================================================================
--- tcpdump.orig/print-udp.c    2011-07-05 11:21:58.768808873 -0500
+++ tcpdump/print-udp.c 2011-07-05 12:01:21.165803777 -0500
@@ -460,6 +460,11 @@
                        tftp_print(cp, length);
                        break;

+               case PT_PGM:
+                       udpipaddr_print(ip, sport, dport);
+                       pgm_print(cp, length, (const u_char *)ip);
+                       break;
+
                case PT_AODV:
                        udpipaddr_print(ip, sport, dport);
                        aodv_print((const u_char *)(up + 1), length,
Index: tcpdump/tcpdump.c
===================================================================
--- tcpdump.orig/tcpdump.c      2011-07-05 11:21:58.780808705 -0500
+++ tcpdump/tcpdump.c   2011-07-05 12:01:21.173803458 -0500
@@ -927,6 +927,8 @@
                                packettype = PT_TFTP;
                        else if (strcasecmp(optarg, "aodv") == 0)
                                packettype = PT_AODV;
+                       else if (strcasecmp(optarg, "pgm") == 0)
+                               packettype = PT_PGM;
                        else
                                error("unknown packet type `%s'", optarg);
                        break;
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.

Reply via email to