]> The Tcpdump Group git mirrors - tcpdump/commitdiff
add better handling for unknown LSAs to OSPF
authorhannes <hannes>
Thu, 2 Oct 2003 13:35:52 +0000 (13:35 +0000)
committerhannes <hannes>
Thu, 2 Oct 2003 13:35:52 +0000 (13:35 +0000)
ospf.h
print-ospf.c

diff --git a/ospf.h b/ospf.h
index 8307f1cc5e9cda31e97a3cb50a7361134f1cbc7b..08e4e0953bc01fc9f9fe419a94fec2dea82a0e95 100644 (file)
--- a/ospf.h
+++ b/ospf.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.7 2002-12-11 07:13:56 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.8 2003-10-02 13:35:52 hannes Exp $ (LBL) */
 /*
  * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
  *     The Regents of the University of California.  All rights reserved.
@@ -172,6 +172,11 @@ struct lsa {
             u_int16_t length;
        } un_opaque[1];
 
+        /* Unknown LSA */
+        struct unknown {
+           u_int8_t data[1]; /* may repeat   */
+       } un_unknown[1];
+
     } lsa_un;
 };
 
index 020dbec90336c53e61e24d72d2a28009463d49bb..6cb6f98d894f78d82117775481a71bc1c1d86107 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.36 2002-12-23 19:57:49 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.37 2003-10-02 13:35:52 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -325,6 +325,31 @@ ospf_print_lsa(register const struct lsa *lsap)
                        }
                ++mcp;
                }
+               break;
+
+         /*
+          * FIXME those are the defined LSAs that lack a decoder
+          * you are welcome to contribute code ;-)
+          */
+
+       case LS_TYPE_OPAQUE_LL:
+       case LS_TYPE_OPAQUE_AL: 
+       case LS_TYPE_OPAQUE_DW:
+
+        default:
+         if (vflag <= 1) {
+           if(!print_unknown_data((u_char *)lsap->lsa_un.un_unknown,
+                                  "\n\t    ", EXTRACT_16BITS(&lsap->ls_hdr.ls_length)-sizeof(struct lsa_hdr)))
+             return(0);
+         }
+         break;
+        }
+
+        /* do we want to see an additionally hexdump ? */
+        if (vflag> 1) {
+         if(!print_unknown_data((u_char *)lsap->lsa_un.un_unknown,
+                                "\n\t    ", EXTRACT_16BITS(&lsap->ls_hdr.ls_length)-sizeof(struct lsa_hdr)))
+           return(0);
        }
 
        return (0);