aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ccsds.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-ccsds.c')
-rw-r--r--epan/dissectors/packet-ccsds.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ccsds.c b/epan/dissectors/packet-ccsds.c
index 2efe5f1c55..bb6e45916b 100644
--- a/epan/dissectors/packet-ccsds.c
+++ b/epan/dissectors/packet-ccsds.c
@@ -89,6 +89,8 @@ static gint ett_ccsds_primary_header = -1;
static gint ett_ccsds_secondary_header = -1;
static gint ett_ccsds_checkword = -1;
+static expert_field ei_ccsds_length_error = EI_INIT;
+
/* Generic data handle */
static dissector_handle_t data_handle;
@@ -355,8 +357,7 @@ dissect_ccsds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
item = proto_tree_add_item(primary_header_tree, hf_ccsds_length, tvb, offset, 2, ENC_BIG_ENDIAN);
}
if (ccsds_length > reported_length) {
- expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
- "Length field value is greater than the packet seen on the wire");
+ expert_add_info(pinfo, item, &ei_ccsds_length_error);
}
if (tree) {
offset += 2;
@@ -663,15 +664,22 @@ proto_register_ccsds(void)
&ett_ccsds_checkword
};
+ static ei_register_info ei[] = {
+ { &ei_ccsds_length_error, { "ccsds.length.error", PI_MALFORMED, PI_ERROR, "Length field value is greater than the packet seen on the wire", EXPFILL }},
+ };
+
/* Define the CCSDS preferences module */
module_t *ccsds_module;
+ expert_module_t* expert_ccsds;
/* Register the protocol name and description */
proto_ccsds = proto_register_protocol("CCSDS", "CCSDS", "ccsds");
- /* Required function calls to register the header fields and subtrees used */
+ /* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_ccsds, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ expert_ccsds = expert_register_protocol(proto_ccsds);
+ expert_register_field_array(expert_ccsds, ei, array_length(ei));
register_dissector ( "ccsds", dissect_ccsds, proto_ccsds );