]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-juniper.c
add GRE and RSVP to the supported IPv6 protos
[tcpdump] / print-juniper.c
index 262098c4a1771e9da93b1c9223361bc48508db33..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.11 2005-06-07 21:54:33 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 */
@@ -521,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;
         }
 
@@ -559,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;
 
@@ -569,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;
         }