Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

dot11decrypt_int.h
1 /* airpcap_int.h
2 *
3 * Copyright (c) 2006 CACE Technologies, Davis (California)
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
7 */
8
9 #ifndef _DOT11DECRYPT_INT_H
10 #define _DOT11DECRYPT_INT_H
11
12 /****************************************************************************/
13 /* File includes */
14
15 #include "dot11decrypt_interop.h"
16 #include "dot11decrypt_system.h"
17
18 /****************************************************************************/
19
20 /****************************************************************************/
21 /* Definitions */
22
23 /* IEEE 802.11 packet type values */
24 #define DOT11DECRYPT_TYPE_MANAGEMENT 0
25 #define DOT11DECRYPT_TYPE_CONTROL 1
26 #define DOT11DECRYPT_TYPE_DATA 2
27
28 /* IEEE 802.11 packet subtype values */
29 #define DOT11DECRYPT_SUBTYPE_ASSOC_REQ 0
30 #define DOT11DECRYPT_SUBTYPE_ASSOC_RESP 1
31 #define DOT11DECRYPT_SUBTYPE_REASSOC_REQ 2
32 #define DOT11DECRYPT_SUBTYPE_REASSOC_RESP 3
33 #define DOT11DECRYPT_SUBTYPE_PROBE_REQ 4
34 #define DOT11DECRYPT_SUBTYPE_PROBE_RESP 5
35 #define DOT11DECRYPT_SUBTYPE_MEASUREMENT_PILOT 6
36 #define DOT11DECRYPT_SUBTYPE_BEACON 8
37 #define DOT11DECRYPT_SUBTYPE_ATIM 9
38 #define DOT11DECRYPT_SUBTYPE_DISASS 10
39 #define DOT11DECRYPT_SUBTYPE_AUTHENTICATION 11
40 #define DOT11DECRYPT_SUBTYPE_DEAUTHENTICATION 12
41 #define DOT11DECRYPT_SUBTYPE_ACTION 13
42 #define DOT11DECRYPT_SUBTYPE_ACTION_NO_ACK 14
43
44 /* Min length of encrypted data (TKIP=21bytes, CCMP=17bytes) */
45 #define DOT11DECRYPT_CRYPTED_DATA_MINLEN 17
46
47 #define DOT11DECRYPT_TA_OFFSET 10
48
49 /* */
50 /****************************************************************************/
51
52 /****************************************************************************/
53 /* Macro definitions */
54
58 #define DOT11DECRYPT_TYPE(FrameControl_0) (UINT8)((FrameControl_0 >> 2) & 0x3)
59 #define DOT11DECRYPT_SUBTYPE(FrameControl_0) (UINT8)((FrameControl_0 >> 4) & 0xF)
60 #define DOT11DECRYPT_DS_BITS(FrameControl_1) (UINT8)(FrameControl_1 & 0x3)
61 #define DOT11DECRYPT_TO_DS(FrameControl_1) (UINT8)(FrameControl_1 & 0x1)
62 #define DOT11DECRYPT_FROM_DS(FrameControl_1) (UINT8)((FrameControl_1 >> 1) & 0x1)
63 #define DOT11DECRYPT_WEP(FrameControl_1) (UINT8)((FrameControl_1 >> 6) & 0x1)
64
68 #define DOT11DECRYPT_EXTIV(KeyID) ((KeyID >> 5) & 0x1)
69
70 #define DOT11DECRYPT_KEY_INDEX(KeyID) ((KeyID >> 6) & 0x3)
72 /* Macros to get various bits of an EAPOL frame */
73 #define DOT11DECRYPT_EAP_KEY_DESCR_VER(KeyInfo_1) ((UCHAR)(KeyInfo_1 & 0x3))
74 #define DOT11DECRYPT_EAP_KEY(KeyInfo_1) ((KeyInfo_1 >> 3) & 0x1)
75 #define DOT11DECRYPT_EAP_INST(KeyInfo_1) ((KeyInfo_1 >> 6) & 0x1)
76 #define DOT11DECRYPT_EAP_ACK(KeyInfo_1) ((KeyInfo_1 >> 7) & 0x1)
77 #define DOT11DECRYPT_EAP_MIC(KeyInfo_0) (KeyInfo_0 & 0x1)
78 #define DOT11DECRYPT_EAP_SEC(KeyInfo_0) ((KeyInfo_0 >> 1) & 0x1)
79
80 /****************************************************************************/
81
82 /****************************************************************************/
83 /* Structure definitions */
84
85 /*
86 * XXX - According to the thread at
87 * http://www.wireshark.org/lists/wireshark-dev/200612/msg00384.html we
88 * shouldn't have to worry about packing our structs, since the largest
89 * elements are 8 bits wide.
90 */
91 #ifdef _MSC_VER /* MS Visual C++ */
92 #pragma pack(push)
93 #pragma pack(1)
94 #endif
95
96 /* Definition of IEEE 802.11 frame (without the address 4) */
97 typedef struct _DOT11DECRYPT_MAC_FRAME {
98 UCHAR fc[2];
99 UCHAR dur[2];
100 UCHAR addr1[DOT11DECRYPT_MAC_LEN];
101 UCHAR addr2[DOT11DECRYPT_MAC_LEN];
102 UCHAR addr3[DOT11DECRYPT_MAC_LEN];
103 UCHAR seq[2];
104 } DOT11DECRYPT_MAC_FRAME, *PDOT11DECRYPT_MAC_FRAME;
105
106 /* Definition of IEEE 802.11 frame (with the address 4) */
107 typedef struct _DOT11DECRYPT_MAC_FRAME_ADDR4 {
108 UCHAR fc[2];
109 UCHAR dur[2];
110 UCHAR addr1[DOT11DECRYPT_MAC_LEN];
111 UCHAR addr2[DOT11DECRYPT_MAC_LEN];
112 UCHAR addr3[DOT11DECRYPT_MAC_LEN];
113 UCHAR seq[2];
114 UCHAR addr4[DOT11DECRYPT_MAC_LEN];
115 } DOT11DECRYPT_MAC_FRAME_ADDR4, *PDOT11DECRYPT_MAC_FRAME_ADDR4;
116
117 /* Definition of IEEE 802.11 frame (without the address 4, with QOS) */
118 typedef struct _DOT11DECRYPT_MAC_FRAME_QOS {
119 UCHAR fc[2];
120 UCHAR dur[2];
121 UCHAR addr1[DOT11DECRYPT_MAC_LEN];
122 UCHAR addr2[DOT11DECRYPT_MAC_LEN];
123 UCHAR addr3[DOT11DECRYPT_MAC_LEN];
124 UCHAR seq[2];
125 UCHAR qos[2];
126 } DOT11DECRYPT_MAC_FRAME_QOS, *PDOT11DECRYPT_MAC_FRAME_QOS;
127
128 /* Definition of IEEE 802.11 frame (with the address 4 and QOS) */
129 typedef struct _DOT11DECRYPT_MAC_FRAME_ADDR4_QOS {
130 UCHAR fc[2];
131 UCHAR dur[2];
132 UCHAR addr1[DOT11DECRYPT_MAC_LEN];
133 UCHAR addr2[DOT11DECRYPT_MAC_LEN];
134 UCHAR addr3[DOT11DECRYPT_MAC_LEN];
135 UCHAR seq[2];
136 UCHAR addr4[DOT11DECRYPT_MAC_LEN];
137 UCHAR qos[2];
138 } DOT11DECRYPT_MAC_FRAME_ADDR4_QOS, *PDOT11DECRYPT_MAC_FRAME_ADDR4_QOS;
139
140 #ifdef _MSC_VER /* MS Visual C++ */
141 #pragma pack(pop)
142 #endif
143
144 /******************************************************************************/
145
146 #endif
_DOT11DECRYPT_MAC_FRAME_QOS
Definition: dot11decrypt_int.h:118
_DOT11DECRYPT_MAC_FRAME_ADDR4
Definition: dot11decrypt_int.h:107
_DOT11DECRYPT_MAC_FRAME_ADDR4_QOS
Definition: dot11decrypt_int.h:129
_DOT11DECRYPT_MAC_FRAME
Definition: dot11decrypt_int.h:97