⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wlanproto.h

📁 Atheros AP Test with Agilent N4010A source code
💻 H
📖 第 1 页 / 共 5 页
字号:
    ASSERT((val & 0x8000) == 0);                    \
    (_dur) = cpu2le16(val);                         \
} while (0)
#define WLAN_SET_DURATION_CFP(_dur)         do {    \
    (_dur) = cpu2le16(0x8000);                      \
} while (0)
#define WLAN_SET_DURATION_AID(_dur, _aid)   do {    \
    A_UINT16 val = 0xc000 | (_aid);                 \
    (_dur) = cpu2le16(val);                         \
} while (0)

typedef WLAN_MACADDR BSSID;             /* BSSID is 48 bit field, same format */
                                        /* as MAC address, but not called MAC */
                                        /* address. Hence a separate definition */

#ifdef BIG_ENDIAN

typedef struct wlanCapabilityInfo {
    A_UINT16    reserved0:4,            /* Reserved bits */
                rsn:1,                  /* RSN enable */
                shortSlotTime:1,        /* G mode short slot time */
                reserved1:2,            /* Reserved bits */
                agility:1,              /* Channel agility in use */
                pbcc:1,                 /* 1 = PBCC modulation allowed */
                shortPreamble:1,        /* 1 = Short preamble allowed, 0 = not */
                privacy:1,              /* Set by AP if WEP required */
                cfPollReq:1,            /* CF poll request */
                cfPollable:1,           /* CF poll ability of STA */
                ibss:1,                 /* Set for IBSS type network */
                ess:1;                  /* Set for ESS type network */
} CAP_INFO;

#else /* Little_Endian */

typedef struct wlanCapabilityInfo {
    A_UINT16    ess:1,                  /* Set for ESS type network */
                ibss:1,                 /* Set for IBSS type network */
                cfPollable:1,           /* CF poll ability of STA */
                cfPollReq:1,            /* CF poll request */
                privacy:1,              /* Set by AP if WEP required */
                shortPreamble:1,        /* 1 = Short preamble allowed, 0 = not */
                pbcc:1,                 /* 1 = PBCC modulation allowed */
                agility:1,              /* Channel agility in use */
                reserved1:2,            /* Reserved bits */
                shortSlotTime:1,        /* G mode short slot time */
                rsn:1,                  /* RSN enable */
                reserved0:4;            /* Reserved bits */
} CAP_INFO;

#endif /* Endianness */

#define NTID    17                      /* number of possible QoS flows (4-bit tid + group address) */
#ifdef BIG_ENDIAN

typedef struct wlanQoSCntl {
    A_UINT8    reserved:1,
               ackpolicy:2,
               eosp:1,
               tid:4;
    A_UINT8    txop:8;
} QOS_CNTL;    

#else /* Little_Endian */

typedef struct wlanQosCntl {
    A_UINT8     tid:4,
                eosp:1,
                ackpolicy:2,
                reserved:1;
    A_UINT8     txop:8;
} QOS_CNTL;

#endif /* Endianness */

#ifdef BIG_ENDIAN

typedef struct wlanNonERPInfo {
    A_UINT8     reserved:5,             /* Reserved bits */
                preamble:1,             /* Set when using long preamble */
                protect:1,              /* Set when protection mechanism on */
                present:1;              /* Set when nonERP STA present */
} NONERP_INFO;

#else /* Little_Endian */

typedef struct wlanNonERPInfo {
    A_UINT8     present:1,              /* Set when nonERP STA present */
                protect:1,              /* Set when protection mechanism on */
                preamble:1,             /* Set when using long preamble */
                reserved:5;             /* Reserved bits */
} NONERP_INFO;

#endif /* Endianness */


#ifdef BIG_ENDIAN
typedef struct wlanAthAdvCapiInfo {
    A_UINT8     boost:1,
                reserved:2,             /* 5:6 Reserved bits */
                useFriendlyTurbo:1,     /* 4 Using Friendly Turbo feature */
                useXr:1,                /* 3 Using XR feature */
                useFastFrame:1,         /* 2 Using FastFrame feature */
                useCompression:1,       /* 1 Using compression feature */
                useTurboPrime:1;        /* 0 Using Turbo Prime feature */

} ATHADVCAP_INFO;

#else /* Little_Endian */

typedef struct wlanAthAdvCapiInfo {
    A_UINT8     useTurboPrime:1,        /* 0 Using Turbo Prime feature */
                useCompression:1,       /* 1 Using compression feature */
                useFastFrame:1,         /* 2 Using FastFrame feature */
                useXr:1,                /* 3 Using XR feature */
                useFriendlyTurbo:1,     /* 4 Using Friendly Turbo Feature */
                reserved:2,             /* 5:6 Reserved bits */
                boost:1;
} ATHADVCAP_INFO;

#endif /* Endianness */

/*
 * Macro to determine if the Advance Capabilities indicate if the Super Features are On.
 */
#define IS_SUPER_FEATURE_ON(_athAdvCap)                 \
        MAKE_BOOL((_athAdvCap)->useFastFrame    ||      \
                  (_athAdvCap)->useCompression  ||      \
                  (_athAdvCap)->useTurboPrime)

typedef struct wlanTimeStamp {
    A_UINT32    low;                    /* Timestamp low order 32 bits */
    A_UINT32    high;                   /* Timestamp high order 32 bits */
} __ATTRIB_PACK WLAN_TIMESTAMP;

/* TSF macros */
#define TSF_TO_TU(_t)                   (((_t).high << 22) | ((_t).low >> 10))
#define TSF_ADD(_t, _x) do {            \
    (_t).low += (_x);                   \
    if ((_t).low < (_x)) (_t).high++;   \
} while (0)
#define TSF_SUB(_t, _x) do {            \
    (_t).low -= (_x);                   \
    if ((_t).low > (_x)) (_t).high--;   \
} while (0)

/*
 * if:      y == x   y > x   y < x
 * returns:    0       1      -1
 */
#define TSF_COMP(x, y)                  \
    (((y).high > (x).high) ?  1 :       \
     ((y).high < (x).high) ? -1 :       \
     ((y).low  > (x).low)  ?  1 :       \
     ((y).low  < (x).low)  ? -1 : 0)

typedef struct wlanInfoElement {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT8     value[ELE_INFO_SIZE];   /* Max 255 byte array of octets */
} __ATTRIB_PACK INFO_ELEMENT;

typedef struct wlanSSID {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT8     ssid[ELE_SSID_SIZE];    /* Variable size 0-32 array of octets */
} __ATTRIB_PACK SSID;

typedef struct wlanRateSet {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT8     rates[ELE_RATE_SIZE];   /* Rates 1-8 array of octets */
} __ATTRIB_PACK RATE_SET;

typedef struct wlanExtRateSet {
    A_UINT8     elementID;                /* 1 byte element ID */
    A_UINT8     length;                   /* Length field */
    A_UINT8     rates[ELE_EXT_RATE_SIZE]; /* Rates 1-n array of octets */
} __ATTRIB_PACK EXT_RATE_SET;

#define VALID_ERS_ELEMENT(_ersp)                \
        (  ((_ersp)->elementID == ELE_EXT_SUPPORTED_RATES) \
        && ((_ersp)->length > 0) )

typedef struct wlanFHParamSet {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT16    dwellTime;              /* Dwell time in TU */
    A_UINT8     hopSet;                 /* Hop set */
    A_UINT8     hopPattern;             /* Hop Pattern */
    A_UINT8     hopIndex;               /* Hop index selects current index in pattern */
} __ATTRIB_PACK FH_PARAM_SET;

typedef struct wlanDSParamSet {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT8     currentChannel;         /* 1 byte channel */
} __ATTRIB_PACK DS_PARAM_SET;

typedef struct wlanCFParamSet {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT8     cfpCount;               /* how many DTIMs before next CFP start */
    A_UINT8     cfpPeriod;              /* No.of DTIMs between CFPs */
    A_UINT16    cfpMaxDuration;         /* Max duration of CFP in TU */
    A_UINT16    cfpDurRemain;           /* Remaining duration */
} __ATTRIB_PACK CF_PARAM_SET;

#define VALID_CF_ELEMENT(_cfp)                          \
        (  ((_cfp)->elementID == ELE_CF_PARAM_SET)      \
        && ((_cfp)->length == ELE_CF_PARAM_SIZE)        \
        && ((_cfp)->cfpPeriod > 0) )

typedef struct wlanTIMElement {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT8     dtimCount;              /* How many beacons before next DTIM */
    A_UINT8     dtimPeriod;             /* No. of beacons between DTIMs */
    A_UINT8     bitmapControl;
    A_UINT8     bitmap[ELE_BITMAP_SIZE];        /* 251 bytes Partial virtual Bitmap */
} __ATTRIB_PACK TIM_ELEMENT;

typedef struct wlanNonERPElement {
    A_UINT8     elementID;             /* 1 byte element ID */
    A_UINT8     length;                /* Length field */
    NONERP_INFO info;                  /* 1 char  */
} __ATTRIB_PACK NONERP_ELEMENT;

typedef struct ccxApAddr {
    A_UINT8  elementID;
    A_UINT8  length;
    A_UINT8  oui[3];                   /* will be filled with ouiAironet */
    A_UINT8  mbz;                      /* must be 0 */
    A_UINT32 ipAddr;                   /* big endian order */
    A_UINT16 reserved;
} __ATTRIB_PACK CCX_AP_ADDR;

typedef struct radioMeasIe {
    A_UINT8             elementId;
    A_UINT8             length;
    A_UINT8             oui[3];
    A_UINT8             ouiType;
    A_UINT16            rmState;
} __ATTRIB_PACK CCX_RM_IE;

typedef struct countryInfoList {
    A_UINT8     elementID;         /* 1 byte element ID */
    A_UINT8     length;            /* Total length of the list */
    A_UINT8     countryString[3];  /* ISO 2 char country string + (I)ndoor/(O)utdoor */
    struct {
        A_UINT8 firstChannel;
        A_UINT8 numChannel;
        A_UINT8 maxTxPwr;
    } subBand[4];                  /* SubBand List starts here */
    A_UINT8     pad;               /* Final pad that may be required if 4 subbands used */
} __ATTRIB_PACK COUNTRY_INFO_LIST;

typedef struct wlanIBSSParamSet {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT16    atimWindow;             /* ATIM window length in TU */
} __ATTRIB_PACK IBSS_PARAM_SET;

typedef struct wlanChlgText {
    A_UINT8     elementID;              /* 1 byte element ID */
    A_UINT8     length;                 /* Length field */
    A_UINT8     chlgText[ELE_CHLG_TEXT_SIZE];   /* Challenge text, 1-253 byte */
} __ATTRIB_PACK CHLG_TEXT;

typedef struct wlanRSNESet {
    A_UINT8     elementID;                  /* 1 byte element ID */
    A_UINT8     length;                     /* Length field */
    A_UINT16    version;                    /* RSN spec revision */
    A_UINT32    mCipher[ELE_MCSE_SIZE/4];   /* multicast/group key cipher */
    A_UINT16    uCipherCount;               /* count of pairwise key ciphers */
    A_UINT32    uCiphers[ELE_UCSE_SIZE/4];  /* ciphers 1-6 array of 4 octets */
    A_UINT16    authSelectorCount;          /* authentication selector count */
    A_UINT32    authSelectors[ELE_AUTHSE_SIZE/4];/* selectors 4*n octets */
} __ATTRIB_PACK RSNE_SET;

/*
 *  Strategy:  When using WPA, the STA will use this IE in the air, but
 *  will store the data internally in Atheros-private CSN style.  The
 *  assumption is that the OUI in the IE will be the same OUI as should
 *  be used in each of the suite elements.
 */
typedef struct wlanVendorIe {
    A_UINT8    elementID;
    A_UINT8    length;
    A_UINT8    oui[3];
    A_UINT8    value[1];
} __ATTRIB_PACK VENDOR_IE;

struct vendorIe {
    A_UINT8    elementID;
    A_UINT8    length;
    A_UINT8    oui[3];
    A_UINT8    ouiType;
    A_UINT16   version;
    A_UINT8    value[1];
};

typedef struct vendorIe __ATTRIB_PACK ATH_VENDOR_IE;
typedef struct vendorIe __ATTRIB_PACK MS_VENDOR_IE;
typedef struct vendorIe __ATTRIB_PACK AIRONET_VENDOR_IE;

typedef struct wlanAthAdvCapIe {
    A_UINT8         elementID;
    A_UINT8         length;
    A_UINT8         oui[3];
    A_UINT8         ouiType;
    A_UINT16        version;
    ATHADVCAP_INFO  info;
    A_UINT16        defKeyIndex;
} __ATTRIB_PACK ATH_ADVCAP_IE;

#define VALID_ATH_ADVCAP_ELEMENT(_np)                    \
        (   ((_np)->elementID == ELE_VENDOR_PRIVATE) &&  \
            ((_np)->length >= 6)                     &&  \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -