summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/lcsap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
commit9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch)
tree2784370cda9bbf2da9114d70f05399c0b229d28c /epan/dissectors/asn1/lcsap
parentAdding debian version 4.2.6-1. (diff)
downloadwireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz
wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/asn1/lcsap')
-rw-r--r--epan/dissectors/asn1/lcsap/lcsap.cnf35
-rw-r--r--epan/dissectors/asn1/lcsap/packet-lcsap-template.c33
2 files changed, 35 insertions, 33 deletions
diff --git a/epan/dissectors/asn1/lcsap/lcsap.cnf b/epan/dissectors/asn1/lcsap/lcsap.cnf
index e4ae9d4a..347f4cff 100644
--- a/epan/dissectors/asn1/lcsap/lcsap.cnf
+++ b/epan/dissectors/asn1/lcsap/lcsap.cnf
@@ -49,7 +49,8 @@ ProtocolIE-Field/value ie_field_value
#.FN_PARS ProtocolIE-ID VAL_PTR=&ProtocolIE_ID
#.FN_FTR ProtocolIE-ID
if (tree) {
- proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s", val_to_str(ProtocolIE_ID, VALS(lcsap_ProtocolIE_ID_vals), "unknown (%d)"));
+ proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s",
+ val_to_str(ProtocolIE_ID, VALS(lcsap_ProtocolIE_ID_vals), "unknown (%d)"));
}
#.END
@@ -98,17 +99,17 @@ ProtocolIE-Field/value ie_field_value
#.FN_FTR ProcedureCode
{
- guint8 tmp = tvb_get_guint8(tvb, 0);
+ uint8_t tmp = tvb_get_uint8(tvb, 0);
if (tmp == 0)
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sReq",
- val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
+ val_to_str_const(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
else if (tmp == 32)
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sResp",
- val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
+ val_to_str_const(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
else
- col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s",
- val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
+ col_set_str(actx->pinfo->cinfo, COL_INFO,
+ val_to_str_const(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
}
#.END
@@ -151,14 +152,14 @@ ProtocolIE-Field/value ie_field_value
tvbuff_t *parameter_tvb=NULL;
proto_tree *subtree;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
- 3, 3, FALSE, &parameter_tvb);
+ 3, 3, false, &parameter_tvb);
if(tvb_reported_length(tvb)==0)
return offset;
if (!parameter_tvb)
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_lcsap_plmnd_id);
- dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, subtree, 0, E212_NONE, FALSE);
+ dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, subtree, 0, E212_NONE, false);
#.END
#.FN_BODY Positioning-Method-And-Usage VAL_PTR = &parameter_tvb
@@ -188,26 +189,26 @@ ProtocolIE-Field/value ie_field_value
#
# Code copied from packet-gsm_a_common.c
#.FN_BODY Uncertainty-Code VAL_PTR = &uncertainty_code
- guint32 uncertainty_code;
+ uint32_t uncertainty_code;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 0U, 127U, &uncertainty_code, FALSE);
+ 0U, 127U, &uncertainty_code, false);
proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1));
#.FN_BODY DegreesLatitude VAL_PTR = &degrees
- gint32 degrees;
+ int32_t degrees;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- 0U, 8388607U, &degrees, FALSE);
+ 0U, 8388607U, &degrees, false);
proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/8388607) * 90));
#.FN_BODY DegreesLongitude VAL_PTR = &degrees
- gint32 degrees;
+ int32_t degrees;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
- -8388608, 8388607U, &degrees, FALSE);
+ -8388608, 8388607U, &degrees, false);
proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/16777215) * 360));
@@ -218,18 +219,18 @@ ProtocolIE-Field/value ie_field_value
proto_tree *subtree;
subtree = proto_item_add_subtree(actx->created_item, ett_lcsap_imsi);
- dissect_e212_imsi(imsi_tvb, actx->pinfo, subtree, 0, tvb_reported_length(imsi_tvb), FALSE);
+ dissect_e212_imsi(imsi_tvb, actx->pinfo, subtree, 0, tvb_reported_length(imsi_tvb), false);
}
#.FN_BODY Horizontal-Accuracy VAL_PTR=&uncertainty_code
- guint32 uncertainty_code;
+ uint32_t uncertainty_code;
%(DEFAULT_BODY)s
#.FN_FTR Horizontal-Accuracy
proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1));
#.FN_BODY Vertical-Accuracy VAL_PTR=&vertical_uncertainty
- guint32 vertical_uncertainty;
+ uint32_t vertical_uncertainty;
%(DEFAULT_BODY)s
#.FN_FTR Vertical-Accuracy
diff --git a/epan/dissectors/asn1/lcsap/packet-lcsap-template.c b/epan/dissectors/asn1/lcsap/packet-lcsap-template.c
index b9ff0c8c..a4b6f866 100644
--- a/epan/dissectors/asn1/lcsap/packet-lcsap-template.c
+++ b/epan/dissectors/asn1/lcsap/packet-lcsap-template.c
@@ -22,6 +22,7 @@
#include <epan/prefs.h>
#include <epan/sctpppids.h>
#include <epan/expert.h>
+#include <wsutil/array.h>
#include "packet-ber.h"
#include "packet-per.h"
@@ -45,30 +46,30 @@ void proto_reg_handoff_lcsap(void);
#include "packet-lcsap-val.h"
/* Initialize the protocol and registered fields */
-static int proto_lcsap = -1;
+static int proto_lcsap;
-static int hf_lcsap_pos_method = -1;
-static int hf_lcsap_pos_usage = -1;
-static int hf_lcsap_gnss_pos_method = -1;
-static int hf_lcsap_gnss_id = -1;
-static int hf_lcsap_gnss_pos_usage = -1;
+static int hf_lcsap_pos_method;
+static int hf_lcsap_pos_usage;
+static int hf_lcsap_gnss_pos_method;
+static int hf_lcsap_gnss_id;
+static int hf_lcsap_gnss_pos_usage;
#include "packet-lcsap-hf.c"
/* Initialize the subtree pointers */
-static int ett_lcsap = -1;
-static int ett_lcsap_plmnd_id = -1;
-static int ett_lcsap_imsi = -1;
-static int ett_lcsap_civic_address = -1;
+static int ett_lcsap;
+static int ett_lcsap_plmnd_id;
+static int ett_lcsap_imsi;
+static int ett_lcsap_civic_address;
#include "packet-lcsap-ett.c"
-static expert_field ei_lcsap_civic_data_not_xml = EI_INIT;
+static expert_field ei_lcsap_civic_data_not_xml;
/* Global variables */
-static guint32 ProcedureCode;
-static guint32 ProtocolIE_ID;
-static guint32 ProtocolExtensionID;
-static guint32 PayloadType = -1;
+static uint32_t ProcedureCode;
+static uint32_t ProtocolIE_ID;
+static uint32_t ProtocolExtensionID;
+static uint32_t PayloadType = -1;
/* Dissector handles */
static dissector_handle_t lcsap_handle;
@@ -275,7 +276,7 @@ void proto_register_lcsap(void) {
};
/* List of subtrees */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_lcsap,
&ett_lcsap_plmnd_id,
&ett_lcsap_imsi,