diff options
Diffstat (limited to 'asn1/acse/packet-acse-template.c')
-rw-r--r-- | asn1/acse/packet-acse-template.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/asn1/acse/packet-acse-template.c b/asn1/acse/packet-acse-template.c index 2f700fa2eb..37bc5e6f06 100644 --- a/asn1/acse/packet-acse-template.c +++ b/asn1/acse/packet-acse-template.c @@ -69,12 +69,15 @@ int proto_clacse = -1; #include "packet-acse-hf.c" +static gint hf_acse_user_data = -1; /* Initialize the subtree pointers */ static gint ett_acse = -1; #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 const char *object_identifier_id; /* indirect_reference, used to pick up the signalling so we know what @@ -173,9 +176,8 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d /* first, try to check length */ /* do we have at least 2 bytes */ if (!tvb_bytes_exist(tvb, 0, 2)){ - proto_tree_add_text(parent_tree, tvb, offset, - tvb_reported_length_remaining(tvb,offset), - "User data"); + proto_tree_add_item(parent_tree, hf_acse_user_data, tvb, offset, + tvb_reported_length_remaining(tvb,offset), ENC_NA); return 0; /* no, it isn't a ACSE PDU */ } @@ -208,7 +210,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d oid=find_oid_by_pres_ctx_id(pinfo, indir_ref); if(oid){ if(strcmp(oid, ACSE_APDU_OID) == 0){ - proto_tree_add_text(parent_tree, tvb, offset, -1, + proto_tree_add_expert_format(parent_tree, pinfo, &ei_acse_invalid_oid, tvb, offset, -1, "Invalid OID: %s", ACSE_APDU_OID); THROW(ReportedBoundsError); } @@ -249,7 +251,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d int old_offset=offset; offset = dissect_acse_ACSE_apdu(FALSE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset ){ - proto_tree_add_text(tree, tvb, offset, -1,"Malformed packet"); + proto_tree_add_expert(tree, pinfo, &ei_acse_malformed, tvb, offset, -1); break; } } @@ -263,6 +265,10 @@ void proto_register_acse(void) { /* List of fields */ static hf_register_info hf[] = { + { &hf_acse_user_data, + { "User data", "acse.user_data", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, #include "packet-acse-hfarr.c" }; @@ -274,6 +280,8 @@ void proto_register_acse(void) { static ei_register_info ei[] = { { &ei_acse_dissector_not_available, { "acse.dissector_not_available", PI_UNDECODED, PI_WARN, "Dissector is not available", EXPFILL }}, + { &ei_acse_malformed, { "acse._malformed", PI_MALFORMED, PI_ERROR, "Malformed packet", EXPFILL }}, + { &ei_acse_invalid_oid, { "acse.invalid_oid", PI_UNDECODED, PI_WARN, "Invalid OID", EXPFILL }}, }; expert_module_t* expert_acse; |