本文整理汇总了C++中IS_ENTRY_CLIENT函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_ENTRY_CLIENT函数的具体用法?C++ IS_ENTRY_CLIENT怎么用?C++ IS_ENTRY_CLIENT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IS_ENTRY_CLIENT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: WscSendEapFragAck
VOID WscSendEapFragAck(
IN PRTMP_ADAPTER pAdapter,
IN PWSC_CTRL pWscControl,
IN PMAC_TABLE_ENTRY pEntry)
{
if (pEntry == NULL)
{
ASSERT(pEntry!=NULL);
return;
}
if (IS_ENTRY_CLIENT(pEntry))
{
pWscControl->bWscLastOne = TRUE;
if (pAdapter->OpMode == OPMODE_AP)
WscSendMessage(pAdapter, WSC_OPCODE_FRAG_ACK, NULL, 0, pWscControl, AP_MODE, EAP_CODE_REQ);
else
{
if (ADHOC_ON(pAdapter) && (pWscControl->WscConfMode == WSC_REGISTRAR))
WscSendMessage(pAdapter, WSC_OPCODE_FRAG_ACK, NULL, 0, pWscControl, STA_MODE, EAP_CODE_REQ);
else
WscSendMessage(pAdapter, WSC_OPCODE_FRAG_ACK, NULL, 0, pWscControl, STA_MODE, EAP_CODE_RSP);
}
}
else if (IS_ENTRY_APCLI(pEntry))
WscSendMessage(pAdapter, WSC_OPCODE_FRAG_ACK, NULL, 0, pWscControl, AP_CLIENT_MODE, EAP_CODE_REQ);
}
开发者ID:23171580,项目名称:ralink,代码行数:26,代码来源:wsc_v2.c
示例2: CMTimerExec
/*
==========================================================================
Description:
countermeasures active attack timer execution
Return:
==========================================================================
*/
VOID CMTimerExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
UINT i,j=0;
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)FunctionContext;
pAd->ApCfg.BANClass3Data = FALSE;
for (i = 0; i < MAX_LEN_OF_MAC_TABLE; i++)
{
if (IS_ENTRY_CLIENT(&pAd->MacTab.Content[i])
&& (pAd->MacTab.Content[i].CMTimerRunning == TRUE))
{
pAd->MacTab.Content[i].CMTimerRunning =FALSE;
j++;
}
}
if (j > 1)
DBGPRINT(RT_DEBUG_ERROR, ("Find more than one entry which generated MIC Fail .. \n"));
pAd->ApCfg.CMTimerRunning = FALSE;
}
开发者ID:23171580,项目名称:ralink,代码行数:32,代码来源:ap_wpa.c
示例3: CMTimerExec
/*
==========================================================================
Description:
countermeasures active attack timer execution
Return:
==========================================================================
*/
VOID CMTimerExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
UINT i,j=0;
struct rtmp_adapter * pAd = (struct rtmp_adapter *)FunctionContext;
pAd->ApCfg.BANClass3Data = false;
for (i = 0; i < MAX_LEN_OF_MAC_TABLE; i++)
{
if (IS_ENTRY_CLIENT(&pAd->MacTab.Content[i])
&& (pAd->MacTab.Content[i].CMTimerRunning == true))
{
pAd->MacTab.Content[i].CMTimerRunning =false;
j++;
}
}
if (j > 1)
DBGPRINT(RT_DEBUG_ERROR, ("Find more than one entry which generated MIC Fail .. \n"));
pAd->ApCfg.CMTimerRunning = false;
}
开发者ID:ulli-kroll,项目名称:mt7612u,代码行数:32,代码来源:ap_wpa.c
示例4: MtPsRecovery
VOID MtPsRecovery(
RTMP_ADAPTER *pAd)
{
MAC_TABLE_ENTRY *pMacEntry;
STA_TR_ENTRY *tr_entry;
UINT32 i;
for (i=1; i < MAX_LEN_OF_MAC_TABLE; i++)
{
pMacEntry = &pAd->MacTab.Content[i];
tr_entry = &pAd->MacTab.tr_entry[i];
if (IS_ENTRY_CLIENT(pMacEntry))
{
if (tr_entry->ps_state == APPS_RETRIEVE_CR_PADDING) {
tr_entry->ps_state = APPS_RETRIEVE_IDLE;
} else if ((tr_entry->ps_state == APPS_RETRIEVE_START_PS)
|| (tr_entry->ps_state == APPS_RETRIEVE_GOING))
{
if (tr_entry->ps_queue.Number) {
MtEnqTxSwqFromPsQueue(pAd, i, tr_entry);
}
if (pAd->MacTab.tr_entry[i].PsMode == PWR_ACTIVE) {
tr_entry->ps_state = APPS_RETRIEVE_IDLE;
MtHandleRxPsPoll(pAd, &pMacEntry->Addr[0], i, TRUE);
} else
tr_entry->ps_state = APPS_RETRIEVE_DONE;
} else if(tr_entry->ps_state == APPS_RETRIEVE_WAIT_EVENT)
{
RTEnqueueInternalCmd(pAd, CMDTHREAD_PS_CLEAR, (VOID *)&i, sizeof(UINT32));
}
}
}
}
开发者ID:pierce1234,项目名称:rt-n56u,代码行数:35,代码来源:mt_ps.c
示例5: APCls2errAction
/*
==========================================================================
Description:
Some STA/AP
Note:
This action should never trigger AUTH state transition, therefore we
separate it from AUTH state machine, and make it as a standalone service
==========================================================================
*/
VOID APCls2errAction(
IN PRTMP_ADAPTER pAd,
IN ULONG Wcid,
IN PHEADER_802_11 pHeader)
{
HEADER_802_11 Hdr;
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
ULONG FrameLen = 0;
USHORT Reason = REASON_CLS2ERR;
MAC_TABLE_ENTRY *pEntry = NULL;
UCHAR idx;
if (Wcid < MAX_LEN_OF_MAC_TABLE)
{
pEntry = &(pAd->MacTab.Content[Wcid]);
}
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
/*ApLogEvent(pAd, pAddr, EVENT_DISASSOCIATED); */
MacTableDeleteEntry(pAd, pEntry->Aid, pHeader->Addr2);
}
else
{
for (idx = 0; idx < pAd->ApCfg.BssidNum; idx++)
{
PMULTISSID_STRUCT pMbss = &pAd->ApCfg.MBSSID[idx];
if (NdisEqualMemory(pMbss->Bssid, pHeader->Addr1, MAC_ADDR_LEN))
break;
}
if (idx == pAd->ApCfg.BssidNum)
return;
}
/* send out DEAUTH request frame */
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
if (NStatus != NDIS_STATUS_SUCCESS)
return;
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - Class 2 error, Send DEAUTH frame to "
"%02x:%02x:%02x:%02x:%02x:%02x \n",
PRINT_MAC(pHeader->Addr2)));
MgtMacHeaderInit(pAd, &Hdr, SUBTYPE_DEAUTH, 0, pHeader->Addr2,
#ifdef P2P_SUPPORT
pHeader->Addr1,
#endif /* P2P_SUPPORT */
pHeader->Addr1);
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &Hdr,
2, &Reason,
END_OF_ARGS);
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
MlmeFreeMemory(pAd, pOutBuffer);
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:68,代码来源:ap_auth.c
示例6: APCls2errAction
/*
==========================================================================
Description:
Some STA/AP
Note:
This action should never trigger AUTH state transition, therefore we
separate it from AUTH state machine, and make it as a standalone service
==========================================================================
*/
VOID APCls2errAction(
IN PRTMP_ADAPTER pAd,
IN ULONG Wcid,
IN PHEADER_802_11 pHeader)
{
HEADER_802_11 Hdr;
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
ULONG FrameLen = 0;
USHORT Reason = REASON_CLS2ERR;
MAC_TABLE_ENTRY *pEntry = NULL;
if (Wcid < MAX_LEN_OF_MAC_TABLE)
{
pEntry = &(pAd->MacTab.Content[Wcid]);
}
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
/*ApLogEvent(pAd, pAddr, EVENT_DISASSOCIATED); */
MacTableDeleteEntry(pAd, pEntry->Aid, pHeader->Addr2);
}
else
{
UCHAR bssid[MAC_ADDR_LEN];
NdisMoveMemory(bssid, pHeader->Addr1, MAC_ADDR_LEN);
bssid[5] &= pAd->ApCfg.MacMask;
if (NdisEqualMemory(pAd->CurrentAddress, bssid, MAC_ADDR_LEN) == 0)
return;
}
/* send out DEAUTH request frame */
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
if (NStatus != NDIS_STATUS_SUCCESS)
return;
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - Class 2 error, Send DEAUTH frame to "
"%02x:%02x:%02x:%02x:%02x:%02x\n",
PRINT_MAC(pHeader->Addr2)));
MgtMacHeaderInit(pAd, &Hdr, SUBTYPE_DEAUTH, 0, pHeader->Addr2,
pHeader->Addr1);
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &Hdr,
2, &Reason,
END_OF_ARGS);
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
MlmeFreeMemory(pAd, pOutBuffer);
}
开发者ID:derekcentrico,项目名称:m6.kernel.3.x,代码行数:62,代码来源:ap_auth.c
示例7: APCls2errAction
/*
==========================================================================
Description:
Some STA/AP
Note:
This action should never trigger AUTH state transition, therefore we
separate it from AUTH state machine, and make it as a standalone service
==========================================================================
*/
VOID APCls2errAction(
IN RTMP_ADAPTER *pAd,
IN ULONG Wcid,
IN HEADER_802_11 *pHeader)
{
HEADER_802_11 Hdr;
UCHAR *pOutBuffer = NULL;
NDIS_STATUS NStatus;
ULONG FrameLen = 0;
USHORT Reason = REASON_CLS2ERR;
MAC_TABLE_ENTRY *pEntry = NULL;
UCHAR apidx;
if (Wcid < MAX_LEN_OF_MAC_TABLE)
pEntry = &(pAd->MacTab.Content[Wcid]);
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
/*ApLogEvent(pAd, pAddr, EVENT_DISASSOCIATED); */
MacTableDeleteEntry(pAd, pEntry->wcid, pHeader->Addr2);
}
else
{
apidx = get_apidx_by_addr(pAd, pHeader->Addr1);
if (apidx >= pAd->ApCfg.BssidNum)
{
DBGPRINT(RT_DEBUG_TRACE,("AUTH - Class 2 error but not my bssid %02x:%02x:%02x:%02x:%02x:%02x\n", PRINT_MAC(pHeader->Addr1)));
return;
}
}
/* send out DEAUTH frame */
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
if (NStatus != NDIS_STATUS_SUCCESS)
return;
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - Class 2 error, Send DEAUTH frame to "
"%02x:%02x:%02x:%02x:%02x:%02x\n",
PRINT_MAC(pHeader->Addr2)));
MgtMacHeaderInit(pAd, &Hdr, SUBTYPE_DEAUTH, 0, pHeader->Addr2,
pHeader->Addr1,
pHeader->Addr1);
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &Hdr,
2, &Reason,
END_OF_ARGS);
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
MlmeFreeMemory(pAd, pOutBuffer);
}
开发者ID:Brainiarc7,项目名称:mtk-wifi-gpl,代码行数:61,代码来源:ap_auth.c
示例8: APCls2errAction
/*
==========================================================================
Description:
Some STA/AP
Note:
This action should never trigger AUTH state transition, therefore we
separate it from AUTH state machine, and make it as a standalone service
==========================================================================
*/
VOID APCls2errAction(
IN struct rtmp_adapter *pAd,
IN ULONG Wcid,
IN HEADER_802_11 *pHeader)
{
HEADER_802_11 Hdr;
u8 *pOutBuffer = NULL;
int NStatus;
ULONG FrameLen = 0;
unsigned short Reason = REASON_CLS2ERR;
MAC_TABLE_ENTRY *pEntry = NULL;
u8 apidx;
if (Wcid < MAX_LEN_OF_MAC_TABLE)
pEntry = &(pAd->MacTab.Content[Wcid]);
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
/*ApLogEvent(pAd, pAddr, EVENT_DISASSOCIATED); */
MacTableDeleteEntry(pAd, pEntry->wcid, pHeader->Addr2);
}
else
{
apidx = get_apidx_by_addr(pAd, pHeader->Addr1);
if (apidx >= pAd->ApCfg.BssidNum)
{
DBGPRINT(RT_DEBUG_TRACE,("AUTH - Class 2 error but not my bssid %02x:%02x:%02x:%02x:%02x:%02x\n", PRINT_MAC(pHeader->Addr1)));
return;
}
}
/* send out DEAUTH frame */
pOutBuffer = kmalloc(MGMT_DMA_BUFFER_SIZE, GFP_ATOMIC);
if (pOutBuffer == NULL)
return;
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - Class 2 error, Send DEAUTH frame to "
"%02x:%02x:%02x:%02x:%02x:%02x\n",
PRINT_MAC(pHeader->Addr2)));
MgtMacHeaderInit(pAd, &Hdr, SUBTYPE_DEAUTH, 0, pHeader->Addr2,
pHeader->Addr1,
pHeader->Addr1);
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &Hdr,
2, &Reason,
END_OF_ARGS);
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
kfree(pOutBuffer);
}
开发者ID:ulli-kroll,项目名称:mt7612u,代码行数:61,代码来源:ap_auth.c
示例9: APPeerAuthReqAtIdleAction
static VOID APPeerAuthReqAtIdleAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
INT i;
USHORT Seq, Alg, RspReason, Status;
UCHAR Addr1[MAC_ADDR_LEN];
UCHAR Addr2[MAC_ADDR_LEN];
CHAR Chtxt[CIPHER_TEXT_LEN];
UINT32 apidx;
PHEADER_802_11 pRcvHdr;
HEADER_802_11 AuthHdr;
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
ULONG FrameLen = 0;
MAC_TABLE_ENTRY *pEntry;
UCHAR ChTxtIe = 16, ChTxtLen = CIPHER_TEXT_LEN;
MULTISSID_STRUCT *pMbss;
struct wifi_dev *wdev;
CHAR rssi;
if (! APPeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr1,
Addr2, &Alg, &Seq, &Status, Chtxt
))
return;
/* Find which MBSSID to be authenticate */
apidx = get_apidx_by_addr(pAd, Addr1);
if (apidx >= pAd->ApCfg.BssidNum)
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid not found\n"));
return;
}
pMbss = &pAd->ApCfg.MBSSID[apidx];
wdev = &pMbss->wdev;
if ((wdev->if_dev == NULL) || ((wdev->if_dev != NULL) &&
!(RTMP_OS_NETDEV_STATE_RUNNING(wdev->if_dev))))
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid IF didn't up yet.\n"));
return;
}
pEntry = MacTableLookup(pAd, Addr2);
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
#ifdef DOT11W_PMF_SUPPORT
if ((CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_PMF_CAPABLE))
&& (pEntry->PortSecured == WPA_802_1X_PORT_SECURED))
goto SendAuth;
#endif /* DOT11W_PMF_SUPPORT */
if (!RTMPEqualMemory(Addr1, pAd->ApCfg.MBSSID[pEntry->apidx].wdev.bssid, MAC_ADDR_LEN))
{
MacTableDeleteEntry(pAd, pEntry->wcid, pEntry->Addr);
pEntry = NULL;
DBGPRINT(RT_DEBUG_WARN, ("AUTH - Bssid does not match\n"));
}
else
{
if (pEntry->bIAmBadAtheros == TRUE)
{
AsicUpdateProtect(pAd, 8, ALLN_SETPROTECT, FALSE, FALSE);
DBGPRINT(RT_DEBUG_TRACE, ("Atheros Problem. Turn on RTS/CTS!!!\n"));
pEntry->bIAmBadAtheros = FALSE;
}
#ifdef DOT11_N_SUPPORT
BASessionTearDownALL(pAd, pEntry->wcid);
#endif /* DOT11_N_SUPPORT */
ASSERT(pEntry->Aid == Elem->Wcid);
}
}
#ifdef DOT11W_PMF_SUPPORT
SendAuth:
#endif /* DOT11W_PMF_SUPPORT */
pRcvHdr = (PHEADER_802_11)(Elem->Msg);
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - MBSS(%d), Rcv AUTH seq#%d, Alg=%d, Status=%d from "
"[wcid=%d]%02x:%02x:%02x:%02x:%02x:%02x\n",
apidx, Seq, Alg, Status, Elem->Wcid, PRINT_MAC(Addr2)));
/* [email protected]: Refuse the weak signal of AuthReq */
rssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, (CHAR)Elem->Rssi0, RSSI_0),
ConvertToRssi(pAd, (CHAR)Elem->Rssi1, RSSI_1),
ConvertToRssi(pAd, (CHAR)Elem->Rssi2, RSSI_2));
DBGPRINT(RT_DEBUG_TRACE, ("%s: AUTH_FAIL_REQ Threshold = %d, AUTH_NO_RSP_REQ Threshold = %d, AUTH RSSI = %d\n",
wdev->if_dev->name, pMbss->AuthFailRssiThreshold, pMbss->AuthNoRspRssiThreshold, rssi));
if (((pMbss->AuthFailRssiThreshold != 0) && (rssi < pMbss->AuthFailRssiThreshold)) ||
((pMbss->AuthNoRspRssiThreshold != 0) && (rssi < pMbss->AuthNoRspRssiThreshold)))
{
//.........这里部分代码省略.........
开发者ID:Brainiarc7,项目名称:mtk-wifi-gpl,代码行数:101,代码来源:ap_auth.c
示例10: RTMPInsertRepeaterEntry
VOID RTMPInsertRepeaterEntry(
IN PRTMP_ADAPTER pAd,
IN UCHAR apidx,
IN PUCHAR pAddr)
{
INT CliIdx, idx;
UCHAR HashIdx;
BOOLEAN Cancelled;
UCHAR tempMAC[MAC_ADDR_LEN];
APCLI_CTRL_MSG_STRUCT ApCliCtrlMsg;
PREPEATER_CLIENT_ENTRY pReptCliEntry = NULL, pCurrEntry = NULL;
PREPEATER_CLIENT_ENTRY_MAP pReptCliMap;
UCHAR SPEC_ADDR[6][3] = {{0x02, 0x0F, 0xB5}, {0x02, 0x09, 0x5B},
{0x02, 0x14, 0x6C}, {0x02, 0x18, 0x4D},
{0x02, 0x1B, 0x2F}, {0x02, 0x1E, 0x2A}};
MAC_TABLE_ENTRY *pMacEntry = NULL;
DBGPRINT(RT_DEBUG_TRACE, (" %s.\n", __FUNCTION__));
pMacEntry = MacTableLookup(pAd, pAddr);
if (pMacEntry && IS_ENTRY_CLIENT(pMacEntry))
{
if (pMacEntry->PortSecured == WPA_802_1X_PORT_NOT_SECURED)
{
DBGPRINT(RT_DEBUG_ERROR, (" wireless client is not ready !!!\n"));
return;
}
}
NdisAcquireSpinLock(&pAd->ApCfg.ReptCliEntryLock);
if (pAd->ApCfg.RepeaterCliSize >= MAX_EXT_MAC_ADDR_SIZE)
{
DBGPRINT(RT_DEBUG_ERROR, (" Repeater Client Full !!!\n"));
NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);
return ;
}
for (CliIdx = 0; CliIdx < MAX_EXT_MAC_ADDR_SIZE; CliIdx++)
{
pReptCliEntry = &pAd->ApCfg.ApCliTab[apidx].RepeaterCli[CliIdx];
if ((pReptCliEntry->CliEnable) &&
(MAC_ADDR_EQUAL(pReptCliEntry->OriginalAddress, pAddr) || MAC_ADDR_EQUAL(pReptCliEntry->CurrentAddress, pAddr)))
{
DBGPRINT(RT_DEBUG_ERROR, ("\n receive mac :%02x:%02x:%02x:%02x:%02x:%02x !!!\n",
pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5]));
DBGPRINT(RT_DEBUG_ERROR, (" duplicate Insert !!!\n"));
NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);
return ;
}
if (pReptCliEntry->CliEnable == FALSE)
break;
}
if (CliIdx >= MAX_EXT_MAC_ADDR_SIZE)
{
DBGPRINT(RT_DEBUG_ERROR, (" Repeater Client Full !!!\n"));
NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);
return ;
}
pReptCliEntry = &pAd->ApCfg.ApCliTab[apidx].RepeaterCli[CliIdx];
pReptCliMap = &pAd->ApCfg.ApCliTab[apidx].RepeaterCliMap[CliIdx];
/* ENTRY PREEMPTION: initialize the entry */
RTMPCancelTimer(&pReptCliEntry->ApCliAuthTimer, &Cancelled);
RTMPCancelTimer(&pReptCliEntry->ApCliAssocTimer, &Cancelled);
pReptCliEntry->CtrlCurrState = APCLI_CTRL_DISCONNECTED;
pReptCliEntry->AuthCurrState = APCLI_AUTH_REQ_IDLE;
pReptCliEntry->AssocCurrState = APCLI_ASSOC_IDLE;
pReptCliEntry->CliConnectState = 0;
pReptCliEntry->CliValid = FALSE;
pReptCliEntry->bEthCli = FALSE;
pReptCliEntry->MacTabWCID = 0xFF;
pReptCliEntry->AuthReqCnt = 0;
pReptCliEntry->AssocReqCnt = 0;
pReptCliEntry->CliTriggerTime = 0;
pReptCliEntry->pNext = NULL;
pReptCliMap->pReptCliEntry = pReptCliEntry;
pReptCliMap->pNext = NULL;
COPY_MAC_ADDR(pReptCliEntry->OriginalAddress, pAddr);
COPY_MAC_ADDR(tempMAC, pAddr);
#ifdef SMART_MESH
NdisZeroMemory(pAd->vMacAddrPrefix,sizeof(pAd->vMacAddrPrefix));
#endif /* SMART_MESH */
if (pAd->ApCfg.MACRepeaterOuiMode == 1)
{
DBGPRINT(RT_DEBUG_ERROR, (" todo !!!\n"));
}
else if (pAd->ApCfg.MACRepeaterOuiMode == 2)
{
INT IdxToUse;
for (idx = 0; idx < 6; idx++)
{
if (RTMPEqualMemory(SPEC_ADDR[idx], pAddr, 3))
//.........这里部分代码省略.........
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:101,代码来源:ap_repeater.c
示例11: APPeerAuthReqAtIdleAction
static VOID APPeerAuthReqAtIdleAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
int i;
USHORT Seq, Alg, RspReason, Status;
UCHAR Addr1[MAC_ADDR_LEN];
UCHAR Addr2[MAC_ADDR_LEN];
CHAR Chtxt[CIPHER_TEXT_LEN];
UINT32 apidx;
PHEADER_802_11 pRcvHdr;
HEADER_802_11 AuthHdr;
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
ULONG FrameLen = 0;
MAC_TABLE_ENTRY *pEntry;
UCHAR ChTxtIe = 16, ChTxtLen = CIPHER_TEXT_LEN;
if (! APPeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr1,
Addr2, &Alg, &Seq, &Status, Chtxt
))
return;
/* Find which MBSSID to be authenticate */
for (apidx=0; apidx<pAd->ApCfg.BssidNum; apidx++)
{
if (RTMPEqualMemory(Addr1, pAd->ApCfg.MBSSID[apidx].Bssid, MAC_ADDR_LEN))
break;
}
if (apidx >= pAd->ApCfg.BssidNum)
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid not found\n"));
return;
}
if ((pAd->ApCfg.MBSSID[apidx].MSSIDDev != NULL) &&
!(RTMP_OS_NETDEV_STATE_RUNNING(pAd->ApCfg.MBSSID[apidx].MSSIDDev)))
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid IF didn't up yet.\n"));
return;
} /* End of if */
pEntry = MacTableLookup(pAd, Addr2);
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
if (!RTMPEqualMemory(Addr1, pAd->ApCfg.MBSSID[pEntry->apidx].Bssid, MAC_ADDR_LEN))
{
MacTableDeleteEntry(pAd, pEntry->Aid, pEntry->Addr);
pEntry = NULL;
DBGPRINT(RT_DEBUG_WARN, ("AUTH - Bssid does not match\n"));
}
else
{
if (pEntry->bIAmBadAtheros == TRUE)
{
AsicUpdateProtect(pAd, 8, ALLN_SETPROTECT, FALSE, FALSE);
DBGPRINT(RT_DEBUG_TRACE, ("Atheros Problem. Turn on RTS/CTS!!!\n"));
pEntry->bIAmBadAtheros = FALSE;
}
#ifdef DOT11_N_SUPPORT
BASessionTearDownALL(pAd, pEntry->Aid);
#endif /* DOT11_N_SUPPORT */
ASSERT(pEntry->Aid == Elem->Wcid);
}
}
pRcvHdr = (PHEADER_802_11)(Elem->Msg);
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - MBSS(%d), Rcv AUTH seq#%d, Alg=%d, Status=%d from "
"[wcid=%d]%02x:%02x:%02x:%02x:%02x:%02x\n",
apidx, Seq, Alg, Status, Elem->Wcid, PRINT_MAC(Addr2)));
/* fail in ACL checking => send an AUTH-Fail seq#2. */
if (! ApCheckAccessControlList(pAd, Addr2, apidx))
{
ASSERT(Seq == 1);
ASSERT(pEntry == NULL);
APPeerAuthSimpleRspGenAndSend(pAd, pRcvHdr, Alg, Seq + 1, MLME_UNSPECIFY_FAIL);
/* If this STA exists, delete it. */
if (pEntry)
MacTableDeleteEntry(pAd, pEntry->Aid, pEntry->Addr);
RTMPSendWirelessEvent(pAd, IW_MAC_FILTER_LIST_EVENT_FLAG, Addr2, apidx, 0);
DBGPRINT(RT_DEBUG_TRACE,
("Failed in ACL checking => send an AUTH seq#2 with "
"Status code = %d\n", MLME_UNSPECIFY_FAIL));
return;
}
//.........这里部分代码省略.........
开发者ID:derekcentrico,项目名称:m6.kernel.3.x,代码行数:101,代码来源:ap_auth.c
示例12: WPARetryExec
VOID WPARetryExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
MAC_TABLE_ENTRY *pEntry = (MAC_TABLE_ENTRY *)FunctionContext;
if ((pEntry) && IS_ENTRY_CLIENT(pEntry))
{
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pEntry->pAd;
pEntry->ReTryCounter++;
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec---> ReTryCounter=%d, WpaState=%d \n", pEntry->ReTryCounter, pEntry->WpaState));
switch (pEntry->AuthMode)
{
case Ndis802_11AuthModeWPA:
case Ndis802_11AuthModeWPAPSK:
case Ndis802_11AuthModeWPA2:
case Ndis802_11AuthModeWPA2PSK:
/* 1. GTK already retried, give up and disconnect client. */
if (pEntry->ReTryCounter > (GROUP_MSG1_RETRY_TIMER_CTR + 1))
{
/* send wireless event - for group key handshaking timeout */
RTMPSendWirelessEvent(pAd, IW_GROUP_HS_TIMEOUT_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::Group Key HS exceed retry count, Disassociate client, pEntry->ReTryCounter %d\n", pEntry->ReTryCounter));
MlmeDeAuthAction(pAd, pEntry, REASON_GROUP_KEY_HS_TIMEOUT, FALSE);
}
/* 2. Retry GTK. */
else if (pEntry->ReTryCounter > GROUP_MSG1_RETRY_TIMER_CTR)
{
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::ReTry 2-way group-key Handshake \n"));
if (pEntry->GTKState == REKEY_NEGOTIATING)
{
WPAStart2WayGroupHS(pAd, pEntry);
RTMPSetTimer(&pEntry->RetryTimer, PEER_MSG3_RETRY_EXEC_INTV);
}
}
/* 3. 4-way message 1 retried more than three times. Disconnect client */
else if (pEntry->ReTryCounter > (PEER_MSG1_RETRY_TIMER_CTR + 3))
{
/* send wireless event - for pairwise key handshaking timeout */
RTMPSendWirelessEvent(pAd, IW_PAIRWISE_HS_TIMEOUT_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::MSG1 timeout, pEntry->ReTryCounter = %d\n", pEntry->ReTryCounter));
MlmeDeAuthAction(pAd, pEntry, REASON_4_WAY_TIMEOUT, FALSE);
}
/* 4. Retry 4 way message 1, the last try, the timeout is 3 sec for EAPOL-Start */
else if (pEntry->ReTryCounter == (PEER_MSG1_RETRY_TIMER_CTR + 3))
{
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::Retry MSG1, the last try\n"));
WPAStart4WayHS(pAd , pEntry, PEER_MSG3_RETRY_EXEC_INTV);
}
/* 4. Retry 4 way message 1 */
else if (pEntry->ReTryCounter < (PEER_MSG1_RETRY_TIMER_CTR + 3))
{
if ((pEntry->WpaState == AS_PTKSTART) || (pEntry->WpaState == AS_INITPSK) || (pEntry->WpaState == AS_INITPMK))
{
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::ReTry MSG1 of 4-way Handshake\n"));
WPAStart4WayHS(pAd, pEntry, PEER_MSG1_RETRY_EXEC_INTV);
}
}
break;
default:
break;
}
}
#ifdef APCLI_SUPPORT
else if ((pEntry) && IS_ENTRY_APCLI(pEntry))
{
if (pEntry->AuthMode == Ndis802_11AuthModeWPA || pEntry->AuthMode == Ndis802_11AuthModeWPAPSK)
{
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pEntry->pAd;
if (pEntry->wdev_idx < MAX_APCLI_NUM)
{
UCHAR ifIndex = pEntry->wdev_idx;
DBGPRINT(RT_DEBUG_TRACE, ("(%s) ApCli interface[%d] startdown.\n", __FUNCTION__, ifIndex));
#ifdef MAC_REPEATER_SUPPORT
if ((pEntry->bReptCli) && (pAd->ApCfg.bMACRepeaterEn == TRUE))
ifIndex = (64 + ifIndex*MAX_EXT_MAC_ADDR_SIZE + pEntry->MatchReptCliIdx);
#endif /* MAC_REPEATER_SUPPORT */
#ifdef MAC_REPEATER_SUPPORT
if ( (pAd->ApCfg.bMACRepeaterEn == TRUE) && (pEntry->bReptCli))
{
RTMPRemoveRepeaterDisconnectEntry(pAd, pEntry->wdev_idx, pEntry->MatchReptCliIdx);
RTMPRemoveRepeaterEntry(pAd, pEntry->wdev_idx, pEntry->MatchReptCliIdx);
}
else
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_DISCONNECT_REQ, 0, NULL, ifIndex);
#endif /* MAC_REPEATER_SUPPORT */
}
}
}
//.........这里部分代码省略.........
开发者ID:23171580,项目名称:ralink,代码行数:101,代码来源:ap_wpa.c
示例13: APPeerAuthConfirmAction
static VOID APPeerAuthConfirmAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
AUTH_FRAME_INFO auth_info;
PHEADER_802_11 pRcvHdr;
MAC_TABLE_ENTRY *pEntry;
UINT32 apidx;
if (!APPeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, &auth_info))
return;
apidx = get_apidx_by_addr(pAd, auth_info.addr1);
if (apidx >= pAd->ApCfg.BssidNum)
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid not found\n"));
return;
}
if ((pAd->ApCfg.MBSSID[apidx].wdev.if_dev != NULL) &&
!(RTMP_OS_NETDEV_STATE_RUNNING(pAd->ApCfg.MBSSID[apidx].wdev.if_dev)))
{
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Bssid IF didn't up yet.\n"));
return;
} /* End of if */
if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
{
DBGPRINT(RT_DEBUG_ERROR, ("AUTH - Invalid wcid (%d).\n", Elem->Wcid));
return;
}
pEntry = &pAd->MacTab.Content[Elem->Wcid];
if (pEntry && IS_ENTRY_CLIENT(pEntry))
{
if (!RTMPEqualMemory(auth_info.addr1, pAd->ApCfg.MBSSID[pEntry->func_tb_idx].wdev.bssid, MAC_ADDR_LEN))
{
MacTableDeleteEntry(pAd, pEntry->wcid, pEntry->Addr);
pEntry = NULL;
DBGPRINT(RT_DEBUG_WARN, ("AUTH - Bssid does not match\n"));
}
else
{
if (pEntry->bIAmBadAtheros == TRUE)
{
AsicUpdateProtect(pAd, 8, ALLN_SETPROTECT, FALSE, FALSE);
DBGPRINT(RT_DEBUG_TRACE, ("Atheros Problem. Turn on RTS/CTS!!!\n"));
pEntry->bIAmBadAtheros = FALSE;
}
ASSERT(pEntry->Aid == Elem->Wcid);
#ifdef DOT11_N_SUPPORT
BASessionTearDownALL(pAd, pEntry->wcid);
#endif /* DOT11_N_SUPPORT */
}
}
pRcvHdr = (PHEADER_802_11)(Elem->Msg);
DBGPRINT(RT_DEBUG_TRACE,
("AUTH - MBSS(%d), Rcv AUTH seq#%d, Alg=%d, Status=%d from "
"[wcid=%d]%02x:%02x:%02x:%02x:%02x:%02x\n",
apidx, auth_info.auth_seq, auth_info.auth_alg,
auth_info.auth_status, Elem->Wcid,
PRINT_MAC(auth_info.addr2)));
if (pEntry && MAC_ADDR_EQUAL(auth_info.addr2, pAd->ApMlmeAux.Addr))
{
if ((pRcvHdr->FC.Wep == 1) &&
NdisEqualMemory(auth_info.Chtxt, pAd->ApMlmeAux.Challenge, CIPHER_TEXT_LEN))
{
/* Successful */
APPeerAuthSimpleRspGenAndSend(pAd, pRcvHdr, auth_info.auth_alg, auth_info.auth_seq + 1, MLME_SUCCESS);
pEntry->AuthState = AS_AUTH_KEY;
pEntry->Sst = SST_AUTH;
}
else
{
/* send wireless event - Authentication rejected because of challenge failure */
RTMPSendWirelessEvent(pAd, IW_AUTH_REJECT_CHALLENGE_FAILURE, pEntry->Addr, 0, 0);
/* fail - wep bit is not set or challenge text is not equal */
APPeerAuthSimpleRspGenAndSend(pAd, pRcvHdr, auth_info.auth_alg,
auth_info.auth_seq + 1,
MLME_REJ_CHALLENGE_FAILURE);
MacTableDeleteEntry(pAd, pEntry->wcid, pEntry->Addr);
/*Chtxt[127]='\0'; */
/*pAd->ApMlmeAux.Challenge[127]='\0'; */
DBGPRINT(RT_DEBUG_TRACE, ("%s\n",
((pRcvHdr->FC.Wep == 1) ? "challenge text is not equal" : "wep bit is not set")));
/*DBGPRINT(RT_DEBUG_TRACE, ("Sent Challenge = %s\n",&pAd->ApMlmeAux.Challenge[100])); */
/*DBGPRINT(RT_DEBUG_TRACE, ("Rcv Challenge = %s\n",&Chtxt[100])); */
}
}
else
//.........这里部分代码省略.........
开发者ID:jing-git,项目名称:rt-n56u,代码行数:101,代码来源:ap_auth.c
示例14: APMsgTypeSubst
/*! \brief To substitute the message type if the message is coming from external
* \param *Fr The frame received
* \param *Machine The state machine
* \param *MsgType the message type for the state machine
* \return TRUE if the substitution is successful, FALSE otherwise
* \pre
* \post
*/
BOOLEAN APMsgTypeSubst(
IN PRTMP_ADAPTER pAd,
IN PFRAME_802_11 pFrame,
OUT INT *Machine,
OUT INT *MsgType)
{
USHORT Seq;
UCHAR EAPType;
BOOLEAN Return = FALSE;
#ifdef WSC_AP_SUPPORT
UCHAR EAPCode;
PMAC_TABLE_ENTRY pEntry;
#endif /* WSC_AP_SUPPORT */
/*
TODO:
only PROBE_REQ can be broadcast, all others must be unicast-to-me && is_mybssid; otherwise,
ignore this frame
*/
/* wpa EAPOL PACKET */
if (pFrame->Hdr.FC.Type == BTYPE_DATA)
{
#ifdef WSC_AP_SUPPORT
/*WSC EAPOL PACKET */
pEntry = MacTableLookup(pAd, pFrame->Hdr.Addr2);
if (pEntry &&
((pEntry->bWscCapable) ||
(pAd->ApCfg.MBSSID[pEntry->apidx].AuthMode < Ndis802_11AuthModeWPA)))
{
if ((MAC_ADDR_EQUAL(pAd->ApCfg.MBSSID[pEntry->apidx].WscControl.EntryAddr, pEntry->Addr) ||
MAC_ADDR_EQUAL(pAd->ApCfg.MBSSID[pEntry->apidx].WscControl.EntryAddr, ZERO_MAC_ADDR)) &&
IS_ENTRY_CLIENT(pEntry) &&
(pAd->ApCfg.MBSSID[pEntry->apidx].WscControl.WscConfMode != WSC_DISABLE))
{
*Machine = WSC_STATE_MACHINE;
EAPType = *((UCHAR*)pFrame + LENGTH_802_11 + LENGTH_802_1_H + 1);
EAPCode = *((UCHAR*)pFrame + LENGTH_802_11 + LENGTH_802_1_H + 4);
Return = WscMsgTypeSubst(EAPType, EAPCode, MsgType);
}
}
#endif /* WSC_AP_SUPPORT */
if (!Return)
{
*Machine = WPA_STATE_MACHINE;
EAPType = *((UCHAR*)pFrame + LENGTH_802_11 + LENGTH_802_1_H + 1);
Return = WpaMsgTypeSubst(EAPType, (INT *) MsgType);
}
return Return;
}
if (pFrame->Hdr.FC.Type != BTYPE_MGMT)
return FALSE;
switch (pFrame->Hdr.FC.SubType)
{
case SUBTYPE_ASSOC_REQ:
*Machine = AP_ASSOC_STATE_MACHINE;
*MsgType = APMT2_PEER_ASSOC_REQ;
break;
/*
case SUBTYPE_ASSOC_RSP:
*Machine = AP_ASSOC_STATE_MACHINE;
*MsgType = APMT2_PEER_ASSOC_RSP;
break;
*/
case SUBTYPE_REASSOC_REQ:
*Machine = AP_ASSOC_STATE_MACHINE;
*MsgType = APMT2_PEER_REASSOC_REQ;
break;
/*
case SUBTYPE_REASSOC_RSP:
*Machine = AP_ASSOC_STATE_MACHINE;
*MsgType = APMT2_PEER_REASSOC_RSP;
break;
*/
case SUBTYPE_PROBE_REQ:
*Machine = AP_SYNC_STATE_MACHINE;
*MsgType = APMT2_PEER_PROBE_REQ;
break;
/* test for 40Mhz intolerant */
/*
For Active Scan
*/
case SUBTYPE_PROBE_RSP:
*Machine = AP_SYNC_STATE_MACHINE;
*MsgType = APMT2_PEER_PROBE_RSP;
break;
case SUBTYPE_BEACON:
*Machine = AP_SYNC_STATE_MACHINE;
*MsgType = APMT2_PEER_BEACON;
//.........这里部分代码省略.........
开发者ID:23171580,项目名称:ralink,代码行数:101,代码来源:ap_mlme.c
示例15: WPARetryExec
VOID WPARetryExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
MAC_TABLE_ENTRY *pEntry = (MAC_TABLE_ENTRY *)FunctionContext;
if ((pEntry) && IS_ENTRY_CLIENT(pEntry))
{
struct rtmp_adapter *pAd = (struct rtmp_adapter *)pEntry->pAd;
pEntry->ReTryCounter++;
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec---> ReTryCounter=%d, WpaState=%d \n", pEntry->ReTryCounter, pEntry->WpaState));
switch (pEntry->AuthMode)
{
case Ndis802_11AuthModeWPA:
case Ndis802_11AuthModeWPAPSK:
case Ndis802_11AuthModeWPA2:
case Ndis802_11AuthModeWPA2PSK:
/* 1. GTK already retried, give up and disconnect client. */
if (pEntry->ReTryCounter > (GROUP_MSG1_RETRY_TIMER_CTR + 1))
{
/* send wireless event - for group key handshaking timeout */
RTMPSendWirelessEvent(pAd, IW_GROUP_HS_TIMEOUT_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::Group Key HS exceed retry count, Disassociate client, pEntry->ReTryCounter %d\n", pEntry->ReTryCounter));
MlmeDeAuthAction(pAd, pEntry, REASON_GROUP_KEY_HS_TIMEOUT, false);
}
/* 2. Retry GTK. */
else if (pEntry->ReTryCounter > GROUP_MSG1_RETRY_TIMER_CTR)
{
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::ReTry 2-way group-key Handshake \n"));
if (pEntry->GTKState == REKEY_NEGOTIATING)
{
WPAStart2WayGroupHS(pAd, pEntry);
RTMPSetTimer(&pEntry->RetryTimer, PEER_MSG3_RETRY_EXEC_INTV);
}
}
/* 3. 4-way message 1 retried more than three times. Disconnect client */
else if (pEntry->ReTryCounter > (PEER_MSG1_RETRY_TIMER_CTR + 3))
{
/* send wireless event - for pairwise key handshaking timeout */
RTMPSendWirelessEvent(pAd, IW_PAIRWISE_HS_TIMEOUT_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::MSG1 timeout, pEntry->ReTryCounter = %d\n", pEntry->ReTryCounter));
MlmeDeAuthAction(pAd, pEntry, REASON_4_WAY_TIMEOUT, false);
}
/* 4. Retry 4 way message 1, the last try, the timeout is 3 sec for EAPOL-Start */
else if (pEntry->ReTryCounter == (PEER_MSG1_RETRY_TIMER_CTR + 3))
{
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::Retry MSG1, the last try\n"));
WPAStart4WayHS(pAd , pEntry, PEER_MSG3_RETRY_EXEC_INTV);
}
/* 4. Retry 4 way message 1 */
else if (pEntry->ReTryCounter < (PEER_MSG1_RETRY_TIMER_CTR + 3))
{
if ((pEntry->WpaState == AS_PTKSTART) || (pEntry->WpaState == AS_INITPSK) || (pEntry->WpaState == AS_INITPMK))
{
DBGPRINT(RT_DEBUG_TRACE, ("WPARetryExec::ReTry MSG1 of 4-way Handshake\n"));
WPAStart4WayHS(pAd, pEntry, PEER_MSG1_RETRY_EXEC_INTV);
}
}
break;
default:
break;
}
}
}
开发者ID:ulli-kroll,项目名称:mt7612u,代码行数:71,代码来源:ap_wpa.c
示例16: GREKEYPeriodicExec
/*
==========================================================================
Description:
Timer execution function for periodically updating group key.
Return:
==========================================================================
*/
VOID GREKEYPeriodicExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
UINT i, apidx;
ULONG temp_counter = 0;
struct rtmp_adapter *pAd = (struct rtmp_adapter *)FunctionContext;
PRALINK_TIMER_STRUCT pTimer = (PRALINK_TIMER_STRUCT) SystemSpecific3;
MULTISSID_STRUCT *pMbss = NULL;
struct rtmp_wifi_dev *wdev;
for (apidx=0; apidx<pAd->ApCfg.BssidNum; apidx++)
{
if (&pAd->ApCfg.MBSSID[apidx].REKEYTimer == pTimer)
break;
}
if (apidx == pAd->ApCfg.BssidNum)
return;
else
pMbss = &pAd->ApCfg.MBSSID[apidx];
wdev = &pMbss->wdev;
if (wdev->AuthMode < Ndis802_11AuthModeWPA ||
wdev->AuthMode > Ndis802_11AuthModeWPA1PSKWPA2PSK)
return;
if ((pMbss->WPAREKEY.ReKeyMethod == TIME_REKEY) && (pMbss->REKEYCOUNTER < 0xffffffff))
temp_counter = (++pMbss->REKEYCOUNTER);
/* REKEYCOUNTER is incremented every MCAST packets transmitted, */
/* But the unit of Rekeyinterval is 1K packets */
else if (pMbss->WPAREKEY.ReKeyMethod == PKT_REKEY)
temp_counter = pMbss->REKEYCOUNTER/1000;
else
{
return;
}
if (temp_counter > (pMbss->WPAREKEY.ReKeyInterval))
{
pMbss->REKEYCOUNTER = 0;
pMbss->RekeyCountDown = 3;
DBGPRINT(RT_DEBUG_TRACE, ("Rekey Interval Excess, GKeyDoneStations=%d\n", pMbss->StaCount));
/* take turn updating different groupkey index, */
if ((pMbss->StaCount) > 0)
{
/* change key index */
wdev->DefaultKeyId = (wdev->DefaultKeyId == 1) ? 2 : 1;
/* Generate GNonce randomly */
GenRandom(pAd, wdev->bssid, pMbss->GNonce);
/* Update GTK */
WpaDeriveGTK(pMbss->GMK,
(u8 *)pMbss->GNonce,
wdev->bssid, pMbss->GTK, LEN_TKIP_GTK);
/* Process 2-way handshaking */
for (i = 0; i < MAX_LEN_OF_MAC_TABLE; i++)
{
MAC_TABLE_ENTRY *pEntry;
pEntry = &pAd->MacTab.Content[i];
if (IS_ENTRY_CLIENT(pEntry) &&
(pEntry->WpaState == AS_PTKINITDONE) &&
(pEntry->apidx == apidx))
{
pEntry->GTKState = REKEY_NEGOTIATING;
#ifdef DROP_MASK_SUPPORT
/* Disable Drop Mask */
set_drop_mask_per_client(pAd, pEntry, 1, 0);
set_drop_mask_per_client(pAd, pEntry, 2, 0);
#endif /* DROP_MASK_SUPPORT */
WPAStart2WayGroupHS(pAd, pEntry);
DBGPRINT(RT_DEBUG_TRACE, ("Rekey interval excess, Update Group Key for %x %x %x %x %x %x , DefaultKeyId= %x \n",\
PRINT_MAC(pEntry->Addr), wdev->DefaultKeyId));
}
}
}
}
/* Use countdown to ensure the 2-way handshaking had completed */
if (pMbss->RekeyCountDown > 0)
{
pMbss->RekeyCountDown--;
if (pMbss->RekeyCountDown == 0)
{
unsigned short Wcid;
//.........这里部分代码省略.........
开发者ID:ulli-kroll,项目名称:mt7612u,代码行数:101,代码来源:ap_wpa.c
示例17: NdisAcquireSpinLock
MAC_TABLE_ENTRY *MacTableInsertEntry(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pAddr,
IN UCHAR apidx,
IN UCHAR OpMode,
IN BOOLEAN CleanAll)
{
UCHAR HashIdx;
int i, FirstWcid;
MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry;
/* USHORT offset;*/
/* ULONG addr;*/
BOOLEAN Cancelled;
/* if FULL, return*/
if (pAd->MacTab.Size >= MAX_LEN_OF_MAC_TABLE)
return NULL;
FirstWcid = 1;
/* allocate one MAC entry*/
NdisAcquireSpinLock(&pAd->MacTabLock);
for (i = FirstWcid; i< MAX_LEN_OF_MAC_TABLE; i++) /* skip entry#0 so that "entry index == AID" for fast lookup*/
{
/* pick up the first available vacancy*/
if (IS_ENTRY_NONE(&pAd->MacTab.Content[i]))
{
pEntry = &pAd->MacTab.Content[i];
/* ENTRY PREEMPTION: initialize the entry */
RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
RTMPCancelTimer(&pEntry->EnqueueStartForPSKTimer, &Cancelled);
NdisZeroMemory(pEntry, sizeof(MAC_TABLE_ENTRY));
if (CleanAll == TRUE)
{
pEntry->MaxSupportedRate = RATE_11;
pEntry->CurrTxRate = RATE_11;
NdisZeroMemory(pEntry, sizeof(MAC_TABLE_ENTRY));
pEntry->PairwiseKey.KeyLen = 0;
pEntry->PairwiseKey.CipherAlg = CIPHER_NONE;
}
do
{
#ifdef CONFIG_AP_SUPPORT
#ifdef APCLI_SUPPORT
if (apidx >= MIN_NET_DEVICE_FOR_APCLI)
{
SET_ENTRY_APCLI(pEntry);
pEntry->isCached = FALSE;
break;
}
#endif /* APCLI_SUPPORT */
#ifdef WDS_SUPPORT
if (apidx >= MIN_NET_DEVICE_FOR_WDS)
{
SET_ENTRY_WDS(pEntry);
pEntry->isCached = FALSE;
break;
}
#endif /* WDS_SUPPORT */
#endif /* CONFIG_AP_SUPPORT */
#ifdef CONFIG_AP_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_AP(pAd)
{ /* be a regular-entry*/
if ((apidx < pAd->ApCfg.BssidNum) &&
(apidx < MAX_MBSSID_NUM(pAd)) &&
((apidx < HW_BEACON_MAX_NUM)) &&
(pAd->ApCfg.MBSSID[apidx].MaxStaNum != 0) &&
(pAd->ApCfg.MBSSID[apidx].StaCount >= pAd->ApCfg.MBSSID[apidx].Max
|
请发表评论