Commit Graph

2 Commits

Author SHA1 Message Date
John Thacker 13c8a2f887 Convert Wiretap to C99
This one is complicated because a gboolean is an int, but a bool
is not, in the way that a pointer to a bool (including in the
return of a function pointer) cannot be substituted for a pointer
to a gboolean. (They can convert a bool used internally to a gboolean
on return.)

Continue for that reason to have some functions return gboolean
when used with glib callback functions:
https://docs.gtk.org/glib/callback.HRFunc.html

Another small gotcha is that macros like UINT64_C are not necessarily
guaranteed to wrap the return in parentheses, which G_GUINT64_CONSTANT
and the like do.

In wtap.h, the file subtype "dump_open" function was typedef'd
as returning an int, but almost all users (except in wslua) returned
a gboolean. Switch it to a bool.

Make a note about why can_write_encap does not return a bool,
because it returns error codes on failure (for Lua) instead of
having the err as a separate parameter.

Update the usbdump wiretap plugin too.

A few places outside of wiretap use wiretap function pointers, such
as in the Lua interface, adding IP addresses to NRBs, merging, and
the frame dissector using wiretap functions. Switch those to bool.

Ping #19116
2024-03-20 20:48:19 +00:00
Dr. Lars Völker 05916eec1f DLT: Adding support to open DLT files
This patch allows Wireshark to open DLT files directly.
2022-08-26 07:45:36 +00:00