summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/inap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
commita86c5f7cae7ec9a3398300555a0b644689d946a1 (patch)
tree39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/asn1/inap
parentReleasing progress-linux version 4.2.6-1~progress7.99u1. (diff)
downloadwireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz
wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--epan/dissectors/asn1/inap/inap.cnf38
-rw-r--r--epan/dissectors/asn1/inap/packet-inap-template.c99
2 files changed, 70 insertions, 67 deletions
diff --git a/epan/dissectors/asn1/inap/inap.cnf b/epan/dissectors/asn1/inap/inap.cnf
index fe9ad0ac..755480e0 100644
--- a/epan/dissectors/asn1/inap/inap.cnf
+++ b/epan/dissectors/asn1/inap/inap.cnf
@@ -63,12 +63,12 @@ ERROR.&ParameterType
OPERATION.&ArgumentType
OPERATION.&ResultType
-# This table creates the value_sting to name Inap operation codes and errors
+# This table creates the value_string to name Inap operation codes and errors
# in file packet-inap-table.c which is included in the template file
#
#.TABLE_HDR
/* INAP OPERATIONS */
-const value_string inap_opr_code_strings[] = {
+static const value_string inap_opr_code_strings[] = {
#.TABLE_BODY OPERATION.&operationCode
{ %(&operationCode)-40s, "%(_ident)s" },
#.TABLE_FTR
@@ -141,7 +141,7 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,a
# Create a table of opcode and corresponding args and res
#.TABLE11_HDR
typedef struct _inap_op_t {
- gint32 opcode;
+ int32_t opcode;
dissector_t arg_pdu;
dissector_t res_pdu;
} inap_op_t;
@@ -155,7 +155,7 @@ static const inap_op_t inap_op_tab[] = {
#.TABLE11_HDR
typedef struct _inap_err_t {
- gint32 errcode;
+ int32_t errcode;
dissector_t err_pdu;
} inap_err_t;
@@ -170,7 +170,7 @@ static const inap_err_t inap_err_tab[] = {
#.FN_BODY Code/local VAL_PTR = &opcode
%(DEFAULT_BODY)s
- if (is_ExtensionField == FALSE){
+ if (is_ExtensionField == false){
if (inap_opcode_type == INAP_OPCODE_RETURN_ERROR){
errorCode = opcode;
col_append_str(actx->pinfo->cinfo, COL_INFO, val_to_str(errorCode, inap_err_code_string_vals, "Unknown INAP error (%%u)"));
@@ -230,7 +230,7 @@ static const inap_err_t inap_err_tab[] = {
#.FN_HDR ExtensionField
obj_id = NULL;
- is_ExtensionField =TRUE;
+ is_ExtensionField =true;
#.FN_PARS Code/global FN_VARIANT = _str VAL_PTR = &obj_id
@@ -243,7 +243,7 @@ static const inap_err_t inap_err_tab[] = {
call_data_dissector(tvb, actx->pinfo, ext_tree);
offset = tvb_reported_length_remaining(tvb,offset);
}
- is_ExtensionField = FALSE;
+ is_ExtensionField = false;
@@ -334,7 +334,7 @@ dissect_isup_called_party_number_parameter(parameter_tvb, actx->pinfo, tree, NUL
* -- For the use of cause and location values refer to Q.850.
*/
tvbuff_t *parameter_tvb;
- guint8 Cause_value;
+ uint8_t Cause_value;
proto_tree *subtree;
%(DEFAULT_BODY)s
@@ -362,8 +362,8 @@ dissect_isup_called_party_number_parameter(parameter_tvb, actx->pinfo, tree, NUL
*/
tvbuff_t *parameter_tvb;
proto_tree *subtree;
- gint ett = -1;
- gboolean digits = FALSE;
+ int ett = -1;
+ bool digits = false;
%(DEFAULT_BODY)s
@@ -376,7 +376,7 @@ dissect_isup_called_party_number_parameter(parameter_tvb, actx->pinfo, tree, NUL
ett = ett_inap_assistingSSPIPRoutingAddress;
} else if (hf_index == hf_inap_correlationID) {
ett = ett_inap_correlationID;
- digits = (opcode != opcode_assistRequestInstructions) ? TRUE : FALSE;
+ digits = (opcode != opcode_assistRequestInstructions) ? true : false;
} else if (hf_index == hf_inap_calledAddressValue) {
ett = ett_inap_calledAddressValue;
} else if (hf_index == hf_inap_callingAddressValue) {
@@ -385,30 +385,30 @@ dissect_isup_called_party_number_parameter(parameter_tvb, actx->pinfo, tree, NUL
ett = ett_inap_number;
} else if (hf_index == hf_inap_dialledNumber) {
ett = ett_inap_dialledNumber;
- digits = TRUE;
+ digits = true;
} else if (hf_index == hf_inap_callingLineID) {
ett = ett_inap_callingLineID;
- digits = TRUE;
+ digits = true;
} else if (hf_index == hf_inap_iNServiceControlCode) {
ett = ett_inap_iNServiceControlCode;
- digits = TRUE;
+ digits = true;
} else if (hf_index == hf_inap_iNServiceControlCodeLow) {
ett = ett_inap_iNServiceControlCodeLow;
- digits = TRUE;
+ digits = true;
} else if (hf_index == hf_inap_iNServiceControlCodeHigh) {
ett = ett_inap_iNServiceControlCodeHigh;
- digits = TRUE;
+ digits = true;
} else if (hf_index == hf_inap_lineID) {
ett = ett_inap_lineID;
- digits = TRUE;
+ digits = true;
} else if (hf_index == hf_inap_prefix) {
ett = ett_inap_prefix;
- digits = TRUE;
+ digits = true;
} else if (hf_index == hf_inap_iPAddressValue) {
ett = ett_inap_iPAddressValue;
} else if (hf_index == hf_inap_digitsResponse) {
ett = ett_inap_digitsResponse;
- digits = TRUE;
+ digits = true;
}
subtree = proto_item_add_subtree(actx->created_item, ett);
diff --git a/epan/dissectors/asn1/inap/packet-inap-template.c b/epan/dissectors/asn1/inap/packet-inap-template.c
index 6baba991..cd91dd80 100644
--- a/epan/dissectors/asn1/inap/packet-inap-template.c
+++ b/epan/dissectors/asn1/inap/packet-inap-template.c
@@ -19,6 +19,7 @@
#include <epan/oids.h>
#include <epan/expert.h>
#include <epan/asn1.h>
+#include <wsutil/array.h>
#include "packet-ber.h"
#include "packet-inap.h"
@@ -38,7 +39,7 @@ void proto_reg_handoff_inap(void);
/* Initialize the protocol and registered fields */
-static int proto_inap = -1;
+static int proto_inap;
/* include constants */
#include "packet-inap-val.h"
@@ -51,10 +52,10 @@ static range_t *global_ssn_range;
static dissector_handle_t inap_handle;
/* Global variables */
-static guint32 opcode=0;
-static guint32 errorCode=0;
-static const char *obj_id = NULL;
-static gboolean is_ExtensionField =FALSE;
+static uint32_t opcode=0;
+static uint32_t errorCode=0;
+static const char *obj_id;
+static bool is_ExtensionField;
static int inap_opcode_type;
#define INAP_OPCODE_INVOKE 1
@@ -62,47 +63,49 @@ static int inap_opcode_type;
#define INAP_OPCODE_RETURN_ERROR 3
#define INAP_OPCODE_REJECT 4
-static int hf_inap_cause_indicator = -1;
+static int hf_inap_cause_indicator;
/* Initialize the subtree pointers */
-static gint ett_inap = -1;
-static gint ett_inapisup_parameter = -1;
-static gint ett_inap_RedirectionInformation = -1;
-static gint ett_inap_HighLayerCompatibility = -1;
-static gint ett_inap_extension_data = -1;
-static gint ett_inap_cause = -1;
-static gint ett_inap_calledAddressValue = -1;
-static gint ett_inap_callingAddressValue = -1;
-static gint ett_inap_additionalCallingPartyNumber = -1;
-static gint ett_inap_assistingSSPIPRoutingAddress = -1;
-static gint ett_inap_correlationID = -1;
-static gint ett_inap_number = -1;
-static gint ett_inap_dialledNumber = -1;
-static gint ett_inap_callingLineID = -1;
-static gint ett_inap_iNServiceControlCode = -1;
-static gint ett_inap_iNServiceControlCodeLow = -1;
-static gint ett_inap_iNServiceControlCodeHigh = -1;
-static gint ett_inap_lineID = -1;
-static gint ett_inap_prefix = -1;
-static gint ett_inap_iPAddressValue = -1;
-static gint ett_inap_digitsResponse = -1;
+static int ett_inap;
+static int ett_inapisup_parameter;
+static int ett_inap_RedirectionInformation;
+static int ett_inap_HighLayerCompatibility;
+static int ett_inap_extension_data;
+static int ett_inap_cause;
+static int ett_inap_calledAddressValue;
+static int ett_inap_callingAddressValue;
+static int ett_inap_additionalCallingPartyNumber;
+static int ett_inap_assistingSSPIPRoutingAddress;
+static int ett_inap_correlationID;
+static int ett_inap_number;
+static int ett_inap_dialledNumber;
+static int ett_inap_callingLineID;
+static int ett_inap_iNServiceControlCode;
+static int ett_inap_iNServiceControlCodeLow;
+static int ett_inap_iNServiceControlCodeHigh;
+static int ett_inap_lineID;
+static int ett_inap_prefix;
+static int ett_inap_iPAddressValue;
+static int ett_inap_digitsResponse;
#include "packet-inap-ett.c"
-static expert_field ei_inap_unknown_invokeData = EI_INIT;
-static expert_field ei_inap_unknown_returnResultData = EI_INIT;
-static expert_field ei_inap_unknown_returnErrorData = EI_INIT;
+static expert_field ei_inap_unknown_invokeData;
+static expert_field ei_inap_unknown_returnResultData;
+static expert_field ei_inap_unknown_returnErrorData;
#include "packet-inap-table.c"
-const value_string inap_general_problem_strings[] = {
-{0,"General Problem Unrecognized Component"},
-{1,"General Problem Mistyped Component"},
-{3,"General Problem Badly Structured Component"},
-{0, NULL}
+#if 0
+static const value_string inap_general_problem_strings[] = {
+ {0,"General Problem Unrecognized Component"},
+ {1,"General Problem Mistyped Component"},
+ {3,"General Problem Badly Structured Component"},
+ {0, NULL}
};
+#endif
-/* Forvard declarations */
+/* Forward declarations */
static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx);
@@ -131,8 +134,8 @@ TC-Invokable OPERATION ::=
#include "packet-inap-table2.c"
-static guint8 inap_pdu_type = 0;
-static guint8 inap_pdu_size = 0;
+static uint8_t inap_pdu_type;
+static uint8_t inap_pdu_size;
static int
@@ -142,7 +145,7 @@ dissect_inap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
proto_tree *tree=NULL;
int offset = 0;
asn1_ctx_t asn1_ctx;
- asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
+ asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "INAP");
@@ -151,25 +154,25 @@ dissect_inap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
item = proto_tree_add_item(parent_tree, proto_inap, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_inap);
}
- inap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f;
+ inap_pdu_type = tvb_get_uint8(tvb, offset)&0x0f;
/* Get the length and add 2 */
- inap_pdu_size = tvb_get_guint8(tvb, offset+1)+2;
+ inap_pdu_size = tvb_get_uint8(tvb, offset+1)+2;
opcode = 0;
- is_ExtensionField =FALSE;
- dissect_inap_ROS(TRUE, tvb, offset, &asn1_ctx, tree, -1);
+ is_ExtensionField =false;
+ dissect_inap_ROS(true, tvb, offset, &asn1_ctx, tree, -1);
return inap_pdu_size;
}
/*--- proto_reg_handoff_inap ---------------------------------------*/
-static void range_delete_callback(guint32 ssn, gpointer ptr _U_)
+static void range_delete_callback(uint32_t ssn, void *ptr _U_)
{
if (ssn) {
delete_itu_tcap_subdissector(ssn, inap_handle);
}
}
-static void range_add_callback(guint32 ssn, gpointer ptr _U_)
+static void range_add_callback(uint32_t ssn, void *ptr _U_)
{
if (ssn) {
add_itu_tcap_subdissector(ssn, inap_handle);
@@ -178,11 +181,11 @@ static void range_add_callback(guint32 ssn, gpointer ptr _U_)
void proto_reg_handoff_inap(void) {
- static gboolean inap_prefs_initialized = FALSE;
+ static bool inap_prefs_initialized = false;
static range_t *ssn_range;
if (!inap_prefs_initialized) {
- inap_prefs_initialized = TRUE;
+ inap_prefs_initialized = true;
oid_add_from_string("Core-INAP-CS1-Codes","0.4.0.1.1.0.3.0");
oid_add_from_string("iso(1) identified-organization(3) icd-ecma(12) member-company(2) 1107 oen(3) inap(3) extensions(2)","1.3.12.2.1107.3.3.2");
oid_add_from_string("alcatel(1006)","1.3.12.2.1006.64");
@@ -221,7 +224,7 @@ void proto_register_inap(void) {
/* List of subtrees */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_inap,
&ett_inapisup_parameter,
&ett_inap_RedirectionInformation,