]> The Tcpdump Group git mirrors - tcpdump/commitdiff
basic preparations for mpls lsp ping decoding
authorhannes <hannes>
Thu, 8 May 2003 15:05:41 +0000 (15:05 +0000)
committerhannes <hannes>
Thu, 8 May 2003 15:05:41 +0000 (15:05 +0000)
interface.h
print-mpls.c
print-udp.c

index 29b6f9b227d348b95fb8f3db02d16180615432db..535cbe7a366b5e4b161e700b22021a36058f33ae 100644 (file)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.209 2003-05-02 08:13:54 itojun Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.210 2003-05-08 15:05:42 hannes Exp $ (LBL)
  */
 
 #ifndef tcpdump_interface_h
@@ -302,6 +302,7 @@ extern void lwres_print(const u_char *, u_int);
 extern void pptp_print(const u_char *);
 extern void sctp_print(const u_char *, const u_char *, u_int);
 extern void mpls_print(const u_char *, u_int);
+extern void mpls_lsp_ping_print(const u_char *, u_int);
 extern void zephyr_print(const u_char *, int);
 extern void hsrp_print(const u_char *, u_int);
 
index 34297dd04b608a33c2a2229ca71babac1e960d0f..67e974bb36122790f8b490786384e9c7bb5f7633 100644 (file)
@@ -28,7 +28,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-mpls.c,v 1.6 2003-02-04 06:26:59 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-mpls.c,v 1.7 2003-05-08 15:05:41 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -184,3 +184,13 @@ trunc:
        printf("[|MPLS]");
 }
 
+/*
+ * draft-ietf-mpls-lsp-ping-02.txt
+ */
+void
+mpls_lsp_ping_print(const u_char *pptr, u_int length)
+{
+    printf("UDP, LSP-PING, length: %u", length);
+    if (vflag >1)
+       print_unknown_data(pptr,"\n\t  ", length);
+}
index db3bf2ee9a06d3888c6604c55bffeb9a7d42a7da..7f6cc847ebee2105fdea3542623938ccd435db66 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.115 2003-05-01 18:02:13 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.116 2003-05-08 15:05:42 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -390,6 +390,7 @@ static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up,
 #define LWRES_PORT             921
 #define ZEPHYR_SRV_PORT                2103
 #define ZEPHYR_CLT_PORT                2104
+#define MPLS_LSP_PING_PORT      3503 /* draft-ietf-mpls-lsp-ping-02.txt */
 
 #ifdef INET6
 #define RIPNG_PORT 521         /*XXX*/
@@ -664,6 +665,8 @@ udp_print(register const u_char *bp, u_int length,
                        lwres_print((const u_char *)(up + 1), length);
                 else if (ISPORT(LDP_PORT))
                        ldp_print((const u_char *)(up + 1), length);
+                else if (ISPORT(MPLS_LSP_PING_PORT))
+                       mpls_lsp_ping_print((const u_char *)(up + 1), length);
                else
                        (void)printf("udp %u",
                            (u_int32_t)(ulen - sizeof(*up)));