]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-l2tp.c
updates/bug fixes from Motonori Shindo <[email protected]>
[tcpdump] / print-l2tp.c
index fa6c43654a1c64992b9f39dcf0b5e00bd79ad04a..8ee0db94ec7690af1ba8d4ec44c945462e475e00 100644 (file)
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * L2TP support contributed by Motonori Shindo (mshindo@ascend.co.jp)
+ * L2TP support contributed by Motonori Shindo (mshindo@mshindo.net)
  */
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.6 1999-12-22 06:27:21 itojun Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.7 2000-07-01 03:48:44 assar Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -303,7 +303,7 @@ l2tp_bearer_cap_print(const u_char *dat, u_int length)
 static void
 l2tp_tie_breaker_print(const u_char *dat, u_int length)
 {
-       printf("%lx", *(u_long *)dat);  /* XXX */
+       print_octets(dat, 8);   /* Tie Break Value is 64bits long */
 }
 
 static void
@@ -592,23 +592,30 @@ l2tp_avp_print(const u_char *dat, u_int length)
                }
                ptr++;
 
-               if (ntohs(*ptr)) {      /* IETF == 0 */
-                       printf("vendor=%04x", ntohs(*ptr));
-               }
-               ptr++;
-
-               if (ntohs(*ptr) < L2TP_MAX_AVP_INDEX) {
-                       printf("%s", l2tp_avp[ntohs(*ptr)].name);
+               if (ntohs(*ptr)) {
+                       /* Vendor Specific Attribute */
+                       printf("VENDOR%04x:", ntohs(*ptr));
+                       ptr++;
+                       printf("ATTR%04x", ntohs(*ptr));
                        printf("(");
-                       if (!hidden) {
-                               (l2tp_avp[ntohs(*ptr)].print)
-                                       ((u_char *)ptr+2, len-6);
-                       } else {
-                               printf("???");
-                       }
+                       print_octets((u_char *)ptr+2, len-6);
                        printf(")");
                } else {
-                       printf(" invalid AVP %u", ntohs(*ptr));
+                       /* IETF-defined Attribute */ 
+                       ptr++;
+                       if (ntohs(*ptr) < L2TP_MAX_AVP_INDEX) {
+                               printf("%s", l2tp_avp[ntohs(*ptr)].name);
+                               printf("(");
+                               if (!hidden) {
+                                       (l2tp_avp[ntohs(*ptr)].print)
+                                               ((u_char *)ptr+2, len-6);
+                               } else {
+                                       printf("???");
+                               }
+                               printf(")");
+                       } else {
+                               printf(" invalid AVP %u", ntohs(*ptr));
+                       }
                }
 
                l2tp_avp_print(dat + len, length - len);