OSI network layer over PPP support, fix to P2P ISIS processing, and ISIS
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 8 Apr 2001 19:32:05 +0000 (19:32 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 8 Apr 2001 19:32:05 +0000 (19:32 +0000)
hostname TLV support, from Hannes Gredler.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3271 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
doc/ethereal.pod.template
packet-isis-clv.c
packet-isis-clv.h
packet-isis-hello.c
packet-isis-lsp.c
packet-isis-lsp.h
packet-osi.c
ppptypes.h

diff --git a/AUTHORS b/AUTHORS
index f8a8287460f66b2da6b57074ff2bd15285d1453a..4875c8d1ff82517c6e39b80388bfbfe640753c1c 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -560,6 +560,12 @@ Michal Melerowicz <Michal.Melerowicz@nokia.com> {
        GTP support
 }
 
+Hannes Gredler <hannes@juniper.net> {
+       OSI network layer over PPP support
+       Fix to P2P ISIS processing
+       ISIS hostname TLV support
+}
+
 Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to
 give his permission to use his version of snprintf.c.
 
index 8b7160cbafaa7f1c706fefe3e7e4fd7f1e64dd70..fb508c7a8d48037415eea072379e741b963e23a7 100644 (file)
@@ -1085,6 +1085,7 @@ B<http://www.ethereal.com>.
   Martin Thomas            <martin_a_thomas@yahoo.com>
   Hartmut Mueller          <hartmut@wendolene.ping.de>
   Michal Melerowicz        <Michal.Melerowicz@nokia.com>
+  Hannes Gredler           <hannes@juniper.net>
 
 Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to give his
 permission to use his version of snprintf.c.
index 4b36e0f37c6c6248342433d40aa8aaf8a0e92beb..5c55d4d967730a3c856d28ffe1f1aa76b482c5e5 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-isis-clv.c
  * Common CLV decode routines.
  *
- * $Id: packet-isis-clv.c,v 1.8 2000/08/11 13:35:17 deniel Exp $
+ * $Id: packet-isis-clv.c,v 1.9 2001/04/08 19:32:03 guy Exp $
  * Stuart Stanley <stuarts@mxmail.net>
  *
  * Ethereal - Network traffic analyzer
@@ -172,6 +172,53 @@ isis_dissect_authentication_clv(const u_char *pd, int offset, guint length,
                }
        }
 }
+
+/*
+ * Name: isis_dissect_hostname_clv()
+ *
+ * Description:
+ *      dump the hostname information found in TLV 137
+ *      pls note that the hostname is not null terminated
+ *
+ * Input:
+ *      u_char * : packet data
+ *      int : offset into packet data where we are.
+ *      guint : length of clv we are decoding
+ *      frame_data * : frame data (complete frame)
+ *      proto_tree * : protocol display tree to fill out.  May be NULL
+ *      char * : Password meaning
+ *
+ * Output:
+ *      void, but we will add to proto tree if !NULL.
+ */
+
+
+void
+isis_dissect_hostname_clv(const u_char *pd, int offset,
+                guint length, frame_data *fd, proto_tree *tree ) {
+        char sbuf[256*6];
+        char *s = sbuf;
+        int hlen = length;
+        int old_offset = offset;
+
+
+        if ( !tree ) return;            /* nothing to do! */
+
+        memcpy ( s, &pd[offset], hlen);
+        sbuf[hlen] = 0;                 /* don't forget null termination */
+
+        if ( hlen == 0 ) {
+                sprintf ( sbuf, "--none--" );
+        }
+
+        proto_tree_add_text ( tree, NullTVB, old_offset, hlen,
+                        "Hostname: %s", sbuf );
+}
+
+
+
+
+
 /*
  * Name: isis_dissect_ip_int_clv()
  * 
index 44873af48e91beef3d53a59c17154006f616b604..c6d7b757ca129b59df155378e4219bf30dde774f 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-isis-clv.h
  * Declares for common clv decoding functions.
  *
- * $Id: packet-isis-clv.h,v 1.2 2000/06/19 08:33:48 guy Exp $
+ * $Id: packet-isis-clv.h,v 1.3 2001/04/08 19:32:03 guy Exp $
  * Stuart Stanley <stuarts@mxmail.net>
  *
  * Ethereal - Network traffic analyzer
@@ -56,4 +56,6 @@ extern void isis_dissect_ip_int_clv(const u_char *pd, int offset,
                guint length, frame_data *fd, proto_tree *tree, gint tree_id );
 extern void isis_dissect_nlpid_clv(const u_char *pd, int offset, 
                guint length, frame_data *fd, proto_tree *tree );
+extern void isis_dissect_hostname_clv(const u_char *pd, int offset, 
+                guint length, frame_data *fd, proto_tree *tree );
 #endif /* _PACKET_ISIS_CLV_H */
index b5e466f80c3136381b6c1d469c8de546d931a774..d5f664f1340354abc3374b46c3b8ce5990758526 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-isis-hello.c
  * Routines for decoding isis hello packets and their CLVs
  *
