summaryrefslogtreecommitdiff
path: root/dissector_80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'dissector_80211.c')
-rw-r--r--dissector_80211.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/dissector_80211.c b/dissector_80211.c
new file mode 100644
index 0000000..f3d8b62
--- /dev/null
+++ b/dissector_80211.c
@@ -0,0 +1,54 @@
+/*
+ * netsniff-ng - the packet sniffing beast
+ * Copyright 2009, 2010 Daniel Borkmann.
+ * Subject to the GPL, version 2.
+ */
+
+#include <stdint.h>
+
+#include "hash.h"
+#include "protos.h"
+#include "pkt_buff.h"
+#include "dissector.h"
+#include "dissector_80211.h"
+#include "xmalloc.h"
+#include "oui.h"
+
+struct hash_table ieee80211_lay2;
+
+#ifdef __WITH_PROTOS
+static inline void dissector_init_entry(int type)
+{
+ dissector_set_print_type(&ieee80211_ops, type);
+}
+
+static inline void dissector_init_exit(int type)
+{
+ dissector_set_print_type(&none_ops, type);
+}
+
+static void dissector_init_layer_2(int type)
+{
+ init_hash(&ieee80211_lay2);
+// INSERT_HASH_PROTOS(blubber_ops, ieee80211_lay2);
+ for_each_hash_int(&ieee80211_lay2, dissector_set_print_type, type);
+}
+#else
+static inline void dissector_init_entry(int type) {}
+static inline void dissector_init_exit(int type) {}
+static void dissector_init_layer_2(int type) {}
+#endif /* __WITH_PROTOS */
+
+void dissector_init_ieee80211(int fnttype)
+{
+ dissector_init_entry(fnttype);
+ dissector_init_layer_2(fnttype);
+ dissector_init_exit(fnttype);
+ dissector_init_oui();
+}
+
+void dissector_cleanup_ieee80211(void)
+{
+ free_hash(&ieee80211_lay2);
+ dissector_cleanup_oui();
+}