more
authorStefan Metzmacher <metze@samba.org>
Thu, 23 Nov 2017 15:49:08 +0000 (16:49 +0100)
committerStefan Metzmacher <metze@samba.org>
Sun, 20 Jan 2019 22:14:58 +0000 (23:14 +0100)
Change-Id: Ib819c592b9623a2b0dd1bee5ac3999b9cb9a5692

epan/dissectors/packet-nmf.c

index 48fd7c4..ae5ab77 100644 (file)
@@ -44,6 +44,7 @@ static int hf_nmf_version_major = -1;
 static int hf_nmf_version_minor = -1;
 static int hf_nmf_mode_value = -1;
 static int hf_nmf_via_length = -1;
+static int hf_nmf_via_value = -1;
 
 enum nmf_record_type {
        NMF_VERSION_RECORD              = 0x00,
@@ -124,6 +125,7 @@ dissect_nmf_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs
        const gchar *record_name = NULL;
        enum nmf_record_type record_type;
        guint32 size = 0;
+       const guint8 *str = NULL;
 
        record_item = proto_tree_add_item(tree, hf_nmf_record, tvb, offset, -1, ENC_NA);
        proto_item_append_text(record_item, ", start_offset=0x%x, ", (guint)offset);
@@ -162,7 +164,11 @@ dissect_nmf_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs
                        return -1;
                }
 
+               proto_tree_add_item_ret_string(record_tree, hf_nmf_via_value,
+                                              tvb, offset, size, ENC_UTF_8,
+                                              wmem_packet_scope(), &str);
                offset += size;
+               proto_item_append_text(record_item, ": %s", (const gchar *)str);
                break;
        case NMF_KNOWN_ENCODING_RECORD:
                offset += 1;
@@ -241,6 +247,9 @@ void proto_register_nmf(void)
        { &hf_nmf_via_length,
                { "Length", "nmf.via.length",
                FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+       { &hf_nmf_via_value,
+               { "Value", "nmf.via.value",
+               FT_STRING, BASE_NONE, NULL, 0x0, "Via URI", HFILL }},
        };
 
        proto_nmf = proto_register_protocol("NMF (.NET Message Framing Protocol)",