- * $Id: packet-isis-hello.c,v 1.11 2001/01/03 06:55:29 guy Exp $
+ * $Id: packet-isis-hello.c,v 1.12 2001/04/08 19:32:03 guy Exp $
  * Stuart Stanley <stuarts@mxmail.net>
  *
  * Ethereal - Network traffic analyzer
@@ -479,15 +479,6 @@ isis_dissect_isis_hello(int hello_type, int header_length, int id_length,
        }
        offset += 2;
 
-       if (tree) {
-               proto_tree_add_uint_format(hello_tree, hf_isis_hello_priority_reserved, NullTVB,
-                                   offset, 1, pd[offset],
-                                   "Priority                  : %d, reserved(0x%02x == 0)",
-                                       pd[offset]&ISIS_HELLO_PRIORITY_MASK,
-                                       pd[offset]&ISIS_HELLO_P_RESERVED_MASK );
-       }
-       offset += 1;
-
        if (hello_type == ISIS_TYPE_PTP_HELLO) {
                if (tree) {
                        proto_tree_add_uint(hello_tree, hf_isis_hello_local_circuit_id, NullTVB,
@@ -495,6 +486,16 @@ isis_dissect_isis_hello(int hello_type, int header_length, int id_length,
                }
                offset += 1;
        } else { 
+
+                if (tree) {
+                        proto_tree_add_uint_format(hello_tree, hf_isis_hello_priority_reserved, NullTVB,
+                                    offset, 1, pd[offset],
+                                    "Priority                  : %d, reserved(0x%02x == 0)",
+                                        pd[offset]&ISIS_HELLO_PRIORITY_MASK,
+                                        pd[offset]&ISIS_HELLO_P_RESERVED_MASK );
+                }
+                offset += 1;
+
                if (tree) {
                        proto_tree_add_bytes_format(hello_tree, hf_isis_hello_lan_id, NullTVB, 
                                     offset, id_length + 1, &pd[offset],
index 9ec043b18f456728e9a4f8a61d914c0c7cdb6d93..bcda7c844a59297621e6c3c8f97e8b2878838fc9 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-isis-lsp.c
  * Routines for decoding isis lsp packets and their CLVs
  *
- * $Id: packet-isis-lsp.c,v 1.10 2001/01/03 06:55:29 guy Exp $
+ * $Id: packet-isis-lsp.c,v 1.11 2001/04/08 19:32:03 guy Exp $
  * Stuart Stanley <stuarts@mxmail.net>
  *
  * Ethereal - Network traffic analyzer
@@ -64,6 +64,7 @@ static gint ett_isis_lsp_clv_unknown = -1;
 static gint ett_isis_lsp_clv_partition_dis = -1;
 static gint ett_isis_lsp_clv_prefix_neighbors = -1;
 static gint ett_isis_lsp_clv_nlpid = -1;
+static gint ett_isis_lsp_clv_hostname = -1;
 static gint ett_isis_lsp_clv_auth = -1;
 static gint ett_isis_lsp_clv_ipv4_int_addr = -1;
 static gint ett_isis_lsp_clv_ip_reachability = -1;
@@ -97,6 +98,8 @@ static void dissect_lsp_ip_reachability_clv(const u_char *pd, int offset,
                guint length, int id_length, frame_data *fd, proto_tree *tree);
 static void dissect_lsp_nlpid_clv(const u_char *pd, int offset,
                guint length, int id_length, frame_data *fd, proto_tree *tree);
+static void dissect_lsp_hostname_clv(const u_char *pd, int offset,
+                guint length, int id_length, frame_data *fd, proto_tree *tree);
 static void dissect_lsp_ip_int_addr_clv(const u_char *pd, int offset,
                guint length, int id_length, frame_data *fd, proto_tree *tree);
 static void dissect_lsp_l1_auth_clv(const u_char *pd, int offset,
@@ -135,6 +138,12 @@ static const isis_clv_handle_t clv_l1_lsp_opts[] = {
                &ett_isis_lsp_clv_nlpid,
                dissect_lsp_nlpid_clv
        },
+        {
+                ISIS_CLV_L1_LSP_HOSTNAME,
+                "Hostname",
+                &ett_isis_lsp_clv_hostname,
+                dissect_lsp_hostname_clv
+        },
        {
                ISIS_CLV_L1_LSP_IP_INTERFACE_ADDR,
                "IP Interface address(es)",
@@ -198,6 +207,12 @@ static const isis_clv_handle_t clv_l2_lsp_opts[] = {
                &ett_isis_lsp_clv_nlpid,
                dissect_lsp_nlpid_clv
        },
+        {
+                ISIS_CLV_L2_LSP_HOSTNAME,
+                "Hostname",
+                &ett_isis_lsp_clv_hostname,
+                dissect_lsp_hostname_clv
+        },
        {
                ISIS_CLV_L2_LSP_IP_EXT_REACHABLE,
                "IP external reachability",
@@ -358,6 +373,29 @@ dissect_lsp_nlpid_clv(const u_char *pd, int offset,
        isis_dissect_nlpid_clv(pd, offset, length, fd, tree );
 }
 
+/*
+ * Name: dissect_lsp_hostname_clv()
+ *
+ * Description:
+ *      Decode for a lsp packets hostname clv.  Calls into the
+ *      clv common one.
+ *
+ * Input:
+ *      u_char * : packet data
+ *      int : current offset into packet data
+ *      guint : length of this clv
+ *      int : length of IDs in packet.
+ *      frame_data * : frame data
+ *      proto_tree * : proto tree to build on (may be null)
+ *
+ * Output:
+ *      void, will modify proto_tree if not null.
+ */
+static void 
+dissect_lsp_hostname_clv(const u_char *pd, int offset, 
+                guint length, int id_length, frame_data *fd, proto_tree *tree) {
+        isis_dissect_hostname_clv(pd, offset, length, fd, tree );
+}
 /*
  * Name: dissect_lsp_ip_int_addr_clv()
  *
@@ -946,6 +984,7 @@ proto_register_isis_lsp(void) {
                &ett_isis_lsp_clv_prefix_neighbors,
                &ett_isis_lsp_clv_auth,
                &ett_isis_lsp_clv_nlpid,
+                &ett_isis_lsp_clv_hostname,
                &ett_isis_lsp_clv_ipv4_int_addr,
                &ett_isis_lsp_clv_ip_reachability,
        };
index 1dec2552c7f58765717c4401b1cb1fe1f1323ea5..dd4c16ef968400c6308c863e4ff0dbc9874d974b 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-isis-lsp.h
  * Defines and such for LSP and their CLV decodes
  *
- * $Id: packet-isis-lsp.h,v 1.2 2000/06/19 08:33:49 guy Exp $
+ * $Id: packet-isis-lsp.h,v 1.3 2001/04/08 19:32:03 guy Exp $
  * Stuart Stanley <stuarts@mxmail.net>
  *
  * Ethereal - Network traffic analyzer
@@ -62,6 +62,7 @@
 #define ISIS_CLV_L1_LSP_IP_INT_REACHABLE       128
 #define ISIS_CLV_L1_LSP_NLPID                  129
 #define ISIS_CLV_L1_LSP_IP_INTERFACE_ADDR      132
+#define ISIS_CLV_L1_LSP_HOSTNAME                137
 /* 
  * Note, the spec say 133, but everyone seems to use 10. Any clue on why
  * this is would be appreciated!
@@ -81,6 +82,7 @@
 #define ISIS_CLV_L2_LSP_IP_EXT_REACHABLE       130
 #define ISIS_CLV_L2_LSP_IDRP_INFO              131
 #define ISIS_CLV_L2_LSP_IP_INTERFACE_ADDR      132
+#define ISIS_CLV_L2_LSP_HOSTNAME                137
 /* 
  * Note, the spec say 133, but everyone seems to use 10. Any clue on why
  * this is would be appreciated!
index b24f1dcccb3cdb0aacfcd82551ddade8f02917d2..a615772e210232dd219c0fbf5b0b9fe8001d6b44 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for ISO/OSI network and transport protocol packet disassembly
  * Main entrance point and common functions
  *
- * $Id: packet-osi.c,v 1.42 2001/04/01 05:48:14 hagbard Exp $
+ * $Id: packet-osi.c,v 1.43 2001/04/08 19:32:03 guy Exp $
  * Laurent Deniel <deniel@worldnet.fr>
  * Ralf Schneider <Ralf.Schneider@t-online.de>
  *
@@ -43,6 +43,7 @@
 #include "llcsaps.h"
 #include "aftypes.h"
 #include "nlpid.h"
+#include "ppptypes.h"
 #include "packet-osi.h"
 #include "packet-isis.h"
 #include "packet-esis.h"
@@ -152,5 +153,6 @@ void
 proto_reg_handoff_osi(void)
 {
        dissector_add("llc.dsap", SAP_OSINL, dissect_osi, -1);
+        dissector_add("ppp.protocol", PPP_OSI, dissect_osi, -1);
        dissector_add("null.type", BSD_AF_ISO, dissect_osi, -1);
 }
index 0e09b7f30b5e7d808dfe024fb701b55e2331037d..6fa5345f67aac39bee7995e3876e2f91aeacc833 100644 (file)
@@ -1,7 +1,7 @@
 /* ppptypes.h
  * Defines PPP packet types.
  *
- * $Id: ppptypes.h,v 1.6 2001/03/15 09:11:01 guy Exp $
+ * $Id: ppptypes.h,v 1.7 2001/04/08 19:32:03 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -32,6 +32,7 @@
 
  */
 #define PPP_IP         0x21    /* Internet Protocol */
+#define PPP_OSI               0x23
 #define PPP_AT         0x29    /* AppleTalk Protocol */
 #define PPP_IPX                0x2b    /* IPX protocol */
 #define        PPP_VJC_COMP    0x2d    /* VJ compressed TCP */