summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/lnpdqp/packet-lnpdqp-template.c
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/lnpdqp/packet-lnpdqp-template.c
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 'epan/dissectors/asn1/lnpdqp/packet-lnpdqp-template.c')
-rw-r--r--epan/dissectors/asn1/lnpdqp/packet-lnpdqp-template.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/epan/dissectors/asn1/lnpdqp/packet-lnpdqp-template.c b/epan/dissectors/asn1/lnpdqp/packet-lnpdqp-template.c
index f3ecee1d..8fe8ca46 100644
--- a/epan/dissectors/asn1/lnpdqp/packet-lnpdqp-template.c
+++ b/epan/dissectors/asn1/lnpdqp/packet-lnpdqp-template.c
@@ -11,6 +11,7 @@
#include <epan/packet.h>
#include <epan/asn1.h>
+#include <wsutil/array.h>
#include "packet-ber.h"
#define PNAME "Local Number Portability Database Query"
@@ -28,37 +29,37 @@
* Operation Family = ProvideInstruction, Reply Required (131) 0x83
* Operation Specifier = Start (1)
*/
-/* Exluding H bit */
+/* Excluding H bit */
#define LNPDQP_ANSI_TCAP_OPCODE_PI 0x0301
void proto_reg_handoff_lnpdqp(void);
void proto_register_lnpdqp(void);
/* Initialize the protocol and registered fields */
-static int proto_lnpdqp = -1;
+static int proto_lnpdqp;
-static int hf_lnpdqp_type_of_digits = -1;
-static int hf_lnpdqp_nature_of_number = -1;
-static int hf_lnpdqp_digits_enc = -1;
-static int hf_lnpdqp_np = -1;
-static int hf_lnpdqp_nr_digits = -1;
-static int hf_lnpdqp_bcd_digits = -1;
-static int hf_lnpdqp_ia5_digits = -1;
+static int hf_lnpdqp_type_of_digits;
+static int hf_lnpdqp_nature_of_number;
+static int hf_lnpdqp_digits_enc;
+static int hf_lnpdqp_np;
+static int hf_lnpdqp_nr_digits;
+static int hf_lnpdqp_bcd_digits;
+static int hf_lnpdqp_ia5_digits;
/* asn2wrs/the ber dissector does not handle the same tag used multiple times
* in asn1 description, do some magic to handle.
*/
-static int hf_lnpdqp_networkRoutingNumber = -1; /* Digits */
-static int hf_lnpdqp_callingPartyANI = -1; /* Digits */
-static int hf_lnpdqp_originatingLATA = -1; /* Digits */
-static int hf_lnpdqp_carrierID = -1; /* Digits */
+static int hf_lnpdqp_networkRoutingNumber; /* Digits */
+static int hf_lnpdqp_callingPartyANI; /* Digits */
+static int hf_lnpdqp_originatingLATA; /* Digits */
+static int hf_lnpdqp_carrierID; /* Digits */
#include "packet-lnpdqp-hf.c"
-static int ett_lnpdqp = -1;
-static int ett_lnpdqp_digitstype = -1;
-static int ett_lnpdqp_digits = -1;
+static int ett_lnpdqp;
+static int ett_lnpdqp_digitstype;
+static int ett_lnpdqp_digits;
#include "packet-lnpdqp-ett.c"
@@ -163,7 +164,7 @@ static const value_string lnpdqp_OriginatingStationType_vals[] = {
static void
dissect_lnpdqp_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, asn1_ctx_t *actx _U_){
- guint8 octet , no_of_digits;
+ uint8_t octet , no_of_digits;
int offset = 0;
char *digit_str;
@@ -179,7 +180,7 @@ dissect_lnpdqp_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
proto_tree_add_item(subtree, hf_lnpdqp_nature_of_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Octet 3 Numbering Plan |Encoding Scheme| */
- octet = tvb_get_guint8(tvb,offset);
+ octet = tvb_get_uint8(tvb,offset);
proto_tree_add_item(subtree, hf_lnpdqp_np, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_lnpdqp_digits_enc, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -187,17 +188,17 @@ dissect_lnpdqp_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
switch ((octet&0xf)){
case 1:
/* BCD Coding */
- no_of_digits = tvb_get_guint8(tvb,offset);
+ no_of_digits = tvb_get_uint8(tvb,offset);
proto_tree_add_item(subtree, hf_lnpdqp_nr_digits, tvb, offset, 1, ENC_BIG_ENDIAN);
if(no_of_digits == 0)
return;
offset++;
- proto_tree_add_item_ret_display_string(subtree, hf_lnpdqp_bcd_digits, tvb, offset, -1, ENC_KEYPAD_BC_TBCD, pinfo->pool, &digit_str);
+ proto_tree_add_item_ret_display_string(subtree, hf_lnpdqp_bcd_digits, tvb, offset, -1, ENC_KEYPAD_BC_TBCD|ENC_LITTLE_ENDIAN, pinfo->pool, &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:
/* IA5 Coding */
- no_of_digits = tvb_get_guint8(tvb,offset);
+ no_of_digits = tvb_get_uint8(tvb,offset);
proto_tree_add_item(subtree, hf_lnpdqp_nr_digits, tvb, offset, 1, ENC_BIG_ENDIAN);
if(no_of_digits == 0)
return;
@@ -221,7 +222,7 @@ dissect_lnpdqp_cc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, vo
proto_tree *tree=NULL;
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, PSNAME);
col_set_str(pinfo->cinfo, COL_INFO, "ConnectionControl");
@@ -241,7 +242,7 @@ dissect_lnpdqp_pi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, vo
proto_tree *tree=NULL;
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, PSNAME);
col_set_str(pinfo->cinfo, COL_INFO, "ProvideInstruction");
@@ -314,7 +315,7 @@ void proto_register_lnpdqp(void) {
};
/* List of subtrees */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_lnpdqp,
&ett_lnpdqp_digitstype,
&ett_lnpdqp_digits,