mausezahn: Don't use ternary operator to decide which function to call
[netsniff-ng.git] / dissector_80211.c
blobe638e1e225dab737b416e0bfe9103687967ec350
1 /*
2 * netsniff-ng - the packet sniffing beast
3 * Copyright 2009, 2010 Daniel Borkmann.
4 * Subject to the GPL, version 2.
5 */
7 #include <stdint.h>
9 #include "hash.h"
10 #include "protos.h"
11 #include "dissector.h"
12 #include "dissector_80211.h"
13 #include "xmalloc.h"
14 #include "oui.h"
16 struct hash_table ieee80211_lay2;
18 #ifdef HAVE_DISSECTOR_PROTOS
19 static inline void dissector_init_entry(int type)
21 dissector_set_print_type(&ieee80211_ops, type);
24 static inline void dissector_init_exit(int type)
26 dissector_set_print_type(&none_ops, type);
29 static void dissector_init_layer_2(int type)
31 init_hash(&ieee80211_lay2);
32 // INSERT_HASH_PROTOS(blubber_ops, ieee80211_lay2);
33 for_each_hash_int(&ieee80211_lay2, dissector_set_print_type, type);
35 #else
36 static inline void dissector_init_entry(int type __maybe_unused) {}
37 static inline void dissector_init_exit(int type __maybe_unused) {}
38 static void dissector_init_layer_2(int type __maybe_unused) {}
39 #endif
41 void dissector_init_ieee80211(int fnttype)
43 dissector_init_entry(fnttype);
44 dissector_init_layer_2(fnttype);
45 dissector_init_exit(fnttype);
46 dissector_init_oui();
49 void dissector_cleanup_ieee80211(void)
51 free_hash(&ieee80211_lay2);
52 dissector_cleanup_oui();