aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/camel/packet-camel-template.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/asn1/camel/packet-camel-template.c')
-rw-r--r--epan/dissectors/asn1/camel/packet-camel-template.c209
1 files changed, 112 insertions, 97 deletions
diff --git a/epan/dissectors/asn1/camel/packet-camel-template.c b/epan/dissectors/asn1/camel/packet-camel-template.c
index b883fdfae3..298da2351f 100644
--- a/epan/dissectors/asn1/camel/packet-camel-template.c
+++ b/epan/dissectors/asn1/camel/packet-camel-template.c
@@ -48,9 +48,9 @@
#define PFNAME "camel"
/* Initialize the protocol and registered fields */
-static int proto_camel = -1;
-int date_format = 1; /*assume european date format */
-int camel_tap = -1;
+static int proto_camel;
+static int date_format = 1; /*assume european date format */
+static int camel_tap;
/* Global variables */
static guint32 opcode=0;
static guint32 errorCode=0;
@@ -66,38 +66,40 @@ static struct camelsrt_info_t camelsrt_global_info[MAX_CAMEL_INSTANCE];
/* ROSE context */
static rose_ctx_t camel_rose_ctx;
-static int hf_digit = -1;
-static int hf_camel_extension_code_local = -1;
-static int hf_camel_error_code_local = -1;
-static int hf_camel_cause_indicator = -1;
-static int hf_camel_PDPTypeNumber_etsi = -1;
-static int hf_camel_PDPTypeNumber_ietf = -1;
-static int hf_camel_PDPAddress_IPv4 = -1;
-static int hf_camel_PDPAddress_IPv6 = -1;
-static int hf_camel_cellGlobalIdOrServiceAreaIdFixedLength = -1;
-static int hf_camel_RP_Cause = -1;
-static int hf_camel_CAMEL_AChBillingChargingCharacteristics = -1;
-static int hf_camel_CAMEL_FCIBillingChargingCharacteristics = -1;
-static int hf_camel_CAMEL_FCIGPRSBillingChargingCharacteristics = -1;
-static int hf_camel_CAMEL_FCISMSBillingChargingCharacteristics = -1;
-static int hf_camel_CAMEL_SCIBillingChargingCharacteristics = -1;
-static int hf_camel_CAMEL_SCIGPRSBillingChargingCharacteristics = -1;
-static int hf_camel_CAMEL_CallResult = -1;
+static int hf_digit;
+static int hf_camel_extension_code_local;
+static int hf_camel_error_code_local;
+static int hf_camel_cause_indicator;
+static int hf_camel_PDPTypeNumber_etsi;
+static int hf_camel_PDPTypeNumber_ietf;
+static int hf_camel_PDPAddress_IPv4;
+static int hf_camel_PDPAddress_IPv6;
+static int hf_camel_cellGlobalIdOrServiceAreaIdFixedLength;
+static int hf_camel_RP_Cause;
+static int hf_camel_CAMEL_AChBillingChargingCharacteristics;
+static int hf_camel_CAMEL_FCIBillingChargingCharacteristics;
+static int hf_camel_CAMEL_FCIGPRSBillingChargingCharacteristics;
+static int hf_camel_CAMEL_FCISMSBillingChargingCharacteristics;
+static int hf_camel_CAMEL_SCIBillingChargingCharacteristics;
+static int hf_camel_CAMEL_SCIGPRSBillingChargingCharacteristics;
+static int hf_camel_CAMEL_CallResult;
/* Used by persistent data */
-static int hf_camelsrt_SessionId=-1;
-static int hf_camelsrt_RequestNumber=-1;
-static int hf_camelsrt_Duplicate=-1;
-static int hf_camelsrt_RequestFrame=-1;
-static int hf_camelsrt_ResponseFrame=-1;
-static int hf_camelsrt_DeltaTime=-1;
-static int hf_camelsrt_SessionTime=-1;
-static int hf_camelsrt_DeltaTime31=-1;
-static int hf_camelsrt_DeltaTime75=-1;
-static int hf_camelsrt_DeltaTime65=-1;
-static int hf_camelsrt_DeltaTime22=-1;
-static int hf_camelsrt_DeltaTime35=-1;
-static int hf_camelsrt_DeltaTime80=-1;
+static int hf_camelsrt_SessionId;
+//static int hf_camelsrt_RequestNumber;
+static int hf_camelsrt_Duplicate;
+static int hf_camelsrt_RequestFrame;
+static int hf_camelsrt_ResponseFrame;
+//static int hf_camelsrt_DeltaTime;
+//static int hf_camelsrt_SessionTime;
+static int hf_camelsrt_DeltaTime31;
+static int hf_camelsrt_DeltaTime75;
+static int hf_camelsrt_DeltaTime65;
+static int hf_camelsrt_DeltaTime22;
+static int hf_camelsrt_DeltaTime35;
+static int hf_camelsrt_DeltaTime80;
+static int hf_camel_timeandtimezone_time;
+static int hf_camel_timeandtimezone_tz;
#include "packet-camel-hf.c"
@@ -107,46 +109,48 @@ static struct camelsrt_info_t * gp_camelsrt_info;
static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx);
static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx);
static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx);
-static int dissect_camel_CAMEL_AChBillingChargingCharacteristics(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
-static int dissect_camel_CAMEL_AChBillingChargingCharacteristicsV2(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
-static int dissect_camel_CAMEL_CallResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
-static int dissect_camel_EstablishTemporaryConnectionArgV2(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
-static int dissect_camel_SpecializedResourceReportArgV23(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
+static int dissect_camel_CAMEL_AChBillingChargingCharacteristics(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
+static int dissect_camel_CAMEL_AChBillingChargingCharacteristicsV2(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
+static int dissect_camel_CAMEL_CallResult(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
+static int dissect_camel_EstablishTemporaryConnectionArgV2(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
+static int dissect_camel_SpecializedResourceReportArgV23(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
/* XXX - can we get rid of these and always do the SRT work? */
-static gboolean gcamel_HandleSRT=FALSE;
static gboolean gcamel_PersistentSRT=FALSE;
static gboolean gcamel_DisplaySRT=FALSE;
gboolean gcamel_StatSRT=FALSE;
/* Initialize the subtree pointers */
-static gint ett_camel = -1;
-static gint ett_camelisup_parameter = -1;
-static gint ett_camel_AccessPointName = -1;
-static gint ett_camel_pdptypenumber = -1;
-static gint ett_camel_cause = -1;
-static gint ett_camel_RPcause = -1;
-static gint ett_camel_stat = -1;
-static gint ett_camel_calledpartybcdnumber = -1;
-static gint ett_camel_callingpartynumber = -1;
-static gint ett_camel_originalcalledpartyid = -1;
-static gint ett_camel_redirectingpartyid = -1;
-static gint ett_camel_locationnumber = -1;
-static gint ett_camel_additionalcallingpartynumber = -1;
-static gint ett_camel_calledAddressValue = -1;
-static gint ett_camel_callingAddressValue = -1;
-static gint ett_camel_assistingSSPIPRoutingAddress = -1;
-static gint ett_camel_correlationID = -1;
-static gint ett_camel_dTMFDigitsCompleted = -1;
-static gint ett_camel_dTMFDigitsTimeOut = -1;
-static gint ett_camel_number = -1;
-static gint ett_camel_digitsResponse = -1;
+static gint ett_camel;
+static gint ett_camelisup_parameter;
+static gint ett_camel_AccessPointName;
+static gint ett_camel_pdptypenumber;
+static gint ett_camel_cause;
+static gint ett_camel_RPcause;
+static gint ett_camel_stat;
+static gint ett_camel_calledpartybcdnumber;
+static gint ett_camel_callingpartynumber;
+static gint ett_camel_originalcalledpartyid;
+static gint ett_camel_redirectingpartyid;
+static gint ett_camel_locationnumber;
+static gint ett_camel_additionalcallingpartynumber;
+static gint ett_camel_calledAddressValue;
+static gint ett_camel_callingAddressValue;
+static gint ett_camel_assistingSSPIPRoutingAddress;
+static gint ett_camel_correlationID;
+static gint ett_camel_dTMFDigitsCompleted;
+static gint ett_camel_dTMFDigitsTimeOut;
+static gint ett_camel_number;
+static gint ett_camel_digitsResponse;
+static gint ett_camel_timeandtimezone;
#include "packet-camel-ett.c"
-static expert_field ei_camel_unknown_invokeData = EI_INIT;
-static expert_field ei_camel_unknown_returnResultData = EI_INIT;
-static expert_field ei_camel_unknown_returnErrorData = EI_INIT;
+static expert_field ei_camel_unknown_invokeData;
+static expert_field ei_camel_unknown_returnResultData;
+static expert_field ei_camel_unknown_returnErrorData;
+static expert_field ei_camel_par_wrong_length;
+static expert_field ei_camel_bcd_not_digit;
/* Preference settings default */
#define MAX_SSN 254
@@ -184,7 +188,7 @@ static const value_string camel_Component_vals[] = {
const value_string camelSRTtype_naming[]= {
{ CAMELSRT_SESSION, "TCAP_Session" },
- { CAMELSRT_VOICE_INITIALDP, "InialDP/Continue" },
+ { CAMELSRT_VOICE_INITIALDP, "InitialDP/Continue" },
{ CAMELSRT_VOICE_ACR1, "Slice1_ACR/ACH" },
{ CAMELSRT_VOICE_ACR2, "Slice2_ACR/ACH" },
{ CAMELSRT_VOICE_ACR3, "Slice3_ACR/ACH" },
@@ -342,7 +346,7 @@ camelstat_init(struct register_srt* srt _U_, GArray* srt_array)
}
static tap_packet_status
-camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
+camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi, tap_flags_t flags _U_)
{
guint idx = 0;
srt_stat_table *camel_srt_table;
@@ -400,7 +404,7 @@ dissect_RP_cause_ie(tvbuff_t *tvb, guint32 offset, _U_ guint len,
return(curr_offset - offset);
}
-static int dissect_camel_InitialDPArgExtensionV2(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
+static int dissect_camel_InitialDPArgExtensionV2(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
#include "packet-camel-fn.c"
@@ -496,9 +500,9 @@ camelsrt_init_routine(void)
/* The Display of SRT is enable
* 1) For wireshark only if Persistent Stat is enable
- * 2) For Tshark, if the SRT handling is enable
+ * 2) For Tshark, if the SRT CLI tap is registered
*/
- gcamel_DisplaySRT=gcamel_PersistentSRT || gcamel_HandleSRT&gcamel_StatSRT;
+ gcamel_DisplaySRT=gcamel_PersistentSRT || gcamel_StatSRT;
}
@@ -1054,7 +1058,7 @@ static guint8 camel_pdu_size = 0;
static int
-dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_,proto_tree *tree,
+dissect_camel_camelPDU(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_,proto_tree *tree,
int hf_index, struct tcap_private_t * p_private_tcap) {
opcode = 0;
@@ -1105,8 +1109,7 @@ dissect_camel_all(int version, const char* col_protocol, const char* suffix,
dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap);
/* If a Tcap context is associated to this transaction */
- if (gcamel_HandleSRT &&
- gp_camelsrt_info->tcap_context ) {
+ if (gp_camelsrt_info->tcap_context ) {
if (gcamel_DisplaySRT && tree) {
stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_camel_stat, NULL, "Stat");
}
@@ -1175,6 +1178,7 @@ static void camel_stat_init(stat_tap_table_ui* new_stat)
table = stat_tap_init_table(table_name, num_fields, 0, NULL);
stat_tap_add_table(new_stat, table);
+ memset(items, 0x0, sizeof(items));
items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING;
items[COUNT_COLUMN].type = TABLE_ITEM_UINT;
items[COUNT_COLUMN].value.uint_value = 0;
@@ -1185,9 +1189,9 @@ static void camel_stat_init(stat_tap_table_ui* new_stat)
const char *ocs = try_val_to_str(i, camel_opr_code_strings);
char *col_str;
if (ocs) {
- col_str = g_strdup_printf("Request %s", ocs);
+ col_str = ws_strdup_printf("Request %s", ocs);
} else {
- col_str = g_strdup_printf("Unknown op code %d", i);
+ col_str = ws_strdup_printf("Unknown op code %d", i);
}
items[MESSAGE_TYPE_COLUMN].value.string_value = col_str;
@@ -1196,7 +1200,7 @@ static void camel_stat_init(stat_tap_table_ui* new_stat)
}
static tap_packet_status
-camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *csi_ptr)
+camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *csi_ptr, tap_flags_t flags _U_)
{
stat_data_t* stat_data = (stat_data_t*)tapdata;
const struct camelsrt_info_t *csi = (const struct camelsrt_info_t *) csi_ptr;
@@ -1376,12 +1380,12 @@ void proto_register_camel(void) {
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
- { &hf_camelsrt_RequestNumber,
- { "Request Number",
- "camel.srt.request_number",
- FT_UINT64, BASE_DEC, NULL, 0x0,
- NULL, HFILL }
- },
+ //{ &hf_camelsrt_RequestNumber,
+ // { "Request Number",
+ // "camel.srt.request_number",
+ // FT_UINT64, BASE_DEC, NULL, 0x0,
+ // NULL, HFILL }
+ //},
{ &hf_camelsrt_Duplicate,
{ "Request Duplicate",
"camel.srt.duplicate",
@@ -1400,18 +1404,18 @@ void proto_register_camel(void) {
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"SRT Response Frame", HFILL }
},
- { &hf_camelsrt_DeltaTime,
- { "Service Response Time",
- "camel.srt.deltatime",
- FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
- "DeltaTime between Request and Response", HFILL }
- },
- { &hf_camelsrt_SessionTime,
- { "Session duration",
- "camel.srt.sessiontime",
- FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
- "Duration of the TCAP session", HFILL }
- },
+ //{ &hf_camelsrt_DeltaTime,
+ // { "Service Response Time",
+ // "camel.srt.deltatime",
+ // FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
+ // "DeltaTime between Request and Response", HFILL }
+ //},
+ //{ &hf_camelsrt_SessionTime,
+ // { "Session duration",
+ // "camel.srt.sessiontime",
+ // FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
+ // "Duration of the TCAP session", HFILL }
+ //},
{ &hf_camelsrt_DeltaTime31,
{ "Service Response Time",
"camel.srt.deltatime31",
@@ -1448,7 +1452,18 @@ void proto_register_camel(void) {
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
"DeltaTime between EventReportGPRS and ContinueGPRS", HFILL }
},
-
+ { &hf_camel_timeandtimezone_time,
+ { "Time",
+ "camel.timeandtimezone.time",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_camel_timeandtimezone_tz,
+ { "Time Zone",
+ "camel.timeandtimezone.timezone",
+ FT_INT8, BASE_DEC, NULL, 0x0,
+ "Difference, expressed in quarters of an hour, between local time and GMT", HFILL }
+ },
#ifdef REMOVED
#endif
#include "packet-camel-hfarr.c"
@@ -1477,6 +1492,7 @@ void proto_register_camel(void) {
&ett_camel_dTMFDigitsTimeOut,
&ett_camel_number,
&ett_camel_digitsResponse,
+ &ett_camel_timeandtimezone,
#include "packet-camel-ettarr.c"
};
@@ -1485,6 +1501,8 @@ void proto_register_camel(void) {
{ &ei_camel_unknown_invokeData, { "camel.unknown.invokeData", PI_MALFORMED, PI_WARN, "Unknown invokeData", EXPFILL }},
{ &ei_camel_unknown_returnResultData, { "camel.unknown.returnResultData", PI_MALFORMED, PI_WARN, "Unknown returnResultData", EXPFILL }},
{ &ei_camel_unknown_returnErrorData, { "camel.unknown.returnErrorData", PI_MALFORMED, PI_WARN, "Unknown returnResultData", EXPFILL }},
+ { &ei_camel_par_wrong_length, { "camel.par_wrong_length", PI_PROTOCOL, PI_ERROR, "Wrong length of parameter", EXPFILL }},
+ { &ei_camel_bcd_not_digit, { "camel.bcd_not_digit", PI_MALFORMED, PI_WARN, "BCD number contains a value that is not a digit", EXPFILL }},
};
expert_module_t* expert_camel;
@@ -1552,10 +1570,7 @@ void proto_register_camel(void) {
"TCAP Subsystem numbers used for Camel",
&global_ssn_range, MAX_SSN);
- prefs_register_bool_preference(camel_module, "srt",
- "Analyze Service Response Time",
- "Enable response time analysis",
- &gcamel_HandleSRT);
+ prefs_register_obsolete_preference(camel_module, "srt");
prefs_register_bool_preference(camel_module, "persistentsrt",
"Persistent stats for SRT",