From Anand Narwani: support for Cisco vendor-specific TLVs.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Sep 2002 19:07:40 +0000 (19:07 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Sep 2002 19:07:40 +0000 (19:07 +0000)
Add RCS IDs to source files.

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

28 files changed:
plugins/docsis/Makefile.am
plugins/docsis/Makefile.nmake
plugins/docsis/packet-bpkmattr.c
plugins/docsis/packet-bpkmreq.c
plugins/docsis/packet-bpkmrsp.c
plugins/docsis/packet-docsis.c
plugins/docsis/packet-docsis.h
plugins/docsis/packet-dsaack.c
plugins/docsis/packet-dsareq.c
plugins/docsis/packet-dsarsp.c
plugins/docsis/packet-dscack.c
plugins/docsis/packet-dscreq.c
plugins/docsis/packet-dscrsp.c
plugins/docsis/packet-dsdreq.c
plugins/docsis/packet-dsdrsp.c
plugins/docsis/packet-macmgmt.c
plugins/docsis/packet-map.c
plugins/docsis/packet-regack.c
plugins/docsis/packet-regreq.c
plugins/docsis/packet-regrsp.c
plugins/docsis/packet-rngreq.c
plugins/docsis/packet-rngrsp.c
plugins/docsis/packet-tlv.c
plugins/docsis/packet-tlv.h
plugins/docsis/packet-uccreq.c
plugins/docsis/packet-uccrsp.c
plugins/docsis/packet-ucd.c
plugins/docsis/packet-vendor.c [new file with mode: 0644]

index aa3ffdf934a22fa386def607b6d308f72870e429..bd0699cde6f4053febeaaf4a39848f954b2cc920 100644 (file)
@@ -26,7 +26,7 @@ INCLUDES = -I$(top_srcdir) -I$(includedir)
 plugindir = @PLUGIN_DIR@
 
 plugin_LTLIBRARIES = docsis.la
-docsis_la_SOURCES = packet-docsis.c packet-bpkmattr.c packet-dsarsp.c packet-macmgmt.c packet-rngrsp.c packet-bpkmreq.c packet-dscack.c packet-map.c packet-tlv.c packet-bpkmrsp.c packet-dscreq.c packet-regack.c packet-uccreq.c packet-dscrsp.c packet-regreq.c packet-uccrsp.c packet-dsaack.c packet-dsdreq.c packet-regrsp.c packet-ucd.c packet-dsareq.c packet-dsdrsp.c packet-rngreq.c packet-docsis.h packet-tlv.h moduleinfo.h
+docsis_la_SOURCES = packet-docsis.c packet-bpkmattr.c packet-dsarsp.c packet-macmgmt.c packet-rngrsp.c packet-bpkmreq.c packet-dscack.c packet-map.c packet-tlv.c packet-bpkmrsp.c packet-dscreq.c packet-regack.c packet-uccreq.c packet-dscrsp.c packet-regreq.c packet-uccrsp.c packet-dsaack.c packet-dsdreq.c packet-regrsp.c packet-ucd.c packet-dsareq.c packet-dsdrsp.c packet-rngreq.c packet-vendor.c packet-docsis.h packet-tlv.h moduleinfo.h
 docsis_la_LDFLAGS = -module -avoid-version
 
 # Libs must be cleared, or else libtool won't create a shared module.
@@ -34,7 +34,7 @@ docsis_la_LDFLAGS = -module -avoid-version
 # add them here.
 LIBS =
 
-docsis_la_DEPENDENCIES = packet-docsis-static.o packet-bpkmattr-static.o packet-dsarsp-static.o packet-macmgmt-static.o packet-rngrsp-static.o packet-bpkmreq-static.o packet-dscack-static.o packet-map-static.o packet-tlv-static.o packet-bpkmrsp-static.o packet-dscreq-static.o packet-regack-static.o packet-uccreq-static.o packet-dscrsp-static.o packet-regreq-static.o packet-uccrsp-static.o packet-dsaack-static.o packet-dsdreq-static.o packet-regrsp-static.o packet-ucd-static.o packet-dsareq-static.o packet-dsdrsp-static.o packet-rngreq-static.o
+docsis_la_DEPENDENCIES = packet-docsis-static.o packet-bpkmattr-static.o packet-dsarsp-static.o packet-macmgmt-static.o packet-rngrsp-static.o packet-bpkmreq-static.o packet-dscack-static.o packet-map-static.o packet-tlv-static.o packet-bpkmrsp-static.o packet-dscreq-static.o packet-regack-static.o packet-uccreq-static.o packet-dscrsp-static.o packet-regreq-static.o packet-uccrsp-static.o packet-dsaack-static.o packet-dsdreq-static.o packet-regrsp-static.o packet-ucd-static.o packet-dsareq-static.o packet-dsdrsp-static.o packet-rngreq-static.o packet-vendor-static.o
 
 packet-docsis-static.o:        packet-docsis.c moduleinfo.h
        $(LTCOMPILE) -c -o packet-docsis-static.o -D__ETHEREAL_STATIC__ $(srcdir)/packet-docsis.c 
@@ -106,6 +106,8 @@ packet-dsdrsp-static.o:     packet-dsdrsp.c moduleinfo.h
 packet-rngreq-static.o:        packet-rngreq.c moduleinfo.h
        $(LTCOMPILE) -c -o packet-rngreq-static.o -D__ETHEREAL_STATIC__ $(srcdir)/packet-rngreq.c
 
+packet-vendor-static.o:        packet-vendor.c moduleinfo.h
+       $(LTCOMPILE) -c -o packet-vendor-static.o -D__ETHEREAL_STATIC__ $(srcdir)/packet-vendor.c
 
 CLEANFILES = \
        docsis \
index 2c4a198aff059d346369cc6c6f72cfab88768a88..40d04ba61a3bb854d5b91cead257a2510cab6288 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.nmake,v 1.2 2002/07/16 10:11:41 guy Exp $
+# $Id: Makefile.nmake,v 1.3 2002/09/10 19:07:37 guy Exp $
 #
 
 include ..\..\config.nmake
@@ -22,9 +22,9 @@ OBJECTS=packet-docsis.obj packet-bpkmattr.obj \
        packet-dsaack.obj packet-dsdreq.obj \
        packet-regrsp.obj packet-ucd.obj \
        packet-dsareq.obj packet-dsdrsp.obj \
-       packet-rngreq.obj
+       packet-rngreq.obj packet-vendor.obj
 
-docsis.dll docsis.exp docsis.lib : packet-docsis.obj packet-bpkmattr.obj packet-dsarsp.obj packet-macmgmt.obj packet-rngrsp.obj packet-bpkmreq.obj packet-dscack.obj packet-map.obj packet-tlv.obj packet-bpkmrsp.obj packet-dscreq.obj packet-regack.obj packet-uccreq.obj packet-dscrsp.obj packet-regreq.obj packet-uccrsp.obj packet-dsaack.obj packet-dsdreq.obj packet-regrsp.obj packet-ucd.obj packet-dsareq.obj packet-dsdrsp.obj packet-rngreq.obj ..\plugin_api.obj 
+docsis.dll docsis.exp docsis.lib : packet-docsis.obj packet-bpkmattr.obj packet-dsarsp.obj packet-macmgmt.obj packet-rngrsp.obj packet-bpkmreq.obj packet-dscack.obj packet-map.obj packet-tlv.obj packet-bpkmrsp.obj packet-dscreq.obj packet-regack.obj packet-uccreq.obj packet-dscrsp.obj packet-regreq.obj packet-uccrsp.obj packet-dsaack.obj packet-dsdreq.obj packet-regrsp.obj packet-ucd.obj packet-dsareq.obj packet-dsdrsp.obj packet-rngreq.obj packet-vendor.obj ..\plugin_api.obj 
        link -dll /out:docsis.dll packet-docsis.obj \
                packet-bpkmattr.obj packet-dsarsp.obj \
                packet-macmgmt.obj packet-rngrsp.obj \
@@ -36,7 +36,8 @@ docsis.dll docsis.exp docsis.lib : packet-docsis.obj packet-bpkmattr.obj packet-
                packet-uccrsp.obj packet-dsaack.obj \
                packet-dsdreq.obj packet-regrsp.obj \
                packet-ucd.obj packet-dsareq.obj \
-               packet-dsdrsp.obj packet-rngreq.obj ..\plugin_api.obj  \
+               packet-dsdrsp.obj packet-rngreq.obj \
+               packet-vendor.obj ..\plugin_api.obj  \
        $(GLIB_DIR)\glib-$(GLIB_VERSION).lib
 
 clean:
index 5f222207b25f94fbd45b611850deee73c4f7bdb4..c201d9091fc24782fe8c93a33cd7db1f09eddc73 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Baseline Privacy Key Management Attributes dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-bpkmattr.c,v 1.4 2002/09/10 19:07:37 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index d76d000a34f6060b457c9a95eddaf26bba2c987a..a37c694152ebbb6e8350bb46fef7fcf69ccee364 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Baseline Privacy Key Management Request dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-bpkmreq.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index aaad61c6bd40864ff64d3a7e7fc84ab86751f474..0dd57620a598e6bdf27031cbd7870d5f63bae0c3 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Baseline Privacy Key Management Response dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-bpkmrsp.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index a37ade51a0395c13cc9c2d1274dd0641d3cadcc1..8724ee5109b6b087ed866fdb801231e97b7d34bb 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for docsis dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
- * $Id: packet-docsis.c,v 1.9 2002/08/30 10:02:10 guy Exp $
+ * $Id: packet-docsis.c,v 1.10 2002/09/10 19:07:38 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -799,6 +799,7 @@ plugin_reg_handoff (void)
   proto_reg_handoff_docsis_ucd ();
   proto_reg_handoff_docsis_dsareq ();
   proto_reg_handoff_docsis_dsdrsp ();
+  proto_reg_handoff_docsis_vsif ();
 }
 
 G_MODULE_EXPORT void
@@ -836,6 +837,7 @@ plugin_init (plugin_address_table_t * pat
       proto_register_docsis_dsareq ();
       proto_register_docsis_dsdrsp ();
       proto_register_docsis_rngreq ();
+      proto_register_docsis_vsif ();
 
     }
 }
index cc8f61303c832ad6ad3031b60d17fd879f648b0a..740367887e4286f02cfcdf25858044059b46941e 100644 (file)
@@ -1,6 +1,6 @@
 /* packet-docsis.h
  *
- * $Id: packet-docsis.h,v 1.3 2002/08/28 20:38:59 jmayer Exp $
+ * $Id: packet-docsis.h,v 1.4 2002/09/10 19:07:38 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -24,7 +24,6 @@
 #ifndef __PACKET_DOCSIS_H__
 #define __PACKET_DOCSIS_H__
 
-void capture_docsis (const guchar *, int, int, packet_counts *);
 void proto_reg_handoff_docsis_bpkmattr (void);
 void proto_reg_handoff_docsis_bpkmreq (void);
 void proto_reg_handoff_docsis_bpkmrsp (void);
@@ -48,6 +47,7 @@ void proto_reg_handoff_docsis_tlv (void);
 void proto_reg_handoff_docsis_uccreq (void);
 void proto_reg_handoff_docsis_uccrsp (void);
 void proto_reg_handoff_docsis_ucd (void);
+void proto_reg_handoff_docsis_vsif (void);
 
 void proto_register_docsis_bpkmattr (void);
 void proto_register_docsis_bpkmreq (void);
@@ -72,5 +72,6 @@ void proto_register_docsis_tlv (void);
 void proto_register_docsis_uccreq (void);
 void proto_register_docsis_uccrsp (void);
 void proto_register_docsis_ucd (void);
+void proto_register_docsis_vsif (void);
 
 #endif
index e44687a52e2a883cb24316478bb0ebf03b024459..0ff2a7e86d2717a09ef99bc78947da8215967f4e 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Dynamic Service Addition Acknowledge dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-dsaack.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index c0efe665f34eb8b21adb52febfc87e9bdf97b9b1..92d4aad2fbe36791ed23ac6019b8499bc13d48c2 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Dynamic Service Addition Request dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-dsareq.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index db2a4bbc4890c3e795812e476192376716a6107f..0e23e0c5895e498a23f01193934eaa0ebc9804e2 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Dynamic Service Addition Response dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-dsarsp.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index f697c1e0ef1e709df4970748b70ecdeb05e99ab0..6929e991768123e875767b27aea975f36c582a5c 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Dynamic Service Change Acknowledge dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-dscack.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 5deaa078cd6058eaa8dac891648339e9f74bff2c..419db6615081f31baf8ad17b2718c66297b92fb4 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Dynamic Service Change Request dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-dscreq.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 686ea0bdbc477824f92b4ea17cf2b5ef5df0cff0..b168447fb5ec0510183977c941ea07fb7fc6b148 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Dynamic Service Change Response dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-dscrsp.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 2ad1945406fc6ab45111a9e6b596c0799ea2ecaf..75aa3b532bfca49ba246fb5242591fb4d49dcafe 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Dynamic Service Delete Request dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-dsdreq.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index d618ac366a6fcc3f42a55c4f02d33e595d0d81a4..e3d8d9a191fd2dd80a45857c2db20985f48a0cbf 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Dynamic Service Delete Response dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-dsdrsp.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 45d4e18ad0d8039829c56629e9f2a676859999c6..1a8c52bd9750fbdc724a6e5f816072a2da66c08f 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for docsis Mac Management Header dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-macmgmt.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 0bbacff59859f241b349b306f4bf55d5d914405d..2716db617a01e7a0d383de5c7e4712ed3bc6636e 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for MAP Message dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-map.c,v 1.5 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 181d470c2893c099d4e9331d64e02805ff12184c..a8723da68626f990e9531b93105c46d04b4b6eb4 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Registration Acknowledge Message dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-regack.c,v 1.4 2002/09/10 19:07:38 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index b402ca5b31e07f0112f2917f2f21d1bad9291d41..da8430af7a3c67114284bdab185ffb95526fbe2d 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Registration Request dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-regreq.c,v 1.4 2002/09/10 19:07:39 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index e0196d64e447fc77a4223a4e9ba9c711c1d87974..e75e44466de905cf77b72ee94a902776a43d4678 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Registration Response Message dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-regrsp.c,v 1.4 2002/09/10 19:07:39 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index ac59ce08aff0ba3c7bee5ce8e59c08e38c5bb54a..eb7dd1dfd1dd89b076dd2ef640c3d08a8ad58068 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Ranging Request Message dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-rngreq.c,v 1.4 2002/09/10 19:07:39 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index fae001a541ecaebb7d3f0b438e4ba344e42ae6c1..825af6feac9310a8119db42424de8d5925e40029 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Ranging Response Message dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-rngrsp.c,v 1.4 2002/09/10 19:07:39 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 4520d58c481383403ee239e1d2eadde03c68d628..c8368e82ec0c53aab8009131ce9ca1caa539fb3b 100644 (file)
@@ -2,6 +2,8 @@
  * Routines to Dissect Appendix C TLV's
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-tlv.c,v 1.7 2002/09/10 19:07:39 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
@@ -47,6 +49,9 @@
  */
 
 /* Initialize the protocol and registered fields */
+static dissector_handle_t docsis_vsif_handle;
+
+
 static int proto_docsis_tlv = -1;
 static int hf_docsis_tlv = -1;
 static int hf_docsis_tlv_down_freq = -1;
@@ -1782,6 +1787,7 @@ dissect_tlv (tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree)
   guint16 pos = 0;
   guint8 type, length;
   guint16 x;
+  tvbuff_t *vsif_tvb;
 
   total_len = tvb_length_remaining (tvb, 0);
 
@@ -2067,8 +2073,8 @@ dissect_tlv (tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree)
                                   tvb, pos, length, FALSE);
              break;
            case TLV_VENDOR_SPEC:
-             proto_tree_add_item (tlv_tree, hf_docsis_tlv_vendor_spec,
-                                  tvb, pos, length, FALSE);
+             vsif_tvb = tvb_new_subset (tvb, pos, length, length);
+             call_dissector (docsis_vsif_handle, vsif_tvb, pinfo, tlv_tree);
              break;
            case TLV_END:
              break;
@@ -2846,6 +2852,8 @@ proto_reg_handoff_docsis_tlv (void)
   dissector_handle_t docsis_tlv_handle;
 
   docsis_tlv_handle = find_dissector ("docsis_tlv");
+  docsis_vsif_handle = find_dissector("docsis_vsif");
+
   dissector_add ("docsis", 0xFF, docsis_tlv_handle);
 
 }
index 3e34cb39f00d0d56a2e2d0007c9a584b9375ff84..8240d3dd82deee4d921b82c6c6ee5e5a20728dca 100644 (file)
@@ -2,6 +2,8 @@
  * Contains Definitions for Configuration types
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-tlv.h,v 1.3 2002/09/10 19:07:40 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index e33734068deffe1d1d49318fe0a60003fd98f2cd..803aac48087c39aeb3344d11100482bc6de3a1e3 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Upstream Channel Change Request dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-uccreq.c,v 1.4 2002/09/10 19:07:40 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 3227ab3c256d410242390d3303bcdd70fae99af0..c93a6beeecee9110486728e825b3e8f0aa0a9357 100644 (file)
@@ -2,6 +2,8 @@
  * Routines for Upstream Channel Change Response dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-uccrsp.c,v 1.4 2002/09/10 19:07:40 guy Exp $
+ *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
index 5f369a8ff1f7b583fca67491d617dd5520949cd1..941de28924a7007d8536f91dc1a4e74ffa69c756 100644 (file)
@@ -2,6 +2,7 @@
  * Routines for UCD Message dissection
  * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
  *
+ * $Id: packet-ucd.c,v 1.4 2002/09/10 19:07:40 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
diff --git a/plugins/docsis/packet-vendor.c b/plugins/docsis/packet-vendor.c
new file mode 100644 (file)
index 0000000..e0c3e46
--- /dev/null
@@ -0,0 +1,322 @@
+/* packet-vendor.c
+ * Routines for Vendor Specific Encodings dissection
+ * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
+ *
+ * $Id: packet-vendor.c,v 1.1 2002/09/10 19:07:40 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.
+ */
+
+
+/* Notes to Adding dissectors for Vendor specific TLV's:
+ * 1. Create a dissect_<vendorname> function with the following prototype:
+ *   dissect_foovendor(tvbuff_t *tvb, proto_tree *tree, guint8 vsif_len)
+ * 2. vsif_len will be the *entire* length of the vsif TLV (including the 
+ *   Vendor Id TLV, which is 5 bytes long).
+ * 3. Create a new 'case' statement in dissect_vsif, for your specific Vendor
+ *   id.  
+ * 4. In that 'case' statement you will make the following calls:
+ *   (assume for this example that your vendor id is 0x000054)
+ *   #define VENDOR_FOOVENDOR 0x00054 
+ *   case VENDOR_FOOVENDOR:
+ *      proto_item_append_text (it, " (foo vendor)");
+ *      dissect_foovendor (tvb, vsif_tree, vsif_len);
+ *      break;
+ * 5.  Please see dissect_cisco for an example of how to do this.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+
+#include "plugins/plugin_api.h"
+#include "plugins/plugin_api_defs.h"
+#include "moduleinfo.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#include <gmodule.h>
+
+#ifdef NEED_SNPRINTF_H
+# include "snprintf.h"
+#endif
+
+#include <epan/packet.h>
+
+/* Define Vendor ID's here */
+#define VENDOR_CISCO 0x00000C
+
+/* Initialize the protocol and registered fields */
+static int proto_docsis_vsif = -1;
+static int hf_docsis_vsif = -1;
+static int hf_docsis_vsif_vendorid = -1;
+static int hf_docsis_vsif_vendor_unknown = -1;
+static int hf_docsis_vsif_cisco_numphones = -1;
+static int hf_docsis_vsif_cisco_ipprec = -1;
+static int hf_docsis_vsif_cisco_ipprec_val = -1;
+static int hf_docsis_vsif_cisco_ipprec_bw = -1;
+static int hf_docsis_vsif_cisco_config_file = -1;
+
+/* Initialize the subtree pointers */
+static gint ett_docsis_vsif = -1;
+static gint ett_docsis_vsif_ipprec = -1;
+
+static const value_string vendorid_vals[] = {
+       {VENDOR_CISCO, "Cisco Systems, Inc."},
+       {0, NULL},
+};
+
+
+
+/* Forward Declarations for vendor specific dissectors */
+static void dissect_cisco (tvbuff_t * tvb, proto_tree * tree,
+                          guint8 vsif_len);
+
+/* Code to actually dissect the packets */
+static void
+dissect_vsif (tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree)
+{
+  proto_item *it;
+  proto_tree *vsif_tree;
+  guint8 type;
+  guint8 length;
+  guint32 value;
+  guint16 vsif_len;
+
+/* get the total length of the VSIF TLV */
+  vsif_len = tvb_length_remaining (tvb, 0);
+
+/* The first TLV in the VSIF encodings must be type 0x08 (Vendor ID) and
+ * length 3.
+ */
+  type = tvb_get_guint8 (tvb, 0);
+  if (type != 0x08)
+    {
+      THROW (ReportedBoundsError);
+    }
+
+  length = tvb_get_guint8 (tvb, 1);
+  if (length != 3)
+    {
+      THROW (ReportedBoundsError);
+    }
+
+  /* Extract the Value of the Vendor ID */
+  value = tvb_get_ntoh24 (tvb, 2);
+  if (tree)
+    {
+      it =
+       proto_tree_add_protocol_format (tree, proto_docsis_vsif, tvb, 0,
+                                       tvb_length_remaining (tvb, 0),
+                                       "VSIF Encodings");
+      vsif_tree = proto_item_add_subtree (it, ett_docsis_vsif);
+      proto_tree_add_item (vsif_tree, hf_docsis_vsif_vendorid, tvb, 2, 3, FALSE);
+
+      /* switch on the Vendor ID */
+      switch (value)
+       {
+       case VENDOR_CISCO:
+         proto_item_append_text (it, " (Cisco)");
+         dissect_cisco (tvb, vsif_tree, vsif_len);
+         break;
+       default:
+         proto_item_append_text (it, " (Unknown)");
+         proto_tree_add_item (vsif_tree, hf_docsis_vsif_vendor_unknown, tvb,
+                              0, -1, FALSE);
+         break;
+       }
+
+    }                          /* if(tree) */
+
+
+}
+
+
+/* Dissector for Cisco Vendor Specific TLV's */
+
+#define NUM_PHONES 0x0a
+#define IOS_CONFIG_FILE 0x80
+#define IP_PREC 0x0b
+#define IP_PREC_VAL 0x01
+#define IP_PREC_BW  0x02
+
+static void
+dissect_cisco (tvbuff_t * tvb, proto_tree * tree, guint8 vsif_len)
+{
+  /* Start at pos = 5, since tvb includes the Vendor ID field */
+  guint16 pos = 5;
+  guint8 type, length;
+  proto_item *ipprec_it;
+  proto_tree *ipprec_tree;
+  guint16 templen;
+
+  while (pos < vsif_len)
+    {
+      /* Extract the type and length Fields from the TLV */
+      type = tvb_get_guint8 (tvb, pos++);
+      length = tvb_get_guint8 (tvb, pos++);
+      switch (type)
+       {
+       case NUM_PHONES:
+         proto_tree_add_item (tree, hf_docsis_vsif_cisco_numphones, tvb,
+                              pos, length, FALSE);
+         break;
+       case IP_PREC:
+         ipprec_it =
+           proto_tree_add_text (tree, tvb, pos, length, "IP Precedence");
+         ipprec_tree =
+           proto_item_add_subtree (ipprec_it, ett_docsis_vsif_ipprec);
+         /* Handle Sub-TLVs in IP Precedence */
+         templen = pos + length;
+         while (pos < templen)
+           {
+             type = tvb_get_guint8 (tvb, pos++);
+             length = tvb_get_guint8 (tvb, pos++);
+             switch (type)
+               {
+               case IP_PREC_VAL:
+                 if (length != 1)
+                   THROW (ReportedBoundsError);
+                 proto_tree_add_item (ipprec_tree,
+                                      hf_docsis_vsif_cisco_ipprec_val, tvb,
+                                      pos, length, FALSE);
+                 break;
+               case IP_PREC_BW:
+                 if (length != 4)
+                   THROW (ReportedBoundsError);
+                 proto_tree_add_item (ipprec_tree,
+                                      hf_docsis_vsif_cisco_ipprec_bw, tvb,
+                                      pos, length, FALSE);
+                 break;
+               default:
+                 THROW (ReportedBoundsError);
+               }
+             pos += length;
+           }
+         break;
+       case IOS_CONFIG_FILE:
+         proto_tree_add_item (tree, hf_docsis_vsif_cisco_config_file, tvb,
+                              pos, length, FALSE);
+       }
+      pos += length;
+    }
+
+}
+
+
+
+/* Register the protocol with Ethereal */
+
+/* this format is require because a script is used to build the C function
+   that calls all the protocol registration.
+*/
+
+
+void
+proto_register_docsis_vsif (void)
+{
+
+/* Setup list of header fields  See Section 1.6.1 for details*/
+  static hf_register_info hf[] = {
+    {&hf_docsis_vsif,
+     {"VSIF Encodings", "docsis.vsif",
+      FT_BYTES, BASE_HEX, NULL, 0x0,
+      "Vendor Specific Encodings", HFILL}
+     },
+    {&hf_docsis_vsif_vendorid,
+     {"Vendor Id", "docsis.vsif.vendorid",
+      FT_UINT24, BASE_HEX, VALS(vendorid_vals), 0x0,
+      "Vendor Identifier", HFILL}
+     },
+    {&hf_docsis_vsif_vendor_unknown,
+     {"VSIF Encodings", "docsis.vsif.unknown",
+      FT_BYTES, BASE_HEX, NULL, 0x0,
+      "Unknown Vendor", HFILL}
+     },
+    {&hf_docsis_vsif_cisco_numphones,
+     {"Number of phone lines", "docsis.vsif.cisco.numphones",
+      FT_UINT8, BASE_DEC, NULL, 0x0,
+      "Number of phone lines", HFILL}
+     },
+    {&hf_docsis_vsif_cisco_ipprec,
+     {"IP Precedence Encodings", "docsis.vsif.cisco.ipprec",
+      FT_BYTES, BASE_HEX, NULL, 0x0,
+      "IP Precedence Encodings", HFILL}
+     },
+    {&hf_docsis_vsif_cisco_ipprec_val,
+     {"IP Precedence Value", "docsis.vsif.cisco.ipprec.value",
+      FT_UINT8, BASE_DEC, NULL, 0x0,
+      "IP Precedence Value", HFILL}
+     },
+    {&hf_docsis_vsif_cisco_ipprec_bw,
+     {"IP Precedence Bandwidth", "docsis.vsif.cisco.ipprec.bw",
+      FT_UINT8, BASE_DEC, NULL, 0x0,
+      "IP Precedence Bandwidth", HFILL}
+     },
+    {&hf_docsis_vsif_cisco_config_file,
+     {"IOS Config File", "docsis.vsif.cisco.iosfile",
+      FT_STRING, BASE_DEC, NULL, 0x0,
+      "IOS Config File", HFILL}
+     },
+  };
+
+/* Setup protocol subtree array */
+  static gint *ett[] = {
+    &ett_docsis_vsif,
+    &ett_docsis_vsif_ipprec,
+  };
+
+/* Register the protocol name and description */
+  proto_docsis_vsif =
+    proto_register_protocol ("DOCSIS Vendor Specific Endodings",
+                            "DOCSIS VSIF", "docsis_vsif");
+
+/* Required function calls to register the header fields and subtrees used */
+  proto_register_field_array (proto_docsis_vsif, hf, array_length (hf));
+  proto_register_subtree_array (ett, array_length (ett));
+
+  register_dissector ("docsis_vsif", dissect_vsif, proto_docsis_vsif);
+}
+
+
+/* If this dissector uses sub-dissector registration add a registration routine.
+   This format is required because a script is used to find these routines and
+   create the code that calls these routines.
+*/
+void
+proto_reg_handoff_docsis_vsif (void)
+{
+  dissector_handle_t docsis_vsif_handle;
+
+  docsis_vsif_handle = find_dissector ("docsis_vsif");
+  assert (docsis_vsif_handle);
+  dissector_add ("docsis", 0xFD, docsis_vsif_handle);
+
+}