proto_ipv4: don't trim length of pkt_buff
[netsniff-ng.git] / src / dissector_80211.c
blobb5cd21e9bfdfa33d8973eef804ac6cf224b3f6b3
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 "xstring.h"
17 #include "oui.h"
19 struct hash_table ieee80211_lay2;
21 #ifdef __WITH_PROTOS
22 static inline void dissector_init_entry(int type)
24 dissector_set_print_type(&ieee80211_ops, type);
27 static inline void dissector_init_exit(int type)
29 dissector_set_print_type(&none_ops, type);
32 static void dissector_init_layer_2(int type)
34 init_hash(&ieee80211_lay2);
35 // INSERT_HASH_PROTOS(blubber_ops, ieee80211_lay2);
36 for_each_hash_int(&ieee80211_lay2, dissector_set_print_type, type);
38 #else
39 static inline void dissector_init_entry(int type) {}
40 static inline void dissector_init_exit(int type) {}
41 static void dissector_init_layer_2(int type) {}
42 #endif /* __WITH_PROTOS */
44 void dissector_init_ieee80211(int fnttype)
46 dissector_init_entry(fnttype);
47 dissector_init_layer_2(fnttype);
48 dissector_init_exit(fnttype);
49 dissector_init_oui();
52 void dissector_cleanup_ieee80211(void)
54 free_hash(&ieee80211_lay2);
55 dissector_cleanup_oui();