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/p1 | |
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/p1')
-rw-r--r-- | epan/dissectors/asn1/p1/p1.cnf | 68 | ||||
-rw-r--r-- | epan/dissectors/asn1/p1/packet-p1-template.c | 95 | ||||
-rw-r--r-- | epan/dissectors/asn1/p1/packet-p1-template.h | 2 |
3 files changed, 83 insertions, 82 deletions
diff --git a/epan/dissectors/asn1/p1/p1.cnf b/epan/dissectors/asn1/p1/p1.cnf index bed9cab2..4190cd0b 100644 --- a/epan/dissectors/asn1/p1/p1.cnf +++ b/epan/dissectors/asn1/p1/p1.cnf @@ -314,12 +314,12 @@ SecurityCategory/type ABBREV=category.type ExtensionField/type ABBREV=extension.type TokenData/type ABBREV=token-data-type -# This table creates the value_sting to name P3 operation codes and errors +# This table creates the value_string to name P3 operation codes and errors # in file packet-p3-table.c which is included in the template file # #.TABLE_HDR /* P3 ABSTRACT-OPERATIONS */ -const value_string p3_opr_code_string_vals[] = { +static const value_string p3_opr_code_string_vals[] = { #.TABLE_BODY OPERATION { %(&operationCode)s, "%(_ident)s" }, #.TABLE_FTR @@ -541,7 +541,7 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" #.FN_BODY AdditionalInformation proto_item *item = NULL; int loffset = 0; - guint32 len = 0; + uint32_t len = 0; /* work out the length */ loffset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, NULL, NULL, NULL); @@ -630,15 +630,15 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" #.FN_PARS StandardExtension VAL_PTR = &actx->external.indirect_reference #.FN_BODY StandardExtension - actx->external.indirect_ref_present = TRUE; - actx->external.direct_ref_present = FALSE; + actx->external.indirect_ref_present = true; + actx->external.direct_ref_present = false; %(DEFAULT_BODY)s #.FN_BODY ExtensionType/private-extension FN_VARIANT = _str VAL_PTR = &actx->external.direct_reference - actx->external.indirect_ref_present = FALSE; + actx->external.indirect_ref_present = false; actx->external.direct_reference = NULL; %(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_PARS ExtendedContentType FN_VARIANT = _str VAL_PTR = &ctx->content_type_id @@ -665,7 +665,7 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" #.FN_PARS BuiltInContentType/_untag VAL_PTR = &ict #.FN_BODY BuiltInContentType/_untag - static guint32 ict = -1; + static uint32_t ict = -1; p1_address_ctx_t* ctx; if (actx->subtree.tree_ctx == NULL) @@ -1011,7 +1011,7 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" ctx->oraddress = wmem_strbuf_new(actx->pinfo->pool, ""); actx->subtree.tree = NULL; - set_do_address(actx, TRUE); + set_do_address(actx, true); %(DEFAULT_BODY)s @@ -1019,7 +1019,7 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" if (ctx->oraddress && (wmem_strbuf_get_len(ctx->oraddress) > 0) && actx->subtree.tree) proto_item_append_text(actx->subtree.tree, " (%%s/)", wmem_strbuf_get_str(ctx->oraddress)); - set_do_address(actx, FALSE); + set_do_address(actx, false); #.FN_BODY ORName p1_address_ctx_t* ctx; @@ -1032,14 +1032,14 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" ctx->oraddress = wmem_strbuf_new(actx->pinfo->pool, ""); actx->subtree.tree = NULL; - set_do_address(actx, TRUE); + set_do_address(actx, true); %(DEFAULT_BODY)s if (ctx->oraddress && (wmem_strbuf_get_len(ctx->oraddress) > 0) && actx->subtree.tree) proto_item_append_text(actx->subtree.tree, " (%%s/)", wmem_strbuf_get_str(ctx->oraddress)); - set_do_address(actx, FALSE); + set_do_address(actx, false); #.FN_BODY MessageIdentifier actx->subtree.tree = NULL; @@ -1087,19 +1087,19 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" #.FN_BODY MTSIdentifier - set_do_address(actx, TRUE); + set_do_address(actx, true); %(DEFAULT_BODY)s - set_do_address(actx, FALSE); + set_do_address(actx, false); #.FN_BODY MTANameAndOptionalGDI - set_do_address(actx, TRUE); + set_do_address(actx, true); %(DEFAULT_BODY)s - set_do_address(actx, FALSE); + set_do_address(actx, false); proto_item_append_text(tree, ")"); #.FN_BODY BuiltInStandardAttributes @@ -1109,36 +1109,36 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" #.FN_BODY TraceInformationElement - set_do_address(actx, TRUE); + set_do_address(actx, true); %(DEFAULT_BODY)s - set_do_address(actx, FALSE); + set_do_address(actx, false); #.FN_BODY InternalTraceInformationElement - set_do_address(actx, TRUE); + set_do_address(actx, true); %(DEFAULT_BODY)s - set_do_address(actx, FALSE); + set_do_address(actx, false); #.FN_BODY DomainSuppliedInformation - set_do_address(actx, FALSE); + set_do_address(actx, false); %(DEFAULT_BODY)s - set_do_address(actx, TRUE); + set_do_address(actx, true); proto_item_append_text(tree, ")"); #.FN_BODY MTASuppliedInformation - set_do_address(actx, FALSE); + set_do_address(actx, false); %(DEFAULT_BODY)s - set_do_address(actx, TRUE); + set_do_address(actx, true); proto_item_append_text(tree, ")"); #.FN_PARS Time @@ -1184,7 +1184,7 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" VAL_PTR = &credentials #.FN_BODY Credentials - gint credentials = -1; + int credentials = -1; %(DEFAULT_BODY)s @@ -1213,7 +1213,7 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" #.FN_BODY PerDomainBilateralInformation/bilateral-information proto_item *item = NULL; int loffset = 0; - guint32 len = 0; + uint32_t len = 0; /* work out the length */ loffset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, NULL, NULL, NULL); @@ -1229,7 +1229,7 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" VAL_PTR = &apdu #.FN_BODY MTS-APDU - gint apdu = -1; + int apdu = -1; %(DEFAULT_BODY)s @@ -1243,7 +1243,7 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" VAL_PTR = &report #.FN_BODY ReportType - gint report = -1; + int report = -1; %(DEFAULT_BODY)s @@ -1252,19 +1252,19 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" } #.FN_BODY MessageSubmissionArgument - p1_initialize_content_globals(actx, tree, TRUE); + p1_initialize_content_globals(actx, tree, true); %(DEFAULT_BODY)s - p1_initialize_content_globals(actx, NULL, FALSE); + p1_initialize_content_globals(actx, NULL, false); #.FN_BODY MessageDeliveryArgument - p1_initialize_content_globals(actx, tree, TRUE); + p1_initialize_content_globals(actx, tree, true); %(DEFAULT_BODY)s - p1_initialize_content_globals(actx, NULL, FALSE); + p1_initialize_content_globals(actx, NULL, false); #.FN_BODY ReportDeliveryArgument - p1_initialize_content_globals(actx, tree, TRUE); + p1_initialize_content_globals(actx, tree, true); %(DEFAULT_BODY)s - p1_initialize_content_globals(actx, NULL, FALSE); + p1_initialize_content_globals(actx, NULL, false); #.FN_HDR MTSBindResult /* TODO: there may be other entry points where this global should be initialized... */ diff --git a/epan/dissectors/asn1/p1/packet-p1-template.c b/epan/dissectors/asn1/p1/packet-p1-template.c index ff27555f..68204b30 100644 --- a/epan/dissectors/asn1/p1/packet-p1-template.c +++ b/epan/dissectors/asn1/p1/packet-p1-template.c @@ -18,6 +18,7 @@ #include <epan/expert.h> #include <epan/strutil.h> #include <epan/proto_data.h> +#include <wsutil/array.h> #include "packet-ber.h" #include "packet-acse.h" @@ -36,33 +37,33 @@ #define PFNAME "p1" /* Initialize the protocol and registered fields */ -static int proto_p1 = -1; -static int proto_p3 = -1; +static int proto_p1; +static int proto_p3; -static int hf_p1_MTS_APDU_PDU = -1; -static int hf_p1_MTABindArgument_PDU = -1; -static int hf_p1_MTABindResult_PDU = -1; -static int hf_p1_MTABindError_PDU = -1; +static int hf_p1_MTS_APDU_PDU; +static int hf_p1_MTABindArgument_PDU; +static int hf_p1_MTABindResult_PDU; +static int hf_p1_MTABindError_PDU; #include "packet-p1-hf.c" /* Initialize the subtree pointers */ -static gint ett_p1 = -1; -static gint ett_p3 = -1; -static gint ett_p1_content_unknown = -1; -static gint ett_p1_bilateral_information = -1; -static gint ett_p1_additional_information = -1; -static gint ett_p1_unknown_standard_extension = -1; -static gint ett_p1_unknown_extension_attribute_type = -1; -static gint ett_p1_unknown_tokendata_type = -1; +static int ett_p1; +static int ett_p3; +static int ett_p1_content_unknown; +static int ett_p1_bilateral_information; +static int ett_p1_additional_information; +static int ett_p1_unknown_standard_extension; +static int ett_p1_unknown_extension_attribute_type; +static int ett_p1_unknown_tokendata_type; #include "packet-p1-ett.c" -static expert_field ei_p1_unknown_extension_attribute_type = EI_INIT; -static expert_field ei_p1_unknown_standard_extension = EI_INIT; -static expert_field ei_p1_unknown_built_in_content_type = EI_INIT; -static expert_field ei_p1_unknown_tokendata_type = EI_INIT; -static expert_field ei_p1_unsupported_pdu = EI_INIT; -static expert_field ei_p1_zero_pdu = EI_INIT; +static expert_field ei_p1_unknown_extension_attribute_type; +static expert_field ei_p1_unknown_standard_extension; +static expert_field ei_p1_unknown_built_in_content_type; +static expert_field ei_p1_unknown_tokendata_type; +static expert_field ei_p1_unsupported_pdu; +static expert_field ei_p1_zero_pdu; /* Dissector tables */ static dissector_table_t p1_extension_dissector_table; @@ -74,13 +75,13 @@ static dissector_handle_t p1_handle; #include "packet-p1-table.c" /* operation and error codes */ typedef struct p1_address_ctx { - gboolean do_address; + bool do_address; const char *content_type_id; - gboolean report_unknown_content_type; + bool report_unknown_content_type; wmem_strbuf_t* oraddress; } p1_address_ctx_t; -static void set_do_address(asn1_ctx_t* actx, gboolean do_address) +static void set_do_address(asn1_ctx_t* actx, bool do_address) { p1_address_ctx_t* ctx; @@ -160,7 +161,7 @@ static const ros_info_t p3_ros_info = { p3_err_tab }; -void p1_initialize_content_globals (asn1_ctx_t* actx, proto_tree *tree, gboolean report_unknown_cont_type) +void p1_initialize_content_globals (asn1_ctx_t* actx, proto_tree *tree, bool report_unknown_cont_type) { p1_address_ctx_t* ctx; @@ -199,10 +200,10 @@ dissect_p1_mts_apdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, proto_item *item=NULL; 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); /* save parent_tree so subdissectors can create new top nodes */ - p1_initialize_content_globals (&asn1_ctx, parent_tree, TRUE); + p1_initialize_content_globals (&asn1_ctx, parent_tree, true); if (parent_tree) { item = proto_tree_add_item(parent_tree, proto_p1, tvb, 0, -1, ENC_NA); @@ -212,8 +213,8 @@ dissect_p1_mts_apdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, col_set_str(pinfo->cinfo, COL_PROTOCOL, "P1"); col_set_str(pinfo->cinfo, COL_INFO, "Transfer"); - dissect_p1_MTS_APDU (FALSE, tvb, 0, &asn1_ctx, tree, hf_p1_MTS_APDU_PDU); - p1_initialize_content_globals (&asn1_ctx, NULL, FALSE); + dissect_p1_MTS_APDU (false, tvb, 0, &asn1_ctx, tree, hf_p1_MTS_APDU_PDU); + p1_initialize_content_globals (&asn1_ctx, NULL, false); return tvb_captured_length(tvb); } @@ -230,9 +231,9 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat struct SESSION_DATA_STRUCTURE* session; int (*p1_dissector)(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) = NULL; const char *p1_op_name; - int hf_p1_index = -1; + int hf_p1_index = 0; 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 operation information from the ROS dissector? */ if (data == NULL) @@ -240,7 +241,7 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat session = (struct SESSION_DATA_STRUCTURE*)data; /* save parent_tree so subdissectors can create new top nodes */ - p1_initialize_content_globals (&asn1_ctx, parent_tree, TRUE); + p1_initialize_content_globals (&asn1_ctx, parent_tree, true); asn1_ctx.private_data = session; @@ -280,13 +281,13 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat while (tvb_reported_length_remaining(tvb, offset) > 0) { old_offset=offset; - offset=(*p1_dissector)(FALSE, tvb, offset, &asn1_ctx , tree, hf_p1_index); + offset=(*p1_dissector)(false, tvb, offset, &asn1_ctx , tree, hf_p1_index); if (offset == old_offset) { proto_tree_add_expert(tree, pinfo, &ei_p1_zero_pdu, tvb, offset, -1); break; } } - p1_initialize_content_globals (&asn1_ctx, NULL, FALSE); + p1_initialize_content_globals (&asn1_ctx, NULL, false); return tvb_captured_length(tvb); } @@ -321,7 +322,7 @@ void proto_register_p1(void) { }; /* List of subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_p1, &ett_p3, &ett_p1_content_unknown, @@ -387,16 +388,16 @@ void proto_reg_handoff_p1(void) { oid_add_from_string("id-ac-mts-transfer","2.6.0.1.6"); /* ABSTRACT SYNTAXES */ - register_rtse_oid_dissector_handle("2.6.0.2.12", p1_handle, 0, "id-as-mta-rtse", TRUE); - register_rtse_oid_dissector_handle("2.6.0.2.7", p1_handle, 0, "id-as-mtse", FALSE); + register_rtse_oid_dissector_handle("2.6.0.2.12", p1_handle, 0, "id-as-mta-rtse", true); + register_rtse_oid_dissector_handle("2.6.0.2.7", p1_handle, 0, "id-as-mtse", false); - register_rtse_oid_dissector_handle("applicationProtocol.1", p1_handle, 0, "mts-transfer-protocol-1984", FALSE); - register_rtse_oid_dissector_handle("applicationProtocol.12", p1_handle, 0, "mta-transfer-protocol", FALSE); + register_rtse_oid_dissector_handle("applicationProtocol.1", p1_handle, 0, "mts-transfer-protocol-1984", false); + register_rtse_oid_dissector_handle("applicationProtocol.12", p1_handle, 0, "mta-transfer-protocol", false); /* the ROS dissector will use the registered P3 ros info */ - register_rtse_oid_dissector_handle(id_as_mts_rtse, NULL, 0, "id-as-mts-rtse", TRUE); - register_rtse_oid_dissector_handle(id_as_msse, NULL, 0, "id-as-msse", TRUE); + register_rtse_oid_dissector_handle(id_as_mts_rtse, NULL, 0, "id-as-mts-rtse", true); + register_rtse_oid_dissector_handle(id_as_msse, NULL, 0, "id-as-msse", true); /* APPLICATION CONTEXT */ @@ -408,16 +409,16 @@ void proto_reg_handoff_p1(void) { /* Register P3 with ROS */ - register_ros_protocol_info(id_as_msse, &p3_ros_info, 0, "id-as-msse", FALSE); + register_ros_protocol_info(id_as_msse, &p3_ros_info, 0, "id-as-msse", false); - register_ros_protocol_info(id_as_mdse_88, &p3_ros_info, 0, "id-as-mdse-88", FALSE); - register_ros_protocol_info(id_as_mdse_94, &p3_ros_info, 0, "id-as-mdse-94", FALSE); + register_ros_protocol_info(id_as_mdse_88, &p3_ros_info, 0, "id-as-mdse-88", false); + register_ros_protocol_info(id_as_mdse_94, &p3_ros_info, 0, "id-as-mdse-94", false); - register_ros_protocol_info(id_as_mase_88, &p3_ros_info, 0, "id-as-mase-88", FALSE); - register_ros_protocol_info(id_as_mase_94, &p3_ros_info, 0, "id-as-mase-94", FALSE); + register_ros_protocol_info(id_as_mase_88, &p3_ros_info, 0, "id-as-mase-88", false); + register_ros_protocol_info(id_as_mase_94, &p3_ros_info, 0, "id-as-mase-94", false); - register_ros_protocol_info(id_as_mts, &p3_ros_info, 0, "id-as-mts", FALSE); - register_ros_protocol_info(id_as_mts_rtse, &p3_ros_info, 0, "id-as-mts-rtse", TRUE); + register_ros_protocol_info(id_as_mts, &p3_ros_info, 0, "id-as-mts", false); + register_ros_protocol_info(id_as_mts_rtse, &p3_ros_info, 0, "id-as-mts-rtse", true); } diff --git a/epan/dissectors/asn1/p1/packet-p1-template.h b/epan/dissectors/asn1/p1/packet-p1-template.h index 2336523d..bf60694e 100644 --- a/epan/dissectors/asn1/p1/packet-p1-template.h +++ b/epan/dissectors/asn1/p1/packet-p1-template.h @@ -14,7 +14,7 @@ #include "packet-p1-val.h" -void p1_initialize_content_globals (asn1_ctx_t* actx, proto_tree *tree, gboolean report_unknown_cont_type); +void p1_initialize_content_globals (asn1_ctx_t* actx, proto_tree *tree, bool report_unknown_cont_type); const char* p1_get_last_oraddress(asn1_ctx_t* actx); int dissect_p1_mts_apdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data); #include "packet-p1-exp.h" |