]> The Tcpdump Group git mirrors - tcpdump/commitdiff
use existing PGM decoder for UDP-encapsulated PGM
authorDenis Ovsienko <[email protected]>
Thu, 14 Mar 2013 17:17:53 +0000 (21:17 +0400)
committerMichael Richardson <[email protected]>
Sun, 14 Apr 2013 22:20:26 +0000 (18:20 -0400)
The original PGM uses its own IP protocol number. "EPGM" or "PGM/UDP"
stands for UDP-encapsulated PGM, which has no assigned UDP port number
and can be decoded only by means of -T option, which now accepts "pgm"
protocol type for this purpose. There is also a sample capture of EPGM
now (similar to the one of native PGM, but produced using the "epgm://"
protocol schema) and a respective test case.

interface.h
netdissect.h
print-udp.c
tcpdump.1.in
tcpdump.c
tests/TESTLIST
tests/epgm_zmtp1.pcap [new file with mode: 0644]
tests/epgmv.out [new file with mode: 0644]

index 5703f3d5c63be9cd2322e9cad34ecd5e868cdfe5..053d30511064cd6903091e3096b755983c15cdcc 100644 (file)
@@ -74,6 +74,7 @@ extern char *strsep(char **, const char *);
 #define PT_RADIUS      11      /* RADIUS authentication Protocol */
 #define PT_ZMTP1       12      /* ZeroMQ Message Transport Protocol 1.0 */
 #define PT_VXLAN       13      /* Virtual eXtensible Local Area Network */
+#define PT_PGM         14      /* [UDP-encapsulated] Pragmatic General Multicast */
 
 #ifndef min
 #define min(a,b) ((a)>(b)?(b):(a))
index da52e4634fbb5a2947805b6d336fd765485820be..a808f2e03b61f9bb4efe8fac7f87585d73de6f71 100644 (file)
@@ -183,6 +183,7 @@ struct netdissect_options {
 #define PT_RADIUS      11      /* RADIUS authentication Protocol */
 #define PT_ZMTP1       12      /* ZeroMQ Message Transport Protocol 1.0 */
 #define PT_VXLAN       13      /* Virtual eXtensible Local Area Network */
+#define PT_PGM         14      /* [UDP-encapsulated] Pragmatic General Multicast */
 
 #ifndef min
 #define min(a,b) ((a)>(b)?(b):(a))
index 3c5ed8bcc47bc9f1381de6cd404b036706578d25..ebb947d89516652a3dc06c7673b56ecf52f70309 100644 (file)
@@ -479,6 +479,11 @@ udp_print(register const u_char *bp, u_int length,
                        udpipaddr_print(ip, sport, dport);
                        vxlan_print((const u_char *)(up + 1), length);
                        break;
+
+               case PT_PGM:
+                       udpipaddr_print(ip, sport, dport);
+                       pgm_print(cp, length, bp2);
+                       break;
                }
                return;
        }
index cb2fbdd378e9cd61378f2452acd1408359e7eda2..c2569db3c3843b81f25c13f2c1af56d2dc631d56 100644 (file)
@@ -519,6 +519,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),
+\fBpgm\fR (Pragmatic General Multicast),
 \fBradius\fR (RADIUS),
 \fBrpc\fR (Remote Procedure Call),
 \fBrtp\fR (Real-Time Applications protocol),
@@ -530,6 +531,10 @@ Currently known types are
 \fBzmtp1\fR (ZeroMQ Message Transport Protocol 1.0)
 and
 \fBvxlan\fR (Virtual eXtensible Local Area Network).
+.IP
+Note that the \fBpgm\fR type above affects UDP interpretation only, the native
+PGM is always recognised as IP protocol 113 regardless. UDP-encapsulated PGM is
+often called "EPGM" or "PGM/UDP".
 .TP
 .B \-t
 \fIDon't\fP print a timestamp on each dump line.
index a4e8bf5a0e29a241372ab91c204bc6cab5600347..a32701cf459d46cf9afa7392d815c6c1f7211dc2 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1015,6 +1015,8 @@ main(int argc, char **argv)
                                packettype = PT_ZMTP1;
                        else if (strcasecmp(optarg, "vxlan") == 0)
                                packettype = PT_VXLAN;
+                       else if (strcasecmp(optarg, "pgm") == 0)
+                               packettype = PT_PGM;
                        else
                                error("unknown packet type `%s'", optarg);
                        break;
index a2e83480531bc974389b2d41497d026b214654e1..a73474f89cfe82a3a93b6b6153c89d819d713826 100644 (file)
@@ -94,6 +94,8 @@ dhcpv6-ia-ta  dhcpv6-ia-ta.pcap       dhcpv6-ia-ta.out        -t -v
 zmtp1v         zmtp1.pcap              zmtp1.out       -t -v -T zmtp1
 # native PGM
 pgmv           pgm_zmtp1.pcap          pgmv.out        -t -v
+# UDP-encapsulated PGM
+epgmv          epgm_zmtp1.pcap         epgmv.out       -t -v -T pgm
 
 # MS NLB tests
 msnlb          msnlb.pcap              msnlb.out       -t
diff --git a/tests/epgm_zmtp1.pcap b/tests/epgm_zmtp1.pcap
new file mode 100644 (file)
index 0000000..1883579
Binary files /dev/null and b/tests/epgm_zmtp1.pcap differ
diff --git a/tests/epgmv.out b/tests/epgmv.out
new file mode 100644 (file)
index 0000000..ffa1b82
--- /dev/null
@@ -0,0 +1,30 @@
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 471 trail 0 lead 281 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 472 trail 0 lead 281 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 473 trail 0 lead 281 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 474 trail 0 lead 281 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 475 trail 0 lead 281 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 1480)
+    10.0.0.45.40251 > 239.255.0.16.5563: 39236 > 5563: PGM, length 1428 0x47e3fdad9a9c ODATA trail 0 seq 282 [1452]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 1480)
+    10.0.0.45.40251 > 239.255.0.16.5563: 39236 > 5563: PGM, length 1428 0x47e3fdad9a9c ODATA trail 0 seq 283 [1452]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 173)
+    10.0.0.45.40251 > 239.255.0.16.5563: 39236 > 5563: PGM, length 121 0x47e3fdad9a9c ODATA trail 0 seq 284 [145]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 476 trail 0 lead 284 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 1, id 0, offset 0, flags [DF], proto UDP (17), length 44)
+    10.0.0.45.46357 > 239.255.0.16.5563: 5563 > 39236: PGM, length 0 0x47e3fdad9a9c SPMR [16]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 477 trail 0 lead 284 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 478 trail 0 lead 284 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 479 trail 0 lead 284 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 480 trail 0 lead 284 nla 10.0.0.45 [36]
+IP (tos 0xb8, ttl 16, id 0, offset 0, flags [DF], proto UDP (17), length 64)
+    10.0.0.45.33280 > 239.255.0.16.5563: 39236 > 5563: PGM, length 0 0x47e3fdad9a9c SPM seq 481 trail 0 lead 284 nla 10.0.0.45 [36]