]> git.ipfire.org Git - thirdparty/libvirt.git/commit
wireshark: Introduce and use vir_val_to_str()
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 10 Oct 2025 16:23:18 +0000 (18:23 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 14 Oct 2025 13:08:28 +0000 (15:08 +0200)
commitba2c4bdd5cbccd5c0673149cf76802c98b70d2f7
treedf8af92d12d5da8c00bd48016578dc9896819249
parent1086888f95a322101f8cf53b63c96600ccbeb882
wireshark: Introduce and use vir_val_to_str()

Wireshark offers val_to_str() function which converts numeric
value to string by looking up value ('val') in an array ('vs') of
<val, string> pairs. If no corresponding string is found, then
the value is formatted using given 'fmt' string.

Starting from wireshark-4.6.0 not only this function gained
another argument but also returns a strdup()-ed string. To keep
our code simple, let's introduce a wrapper so which can be then
adjusted as needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tools/wireshark/src/packet-libvirt.c