]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-juniper.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-juniper.c
index 48b8a35521404d1b0fc09c4f9a9c42afe0419223..1948075866a9f2e9d8c1e9f58c0fbdd14d99e9c9 100644 (file)
@@ -22,9 +22,7 @@
 __RCSID("NetBSD: print-juniper.c,v 1.3 2007/07/25 06:31:32 dogcow Exp ");
 #endif
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -892,7 +890,6 @@ juniper_mlppp_if_print(netdissect_options *ndo,
 }
 #endif
 
-
 #ifdef DLT_JUNIPER_MFR
 void
 juniper_mfr_if_print(netdissect_options *ndo,
@@ -1011,7 +1008,7 @@ juniper_mlfr_if_print(netdissect_options *ndo,
  *     ATM1 PIC cookie format
  *
  *     +-----+-------------------------+-------------------------------+
- *     |fmtid|     vc index            |  channel  ID                  |
+ *     |fmtid|     vc index            |  channel ID                   |
  *     +-----+-------------------------+-------------------------------+
  */
 
@@ -1072,7 +1069,7 @@ juniper_atm1_if_print(netdissect_options *ndo,
  *     ATM2 PIC cookie format
  *
  *     +-------------------------------+---------+---+-----+-----------+
- *     |     channel ID                |  reserv |AAL| CCRQ| gap cnt   |
+ *     |     channel ID                |reserved |AAL| CCRQ| gap count |
  *     +-------------------------------+---------+---+-----+-----------+
  */
 
@@ -1166,7 +1163,6 @@ juniper_ppp_heuristic_guess(netdissect_options *ndo,
 
     default:
         return 0; /* did not find a ppp header */
-        break;
     }
     return 1; /* we printed a ppp packet */
 }
@@ -1210,7 +1206,6 @@ ip_heuristic_guess(netdissect_options *ndo,
         break;
     default:
         return 0; /* did not find a ip header */
-        break;
     }
     return 1; /* we printed an v4/v6 packet */
 }
@@ -1276,12 +1271,10 @@ juniper_parse_header(netdissect_options *ndo,
     int tlv_value;
     const u_char *tptr;
 
-
     l2info->header_len = 0;
     l2info->cookie_len = 0;
     l2info->proto = 0;
 
-
     l2info->length = h->len;
     l2info->caplen = h->caplen;
     l2info->flags = GET_U_1(p + 3);
@@ -1433,7 +1426,6 @@ juniper_parse_header(netdissect_options *ndo,
             break;
         }
 
-
 #ifdef DLT_JUNIPER_MFR
         /* MFR child links don't carry cookies */
         if (l2info->pictype == DLT_JUNIPER_MFR &&
@@ -1451,10 +1443,7 @@ juniper_parse_header(netdissect_options *ndo,
                    lp->s,
                    l2info->cookie_len);
 
-        if (l2info->cookie_len > 8) {
-            nd_print_invalid(ndo);
-            return 0;
-        }
+        ND_ICHECKMSG_U("cookie length", l2info->cookie_len, >, 8);
 
         if (l2info->cookie_len > 0) {
             ND_TCHECK_LEN(p, l2info->cookie_len);
@@ -1468,7 +1457,6 @@ juniper_parse_header(netdissect_options *ndo,
 
         if (ndo->ndo_eflag) ND_PRINT(": "); /* print demarc b/w L2/L3*/
 
-
         l2info->proto = GET_BE_U_2(p + l2info->cookie_len);
     }
     p+=l2info->cookie_len;
@@ -1559,10 +1547,18 @@ juniper_parse_header(netdissect_options *ndo,
         }
         break;
 #endif
+#ifdef DLT_JUNIPER_ES
+    case DLT_JUNIPER_ES:
+        break;
+#endif
 #ifdef DLT_JUNIPER_GGSN
     case DLT_JUNIPER_GGSN:
         break;
 #endif
+#ifdef DLT_JUNIPER_SERVICES
+    case DLT_JUNIPER_SERVICES:
+        break;
+#endif
 #ifdef DLT_JUNIPER_ATM1
     case DLT_JUNIPER_ATM1:
         break;
@@ -1583,6 +1579,18 @@ juniper_parse_header(netdissect_options *ndo,
     case DLT_JUNIPER_FRELAY:
         break;
 #endif
+#ifdef DLT_JUNIPER_MONITOR
+    case DLT_JUNIPER_MONITOR:
+        break;
+#endif
+#ifdef DLT_JUNIPER_PPPOE
+    case DLT_JUNIPER_PPPOE:
+        break;
+#endif
+#ifdef DLT_JUNIPER_PPPOE_ATM
+    case DLT_JUNIPER_PPPOE_ATM:
+        break;
+#endif
 
     default:
         ND_PRINT("Unknown Juniper DLT_ type %u: ", l2info->pictype);