diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
commit | 9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch) | |
tree | 2784370cda9bbf2da9114d70f05399c0b229d28c /epan/dissectors/asn1/rtse | |
parent | Adding debian version 4.2.6-1. (diff) | |
download | wireshark-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/rtse')
-rw-r--r-- | epan/dissectors/asn1/rtse/packet-rtse-template.c | 85 | ||||
-rw-r--r-- | epan/dissectors/asn1/rtse/packet-rtse-template.h | 2 | ||||
-rw-r--r-- | epan/dissectors/asn1/rtse/rtse.cnf | 10 |
3 files changed, 49 insertions, 48 deletions
diff --git a/epan/dissectors/asn1/rtse/packet-rtse-template.c b/epan/dissectors/asn1/rtse/packet-rtse-template.c index 63fc3758..0549e4c7 100644 --- a/epan/dissectors/asn1/rtse/packet-rtse-template.c +++ b/epan/dissectors/asn1/rtse/packet-rtse-template.c @@ -18,6 +18,7 @@ #include <epan/asn1.h> #include <epan/expert.h> +#include <wsutil/array.h> #include <wsutil/str_util.h> #include "packet-ber.h" @@ -34,46 +35,46 @@ void proto_register_rtse(void); void proto_reg_handoff_rtse(void); /* Initialize the protocol and registered fields */ -static int proto_rtse = -1; +static int proto_rtse; -static gboolean open_request=FALSE; -static guint32 app_proto=0; +static bool open_request=false; +static uint32_t app_proto=0; -static proto_tree *top_tree=NULL; +static proto_tree *top_tree; /* Preferences */ -static gboolean rtse_reassemble = TRUE; +static bool rtse_reassemble = true; #include "packet-rtse-hf.c" /* Initialize the subtree pointers */ -static gint ett_rtse = -1; +static int ett_rtse; #include "packet-rtse-ett.c" -static expert_field ei_rtse_dissector_oid_not_implemented = EI_INIT; -static expert_field ei_rtse_unknown_rtse_pdu = EI_INIT; -static expert_field ei_rtse_abstract_syntax = EI_INIT; +static expert_field ei_rtse_dissector_oid_not_implemented; +static expert_field ei_rtse_unknown_rtse_pdu; +static expert_field ei_rtse_abstract_syntax; -static dissector_table_t rtse_oid_dissector_table=NULL; -static dissector_handle_t rtse_handle = NULL; -static gint ett_rtse_unknown = -1; +static dissector_table_t rtse_oid_dissector_table; +static dissector_handle_t rtse_handle; +static int ett_rtse_unknown; static reassembly_table rtse_reassembly_table; -static int hf_rtse_segment_data = -1; -static int hf_rtse_fragments = -1; -static int hf_rtse_fragment = -1; -static int hf_rtse_fragment_overlap = -1; -static int hf_rtse_fragment_overlap_conflicts = -1; -static int hf_rtse_fragment_multiple_tails = -1; -static int hf_rtse_fragment_too_long_fragment = -1; -static int hf_rtse_fragment_error = -1; -static int hf_rtse_fragment_count = -1; -static int hf_rtse_reassembled_in = -1; -static int hf_rtse_reassembled_length = -1; - -static gint ett_rtse_fragment = -1; -static gint ett_rtse_fragments = -1; +static int hf_rtse_segment_data; +static int hf_rtse_fragments; +static int hf_rtse_fragment; +static int hf_rtse_fragment_overlap; +static int hf_rtse_fragment_overlap_conflicts; +static int hf_rtse_fragment_multiple_tails; +static int hf_rtse_fragment_too_long_fragment; +static int hf_rtse_fragment_error; +static int hf_rtse_fragment_count; +static int hf_rtse_reassembled_in; +static int hf_rtse_reassembled_length; + +static int ett_rtse_fragment; +static int ett_rtse_fragments; static const fragment_items rtse_frag_items = { /* Fragment subtrees */ @@ -99,7 +100,7 @@ static const fragment_items rtse_frag_items = { }; void -register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto, const char *name, gboolean uses_ros) +register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto, const char *name, bool uses_ros) { /* XXX: Note that this fcn is called from proto_reg_handoff in *other* dissectors ... */ @@ -117,7 +118,7 @@ register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector /* and then tell ROS how to dissect the AS*/ if (dissector != NULL) - register_ros_oid_dissector_handle(oid, dissector, proto, name, TRUE); + register_ros_oid_dissector_handle(oid, dissector, proto, name, true); } else { /* otherwise we just remember how to dissect the AS */ @@ -188,13 +189,13 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d tvbuff_t *next_tvb = NULL; tvbuff_t *data_tvb = NULL; fragment_head *frag_msg = NULL; - guint32 fragment_length; - guint32 rtse_id = 0; - gboolean data_handled = FALSE; + uint32_t fragment_length; + uint32_t rtse_id = 0; + bool data_handled = false; struct SESSION_DATA_STRUCTURE* session; conversation_t *conversation = 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); /* do we have application context from the acse dissector? */ if (data == NULL) @@ -218,7 +219,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d if (conversation != NULL) { rtse_id = conversation->conv_index; } - session->rtse_reassemble = TRUE; + session->rtse_reassemble = true; } if (rtse_reassemble && session->spdu_type == SES_MAJOR_SYNC_POINT) { frag_msg = fragment_end_seq_next (&rtse_reassembly_table, @@ -232,7 +233,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d if (rtse_reassemble && session->spdu_type == SES_DATA_TRANSFER) { /* strip off the OCTET STRING encoding - including any CONSTRUCTED OCTET STRING */ - dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, offset, hf_rtse_segment_data, &data_tvb); + dissect_ber_octet_string(false, &asn1_ctx, tree, tvb, offset, hf_rtse_segment_data, &data_tvb); if (data_tvb) { fragment_length = tvb_captured_length_remaining (data_tvb, 0); @@ -241,14 +242,14 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d frag_msg = fragment_add_seq_next (&rtse_reassembly_table, data_tvb, 0, pinfo, rtse_id, NULL, - fragment_length, TRUE); + fragment_length, true); if (frag_msg && pinfo->num != frag_msg->reassembled_in) { /* Add a "Reassembled in" link if not reassembled in this frame */ proto_tree_add_uint (tree, *(rtse_frag_items.hf_reassembled_in), data_tvb, 0, 0, frag_msg->reassembled_in); } - pinfo->fragmented = TRUE; - data_handled = TRUE; + pinfo->fragmented = true; + data_handled = true; } else { fragment_length = tvb_captured_length_remaining (tvb, offset); } @@ -259,21 +260,21 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d if (next_tvb) { /* ROS won't do this for us */ session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); - /*offset=*/dissect_ber_external_type(FALSE, tree, next_tvb, 0, &asn1_ctx, -1, call_rtse_external_type_callback); + /*offset=*/dissect_ber_external_type(false, tree, next_tvb, 0, &asn1_ctx, -1, call_rtse_external_type_callback); top_tree = NULL; /* Return other than 0 to indicate that we handled this packet */ return 1; } else { offset = tvb_captured_length (tvb); } - pinfo->fragmented = FALSE; - data_handled = TRUE; + pinfo->fragmented = false; + data_handled = true; } if (!data_handled) { while (tvb_reported_length_remaining(tvb, offset) > 0) { old_offset=offset; - offset=dissect_rtse_RTSE_apdus(TRUE, tvb, offset, &asn1_ctx, tree, -1); + offset=dissect_rtse_RTSE_apdus(true, tvb, offset, &asn1_ctx, tree, -1); if (offset == old_offset) { next_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtse_unknown, &item, "Unknown RTSE PDU"); @@ -335,7 +336,7 @@ void proto_register_rtse(void) { }; /* List of subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_rtse, &ett_rtse_unknown, &ett_rtse_fragment, diff --git a/epan/dissectors/asn1/rtse/packet-rtse-template.h b/epan/dissectors/asn1/rtse/packet-rtse-template.h index eb7b0473..09f6486e 100644 --- a/epan/dissectors/asn1/rtse/packet-rtse-template.h +++ b/epan/dissectors/asn1/rtse/packet-rtse-template.h @@ -14,6 +14,6 @@ #include "packet-rtse-exp.h" -void register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_ros); +void register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, bool uses_ros); #endif /* PACKET_RTSE_H */ diff --git a/epan/dissectors/asn1/rtse/rtse.cnf b/epan/dissectors/asn1/rtse/rtse.cnf index 8bf5a8c9..ac1fa1ac 100644 --- a/epan/dissectors/asn1/rtse/rtse.cnf +++ b/epan/dissectors/asn1/rtse/rtse.cnf @@ -42,9 +42,9 @@ RTSE-apdus if(session != NULL) session->ros_op = (ROS_OP_BIND | ROS_OP_ARGUMENT); - open_request=TRUE; + open_request=true; %(DEFAULT_BODY)s - open_request=FALSE; + open_request=false; #.FN_BODY RTOACapdu struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE*)actx->private_data; @@ -86,7 +86,7 @@ RTSE-apdus tvbuff_t *next_tvb = NULL; struct SESSION_DATA_STRUCTURE* session = (struct SESSION_DATA_STRUCTURE*)actx->private_data; - offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &next_tvb); + offset = dissect_ber_octet_string(false, actx, tree, tvb, offset, hf_index, &next_tvb); if(next_tvb) { @@ -96,13 +96,13 @@ RTSE-apdus if(session) session->ros_op = (ROS_OP_INVOKE | ROS_OP_ARGUMENT); - offset = dissect_ber_external_type(FALSE, tree, next_tvb, 0, actx, -1, call_rtse_external_type_callback); + offset = dissect_ber_external_type(false, tree, next_tvb, 0, actx, -1, call_rtse_external_type_callback); } #.FN_BODY RTORQapdu/applicationProtocol - offset = dissect_ber_integer(TRUE, actx, tree, tvb, offset, hf_index, &app_proto); + offset = dissect_ber_integer(true, actx, tree, tvb, offset, hf_index, &app_proto); #.FN_BODY SessionConnectionIdentifier if(open_request){ |