From 757e793ca521cbfdc4a6104c9a2a920f5538d195 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Thu, 26 Dec 2019 22:08:03 +0100 Subject: 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. --- print.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'print.h') diff --git a/print.h b/print.h index 70ea9f8e..5e67b33a 100644 --- a/print.h +++ b/print.h @@ -32,7 +32,7 @@ void init_print(netdissect_options *ndo, uint32_t localnet, uint32_t mask); int has_printer(int type); -if_printer get_if_printer(netdissect_options *ndo, int type); +if_printer_t get_if_printer(netdissect_options *ndo, int type); void pretty_print_packet(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *sp, -- cgit v1.2.1