flowtop: refactor major parts of the code (more on todo)
[netsniff-ng.git] / src / dissector_80211.c
blobf87329980726e08784c092692765c6e351c24757
1 /*
2 * netsniff-ng - the packet sniffing beast
3 * By Daniel Borkmann <daniel@netsniff-ng.org>
4 * Copyright 2009, 2010 Daniel Borkmann.
5 * Subject to the GPL, version 2.
6 */
8 #include <stdint.h>
10 #include "hash.h"
11 #include "protos.h"
12 #include "pkt_buff.h"
13 #include "dissector.h"
14 #include "dissector_80211.h"
15 #include "xmalloc.h"
16 #include "oui.h"
18 struct hash_table ieee80211_lay2;
20 #ifdef __WITH_PROTOS
21 static inline void dissector_init_entry(int type)
23 dissector_set_print_type(&ieee80211_ops, type);
26 static inline void dissector_init_exit(int type)
28 dissector_set_print_type(&none_ops, type);
31 static void dissector_init_layer_2(int type)
33 init_hash(&ieee80211_lay2);
34 // INSERT_HASH_PROTOS(blubber_ops, ieee80211_lay2);
35 for_each_hash_int(&ieee80211_lay2, dissector_set_print_type, type);
37 #else
38 static inline void dissector_init_entry(int type) {}
39 static inline void dissector_init_exit(int type) {}
40 static void dissector_init_layer_2(int type) {}
41 #endif /* __WITH_PROTOS */
43 void dissector_init_ieee80211(int fnttype)
45 dissector_init_entry(fnttype);
46 dissector_init_layer_2(fnttype);
47 dissector_init_exit(fnttype);
48 dissector_init_oui();
51 void dissector_cleanup_ieee80211(void)
53 free_hash(&ieee80211_lay2);
54 dissector_cleanup_oui();