aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee1722.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-ieee1722.c')
-rw-r--r--epan/dissectors/packet-ieee1722.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ieee1722.c b/epan/dissectors/packet-ieee1722.c
index 9f135267d9..46f6c977f1 100644
--- a/epan/dissectors/packet-ieee1722.c
+++ b/epan/dissectors/packet-ieee1722.c
@@ -32,6 +32,7 @@
#include "config.h"
#include <epan/packet.h>
+#include <epan/expert.h>
#include <epan/etypes.h>
void proto_register_1722(void);
@@ -117,6 +118,8 @@ static int ett_1722 = -1;
static int ett_1722_audio = -1;
static int ett_1722_sample = -1;
+static expert_field ei_1722_incorrect_dbs = EI_INIT;
+
static dissector_table_t avb_dissector_table;
static void
@@ -236,13 +239,12 @@ dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* If the DBS is ever 0 for whatever reason, then just add the rest of packet as unknown */
if(dbs == 0)
- proto_tree_add_text(ieee1722_tree, tvb, IEEE_1722_DATA_OFFSET, datalen, "Incorrect DBS");
+ expert_add_info(pinfo, ti, &ei_1722_incorrect_dbs);
else {
/* Loop through all samples and add them to the audio tree. */
for (j = 0; j < (datalen / (dbs*4)); j++) {
- ti = proto_tree_add_text(audio_tree, tvb, offset, 1, "Sample %d", j+1);
- sample_tree = proto_item_add_subtree(ti, ett_1722_sample);
+ sample_tree = proto_tree_add_subtree_format(audio_tree, tvb, offset, 1, ett_1722_sample, NULL, "Sample %d", j+1);
for (i = 0; i < dbs; i++) {
proto_tree_add_item(sample_tree, hf_1722_label, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@@ -383,12 +385,20 @@ void proto_register_1722(void)
&ett_1722_sample
};
+ static ei_register_info ei[] = {
+ { &ei_1722_incorrect_dbs, { "ieee1722.incorrect_dbs", PI_PROTOCOL, PI_WARN, "Incorrect DBS", EXPFILL }},
+ };
+
+ expert_module_t* expert_1722;
+
/* Register the protocol name and description */
proto_1722 = proto_register_protocol("IEEE 1722 Protocol", "IEEE1722", "ieee1722");
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_1722, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ expert_1722 = expert_register_protocol(proto_1722);
+ expert_register_field_array(expert_1722, ei, array_length(ei));
/* Sub-dissector for 1772.1 */
avb_dissector_table = register_dissector_table("ieee1722.subtype",