diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/packet-libvirt.c index f7aa7edfee5f54baa475762a557aac1c5fe5c128..3103562896baa12b21b60cc458b27cd64dc7c57f 100644 --- a/tools/wireshark/src/packet-libvirt.c +++ b/tools/wireshark/src/packet-libvirt.c @@ -56,7 +56,7 @@ static int hf_libvirt_serial = -1; static int hf_libvirt_status = -1; static int hf_libvirt_stream = -1; static int hf_libvirt_num_of_fds = -1; -static int hf_libvirt_unknown = -1; +int hf_libvirt_unknown = -1; static gint ett_libvirt = -1; #define XDR_PRIMITIVE_DISSECTOR(xtype, ctype, ftype) \ diff --git a/tools/wireshark/util/genxdrstub.pl b/tools/wireshark/util/genxdrstub.pl index 76ccda9360a653257f51bbdc7a86be3ae0f4c3b3..07f0ff7250554c4802feacbbfc7259348c067dff 100755 --- a/tools/wireshark/util/genxdrstub.pl +++ b/tools/wireshark/util/genxdrstub.pl @@ -57,6 +57,9 @@ for my $proto (@ARGV) { $c->add_header_file($name, sub { dbg "*** Start parsing $proto\n"; + + $c->print("extern int hf_libvirt_unknown;\n"); + my @lexs = Lexicalizer->parse($source); for my $lex (@lexs) { next if $lex->ident eq "enum $name\_procedure"; @@ -903,7 +906,7 @@ static gboolean dissect_xdr_<%= $ident %>(tvbuff_t *tvb, proto_tree *tree, XDR * <% } %> } } else { - proto_tree_add_text(tree, tvb, start, -1, "(unknown)"); + proto_tree_add_item(tree, hf_libvirt_unknown, tvb, start, -1, ENC_NA); } return FALSE; } @@ -933,7 +936,7 @@ static gboolean dissect_xdr_<%= $ident %>(tvbuff_t *tvb, proto_tree *tree, XDR * <% } %> } if (!rc) { - proto_tree_add_text(tree, tvb, start, -1, "(unknown)"); + proto_tree_add_item(tree, hf_libvirt_unknown, tvb, start, -1, ENC_NA); } return rc; }