From Giles Scott: Nortel/SynOptics Network Management Protocol support.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 28 Aug 2003 00:11:32 +0000 (00:11 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 28 Aug 2003 00:11:32 +0000 (00:11 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8290 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
Makefile.am
Makefile.nmake
doc/ethereal.pod.template
oui.h
packet-llc.c
packet-nt-sonmp.c [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
index ac8ae239c405e37d91be35531121636296b1946a..4124575fd600d84f595a649f4e1ad31e892f1dcc 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1801,6 +1801,10 @@ Jesper Peterson <jesper [AT] endace.com> {
        Cisco HDLC FCS support
 }
 
+Giles Scott <gscott2 [AT] nortelnetworks.com> {
+       Nortel/SynOptics Network Management Protocol support
+}
+
 And assorted fixes and enhancements by the people listed above and by:
 
        Pavel Roskin <proski [AT] gnu.org>
index 156c9588a93d0272f87cc61be0edb0c4cf06bb55..42f2a10dae9948f2fb723bb6770eff5edb7a6d8f 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal
 #
-# $Id: Makefile.am,v 1.613 2003/08/26 05:09:55 guy Exp $
+# $Id: Makefile.am,v 1.614 2003/08/28 00:11:31 guy Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@ethereal.com>
@@ -309,6 +309,7 @@ DISSECTOR_SRC = \
        packet-nlm.c   \
        packet-nlsp.c  \
        packet-nntp.c  \
+       packet-nt-sonmp.c \
        packet-ntlmssp.c  \
        packet-ntp.c  \
        packet-null.c  \
index d5fa0dcd031e9c649b4d014a6699c6eb58439f26..7fe2cd23147e2ed32b26d80e1007c8e94f2b5091 100644 (file)
@@ -1,7 +1,7 @@
 ## Makefile for building ethereal.exe with Microsoft C and nmake
 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
 #
-# $Id: Makefile.nmake,v 1.326 2003/08/26 05:09:55 guy Exp $
+# $Id: Makefile.nmake,v 1.327 2003/08/28 00:11:31 guy Exp $
 
 include config.nmake
 include <win32.mak>
@@ -250,6 +250,7 @@ DISSECTOR_SRC = \
        packet-nlm.c   \
        packet-nlsp.c  \
        packet-nntp.c  \
+       packet-nt-sonmp.c \
        packet-ntlmssp.c  \
        packet-ntp.c  \
        packet-null.c  \
index 33d2230fef5c143b2ae60808e4364374d8361e2d..a4499a1dcc171344a262e7a9d3417d9e5ac2f2fc 100644 (file)
@@ -2045,6 +2045,7 @@ B<http://www.ethereal.com>.
   Tony Lindstrom           <tony.lindstrom [AT] ericsson.com>
   Niklas Ogren             <niklas.ogren [AT] 71.se>
   Jesper Peterson          <jesper [AT] endace.com>
+  Giles Scott              <gscott2 [AT] nortelnetworks.com>
   Pavel Roskin             <proski [AT] gnu.org>
   Georgi Guninski          <guninski [AT] guninski.com>
   Jason Copenhaver         <jcopenha [AT] typedef.org>
diff --git a/oui.h b/oui.h
index 976682cbe8af8e9bd58b7062dc85b5bbd569b5da..724f2fa9e4fdcf2d074c6cd1d8fa8de0af2f9fc6 100644 (file)
--- a/oui.h
+++ b/oui.h
@@ -1,7 +1,7 @@
 /* oui.h
  * Definitions of OUIs
  *
- * $Id: oui.h,v 1.12 2002/08/28 21:00:06 jmayer Exp $
+ * $Id: oui.h,v 1.13 2003/08/28 00:11:31 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -28,6 +28,7 @@
 
 #define        OUI_ENCAP_ETHER 0x000000        /* encapsulated Ethernet */
 #define        OUI_CISCO       0x00000C        /* Cisco (future use) */
+#define OUI_NORTEL     0x000081        /* Nortel SONMP */
 #define        OUI_CISCO_90    0x0000F8        /* Cisco (IOS 9.0 and above?) */
 #define OUI_BRIDGED    0x0080C2        /* Bridged Frame-Relay, RFC 2427 */
                                        /* and Bridged ATM, RFC 2684 */
index d217fcc6a3c1cb1f0dab40fbff93f959d1bf6423..b9506fc027808716f44fc70eb1d51d0d312f14b7 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for IEEE 802.2 LLC layer
  * Gilbert Ramirez <gram@alumni.rice.edu>
  *
- * $Id: packet-llc.c,v 1.110 2003/06/10 05:38:51 guy Exp $
+ * $Id: packet-llc.c,v 1.111 2003/08/28 00:11:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -68,6 +68,8 @@ static dissector_table_t subdissector_table;
 static dissector_table_t cisco_subdissector_table;
 static dissector_table_t xid_subdissector_table;
 
+static dissector_table_t nortel_subdissector_table;
+
 static dissector_handle_t bpdu_handle;
 static dissector_handle_t eth_handle;
 static dissector_handle_t fddi_handle;
@@ -166,6 +168,7 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r
        { OUI_ATM_FORUM,   "ATM Forum" },
        { OUI_CABLE_BPDU,  "DOCSIS Spanning Tree" }, /* DOCSIS spanning tree BPDU */
        { OUI_APPLE_ATALK, "Apple (AppleTalk)" },
+       { OUI_NORTEL,   "Nortel Networks SONMP" },
        { 0,               NULL }
 };
 
@@ -500,6 +503,23 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
                call_dissector(bpdu_handle, next_tvb, pinfo, tree);
                break;
 
+       case OUI_NORTEL:
+               /* Nortel Networks
+                * Synoptics Networks Management Protocol
+                * protocol ID's 0x01a1, 0x01a2, 0x01a3
+                */
+               if (tree) {
+                       proto_tree_add_uint(snap_tree, hf_pid,tvb, offset+3,2, etype);
+               }
+               next_tvb = tvb_new_subset(tvb, offset + 5, -1, -1);
+               if (XDLC_IS_INFORMATION(control)) {
+                       /* do lookup with the subdissector table */
+                       if (!dissector_try_port(nortel_subdissector_table,
+                                etype, next_tvb, pinfo, tree))
+                                        call_dissector(data_handle, next_tvb, pinfo, tree);
+                } else
+                        call_dissector(data_handle, next_tvb, pinfo, tree);
+               break;
        default:
                if (tree) {
                        proto_tree_add_uint(snap_tree, hf_pid, tvb, offset+3, 2,
@@ -567,6 +587,8 @@ proto_register_llc(void)
          "Cisco OUI PID", FT_UINT16, BASE_HEX);
        xid_subdissector_table = register_dissector_table("llc.xid_dsap",
          "LLC XID SAP", FT_UINT8, BASE_HEX);
+       nortel_subdissector_table = register_dissector_table("llc.nortel_pid",
+         "Nortel OUI PID", FT_UINT16, BASE_HEX);
 
        register_dissector("llc", dissect_llc, proto_llc);
 }
diff --git a/packet-nt-sonmp.c b/packet-nt-sonmp.c
new file mode 100644 (file)
index 0000000..c5c7cc2
--- /dev/null
@@ -0,0 +1,306 @@
+/* packet-sonmp.c
+* Routines for the disassembly of the "Nortel Networks / SynOptics Network Management Protocol"
+* (c) Copyright Giles Scott <gscott2@nortelnetworks.com> 
+*
+* $Id: packet-nt-sonmp.c,v 1.1 2003/08/28 00:11:32 guy Exp $
+*
+* Ethereal - Network traffic analyzer
+* By Gerald Combs <gerald@ethereal.com>
+* Copyright 1998 Gerald Combs
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+#include "config.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+#include <epan/packet.h>
+/* #include "strutil.h" */
+#include "nlpid.h"
+
+/* Although this protocol is propietary it is documented in the SynOptics MIB's
+* So I'm not giving anything away :-)
+* The only thing I have not done is decode the segment identifier;
+* This changes so much depending on whether the chassis supports
+* multi-segment autotopology. As the 5000 is now EOL don't see much point.
+*
+* MIB's s5emt104.mib, s5tcs112.mib, synro179.mib these should be available via
+* http://www.nortelnetworks.com
+*/
+
+  
+/* chassis types */
+/* From  synro179.mib - SnpxChassisType */
+static value_string sonmp_chassis_val[] =
+{
+       {2, "m3000"},
+       {3, "m3030"},
+       {4, "m2310"},
+       {5, "m2810"},
+       {6, "m2912"},
+       {7, "m2914"},
+       {8, "m271x"},
+       {9, "m2813"},
+       {10, "m2814"},
+       {11, "m2915"},
+       {12, "m5000"},
+       {13, "m2813SA"},
+       {14, "m2814SA"},
+       {15, "m810M"},
+       {16, "m1032x Ethercell"},
+       {17, "5005"},
+       {18, "Alcatel Ethernet workgroup conc"},
+       {20, "m2715SA"},
+       {21, "m2486"},
+       {22, "m28xxx"},
+       {23, "m23xxx"},
+       {24, "5DN000"},
+       {25, "NBayStack"},
+       {26, "m2310x"},
+       {27, "BayStack100 hub"},
+       {28, "M3000 Fast ethernet"},
+       {29, "Xedia"},
+       {31, "28200"},
+       {32, "Centillion-sixSlot"},
+       {33, "Centillion-twelveSlot"},
+       {34, "Centillion-singleSlot"},
+       {35, "BayStack301"},
+       {36, "BayStackTr"},
+       {37, "FVC Multimedia Switch"},
+       {38, "SwitchNode"},
+       {39, "BayStack 302"},
+       {40, "BayStack 350"},
+       {41, "BayStack 150"},
+       {42, "Centillion 50"},
+       {43, "Centillion 50tr"},
+       {44, "BayStack 303-304"},
+       {45, "BayStack 200"},
+       {46, "BayStack 250"},
+       {47, "StackProbe"},
+       {48, "BayStack 450"},
+       {49, "BayStack 303-24T"},
+       {50, "Accelar 1200 L3 switch"},
+       {51, "Accelar 1250 L3 switch"},
+       {52, "Accelar 1100 L3 switch"},
+       {53, "Accelar 1150 L3 switch"},
+       {54, "Accelar 1050 L3 switch"},
+       {55, "Accelar 1051 L3 switch"},
+       {56, "Accelar 8610 L3 switch"},
+       {57, "Accelar 8006"},
+       {58, "Accelar 8010"},
+       {59, "Accelar 8006"},
+       {60, "BayStack 670"},
+       {61, "Accelar 740"},
+       {62, "Accelar 750"},
+       {63, "Accelar 790"},
+       {64, "Business Policy switch 2000"},
+       {65, "Accelar 8110 L2 switch"},
+       {66, "Accelar 8106 L2 switch"},
+       {67, "BayStack 3580"},
+       {68, "Baystack 10 PSU"},
+       {69, "BayStack 420"},
+       {70, "OPTera Metro 1200ESM"},
+       {71, "OPTera 8010co"},
+       {72, "OPTera 8610co L3 switch"},
+       {73, "OPTera 8110co L2 switch"},
+       {74, "OPTera 8003"},
+       {75, "OPTera 8603 L3 switch"},
+       {76, "OPTera 8103 L2 switch"},
+       {77, "Baystack 380 10/100/1000 switch"},
+       {78, "Baystack 470 10/100 switch"},
+       {79, "OPTera Metro 1450ESM"},
+       {80, "OPTera Metro 1400ESM"},
+       {81, "Alteon switch family"},
+       {82, "BayStack 460-24T-PWR"},
+       {83, "OPTera Metro 8010 OPM L2 Switch"},
+       {84, "OPTera Metro 8010co OPM L2 Switch"},
+       {85, "OPTera Metro 8006 OPM L2 Switch"},
+       {86, "OPTera Metro 8003 OPM L2 Switch"},
+       {87, "Alteon 180e"},
+       {88, "Alteon AD3"},
+       {89, "Alteon 184"},
+       {90, "Alteon AD4"},
+       {0, NULL}
+};
+
+/* from synro179.mib - SnpxBackplaneType */
+static value_string sonmp_backplane_val[] =
+{
+       {1, "Other"},
+       {2, "ethernet"},
+       {3, "ethernet and tokenring"},
+       {4, "ethernet and FDDI"},
+       {5, "ethernet, tokenring and FDDI"},
+       {6, "ethernet and tokenring with redundant power"},
+       {7, "ethernet, tokenring, FDDI with redunadant power"},
+       {8, "token ring"},
+       {9, "ethernet, tokenring and fast ethernet"},
+       {10, "ethernet and fast ethernet"},
+       {11, "ethernet, tokenring, fast ethernet with redunant power"},
+       {12, "ethernet, fast ethernet and gigabit ethernet"},
+       {0, NULL}
+};
+
+static value_string sonmp_nmm_state_val[] =
+{
+       {1, "Topology Change"},
+       {2, "Heartbeat"},
+       {3, "New"},
+       {0, NULL}
+};
+
+
+/* Offsets in SONMP NMM Hello structure. */
+#define SONMP_IP_ADDRESS 0
+#define SONMP_SEGMENT_IDENTIFIER 4
+#define SONMP_CHASSIS_TYPE 7
+#define SONMP_BACKPLANE_TYPE 8
+#define SONMP_NMM_STATE 9
+#define SONMP_NUMBER_OF_LINKS 10
+
+static int proto_sonmp = -1;
+static int hf_sonmp_ip_address = -1;
+/* static int hf_sonmp_segment_identifier = -1; */
+static int hf_sonmp_chassis_type = -1;
+static int hf_sonmp_backplane_type = -1;
+static int hf_sonmp_nmm_state = -1;
+static int hf_sonmp_number_of_links = -1;
+
+static gint ett_sonmp = -1;
+
+
+static void 
+dissect_sonmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+       guint32 sonmp_ip_address;
+       guint32 sonmp_segment_identifier = 0; /* actually 3 bytes not 4 */
+       guint8 sonmp_chassis_type;
+       guint8 sonmp_backplane_type;
+       guint8 sonmp_nmm_state;
+       guint8 sonmp_number_of_links;
+       
+       proto_tree *sonmp_tree = NULL;
+       proto_item *ti;
+       
+       if (check_col(pinfo->cinfo, COL_PROTOCOL))
+               col_set_str(pinfo->cinfo, COL_PROTOCOL, "SONMP");
+       
+       if (check_col(pinfo->cinfo, COL_INFO))
+               col_add_fstr(pinfo->cinfo, COL_INFO, "SONMP - %s Hello",
+               pinfo->dl_dst.data[5] == 0 ? "Segment" :
+               pinfo->dl_dst.data[5] == 1 ? "FlatNet" : "");
+       
+       if (tree) {
+               ti = proto_tree_add_protocol_format(tree, proto_sonmp, tvb, 0, 11,
+                       "Nortel Networks / SynOptics Network Management Protocol");
+               sonmp_tree = proto_item_add_subtree(ti, ett_sonmp);
+               
+               sonmp_ip_address = tvb_get_letohl(tvb, SONMP_IP_ADDRESS);
+               proto_tree_add_ipv4(sonmp_tree, hf_sonmp_ip_address,
+                       tvb, SONMP_IP_ADDRESS, 4, sonmp_ip_address);
+               
+               /* there is probably a better way of doing this but i need to get three bytes :-( */
+               sonmp_segment_identifier = tvb_get_guint8(tvb, SONMP_SEGMENT_IDENTIFIER);
+               sonmp_segment_identifier = (sonmp_segment_identifier <<16) + tvb_get_ntohs(tvb, SONMP_SEGMENT_IDENTIFIER +1);
+               
+               proto_tree_add_text(sonmp_tree, 
+                       tvb, SONMP_SEGMENT_IDENTIFIER, 3, "Segment identifier: %06x", sonmp_segment_identifier);
+               
+               sonmp_chassis_type = tvb_get_guint8(tvb, SONMP_CHASSIS_TYPE);
+               
+               proto_tree_add_uint_format(sonmp_tree, hf_sonmp_chassis_type, tvb, SONMP_CHASSIS_TYPE, 1, sonmp_chassis_type,
+                       "Chassis : %s (%u)",
+                       val_to_str(sonmp_chassis_type, sonmp_chassis_val, "Unknown"), sonmp_chassis_type);
+               
+               sonmp_backplane_type = tvb_get_guint8(tvb, SONMP_BACKPLANE_TYPE);
+               proto_tree_add_uint_format(sonmp_tree, hf_sonmp_backplane_type, tvb, SONMP_BACKPLANE_TYPE, 1,sonmp_backplane_type,
+                       "Backplane : %s (%u)",
+                       val_to_str(sonmp_backplane_type, sonmp_backplane_val, "Unknown"), sonmp_backplane_type);
+               
+               
+               sonmp_nmm_state = tvb_get_guint8(tvb, SONMP_NMM_STATE);
+               proto_tree_add_uint_format(sonmp_tree, hf_sonmp_nmm_state,
+                       tvb, SONMP_NMM_STATE, 1, sonmp_nmm_state,
+                       "State: %s", val_to_str(sonmp_nmm_state, sonmp_nmm_state_val, "Unknown"));
+               
+               sonmp_number_of_links = tvb_get_guint8(tvb, SONMP_NUMBER_OF_LINKS);
+               proto_tree_add_item(sonmp_tree, hf_sonmp_number_of_links,
+                       tvb, SONMP_NUMBER_OF_LINKS, 1, sonmp_number_of_links);
+       }
+       
+       
+}
+
+
+
+void
+proto_register_sonmp(void)
+{
+    static hf_register_info hf[] = {
+               { &hf_sonmp_ip_address,
+               { "NMM IP address",             "sonmp.ipaddress",  FT_IPv4, BASE_NONE, NULL, 0x0,
+               "IP address of the agent (NMM)", HFILL }},
+               
+               /*      { &hf_sonmp_segment_identifier,
+               { "Segment Identifier",         "sonmp.segmentident", FT_UINT24, BASE_HEX, NULL, 0x0,
+               "Segment id of the segment from which the agent is sending the topology message", HFILL }},
+               */
+               { &hf_sonmp_chassis_type,
+               { "Chassis type",               "sonmp.chassis", FT_UINT8, BASE_DEC, NULL, 0x0,
+               "Chassis type of the agent sending the topology message", HFILL }},
+               
+               { &hf_sonmp_backplane_type,
+               { "Backplane type",             "sonmp.backplane", FT_UINT8, BASE_DEC, NULL, 0x0,
+               "Backplane type of the agent sending the topology message", HFILL }},
+               
+               { &hf_sonmp_nmm_state,
+               { "NMM state",          "sonmp.nmmstate", FT_UINT8, BASE_DEC, NULL, 0x0,
+               "Current state of this agent", HFILL }},
+               
+               { &hf_sonmp_number_of_links,
+               { "Number of links",            "sonmp.numberoflinks", FT_UINT8, BASE_DEC, NULL, 0x0,
+               "Number of interconnect ports", HFILL }},
+    };
+       
+    static gint *ett[] = {
+               &ett_sonmp,
+    };
+    proto_sonmp = proto_register_protocol("Nortel SONMP", "SONMP", "sonmp");
+    proto_register_field_array(proto_sonmp, hf, array_length(hf));
+    proto_register_subtree_array(ett, array_length(ett));
+       
+    register_dissector("sonmp", dissect_sonmp, proto_sonmp);
+}
+
+void
+proto_reg_handoff_sonmp(void)
+{
+       dissector_handle_t sonmp_handle;
+       
+       sonmp_handle = create_dissector_handle(dissect_sonmp, proto_sonmp);
+       
+       dissector_add("llc.nortel_pid", 0x01a1, sonmp_handle); /* flatnet hello */
+       dissector_add("llc.nortel_pid", 0x01a2, sonmp_handle); /* Segment hello */ 
+       /* not got round to adding this but its really old, so I'm not sure people will see it */
+       /* it uses a different packet format */
+       /*      dissector_add("llc.nortel_pid", 0x01a3, sonmp_handle); */ /* Bridge hello */
+}