diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-rtse.c | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-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/packet-rtse.c | 167 |
1 files changed, 84 insertions, 83 deletions
diff --git a/epan/dissectors/packet-rtse.c b/epan/dissectors/packet-rtse.c index e7e707a9..194b617c 100644 --- a/epan/dissectors/packet-rtse.c +++ b/epan/dissectors/packet-rtse.c @@ -1,7 +1,7 @@ /* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-rtse.c */ -/* asn2wrs.py -b -L -p rtse -c ./rtse.cnf -s ./packet-rtse-template -D . -O ../.. rtse.asn */ +/* asn2wrs.py -b -q -L -p rtse -c ./rtse.cnf -s ./packet-rtse-template -D . -O ../.. rtse.asn */ /* packet-rtse-template.c * Routines for RTSE packet dissection @@ -23,6 +23,7 @@ #include <epan/asn1.h> #include <epan/expert.h> +#include <wsutil/array.h> #include <wsutil/str_util.h> #include "packet-ber.h" @@ -39,76 +40,76 @@ 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 int hf_rtse_rtorq_apdu = -1; /* RTORQapdu */ -static int hf_rtse_rtoac_apdu = -1; /* RTOACapdu */ -static int hf_rtse_rtorj_apdu = -1; /* RTORJapdu */ -static int hf_rtse_rttp_apdu = -1; /* RTTPapdu */ -static int hf_rtse_rttr_apdu = -1; /* RTTRapdu */ -static int hf_rtse_rtab_apdu = -1; /* RTABapdu */ -static int hf_rtse_checkpointSize = -1; /* INTEGER */ -static int hf_rtse_windowSize = -1; /* INTEGER */ -static int hf_rtse_dialogueMode = -1; /* T_dialogueMode */ -static int hf_rtse_connectionDataRQ = -1; /* ConnectionData */ -static int hf_rtse_applicationProtocol = -1; /* T_applicationProtocol */ -static int hf_rtse_connectionDataAC = -1; /* ConnectionData */ -static int hf_rtse_refuseReason = -1; /* RefuseReason */ -static int hf_rtse_userDataRJ = -1; /* T_userDataRJ */ -static int hf_rtse_abortReason = -1; /* AbortReason */ -static int hf_rtse_reflectedParameter = -1; /* BIT_STRING */ -static int hf_rtse_userdataAB = -1; /* T_userdataAB */ -static int hf_rtse_open = -1; /* T_open */ -static int hf_rtse_recover = -1; /* SessionConnectionIdentifier */ -static int hf_rtse_callingSSuserReference = -1; /* CallingSSuserReference */ -static int hf_rtse_commonReference = -1; /* CommonReference */ -static int hf_rtse_additionalReferenceInformation = -1; /* AdditionalReferenceInformation */ -static int hf_rtse_t61String = -1; /* T_t61String */ -static int hf_rtse_octetString = -1; /* T_octetString */ +static bool rtse_reassemble = true; + +static int hf_rtse_rtorq_apdu; /* RTORQapdu */ +static int hf_rtse_rtoac_apdu; /* RTOACapdu */ +static int hf_rtse_rtorj_apdu; /* RTORJapdu */ +static int hf_rtse_rttp_apdu; /* RTTPapdu */ +static int hf_rtse_rttr_apdu; /* RTTRapdu */ +static int hf_rtse_rtab_apdu; /* RTABapdu */ +static int hf_rtse_checkpointSize; /* INTEGER */ +static int hf_rtse_windowSize; /* INTEGER */ +static int hf_rtse_dialogueMode; /* T_dialogueMode */ +static int hf_rtse_connectionDataRQ; /* ConnectionData */ +static int hf_rtse_applicationProtocol; /* T_applicationProtocol */ +static int hf_rtse_connectionDataAC; /* ConnectionData */ +static int hf_rtse_refuseReason; /* RefuseReason */ +static int hf_rtse_userDataRJ; /* T_userDataRJ */ +static int hf_rtse_abortReason; /* AbortReason */ +static int hf_rtse_reflectedParameter; /* BIT_STRING */ +static int hf_rtse_userdataAB; /* T_userdataAB */ +static int hf_rtse_open; /* T_open */ +static int hf_rtse_recover; /* SessionConnectionIdentifier */ +static int hf_rtse_callingSSuserReference; /* CallingSSuserReference */ +static int hf_rtse_commonReference; /* CommonReference */ +static int hf_rtse_additionalReferenceInformation; /* AdditionalReferenceInformation */ +static int hf_rtse_t61String; /* T_t61String */ +static int hf_rtse_octetString; /* T_octetString */ /* Initialize the subtree pointers */ -static gint ett_rtse = -1; -static gint ett_rtse_RTSE_apdus = -1; -static gint ett_rtse_RTORQapdu = -1; -static gint ett_rtse_RTOACapdu = -1; -static gint ett_rtse_RTORJapdu = -1; -static gint ett_rtse_RTABapdu = -1; -static gint ett_rtse_ConnectionData = -1; -static gint ett_rtse_SessionConnectionIdentifier = -1; -static gint ett_rtse_CallingSSuserReference = -1; - -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 dissector_table_t rtse_oid_dissector_table=NULL; -static dissector_handle_t rtse_handle = NULL; -static gint ett_rtse_unknown = -1; +static int ett_rtse; +static int ett_rtse_RTSE_apdus; +static int ett_rtse_RTORQapdu; +static int ett_rtse_RTOACapdu; +static int ett_rtse_RTORJapdu; +static int ett_rtse_RTABapdu; +static int ett_rtse_ConnectionData; +static int ett_rtse_SessionConnectionIdentifier; +static int ett_rtse_CallingSSuserReference; + +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; +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 */ @@ -134,7 +135,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 ... */ @@ -152,7 +153,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 */ @@ -401,7 +402,7 @@ static const value_string rtse_T_applicationProtocol_vals[] = { static int dissect_rtse_T_applicationProtocol(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; @@ -423,11 +424,11 @@ dissect_rtse_RTORQapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, if(session != NULL) session->ros_op = (ROS_OP_BIND | ROS_OP_ARGUMENT); - open_request=TRUE; + open_request=true; offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset, RTORQapdu_set, hf_index, ett_rtse_RTORQapdu); - open_request=FALSE; + open_request=false; return offset; @@ -560,7 +561,7 @@ dissect_rtse_RTTRapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, 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) { @@ -570,7 +571,7 @@ dissect_rtse_RTTRapdu(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, 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); } @@ -683,13 +684,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) @@ -713,7 +714,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, @@ -727,7 +728,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); @@ -736,14 +737,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); } @@ -754,21 +755,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"); @@ -925,7 +926,7 @@ void proto_register_rtse(void) { }; /* List of subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_rtse, &ett_rtse_unknown, &ett_rtse_fragment, |