?? frame.h
字號:
/**************************************************************************//* */ /* Copyright (c) 1999-2000 by Atmel Corporation */ /* */ /* This software is copyrighted by and is the sole property of Atmel */ /* Corporation. All rights, title, ownership, or other interests */ /* in the software remain the property of Atmel Corporation. This */ /* software may only be used in accordance with the corresponding */ /* license agreement. Any un-authorized use, duplication, transmission, */ /* distribution, or disclosure of this software is expressly forbidden. */ /* *//* This Copyright notice may not be removed or modified without prior */ /* written consent of Atmel Corporation. */ /* */ /* Atmel Corporation, Inc. reserves the right to modify this software */ /* without notice. */ /* */ /* Atmel Corporation. *//* 2325 Orchard Parkway literature@atmel.com *//* San Jose, CA 95131 http://www.atmel.com *//* *//**************************************************************************//**************************************************************************//**************************************************************************//** */ /** FastVNET (PCMCIA) NDIS Miniport Driver */ /** *//** 802,11 Frame Formats & definitions *//** *//**************************************************************************//**************************************************************************/#ifndef __frame_h_OK__#define __frame_h_OK__/////////////////////////////////////////////////////////////////////////////// FRAME CONTROL BIT 0//#define C80211_PROTOCOL_VERSION 0x00// FRAME TYPE#define C80211_TYPE_MASK 0x0C // 00001100#define C80211_TYPE_MGMT 0x00 // 00000000#define C80211_TYPE_CTRL 0x04 // 00000100#define C80211_TYPE_DATA 0x08 // 00001000#define C80211_TYPE_RSRV 0x0C // 00001100// FRAME SUBTYPE#define C80211_SUBTYPE_MASK 0xF0// Management subtypes#define C80211_SUBTYPE_MGMT_ASS_REQUEST 0x00#define C80211_SUBTYPE_MGMT_ASS_RESPONSE 0x10#define C80211_SUBTYPE_MGMT_REASS_REQUEST 0x20#define C80211_SUBTYPE_MGMT_REASS_RESPONSE 0x30#define C80211_SUBTYPE_MGMT_ProbeRequest 0x40#define C80211_SUBTYPE_MGMT_ProbeResponse 0x50#define C80211_SUBTYPE_MGMT_BEACON 0x80#define C80211_SUBTYPE_MGMT_ATIM 0x90#define C80211_SUBTYPE_MGMT_DISASSOSIATION 0xA0#define C80211_SUBTYPE_MGMT_Authentication 0xB0#define C80211_SUBTYPE_MGMT_Deauthentication 0xC0// Control subtypes#define C80211_SUBTYPE_CTRL_PSPOLL 0xA0#define C80211_SUBTYPE_CTRL_RTS 0xB0#define C80211_SUBTYPE_CTRL_CTS 0xC0#define C80211_SUBTYPE_CTRL_ACK 0xD0#define C80211_SUBTYPE_CTRL_CFEND 0xE0#define C80211_SUBTYPE_CTRL_CFEND_CFACK 0xF0// Data subtypes#define C80211_SUBTYPE_DATA_DATA 0x00#define C80211_SUBTYPE_DATA_CFACK 0x10#define C80211_SUBTYPE_DATA_CFPOLL 0x20#define C80211_SUBTYPE_DATA_CFACK_CFPOLL 0x30#define C80211_SUBTYPE_DATA_NULL 0x40#define C80211_SUBTYPE_DATA_CFACK_ND 0x50#define C80211_SUBTYPE_DATA_CFPOLL_ND 0x60#define C80211_SUBTYPE_DATA_CFACK_CFPOLL_ND 0x70/////////////////////////////////////////////////////////////////////////////// FRAME CONTROL BIT 1//#define C80211_FRMCTRL_TO_DS 0x01// All Data type frames from STA->AP#define C80211_FRMCTRL_FROM_DS 0x02// TO_DS-FROM_DS// 0 0 DATA frames STA->STA in IBSS, MGMT, CTRL frames// 1 0 DATA frames to DS// 0 1 DATA frames exiting the DS// 1 1 WDS frames AP->AP#define C80211_FRMCTRL_MORE_FRAG 0x04// More Fragments.// Set to 1 in DATA and MGMT frames which have another fragment of the current MSDU or MMPDU#define C80211_FRMCTRL_RETRY 0x08// Set to 1 in DATA and MGMT retransmitted frames#define C80211_FRMCTRL_PWR_MGMT 0x10// Power management mode. // Always 0 when transmitting from AP#define C80211_FRMCTRL_MORE_DATA 0x20// Directed Frames// from AP->(STA in power save mode) for MSDU / MMPDU frames// from (CF-Pollable STA)->AP for MSDU frames// Multicast// From AP when additional multicast frames during this beacon interval#define C80211_FRMCTRL_ENCRYPTION 0x40// Valid only in MSDU using WEP and MMPDU SubType Authentication#define C80211_FRMCTRL_ORDER 0x80// Set in MSDUs/fragments transferred using the Strictly-Ordered service class/////////////////////////////////////////////////////////////////////////////// DURATION/ID//// a) In C80211_SUBTYPE_CTRL_PSPOLL AID (Association Identity) in 14 LSB// with bits 15-16 set to 1// b) On ContentionFree period set to 32768 (0x8000)// c) On all other frames set according to each frame type///////////////////////////////////////////////////////////////////////////////// Addresses//// BSSID// In infrastructure BSS is the MAC of the STA-AP// In IBSS a locally administered IEEE MAC address formed from a 46 bit number,// setting the MULTICAST_BIT to 0 and the LOCAL_ADMIN_BIT to 1.// See also Unsigned64::generate_BSSID()// A Broadcast BSSID can be used in C80211_SUBTYPE_MGMT_ProbeRequest//// DA - Destination Address: Final recipient// SA - Source Address: Initiating Transmitter// RA - Receiving Address: Immediate recipient// TA - Transmitting Address: Immediate transmitter///////////////////////////////////////////////////////////////////////////////// SequenceControl//#define C80211_SEQCTRL_FRAGMENT_MASK 0x000F#define C80211_SEQCTRL_SEQUENCE_MASK 0xFFF0// Sequence number// Used in MSDU/MMPDU starting at 0 to modulo(4096). Constant in retransmissions.// Fragment number// Used in MSDU/MMPDU starting at 0 at first or only fragment. Constant in retransmissions./////////////////////////////////////////////////////////////////////////////// FrameBody// FCS////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Frame Formats///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 802.11 General Frame format and DATA frame format//typedef struct _s80211GFF { UCHAR FrameControl[2]; USHORT DurationID;// during the Contention Free period Set to 32768 // During the Contention period:// if Address1 is multicast set to 0// if Address1 is unicast:// if MORE_FRAG bit is 0 set to ACK + SIFS (msec)// else set to DurationOfNextFrag + 2*ACK + 3*SIFS (msec)// All stations process DurationID<32768 to update NAV according to CF rules. UCHAR uAddress1[6]; UCHAR uAddress2[6]; UCHAR uAddress3[6]; USHORT SequenceControl; UCHAR uAddress4[6]; UCHAR Body[1508]; ULONG FCS;}s80211GFF;// FromDS-ToDS Address1 Address2 Address3 Address4// 0 0 DA SA BSSID N/A// 0 1 DA BSSID SA N/A// 1 0 BSSID SA DA N/A// 1 1 RA TA DA SA//// Frame Body is zero-bytes in// C80211_SUBTYPE_DATA_NULL// C80211_SUBTYPE_DATA_CFACK_ND// C80211_SUBTYPE_DATA_CFPOLL_ND// C80211_SUBTYPE_DATA_CFACK_CFPOLL_ND//typedef struct _s80211Header { UCHAR FrameControl[2]; USHORT DurationID;// during the Contention Free period Set to 32768 // During the Contention period:// if Address1 is multicast set to 0// if Address1 is unicast:// if MORE_FRAG bit is 0 set to ACK + SIFS (msec)// else set to DurationOfNextFrag + 2*ACK + 3*SIFS (msec)// All stations process DurationID<32768 to update NAV according to CF rules. UCHAR uAddress1[6]; UCHAR uAddress2[6]; UCHAR uAddress3[6]; USHORT SequenceControl; UCHAR uAddress4[6];// UCHAR Body[8];} s80211Header;/////////////////////////////////////////////////////////////////////////////// 802.11 Control Frame formats//// RTS (Request To Send) Frame Formattypedef struct _s80211_RTS { UCHAR FrameControl[2]; USHORT DurationID; // Transmitting duration + CTS + ACK + 3 * SIFS (msecs) UCHAR RA[6]; UCHAR TA[6]; ULONG FCS;} s80211_RTS;// CTS (Clear To Send) Frame Formattypedef struct _s80211_CTS { UCHAR FrameControl[2]; USHORT DurationID; // DurationIDOf(RTS) - CTS - SIFS (msecs) UCHAR RA[6]; // Copied from TA of RTS ULONG FCS;} s80211_CTS;// ACK (Acknowledgment) Frame Formattypedef struct _s80211_ACK { UCHAR FrameControl[2]; USHORT DurationID;// Set to 0 if C80211_FRMCTRL_MORE_FRAG was 0 in prev directed DATA / MGMT// else set to DurationIDOf(Dir.DATA/MGMT) - ACK - SIFS (msecs)// Set to 1 if C80211_FRMCTRL_MORE_FRAG was 0 in prev directed DATA / MGMT UCHAR RA[6]; // Copied from TA of Directed DATA, MGMT, PS-POLL ULONG FCS;} s80211_ACK;// PS-Poll (Power Save Poll) Frame Format// All Stations update their NAV (Network Allocation Vector) settingstypedef struct _s80211_PSPoll { UCHAR FrameControl[2]; USHORT AID; // The ID of the Association (bits 15-16 set to 1) UCHAR BSSID[6]; // The MAC Address of the AP-STA UCHAR TA[6]; ULONG FCS;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -