From e2f6b3f5308a1ff7e5590d21b148bfc306d6901c Mon Sep 17 00:00:00 2001 From: etxrab Date: Tue, 26 Jan 2010 16:52:19 +0000 Subject: Remove redundant code (the local variable 'opcode' seems to be set but is never used.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31683 f5534014-38df-0310-8fa8-9805f1628bb7 --- asn1/camel/camel.cnf | 26 ----------- asn1/camel/packet-camel-template.c | 89 +------------------------------------- 2 files changed, 1 insertion(+), 114 deletions(-) (limited to 'asn1/camel') diff --git a/asn1/camel/camel.cnf b/asn1/camel/camel.cnf index 1f5dcfbbe6..43b41ecbe5 100644 --- a/asn1/camel/camel.cnf +++ b/asn1/camel/camel.cnf @@ -162,32 +162,6 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,a return offset; } #.END -# Create a table of opcode and corresponding args and res -#.TABLE11_HDR -typedef struct _camel_op_t { - gint32 opcode; - new_dissector_t arg_pdu; - new_dissector_t res_pdu; -} camel_op_t; - -static const camel_op_t camel_op_tab[] = { -#.TABLE11_BODY OPERATION - /* %(_name)-31s */ { %(&operationCode)-40s, %(_argument_pdu)-45s, %(_result_pdu)s }, -#.TABLE11_FTR -}; -#.END -#.TABLE21_HDR -typedef struct _camel_err_t { - gint32 errcode; - new_dissector_t err_pdu; -} camel_err_t; - -static const camel_err_t camel_err_tab[] = { -#.TABLE21_BODY ERROR - /* %(_name)-24s */ { %(&errorCode)4s, %(_parameter_pdu)s }, -#.TABLE21_FTR -}; -#.END # ROS stuff here XXX change when TCAP is redone. #.FN_BODY Code/local VAL_PTR = &opcode diff --git a/asn1/camel/packet-camel-template.c b/asn1/camel/packet-camel-template.c index 043f054ec5..de5ffaf098 100644 --- a/asn1/camel/packet-camel-template.c +++ b/asn1/camel/packet-camel-template.c @@ -4,7 +4,7 @@ * Copyright 2005, Olivier Jacques * Copyright 2005, Javier Acuna * Updated to ETSI TS 129 078 V6.4.0 (2004-3GPP TS 29.078 version 6.4.0 Release 6 1 12) - * Copyright 2005-2007, Anders Broman + * Copyright 2005-2010, Anders Broman * Updated to 3GPP TS 29.078 version 7.3.0 Release 7 (2006-06) * Built from the gsm-map dissector Copyright 2004, Anders Broman * @@ -316,8 +316,6 @@ dissect_RP_cause_ie(tvbuff_t *tvb, guint32 offset, _U_ guint len, #include "packet-camel-table2.c" -#include "packet-camel-table11.c" -#include "packet-camel-table21.c" static guint8 camel_pdu_type = 0; static guint8 camel_pdu_size = 0; @@ -360,77 +358,6 @@ dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn return offset; } -/*--- dissect_camel_arg ------------------------------------------------------*/ -static int -dissect_camel_arg(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_) { - int offset; - rose_ctx_t *rctx; - gint32 opcode; - /* - const camel_op_t *op_ptr; - const gchar *p; - proto_item *ti, *ti_tmp; - proto_tree *camel_tree; -*/ - offset = 0; - rctx = get_rose_ctx(pinfo->private_data); - DISSECTOR_ASSERT(rctx); - if (rctx->d.pdu != 1) /* invoke */ - return offset; - if (rctx->d.code != 0) /* local */ - return offset; - opcode = rctx->d.code_local; - - return offset; -} - -/*--- dissect_camel_res -------------------------------------------------------*/ -static int -dissect_camel_res(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_) { - gint offset; - rose_ctx_t *rctx; - gint32 opcode; - /* - const camel_op_t *op_ptr; - const gchar *p; - proto_item *ti, *ti_tmp; - proto_tree *camel_tree; -*/ - offset = 0; - rctx = get_rose_ctx(pinfo->private_data); - DISSECTOR_ASSERT(rctx); - if (rctx->d.pdu != 2) /* returnResult */ - return offset; - if (rctx->d.code != 0) /* local */ - return offset; - opcode = rctx->d.code_local; - - return offset; -} -/*--- dissect_camel_err ------------------------------------------------------*/ -static int -dissect_camel_err(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_) { - int offset; - rose_ctx_t *rctx; - gint32 errcode; - /* - const camel_err_t *err_ptr; - const gchar *p; - proto_item *ti; - proto_tree *camel_tree; -*/ - offset = 0; - rctx = get_rose_ctx(pinfo->private_data); - DISSECTOR_ASSERT(rctx); - if (rctx->d.pdu != 3) /* returnError */ - return offset; - if (rctx->d.code != 0) /* local */ - return offset; - errcode = rctx->d.code_local; - - return offset; - -} static void dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) @@ -486,17 +413,10 @@ void proto_reg_handoff_camel(void) { static range_t *ssn_range; if (!camel_prefs_initialized) { - int i; - dissector_handle_t camel_arg_handle; - dissector_handle_t camel_res_handle; - dissector_handle_t camel_err_handle; camel_prefs_initialized = TRUE; camel_handle = find_dissector("camel"); - camel_arg_handle = new_create_dissector_handle(dissect_camel_arg, proto_camel); - camel_res_handle = new_create_dissector_handle(dissect_camel_res, proto_camel); - camel_err_handle = new_create_dissector_handle(dissect_camel_err, proto_camel); register_ber_oid_dissector_handle("0.4.0.0.1.0.50.0",camel_handle, proto_camel, "CAP-v1-gsmSSF-to-gsmSCF-AC" ); register_ber_oid_dissector_handle("0.4.0.0.1.0.50.1",camel_handle, proto_camel, "CAP-v2-gsmSSF-to-gsmSCF-AC" ); @@ -508,13 +428,6 @@ void proto_reg_handoff_camel(void) { register_ber_oid_dissector_handle("0.4.0.0.1.23.3.4",camel_handle, proto_camel, "capssf-scfGenericAC" ); register_ber_oid_dissector_handle("0.4.0.0.1.23.3.61",camel_handle, proto_camel, "cap4-sms-AC" ); - for (i=0; i<(int)array_length(camel_op_tab); i++) { - dissector_add("camel.ros.local.arg", camel_op_tab[i].opcode, camel_arg_handle); - dissector_add("camel.ros.local.res", camel_op_tab[i].opcode, camel_res_handle); - } - for (i=0; i<(int)array_length(camel_err_tab); i++) { - dissector_add("camel.ros.local.err", camel_err_tab[i].errcode, camel_err_handle); - } #include "packet-camel-dis-tab.c" } else { -- cgit v1.2.3