summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/acse
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
commitc4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch)
tree93d5c6aa93d9987680dd1adad5685e2ad698f223 /epan/dissectors/asn1/acse
parentAdding upstream version 4.2.6. (diff)
downloadwireshark-upstream.tar.xz
wireshark-upstream.zip
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/asn1/acse')
-rw-r--r--epan/dissectors/asn1/acse/acse.cnf24
-rw-r--r--epan/dissectors/asn1/acse/packet-acse-template.c41
2 files changed, 33 insertions, 32 deletions
diff --git a/epan/dissectors/asn1/acse/acse.cnf b/epan/dissectors/asn1/acse/acse.cnf
index 8676d687..924f0ae4 100644
--- a/epan/dissectors/asn1/acse/acse.cnf
+++ b/epan/dissectors/asn1/acse/acse.cnf
@@ -48,7 +48,7 @@ PDV-list/presentation-data-values/octet-aligned pDVList_octet_aligned
#.FN_BODY Authentication-value-other/other-mechanism-name
%(DEFAULT_BODY)s
- actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
+ actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? true : false;
#.FN_BODY Authentication-value-other/other-mechanism-value
if (actx->external.direct_ref_present) {
@@ -59,37 +59,37 @@ PDV-list/presentation-data-values/octet-aligned pDVList_octet_aligned
/*XXX not implemented yet */
#.FN_BODY AARQ-apdu/_untag/aSO-context-name
- offset = dissect_ber_object_identifier_str(FALSE, actx, tree, tvb, offset,
+ offset = dissect_ber_object_identifier_str(false, actx, tree, tvb, offset,
hf_index, &actx->external.direct_reference);
- actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
+ actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? true : false;
#.FN_BODY AARE-apdu/_untag/aSO-context-name
- offset = dissect_ber_object_identifier_str(FALSE, actx, tree, tvb, offset,
+ offset = dissect_ber_object_identifier_str(false, actx, tree, tvb, offset,
hf_index, &actx->external.direct_reference);
- actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
+ actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? true : false;
#.FN_BODY ACRQ-apdu/_untag/aSO-context-name
- offset = dissect_ber_object_identifier_str(FALSE, actx, tree, tvb, offset,
+ offset = dissect_ber_object_identifier_str(false, actx, tree, tvb, offset,
hf_index, &actx->external.direct_reference);
- actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
+ actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? true : false;
#.FN_BODY ACRP-apdu/_untag/aSO-context-name
- offset = dissect_ber_object_identifier_str(FALSE, actx, tree, tvb, offset,
+ offset = dissect_ber_object_identifier_str(false, actx, tree, tvb, offset,
hf_index, &actx->external.direct_reference);
- actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
+ actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? true : false;
#.FN_BODY EXTERNALt/_untag/indirect-reference
char *oid;
struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE*) actx->private_data;
- offset = dissect_ber_integer(FALSE, actx, tree, tvb, offset,
+ offset = dissect_ber_integer(false, actx, tree, tvb, offset,
hf_acse_indirect_reference,
&indir_ref);
/* look up the indirect reference */
if((oid = find_oid_by_pres_ctx_id(actx->pinfo, indir_ref)) != NULL) {
actx->external.direct_reference = wmem_strdup(actx->pinfo->pool, oid);
- actx->external.direct_ref_present = TRUE;
+ actx->external.direct_ref_present = true;
}
if(session)
@@ -100,7 +100,7 @@ PDV-list/presentation-data-values/octet-aligned pDVList_octet_aligned
#.FN_BODY EXTERNALt/_untag/direct-reference
%(DEFAULT_BODY)s
- actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
+ actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? true : false;
#.FN_BODY EXTERNALt/_untag/encoding/single-ASN1-type
if (actx->external.direct_ref_present) {
diff --git a/epan/dissectors/asn1/acse/packet-acse-template.c b/epan/dissectors/asn1/acse/packet-acse-template.c
index d10208ab..07fa6fcc 100644
--- a/epan/dissectors/asn1/acse/packet-acse-template.c
+++ b/epan/dissectors/asn1/acse/packet-acse-template.c
@@ -26,6 +26,7 @@
#include <epan/expert.h>
#include <epan/oids.h>
#include <epan/asn1.h>
+#include <wsutil/array.h>
#include "packet-ber.h"
#include "packet-acse.h"
@@ -47,46 +48,46 @@ void proto_register_acse(void);
void proto_reg_handoff_acse(void);
/* Initialize the protocol and registered fields */
-int proto_acse = -1;
-int proto_clacse = -1;
+int proto_acse;
+int proto_clacse;
#include "packet-acse-hf.c"
-static gint hf_acse_user_data = -1;
+static int hf_acse_user_data;
/* Initialize the subtree pointers */
-static gint ett_acse = -1;
+static int ett_acse;
#include "packet-acse-ett.c"
-static expert_field ei_acse_dissector_not_available = EI_INIT;
-static expert_field ei_acse_malformed = EI_INIT;
-static expert_field ei_acse_invalid_oid = EI_INIT;
+static expert_field ei_acse_dissector_not_available;
+static expert_field ei_acse_malformed;
+static expert_field ei_acse_invalid_oid;
-static dissector_handle_t acse_handle = NULL;
+static dissector_handle_t acse_handle;
/* indirect_reference, used to pick up the signalling so we know what
kind of data is transferred in SES_DATA_TRANSFER_PDUs */
-static guint32 indir_ref=0;
+static uint32_t indir_ref=0;
#if NOT_NEEDED
/* to keep track of presentation context identifiers and protocol-oids */
typedef struct _acse_ctx_oid_t {
/* XXX here we should keep track of ADDRESS/PORT as well */
- guint32 ctx_id;
+ uint32_t ctx_id;
char *oid;
} acse_ctx_oid_t;
-static wmem_map_t *acse_ctx_oid_table = NULL;
+static wmem_map_t *acse_ctx_oid_table;
-static guint
-acse_ctx_oid_hash(gconstpointer k)
+static unsigned
+acse_ctx_oid_hash(const void *k)
{
acse_ctx_oid_t *aco=(acse_ctx_oid_t *)k;
return aco->ctx_id;
}
/* XXX this one should be made ADDRESS/PORT aware */
-static gint
-acse_ctx_oid_equal(gconstpointer k1, gconstpointer k2)
+static int
+acse_ctx_oid_equal(const void *k1, const void *k2)
{
acse_ctx_oid_t *aco1=(acse_ctx_oid_t *)k1;
acse_ctx_oid_t *aco2=(acse_ctx_oid_t *)k2;
@@ -94,7 +95,7 @@ acse_ctx_oid_equal(gconstpointer k1, gconstpointer k2)
}
static void
-register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
+register_ctx_id_and_oid(packet_info *pinfo _U_, uint32_t idx, char *oid)
{
acse_ctx_oid_t *aco, *tmpaco;
aco=wmem_new(wmem_file_scope(), acse_ctx_oid_t);
@@ -109,7 +110,7 @@ register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
wmem_map_insert(acse_ctx_oid_table, aco, aco);
}
static char *
-find_oid_by_ctx_id(packet_info *pinfo _U_, guint32 idx)
+find_oid_by_ctx_id(packet_info *pinfo _U_, uint32_t idx)
{
acse_ctx_oid_t aco, *tmpaco;
aco.ctx_id=idx;
@@ -137,7 +138,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
char *oid;
struct SESSION_DATA_STRUCTURE* session;
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);
/* do we have spdu type from the session dissector? */
if (data == NULL) {
@@ -215,7 +216,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
/* postpone it before dissector will have more information */
while (tvb_reported_length_remaining(tvb, offset) > 0) {
int old_offset=offset;
- offset = dissect_acse_ACSE_apdu(FALSE, tvb, offset, &asn1_ctx, tree, -1);
+ offset = dissect_acse_ACSE_apdu(false, tvb, offset, &asn1_ctx, tree, -1);
if (offset == old_offset) {
proto_tree_add_expert(tree, pinfo, &ei_acse_malformed, tvb, offset, -1);
break;
@@ -238,7 +239,7 @@ void proto_register_acse(void) {
};
/* List of subtrees */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_acse,
#include "packet-acse-ettarr.c"
};