diff options
author | Gerald Combs <gerald@wireshark.org> | 2006-12-28 17:22:12 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2006-12-28 17:22:12 +0000 |
commit | bd282b4114be8c7060fbc3873a04b80ec18317b8 (patch) | |
tree | ef14ce379885a746930a9839b20bebb530b35d04 /epan/crypt/airpdcap_int.h | |
parent | 60180815a6a70d264fdf4f6ff9f49eeb1a7c6742 (diff) | |
download | wireshark-bd282b4114be8c7060fbc3873a04b80ec18317b8.tar.gz |
Move the contents of airpdcap to epan/crypt. Try to fix the current
distcheck failure. Move the nmake build targets for airpdcap from
epan/dissectors to epan. This will probably break the Windows build.
svn path=/trunk/; revision=20231
Diffstat (limited to 'epan/crypt/airpdcap_int.h')
-rw-r--r-- | epan/crypt/airpdcap_int.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/epan/crypt/airpdcap_int.h b/epan/crypt/airpdcap_int.h new file mode 100644 index 0000000000..6424be6731 --- /dev/null +++ b/epan/crypt/airpdcap_int.h @@ -0,0 +1,113 @@ +#ifndef _AIRPDCAP_INT_H +#define _AIRPDCAP_INT_H + +/******************************************************************************/ +/* File includes */ +/* */ +#include "airpdcap_interop.h" +/* */ +/* */ +/******************************************************************************/ + +/******************************************************************************/ +/* Definitions */ +/* */ +/* IEEE 802.11 packet type values */ +#define AIRPDCAP_TYPE_MANAGEMENT 0 +#define AIRPDCAP_TYPE_CONTROL 1 +#define AIRPDCAP_TYPE_DATA 2 + +/* Min length of encrypted data (TKIP=25bytes, CCMP=21bytes) */ +#define AIRPDCAP_CRYPTED_DATA_MINLEN 21 + +#define AIRPDCAP_TA_OFFSET 10 + +/* */ +/******************************************************************************/ + +/******************************************************************************/ +/* Macro definitions */ +/* */ +/* Macro to get MAC header length (if ToDS and FromDS are set, there is the address 4) */ +#define AIRPDCAP_HEADER_LEN(FrameControl_1) (UINT8)((FrameControl_1 & 0x3)==3 ? 30 : 24) + +/* Macro to get various bits of a 802.11 control frame */ +#define AIRPDCAP_TYPE(FrameControl_0) (UINT8)((FrameControl_0 >> 2) & 0x3) +#define AIRPDCAP_SUBTYPE(FrameControl_0) (UINT8)((FrameControl_0 >> 4) & 0xF) +#define AIRPDCAP_TO_DS(FrameControl_1) (UINT8)(FrameControl_1 & 0x1) +#define AIRPDCAP_FROM_DS(FrameControl_1) (UINT8)((FrameControl_1 >> 1) & 0x1) +#define AIRPDCAP_WEP(FrameControl_1) (UINT8)((FrameControl_1 >> 6) & 0x1) +/*! +/brief +it gets the Key ID from the Initialization Vector (last byte) +*/ +#define AIRPDCAP_EXTIV(KeyID) ((KeyID >> 5) & 0x1) + +/* Macro to get various bits of an EAPOL frame */ +#define AIRPDCAP_EAP_KEY_DESCR_VER(KeyInfo_1) ((UCHAR)(KeyInfo_1 & 0x3)) +#define AIRPDCAP_EAP_KEY(KeyInfo_1) ((KeyInfo_1 >> 3) & 0x1) +#define AIRPDCAP_EAP_INST(KeyInfo_1) ((KeyInfo_1 >> 6) & 0x1) +#define AIRPDCAP_EAP_ACK(KeyInfo_1) ((KeyInfo_1 >> 7) & 0x1) +#define AIRPDCAP_EAP_MIC(KeyInfo_0) (KeyInfo_0 & 0x1) +#define AIRPDCAP_EAP_SEC(KeyInfo_0) ((KeyInfo_0 >> 1) & 0x1) + +/* Note: copied from net80211/ieee80211_airpdcap_tkip.c */ +#define S_SWAP(a,b) { UINT8 t = S[a]; S[a] = S[b]; S[b] = t; } +/* */ +/******************************************************************************/ + +/******************************************************************************/ +/* Structure definitions */ +/* */ +#pragma pack(push) +#pragma pack(1) + +/* Definition of IEEE 802.11 frame (without the address 4) */ +typedef struct _AIRPDCAP_MAC_FRAME { + UCHAR fc[2]; + UCHAR dur[2]; + UCHAR addr1[AIRPDCAP_MAC_LEN]; + UCHAR addr2[AIRPDCAP_MAC_LEN]; + UCHAR addr3[AIRPDCAP_MAC_LEN]; + UCHAR seq[2]; +} AIRPDCAP_MAC_FRAME, *PAIRPDCAP_MAC_FRAME; + +/* Definition of IEEE 802.11 frame (with the address 4) */ +typedef struct _AIRPDCAP_MAC_FRAME_ADDR4 { + UCHAR fc[2]; + UCHAR dur[2]; + UCHAR addr1[AIRPDCAP_MAC_LEN]; + UCHAR addr2[AIRPDCAP_MAC_LEN]; + UCHAR addr3[AIRPDCAP_MAC_LEN]; + UCHAR seq[2]; + UCHAR addr4[AIRPDCAP_MAC_LEN]; +} AIRPDCAP_MAC_FRAME_ADDR4, *PAIRPDCAP_MAC_FRAME_ADDR4; + +/* Definition of IEEE 802.11 frame (without the address 4, with QOS) */ +typedef struct _AIRPDCAP_MAC_FRAME_QOS { + UCHAR fc[2]; + UCHAR dur[2]; + UCHAR addr1[AIRPDCAP_MAC_LEN]; + UCHAR addr2[AIRPDCAP_MAC_LEN]; + UCHAR addr3[AIRPDCAP_MAC_LEN]; + UCHAR seq[2]; + UCHAR qos[2]; +} AIRPDCAP_MAC_FRAME_QOS, *PAIRPDCAP_MAC_FRAME_QOS; + +/* Definition of IEEE 802.11 frame (with the address 4 and QOS) */ +typedef struct _AIRPDCAP_MAC_FRAME_ADDR4_QOS { + UCHAR fc[2]; + UCHAR dur[2]; + UCHAR addr1[AIRPDCAP_MAC_LEN]; + UCHAR addr2[AIRPDCAP_MAC_LEN]; + UCHAR addr3[AIRPDCAP_MAC_LEN]; + UCHAR seq[2]; + UCHAR addr4[AIRPDCAP_MAC_LEN]; + UCHAR qos[2]; +} AIRPDCAP_MAC_FRAME_ADDR4_QOS, *PAIRPDCAP_MAC_FRAME_ADDR4_QOS; + +#pragma pack(pop) +/* */ +/******************************************************************************/ + +#endif |