ieee80211.h
Go to the documentation of this file.
00001 /*
00002  * IEEE 802.11 defines
00003  *
00004  * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
00005  * <jkmaline@cc.hut.fi>
00006  * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
00007  * Copyright (c) 2005, Devicescape Software, Inc.
00008  * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License version 2 as
00012  * published by the Free Software Foundation.
00013  */
00014 
00015 #ifndef IEEE80211_H
00016 #define IEEE80211_H
00017 
00018 #define FCS_LEN 4
00019 
00020 #define IEEE80211_FCTL_VERS             0x0003
00021 #define IEEE80211_FCTL_FTYPE            0x000c
00022 #define IEEE80211_FCTL_STYPE            0x00f0
00023 #define IEEE80211_FCTL_TODS             0x0100
00024 #define IEEE80211_FCTL_FROMDS           0x0200
00025 #define IEEE80211_FCTL_MOREFRAGS        0x0400
00026 #define IEEE80211_FCTL_RETRY            0x0800
00027 #define IEEE80211_FCTL_PM               0x1000
00028 #define IEEE80211_FCTL_MOREDATA         0x2000
00029 #define IEEE80211_FCTL_PROTECTED        0x4000
00030 #define IEEE80211_FCTL_ORDER            0x8000
00031 
00032 #define IEEE80211_SCTL_FRAG             0x000F
00033 #define IEEE80211_SCTL_SEQ              0xFFF0
00034 
00035 #define IEEE80211_FTYPE_MGMT            0x0000
00036 #define IEEE80211_FTYPE_CTL             0x0004
00037 #define IEEE80211_FTYPE_DATA            0x0008
00038 
00039 /* management */
00040 #define IEEE80211_STYPE_ASSOC_REQ       0x0000
00041 #define IEEE80211_STYPE_ASSOC_RESP      0x0010
00042 #define IEEE80211_STYPE_REASSOC_REQ     0x0020
00043 #define IEEE80211_STYPE_REASSOC_RESP    0x0030
00044 #define IEEE80211_STYPE_PROBE_REQ       0x0040
00045 #define IEEE80211_STYPE_PROBE_RESP      0x0050
00046 #define IEEE80211_STYPE_BEACON          0x0080
00047 #define IEEE80211_STYPE_ATIM            0x0090
00048 #define IEEE80211_STYPE_DISASSOC        0x00A0
00049 #define IEEE80211_STYPE_AUTH            0x00B0
00050 #define IEEE80211_STYPE_DEAUTH          0x00C0
00051 #define IEEE80211_STYPE_ACTION          0x00D0
00052 
00053 /* control */
00054 #define IEEE80211_STYPE_BACK_REQ        0x0080
00055 #define IEEE80211_STYPE_BACK            0x0090
00056 #define IEEE80211_STYPE_PSPOLL          0x00A0
00057 #define IEEE80211_STYPE_RTS             0x00B0
00058 #define IEEE80211_STYPE_CTS             0x00C0
00059 #define IEEE80211_STYPE_ACK             0x00D0
00060 #define IEEE80211_STYPE_CFEND           0x00E0
00061 #define IEEE80211_STYPE_CFENDACK        0x00F0
00062 
00063 /* data */
00064 #define IEEE80211_STYPE_DATA                    0x0000
00065 #define IEEE80211_STYPE_DATA_CFACK              0x0010
00066 #define IEEE80211_STYPE_DATA_CFPOLL             0x0020
00067 #define IEEE80211_STYPE_DATA_CFACKPOLL          0x0030
00068 #define IEEE80211_STYPE_NULLFUNC                0x0040
00069 #define IEEE80211_STYPE_CFACK                   0x0050
00070 #define IEEE80211_STYPE_CFPOLL                  0x0060
00071 #define IEEE80211_STYPE_CFACKPOLL               0x0070
00072 #define IEEE80211_STYPE_QOS_DATA                0x0080
00073 #define IEEE80211_STYPE_QOS_DATA_CFACK          0x0090
00074 #define IEEE80211_STYPE_QOS_DATA_CFPOLL         0x00A0
00075 #define IEEE80211_STYPE_QOS_DATA_CFACKPOLL      0x00B0
00076 #define IEEE80211_STYPE_QOS_NULLFUNC            0x00C0
00077 #define IEEE80211_STYPE_QOS_CFACK               0x00D0
00078 #define IEEE80211_STYPE_QOS_CFPOLL              0x00E0
00079 #define IEEE80211_STYPE_QOS_CFACKPOLL           0x00F0
00080 
00081 
00082 /* miscellaneous IEEE 802.11 constants */
00083 #define IEEE80211_MAX_FRAG_THRESHOLD    2352
00084 #define IEEE80211_MAX_RTS_THRESHOLD     2353
00085 #define IEEE80211_MAX_AID               2007
00086 #define IEEE80211_MAX_TIM_LEN           251
00087 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
00088    6.2.1.1.2.
00089 
00090    802.11e clarifies the figure in section 7.1.2. The frame body is
00091    up to 2304 octets long (maximum MSDU size) plus any crypt overhead. */
00092 #define IEEE80211_MAX_DATA_LEN          2304
00093 /* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */
00094 #define IEEE80211_MAX_FRAME_LEN         2352
00095 
00096 #define IEEE80211_MAX_SSID_LEN          32
00097 
00098 #define IEEE80211_4ADDR_LEN 30
00099 #define IEEE80211_3ADDR_LEN 24
00100 
00101 struct ieee80211_hdr {
00102         __le16 frame_control;
00103         __le16 duration_id;
00104         u8 addr1[6];
00105         u8 addr2[6];
00106         u8 addr3[6];
00107         __le16 seq_ctrl;
00108         u8 addr4[6];
00109 } __attribute__ ((packed));
00110 
00111 
00112 #define P80211_OUI_LEN 3
00113 
00114 struct ieee80211_snap_hdr {
00115 
00116         u8 dsap;                /* always 0xAA */
00117         u8 ssap;                /* always 0xAA */
00118         u8 ctrl;                /* always 0x03 */
00119         u8 oui[P80211_OUI_LEN]; /* organizational universal id */
00120 
00121 } __attribute__ ((packed));
00122 
00123 #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
00124 
00125 
00126 #endif /* IEEE80211_H */
00127 


ros_rt_wmp
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Mon Oct 6 2014 08:27:10