* Routines for SSCOP (Q.2110, Q.SAAL) frame disassembly
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-sscop.c,v 1.8 2000/05/29 08:57:40 guy Exp $
+ * $Id: packet-sscop.c,v 1.20 2002/08/28 21:00:35 jmayer Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998
*
- *
+ *
* 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"
#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
#include <stdio.h>
#include <glib.h>
#include <string.h>
-#include "packet.h"
-#include "packet-q2931.h"
+#include <epan/packet.h>
static int proto_sscop = -1;
static gint ett_sscop = -1;
+static dissector_handle_t q2931_handle;
+static dissector_handle_t data_handle;
+
/*
* See
*
#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;
int pad_len;
tvbuff_t *next_tvb;
- 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;
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_add_str(pinfo->fd, COL_PROTOCOL, "SSCOP");
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, val_to_str(pdu_type, sscop_type_vals,
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SSCOP");
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str(pdu_type, sscop_type_vals,
"Unknown PDU type (0x%02x)"));
/*
*/
next_tvb = tvb_new_subset(tvb, 0, reported_length, reported_length);
if (pdu_type == SSCOP_SD)
- dissect_q2931(next_tvb, pinfo, tree);
+ call_dissector(q2931_handle, next_tvb, pinfo, tree);
else
- dissect_data_tvb(next_tvb, pinfo, tree);
+ call_dissector(data_handle,next_tvb, pinfo, tree);
}
break;
}
void
proto_register_sscop(void)
{
- static gint *ett[] = {
- &ett_sscop,
- };
- proto_sscop = proto_register_protocol("SSCOP", "sscop");
- proto_register_subtree_array(ett, array_length(ett));
+ static gint *ett[] = {
+ &ett_sscop,
+ };
+ proto_sscop = proto_register_protocol("SSCOP", "SSCOP", "sscop");
+ proto_register_subtree_array(ett, array_length(ett));
+ register_dissector("sscop", dissect_sscop, proto_sscop);
+}
+
+void
+proto_reg_handoff_sscop(void)
+{
+ /*
+ * Get handle for the Q.2931 dissector.
+ */
+ q2931_handle = find_dissector("q2931");
+ data_handle = find_dissector("data");
}