summaryrefslogtreecommitdiff
path: root/netdissect.h
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-06 19:12:49 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-06 22:55:05 +0200
commitb30f3843b93c11e897e6d8888a91abf709a716ae (patch)
treef896ae7aeb0b456076d21243c3d130bedbeaf75b /netdissect.h
parent0c93b15d38b3f63047344fcb2ea920e73498bb3d (diff)
downloadtcpdump-b30f3843b93c11e897e6d8888a91abf709a716ae.tar.gz
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.
Diffstat (limited to 'netdissect.h')
-rw-r--r--netdissect.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/netdissect.h b/netdissect.h
index 3da175da..d73d3f78 100644
--- a/netdissect.h
+++ b/netdissect.h
@@ -166,15 +166,7 @@ typedef struct netdissect_options netdissect_options;
#define IF_PRINTER_ARGS (netdissect_options *, const struct pcap_pkthdr *, const u_char *)
-typedef u_int (*uint_if_printer) IF_PRINTER_ARGS;
-typedef void (*void_if_printer) IF_PRINTER_ARGS;
-
-/* pointer to the uint_if_printer or the void_if_printer function */
-typedef union {
- uint_if_printer uint_printer;
- void_if_printer void_printer;
- void* printer; /* generic when testing if NULL or not */
-} if_printer_t;
+typedef void (*if_printer) IF_PRINTER_ARGS;
/*
* In case the data in a buffer needs to be processed by being decrypted,
@@ -246,9 +238,8 @@ struct netdissect_options {
/* stack of saved packet boundary and buffer information */
struct netdissect_saved_packet_info *ndo_packet_info_stack;
- /* pointer to the uint_if_printer or the void_if_printer function */
- if_printer_t ndo_if_printer;
- int ndo_void_printer; /* void_if_printer ? (FALSE/TRUE) */
+ /* pointer to the if_printer function */
+ if_printer ndo_if_printer;
/* pointer to void function to output stuff */
void (*ndo_default_print)(netdissect_options *,
@@ -457,9 +448,7 @@ extern int unaligned_memcmp(const void *, const void *, size_t);
extern const char *tok2strary_internal(const char **, int, const char *, int);
#define tok2strary(a,f,i) tok2strary_internal(a, sizeof(a)/sizeof(a[0]),f,i)
-extern uint_if_printer lookup_uint_printer(int);
-extern void_if_printer lookup_void_printer(int);
-extern if_printer_t lookup_printer(netdissect_options *, int);
+extern if_printer lookup_printer(int);
#define ND_DEBUG {printf(" [%s:%d %s] ", __FILE__, __LINE__, __FUNCTION__); fflush(stdout);}