]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-juniper.c
add GRE and RSVP to the supported IPv6 protos
[tcpdump] / print-juniper.c
index fc0fd904b665e5d5ed6286ee41a79f18670ce689..92ef4534577ccd7bf93b72e91f3f985af4b0104d 100644 (file)
@@ -15,7 +15,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.8.2.10 2005-06-03 22:03:48 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.8.2.13 2005-06-20 07:45:05 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -34,6 +34,7 @@ static const char rcsid[] _U_ =
 #include "llc.h"
 #include "nlpid.h"
 #include "ethertype.h"
+#include "atm.h"
 
 #define JUNIPER_BPF_OUT           0       /* Outgoing packet */
 #define JUNIPER_BPF_IN            1       /* Incoming packet */
@@ -403,9 +404,11 @@ juniper_mlppp_print(const struct pcap_pkthdr *h, register const u_char *p)
         case JUNIPER_LSQ_L3_PROTO_IPV4:
             ip_print(gndo, p, l2info.length);
             return l2info.header_len;
+#ifdef INET6
         case JUNIPER_LSQ_L3_PROTO_IPV6:
             ip6_print(p,l2info.length);
             return l2info.header_len;
+#endif
         case JUNIPER_LSQ_L3_PROTO_MPLS:
             mpls_print(p,l2info.length);
             return l2info.header_len;
@@ -519,7 +522,7 @@ juniper_atm1_print(const struct pcap_pkthdr *h, register const u_char *p)
         p+=l2info.header_len;
 
         if (l2info.cookie[0] == 0x80) { /* OAM cell ? */
-            oam_print(p,l2info.length);
+            oam_print(p,l2info.length,ATM_OAM_NOHEC);
             return l2info.header_len;
         }
 
@@ -557,6 +560,7 @@ u_int
 juniper_atm2_print(const struct pcap_pkthdr *h, register const u_char *p)
 {
         u_int16_t extracted_ethertype;
+        u_int32_t control_word;
 
         struct juniper_l2info_t l2info;
 
@@ -567,7 +571,13 @@ juniper_atm2_print(const struct pcap_pkthdr *h, register const u_char *p)
         p+=l2info.header_len;
 
         if (l2info.cookie[7] & ATM2_PKT_TYPE_MASK) { /* OAM cell ? */
-            oam_print(p,l2info.length);
+            control_word = EXTRACT_32BITS(p);
+            if(control_word == 0 || control_word == 0x08000000) {
+                l2info.header_len += 4;
+                l2info.length -= 4;
+                p += 4;
+            }
+            oam_print(p,l2info.length,ATM_OAM_NOHEC);
             return l2info.header_len;
         }