]> xenbits.xensource.com Git - libvirt.git/commitdiff
wireshark: s/proto_tree_add_text/proto_tree_add_item/
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 27 Dec 2015 09:43:37 +0000 (10:43 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 11 Jan 2016 16:23:41 +0000 (17:23 +0100)
In the wireshark commit e2735ecfdd7a96c they dropped
proto_tree_add_text in favor of proto_tree_add_item. Adapt to
this change.

Moreover, the proto_tree_add_item API is around for ages and we
are already using it anyway. Therefore we don't need to change
required version of wireshark.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/wireshark/src/packet-libvirt.c
tools/wireshark/util/genxdrstub.pl

index f7aa7edfee5f54baa475762a557aac1c5fe5c128..3103562896baa12b21b60cc458b27cd64dc7c57f 100644 (file)
@@ -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)                    \
index 76ccda9360a653257f51bbdc7a86be3ae0f4c3b3..07f0ff7250554c4802feacbbfc7259348c067dff 100755 (executable)
@@ -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;
 }