2 * netsniff-ng - the packet sniffing beast
3 * By Daniel Borkmann <daniel@netsniff-ng.org>
4 * Copyright 2012 Daniel Borkmann.
5 * Subject to the GPL, version 2.
10 #include <netinet/in.h> /* for ntohs() */
11 #include <asm/byteorder.h>
15 #include "dissector_80211.h"
20 /* XXX: clarify which endianess */
25 #if defined(__BIG_ENDIAN_BITFIELD)
26 __extension__ u16 subtype
:4,
37 #elif defined(__LITTLE_ENDIAN_BITFIELD)
38 __extension__ u16 proto_version
:2,
50 # error "Adjust your <asm/byteorder.h> defines"
56 static void ieee80211(struct pkt_buff
*pkt
)
58 struct ieee80211hdr
*hdr
=
59 (struct ieee80211hdr
*) pkt_pull(pkt
, sizeof(*hdr
));
63 tprintf(" [ 802.11 Frame Control (0x%x), Duration/ID (%u) ]\n",
64 0/*ntohs(hdr->frame_control)*/, /*ntohs(*/hdr
->duration
);
65 tprintf("\t [ Proto Version (%u), ", hdr
->proto_version
);
66 tprintf("Type (%u), ", hdr
->type
/*XXX*/);
67 tprintf("Subtype (%u)", hdr
->subtype
/*XXX*/);
69 hdr
->to_ds
? ", Frame goes to DS" : "",
70 hdr
->from_ds
? ", Frame comes from DS" : "");
71 tprintf("%s", hdr
->more_frags
? ", More Fragments" : "");
72 tprintf("%s", hdr
->retry
? ", Frame is retransmitted" : "");
73 tprintf("%s", hdr
->power_mgmt
? ", In Power Saving Mode" : "");
74 tprintf("%s", hdr
->more_data
? ", More Data" : "");
75 tprintf("%s", hdr
->wep
? ", Needs WEP" : "");
76 tprintf("%s", hdr
->order
? ", Order" : "");
79 // pkt_set_proto(pkt, &ieee802_lay2, ntohs(eth->h_proto));
82 static void ieee80211_less(struct pkt_buff
*pkt
)
84 tprintf("802.11 frame (more on todo)");
87 struct protocol ieee80211_ops
= {
89 .print_full
= ieee80211
,
90 .print_less
= ieee80211_less
,
93 EXPORT_SYMBOL(ieee80211_ops
);