Call the SSCOP dissector through a handle. That lets us get rid of the
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 27 May 2001 04:50:51 +0000 (04:50 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 27 May 2001 04:50:51 +0000 (04:50 +0000)
CHECK_DISPLAY_AS_DATA call and code to set "pinfo->current_proto", as
"call_dissector()" does that for us.

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

Makefile.am
packet-atm.c
packet-sscop.c
packet-sscop.h [deleted file]

index 2a7886acaaebda0dfd23429ca6ef203232713d79..a0ede554146ceb566b8fba77b215d5c8b516f473 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal
 #
-# $Id: Makefile.am,v 1.324 2001/05/25 16:17:22 guy Exp $
+# $Id: Makefile.am,v 1.325 2001/05/27 04:50:51 guy Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@zing.org>
@@ -322,7 +322,6 @@ noinst_HEADERS = \
        packet-sna.h   \
        packet-snmp.h   \
        packet-spray.h \
-       packet-sscop.h \
        packet-stat.h   \
        packet-stat-notify.h \
        packet-tcp.h   \
index 1ba40260c79485d79c264aa7fd009ec9f632c274..1c438c21c8be39305249ee7670854742e0131bc6 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-atm.c
  * Routines for ATM packet disassembly
  *
- * $Id: packet-atm.c,v 1.33 2001/04/15 07:30:02 guy Exp $
+ * $Id: packet-atm.c,v 1.34 2001/05/27 04:50:51 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -38,7 +38,6 @@
 #include "resolv.h"
 
 #include "packet-snmp.h"
-#include "packet-sscop.h"
 
 static int proto_atm = -1;
 static int hf_atm_vpi = -1;
@@ -57,6 +56,7 @@ static gint ett_ilmi = -1;
 static dissector_handle_t eth_handle;
 static dissector_handle_t tr_handle;
 static dissector_handle_t llc_handle;
+static dissector_handle_t sscop_handle;
 
 /*
  * See
@@ -716,7 +716,7 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   switch (aal_type) {
 
   case ATT_AAL_SIGNALLING:
-    dissect_sscop(tvb, pinfo, tree);
+    call_dissector(sscop_handle, tvb, pinfo, tree);
     break;
 
   case ATT_AAL5:
@@ -789,11 +789,13 @@ void
 proto_reg_handoff_atm(void)
 {
        /*
-        * Get handles for the Ethernet, Token Ring, and LLC dissectors.
+        * Get handles for the Ethernet, Token Ring, LLC, and SSCOP
+        * dissectors.
         */
        eth_handle = find_dissector("eth");
        tr_handle = find_dissector("tr");
        llc_handle = find_dissector("llc");
+       sscop_handle = find_dissector("sscop");
 
        dissector_add("wtap_encap", WTAP_ENCAP_ATM_SNIFFER, dissect_atm,
            proto_atm);
index 01a7c1b9cd248633ce35a632336c6c76772d95d7..e989489231f73f7cdba7136cd686b19386c90fef 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for SSCOP (Q.2110, Q.SAAL) frame disassembly
  * Guy Harris <guy@alum.mit.edu>
  *
- * $Id: packet-sscop.c,v 1.13 2001/01/03 06:55:33 guy Exp $
+ * $Id: packet-sscop.c,v 1.14 2001/05/27 04:50:51 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -132,7 +132,7 @@ static const value_string sscop_type_vals[] = {
 #define        SSCOP_SS_N_MR   (reported_length - 8)   /* lower 3 bytes thereof */
 #define        SSCOP_SS_N_R    (reported_length - 4)   /* lower 3 bytes thereof */
 
-void
+static void
 dissect_sscop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
   guint reported_length;
@@ -144,10 +144,6 @@ dissect_sscop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   int pad_len;
   tvbuff_t *next_tvb;
 
-  CHECK_DISPLAY_AS_DATA(proto_sscop, tvb, pinfo, tree);
-
-  pinfo->current_proto = "SSCOP";
-
   reported_length = tvb_reported_length(tvb);  /* frame length */
   sscop_pdu_type = tvb_get_guint8(tvb, SSCOP_PDU_TYPE);
   pdu_type = sscop_pdu_type & SSCOP_TYPE_MASK;
@@ -324,4 +320,5 @@ proto_register_sscop(void)
        };
        proto_sscop = proto_register_protocol("SSCOP", "SSCOP", "sscop");
        proto_register_subtree_array(ett, array_length(ett));
+       register_dissector("sscop", dissect_sscop, proto_sscop);
 }
diff --git a/packet-sscop.h b/packet-sscop.h
deleted file mode 100644 (file)
index 2a7d91d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* packet-sscop.h
- *
- * $Id: packet-sscop.h,v 1.3 2000/08/11 13:33:59 deniel Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
- * 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.
- */
-
-#ifndef __PACKET_SSCOP_H__
-#define __PACKET_SSCOP_H__
-
-void dissect_sscop(tvbuff_t *, packet_info *, proto_tree *);
-
-#endif