From abec60cfddd94fa5f856c071f5b5861e81899f8a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 16 Jun 2014 10:00:55 +0200 Subject: dissector: Get rid of now unnecessary HAVE_DISSECTOR_PROTOS Since commit 1cc762a ("lookup: Move UDP/TCP port and Ethernet type lookup into own module") the netsniff-ng tool is the only one using the dissector infrastructure. Thus we no longer need to conditionally device HAVE_DISSECTOR_PROTOS, since netsniff-ng is the only tool defining this. While at it, also remove the __WITH_PROTOS macro which is checked in dissector_init_ethernet/dissector_cleanup_ethernet but is defined nowhere. This will cause the functions to be called from both the ethernet and ieee80211 dissectors, thus make sure we check the initialization state before freeing as well. Signed-off-by: Tobias Klauser --- dissector_eth.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'dissector_eth.c') diff --git a/dissector_eth.c b/dissector_eth.c index 035cdfa..60d8429 100644 --- a/dissector_eth.c +++ b/dissector_eth.c @@ -18,7 +18,6 @@ struct hash_table eth_lay2; struct hash_table eth_lay3; -#ifdef HAVE_DISSECTOR_PROTOS static inline void dissector_init_entry(int type) { dissector_set_print_type(ðernet_ops, type); @@ -61,13 +60,6 @@ static void dissector_init_layer_3(int type) INSERT_HASH_PROTOS(udp_ops, eth_lay3); for_each_hash_int(ð_lay3, dissector_set_print_type, type); } -#else -static inline void dissector_init_entry(int type __maybe_unused) {} -static inline void dissector_init_exit(int type __maybe_unused) {} -static void dissector_init_layer_2(int type __maybe_unused) {} -static void dissector_init_layer_3(int type __maybe_unused) {} -#endif - void dissector_init_ethernet(int fnttype) { @@ -76,9 +68,8 @@ void dissector_init_ethernet(int fnttype) dissector_init_layer_3(fnttype); dissector_init_exit(fnttype); -#ifdef __WITH_PROTOS dissector_init_oui(); -#endif + lookup_init_ports(PORTS_UDP); lookup_init_ports(PORTS_TCP); lookup_init_ports(PORTS_ETHER); @@ -93,7 +84,5 @@ void dissector_cleanup_ethernet(void) lookup_cleanup_ports(PORTS_TCP); lookup_cleanup_ports(PORTS_UDP); -#ifdef __WITH_PROTOS dissector_cleanup_oui(); -#endif } -- cgit v1.2.3-54-g00ecf