Commit Graph

7 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
b30f3843b9 Apply the last step of the new way to update the link-layer header length
All the link-layer dissectors are now void functions.

All the functions were moved to the void_printers[] array.
Rename this array to printers[].
Remove the uint_printers[] array, now empty.
Remove the 'ndo_void_printer' flag field, now useless, from
netdissect_options.
Remove other transitional code.
2020-08-06 22:55:05 +02:00
Francois-Xavier Le Bail
757e793ca5 Apply the first step of the new way to update the link-layer header length
Currently the return value of link-layer dissectors is supposed to be
the length of the link-layer header, so that it can be skipped for -x
and -X.

If a link-layer dissector or a called function throws an exception, it
returns no value, so that length isn't available.

The goal is to change all the link-layer dissectors to be void functions
and dissectors should update a new field of the netdissect_options
structure "link-layer header length" rather than returning it as a value.

In this transition process, the link-layer dissectors will be moved, when
updated, from the uint_printers[] array (named before printers[]) to the
void_printers[] array.

In this transition process, a new field of the netdissect_options
structure, ndo_void_printer (TRUE/FALSE), set in the updated function
lookup_printer(), will permit to choose between the old and new way to
update the link-layer header length.
2020-02-02 14:15:24 +01:00
Francois-Xavier Le Bail
d77ac851c7 Fix local time printing
Using seconds offset from GMT to local time to compute local time give
errors when printing times outside the same daylight saving time period.

Use the localtime() function for default and -tttt cases.
Use the gmtime() function for -ttt and -ttttt cases.

Rename ts_hmsfrac_print() to ts_date_hmsfrac_print().
Remove some variables now useless.
Update some comments.
2018-08-07 17:37:36 +02:00
Guy Harris
77453f5355 Eliminate some remaining uses of u_int32_t. 2015-09-18 15:11:43 -07:00
Francois-Xavier Le Bail
f0ff49cc4d Move if_printer to structure netdissect_options
The structure 'netdissect_options' can hold if_printer.
Thus the structure 'print_info' is useless now.

Moreover:
Delete useless blank lines
Fix indent
2015-09-14 15:54:54 +02:00
Brooks Davis
dcfd7c43ad Pass an ndo to the print API rather than using gndo.
Since gndo is only referenced in main() move it there.
2015-04-27 00:10:23 +00:00
Brooks Davis
115a063589 Disentangle packet dissection functionally in tcpdump from the internal
libnetdissect.  This greatly narrows the public interface and allows
libnetdissect to be more easily sandboxed.
2015-04-15 18:52:33 +00:00