• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ COPY_MAC_ADDR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中COPY_MAC_ADDR函数的典型用法代码示例。如果您正苦于以下问题:C++ COPY_MAC_ADDR函数的具体用法?C++ COPY_MAC_ADDR怎么用?C++ COPY_MAC_ADDR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了COPY_MAC_ADDR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PeerAuthRspAtSeq4Action

/*
    ==========================================================================
    Description:
        
	IRQL = DISPATCH_LEVEL

    ==========================================================================
 */
VOID PeerAuthRspAtSeq4Action(
    IN PRTMP_ADAPTER pAd, 
    IN MLME_QUEUE_ELEM *Elem) 
{
    UCHAR         Addr2[MAC_ADDR_LEN];
    USHORT        Alg, Seq, Status;
//    CHAR          ChlgText[CIPHER_TEXT_LEN];
	CHAR		*ChlgText = NULL;
    BOOLEAN       TimerCancelled;

	/* allocate memory */
	os_alloc_mem(NULL, (UCHAR **)&ChlgText, CIPHER_TEXT_LEN);
	if (ChlgText == NULL)
	{
		DBGPRINT(RT_DEBUG_ERROR, ("%s: ChlgText Allocate memory fail!!!\n", __FUNCTION__));
		return;
	}

    if(PeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status, ChlgText)) 
    {
        if(MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 4) 
        {
            DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Receive AUTH_RSP seq#4 to me\n"));
            RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &TimerCancelled);
            
            if (Status != MLME_SUCCESS) 
            {
                pAd->StaCfg.AuthFailReason = Status;
                COPY_MAC_ADDR(pAd->StaCfg.AuthFailSta, Addr2);
				RTMPSendWirelessEvent(pAd, IW_SHARED_WEP_FAIL, NULL, BSS0, 0); 
            }                

            pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
            MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status, 0);
        }
    }
    else
    {
        DBGPRINT(RT_DEBUG_TRACE, ("AUTH - PeerAuthRspAtSeq4Action() sanity check fail\n"));
    }

	if (ChlgText != NULL)
		os_free_mem(NULL, ChlgText);
}
开发者ID:philenotfound,项目名称:belkin-wemo-linux-2.6.21.x,代码行数:52,代码来源:auth.c


示例2: MlmeDeauthReqAction

/*
    ==========================================================================
    Description:
        
	IRQL = DISPATCH_LEVEL

    ==========================================================================
 */
VOID MlmeDeauthReqAction(RTMP_ADAPTER *pAd, MLME_QUEUE_ELEM *Elem)
{
	MLME_DEAUTH_REQ_STRUCT *pInfo;
	HEADER_802_11 DeauthHdr;
	PUCHAR pOutBuffer = NULL;
	NDIS_STATUS NStatus;
	ULONG FrameLen = 0;
	USHORT Status;

	pInfo = (MLME_DEAUTH_REQ_STRUCT *) Elem->Msg;

	NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);	/*Get an unused nonpaged memory */
	if (NStatus != NDIS_STATUS_SUCCESS) {
		DBGPRINT(RT_DEBUG_TRACE,
			 ("AUTH - MlmeDeauthReqAction() allocate memory fail\n"));
		pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
		Status = MLME_FAIL_NO_RESOURCE;
		MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_DEAUTH_CONF, 2,
			    &Status, 0);
		return;
	}

	DBGPRINT(RT_DEBUG_TRACE,
		 ("AUTH - Send DE-AUTH request (Reason=%d)...\n",
		  pInfo->Reason));
	MgtMacHeaderInit(pAd, &DeauthHdr, SUBTYPE_DEAUTH, 0, pInfo->Addr,
						pAd->CurrentAddress,
						pAd->MlmeAux.Bssid);
	MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof (HEADER_802_11),
			  &DeauthHdr, 2, &pInfo->Reason, END_OF_ARGS);
	MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
	MlmeFreeMemory(pAd, pOutBuffer);

	pAd->StaCfg.DeauthReason = pInfo->Reason;
	COPY_MAC_ADDR(pAd->StaCfg.DeauthSta, pInfo->Addr);
	pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
	Status = MLME_SUCCESS;
	MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_DEAUTH_CONF, 2, &Status,
		    0);

	/* send wireless event - for deauthentication */
	RTMPSendWirelessEvent(pAd, IW_DEAUTH_EVENT_FLAG, NULL, BSS0, 0);
}
开发者ID:rizi-456,项目名称:mtabox,代码行数:51,代码来源:auth.c


示例3: MlmeAssocReqSanity

/*
    ==========================================================================
    Description:
        MLME message sanity check
    Return:
        TRUE if all parameters are OK, FALSE otherwise
    ==========================================================================
 */
BOOLEAN MlmeAssocReqSanity(
    IN PRTMP_ADAPTER pAd,
    IN VOID *Msg,
    IN ULONG MsgLen,
    OUT PUCHAR pApAddr,
    OUT USHORT *pCapabilityInfo,
    OUT ULONG *pTimeout,
    OUT USHORT *pListenIntv)
{
    MLME_ASSOC_REQ_STRUCT *pInfo;

    pInfo = (MLME_ASSOC_REQ_STRUCT *)Msg;
    *pTimeout = pInfo->Timeout;                             // timeout
    COPY_MAC_ADDR(pApAddr, pInfo->Addr);                   // AP address
    *pCapabilityInfo = pInfo->CapabilityInfo;               // capability info
    *pListenIntv = pInfo->ListenIntv;

    return TRUE;
}
开发者ID:amalrajt,项目名称:linux-sh4-2.6.23.17_stm23_A18B,代码行数:27,代码来源:sanity.c


示例4: P2pSendPassedAction

static VOID P2pSendPassedAction(
	IN PRTMP_ADAPTER pAd,
	IN MLME_QUEUE_ELEM *Elem)
{
	P2P_GO_FORM_STATE *pCurrState = &(pAd->P2pCfg.GoFormCurrentState);
	PP2P_CMD_STRUCT pP2pCmd = (PP2P_CMD_STRUCT)Elem->Msg;
	UCHAR index = pP2pCmd->Idx;

	DBGPRINT(RT_DEBUG_ERROR, ("%s::\n", __FUNCTION__));
	DBGPRINT(RT_DEBUG_ERROR, ("Addr = %02x:%02x:%02x:%02x:%02x:%02x\n", PRINT_MAC(pP2pCmd->Addr)));

	pAd->P2pTable.Client[index].P2pClientState = P2PSTATE_CONNECT_COMMAND;
	COPY_MAC_ADDR(pAd->P2pCfg.ConnectingMAC, pAd->P2pTable.Client[index].addr);
	pAd->P2pTable.Client[index].StateCount = 20;
	pAd->P2pTable.Client[index].bValid = TRUE;
	P2pConnect(pAd);

	*pCurrState = P2P_GO_FORM_IDLE;
}
开发者ID:feimengspirit,项目名称:galen-emacs,代码行数:19,代码来源:p2p_nego_mng.c


示例5: RRM_BcnReortQuery

static VOID RRM_BcnReortQuery(
	IN PRTMP_ADAPTER pAd,
	IN INT ApIdx,
	IN PRRM_CONFIG pRrmCfg)
{
	INT idx;

	for (idx = pRrmCfg->QuietCB.CurAid; idx < (pAd->MacTab.Size+1); idx++)
	{
		PMAC_TABLE_ENTRY pEntry = &pAd->MacTab.Content[idx];

		if (IS_RRM_CAPABLE(pEntry)
			&& IS_RRM_BEACON_MEASURE(pEntry))
		{
			RRM_MLME_BCN_REQ_INFO BcnReq;
	
			NdisZeroMemory(&BcnReq, sizeof(RRM_MLME_BCN_REQ_INFO));
			COPY_MAC_ADDR(BcnReq.Bssid, BROADCAST_ADDR);
			BcnReq.pSsid = (PUCHAR)pAd->ApCfg.MBSSID[ApIdx].Ssid;
			BcnReq.SsidLen = pAd->ApCfg.MBSSID[ApIdx].SsidLen;
			BcnReq.RegulatoryClass = pAd->CommonCfg.RegulatoryClass[0];
			BcnReq.MeasureCh = pRrmCfg->QuietCB.MeasureCh;
			BcnReq.MeasureMode = RRM_BCN_REQ_MODE_BCNTAB;
			BcnReq.BcnReqCapFlag.field.ReportCondition = TRUE;
			BcnReq.MeasureDuration = cpu2le16(pRrmCfg->QuietCB.QuietDuration);
			if (BcnReq.MeasureCh == 255)
				BcnReq.BcnReqCapFlag.field.ChannelRep = TRUE;
			else
				BcnReq.BcnReqCapFlag.field.ChannelRep = FALSE;
			RRM_EnqueueBcnReq(pAd, pEntry->Aid, pEntry->apidx, &BcnReq);
			
			pRrmCfg->QuietCB.CurAid = idx + 1;
			break;
		}
	}

	if (idx == (pAd->MacTab.Size + 1))
	{
		pRrmCfg->QuietCB.CurAid = 1;
		pRrmCfg->QuietCB.MeasureCh =
			(pRrmCfg->QuietCB.MeasureCh == 255) ? pAd->CommonCfg.Channel : 255;
	}
}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:43,代码来源:rrm.c


示例6: FT_OTA_AuthParmFill

VOID FT_OTA_AuthParmFill(
	IN PRTMP_ADAPTER pAd, 
	IN OUT MLME_FT_OTA_AUTH_REQ_STRUCT *pFtOtaAuthReq, 
	IN PUCHAR 	pAddr, 
	IN USHORT 	Alg,
	IN PDOT11R_CMN_STRUC	pCmmDot11rCfg)
{		
	COPY_MAC_ADDR(pFtOtaAuthReq->Addr, pAddr);
	pFtOtaAuthReq->Alg = Alg;
	pFtOtaAuthReq->Timeout = (AUTH_TIMEOUT * 2);

	/* MDIE */
	pFtOtaAuthReq->MdIe.FtCapPlc.field.RsrReqCap = 0;
	pFtOtaAuthReq->MdIe.FtCapPlc.field.FtOverDs = 0;
	if (pCmmDot11rCfg->bSupportResource && pAd->MlmeAux.MdIeInfo.FtCapPlc.field.RsrReqCap)
		pFtOtaAuthReq->MdIe.FtCapPlc.field.RsrReqCap = 1;
	pFtOtaAuthReq->MdIe.FtCapPlc.field.FtOverDs = pAd->MlmeAux.MdIeInfo.FtCapPlc.field.FtOverDs;
	FT_SET_MDID(pFtOtaAuthReq->MdIe.MdId, pCmmDot11rCfg->MdIeInfo.MdId);
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:19,代码来源:ft_auth.c


示例7: D_CheckConnectionReq

static INT D_CheckConnectionReq(
    PRTMP_ADAPTER pAd,
    PUCHAR pSrcAddr,
    UINT8 FrameType,
    PCHAR Rssi,
    BOOLEAN *bAuthCheck)
{
    PBND_STRG_CLI_TABLE table = P_BND_STRG_TABLE;
    BNDSTRG_MSG msg;

    /* Send to daemon */
    NdisCopyMemory(msg.Rssi, Rssi, 3);
    msg.Action= CONNECTION_REQ;
    msg.Band = table->Band;
    msg.FrameType = FrameType;
    msg.bAuthCheck = bAuthCheck ? 1:0;
    COPY_MAC_ADDR(msg.Addr, pSrcAddr);
    D_BndStrgSendMsg(pAd, &msg);

    if (bAuthCheck)
    {
        PBND_STRG_CLI_TABLE table = P_BND_STRG_TABLE;
        PBND_STRG_CLI_ENTRY entry = NULL;

        if (table->Ops)
            entry = table->Ops->TableLookup(table, pSrcAddr);

        if (entry || table->Band == BAND_5G)
            *bAuthCheck = TRUE;
#ifdef BND_STRG_QA
        else
        {
            *bAuthCheck = FALSE;
            BND_STRG_PRINTQAMSG(table, pSrcAddr,
                                (RED("check 2.4G connection failed. client (%02x:%02x:%02x:%02x:%02x:%02x)"
                                     " is not allowed to connect 2.4G.\n"), PRINT_MAC(pSrcAddr)));
        }
#endif
    }

    return TRUE;
}
开发者ID:houzhenggang,项目名称:mtk-sources,代码行数:42,代码来源:ap_band_steering.c


示例8: GenRandom

/*
	========================================================================
	
	Routine Description:
		Generate random number by software.

	Arguments:
		pAd		-	pointer to our pAdapter context 
		macAddr	-	pointer to local MAC address
		
	Return Value:

	Note:
		802.1ii-2004  Annex H.5
		
	========================================================================
*/
VOID	GenRandom(
	IN	PRTMP_ADAPTER	pAd, 
	IN	UCHAR			*macAddr,
	OUT	UCHAR			*random)
{	
	INT		i, curr;
	UCHAR	local[80], KeyCounter[32];
	UCHAR	result[80];
	ULONG	CurrentTime;
	UCHAR	prefix[] = {'I', 'n', 'i', 't', ' ', 'C', 'o', 'u', 'n', 't', 'e', 'r'};

	// Zero the related information
	NdisZeroMemory(result, 80);
	NdisZeroMemory(local, 80);
	NdisZeroMemory(KeyCounter, 32);	

	for	(i = 0;	i <	32;	i++)
	{		
		// copy the local MAC address
		COPY_MAC_ADDR(local, macAddr);
		curr =	MAC_ADDR_LEN;

		// concatenate the current time
		NdisGetSystemUpTime(&CurrentTime);
		NdisMoveMemory(&local[curr],  &CurrentTime,	sizeof(CurrentTime));
		curr +=	sizeof(CurrentTime);

		// concatenate the last result
		NdisMoveMemory(&local[curr],  result, 32);
		curr +=	32;
		
		// concatenate a variable 
		NdisMoveMemory(&local[curr],  &i,  2);		
		curr +=	2;

		// calculate the result
		PRF(KeyCounter, 32, prefix,12, local, curr, result, 32); 
	}
	
	NdisMoveMemory(random, result,	32);	
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:58,代码来源:cmm_wpa.c


示例9: ApCliCtrlAuthReqTimeoutAction

/* 
    ==========================================================================
    Description:
        APCLI MLME Auth Req timeout state machine procedure
    ==========================================================================
 */
static VOID ApCliCtrlAuthReqTimeoutAction(
	IN PRTMP_ADAPTER pAd, 
	IN MLME_QUEUE_ELEM *Elem)
{
	MLME_AUTH_REQ_STRUCT AuthReq;
	PAPCLI_STRUCT pApCliEntry;
	USHORT ifIndex = (USHORT)(Elem->Priv);
	PULONG pCurrState = &pAd->ApCfg.ApCliTab[ifIndex].CtrlCurrState;


	DBGPRINT(RT_DEBUG_TRACE, ("(%s) Auth Req Timeout.\n", __FUNCTION__));

	if (ifIndex >= MAX_APCLI_NUM)
		return;

	pApCliEntry = &pAd->ApCfg.ApCliTab[ifIndex];

	pApCliEntry->AuthReqCnt++;

	if (pApCliEntry->AuthReqCnt > 5)
	{
		*pCurrState = APCLI_CTRL_DISCONNECTED;
		NdisZeroMemory(pAd->ApCfg.ApCliTab[ifIndex].ApCliMlmeAux.Bssid, MAC_ADDR_LEN);
		NdisZeroMemory(pAd->ApCfg.ApCliTab[ifIndex].ApCliMlmeAux.Ssid, MAX_LEN_OF_SSID);
		pApCliEntry->AuthReqCnt = 0;
		return;
	}

	/* stay in same state. */
	*pCurrState = APCLI_CTRL_AUTH;

	/* retry Authentication. */
	DBGPRINT(RT_DEBUG_TRACE, ("(%s) Retry Auth Req.\n", __FUNCTION__));
	COPY_MAC_ADDR(AuthReq.Addr, pAd->ApCfg.ApCliTab[ifIndex].ApCliMlmeAux.Bssid);
	AuthReq.Alg = pAd->ApCfg.ApCliTab[ifIndex].ApCliMlmeAux.Alg; /* Ndis802_11AuthModeOpen; */
	AuthReq.Timeout = AUTH_TIMEOUT;
	MlmeEnqueue(pAd, APCLI_AUTH_STATE_MACHINE, APCLI_MT2_MLME_AUTH_REQ,
		sizeof(MLME_AUTH_REQ_STRUCT), &AuthReq, ifIndex);

	return;
}
开发者ID:23171580,项目名称:ralink,代码行数:47,代码来源:p2pcli_ctrl.c


示例10: PeerAddBAReqActionSanity

BOOLEAN PeerAddBAReqActionSanity(
    IN PRTMP_ADAPTER pAd, 
    IN VOID *pMsg, 
    IN ULONG MsgLen,
	OUT PUCHAR pAddr2)
{
	PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg;
	PFRAME_ADDBA_REQ pAddFrame;
	pAddFrame = (PFRAME_ADDBA_REQ)(pMsg);
	if (MsgLen < (sizeof(FRAME_ADDBA_REQ)))
	{
		DBGPRINT(RT_DEBUG_ERROR,("PeerAddBAReqActionSanity: ADDBA Request frame length size = %ld incorrect\n", MsgLen));
		return FALSE;
	}
	/* we support immediate BA.*/
#ifdef UNALIGNMENT_SUPPORT
	{
		BA_PARM		tmpBaParm;

		NdisMoveMemory((PUCHAR)(&tmpBaParm), (PUCHAR)(&pAddFrame->BaParm), sizeof(BA_PARM));
		*(USHORT *)(&tmpBaParm) = cpu2le16(*(USHORT *)(&tmpBaParm));
		NdisMoveMemory((PUCHAR)(&pAddFrame->BaParm), (PUCHAR)(&tmpBaParm), sizeof(BA_PARM));
	}
#else
	*(USHORT *)(&pAddFrame->BaParm) = cpu2le16(*(USHORT *)(&pAddFrame->BaParm));
#endif
	pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue);
	pAddFrame->BaStartSeq.word = cpu2le16(pAddFrame->BaStartSeq.word); 

	COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);

	if (pAddFrame->BaParm.BAPolicy != IMMED_BA)
	{
		DBGPRINT(RT_DEBUG_ERROR,("PeerAddBAReqActionSanity: ADDBA Request Ba Policy[%d] not support\n", pAddFrame->BaParm.BAPolicy));
		DBGPRINT(RT_DEBUG_ERROR,("ADDBA Request. tid=%x, Bufsize=%x, AMSDUSupported=%x \n", pAddFrame->BaParm.TID, pAddFrame->BaParm.BufSize, pAddFrame->BaParm.AMSDUSupported));
		return FALSE;
	}

	return TRUE;
}
开发者ID:devMichaelJones,项目名称:patched-Asus-PCE-N53-linux-driver,代码行数:40,代码来源:cmm_sanity.c


示例11: kalP2PIndicateConnReq

/*----------------------------------------------------------------------------*/
VOID
kalP2PIndicateConnReq(
    IN P_GLUE_INFO_T        prGlueInfo,
    IN PUINT_8              pucDevName,
    IN INT_32               u4NameLength,
    IN PARAM_MAC_ADDRESS    rPeerAddr,
    IN UINT_8               ucDevType, /* 0: P2P Device / 1: GC / 2: GO */
    IN INT_32               i4ConfigMethod,
    IN INT_32               i4ActiveConfigMethod
    )
{
    union iwreq_data evt;
    UINT_8 aucBuffer[IW_CUSTOM_MAX];

    ASSERT(prGlueInfo);

    /* buffer peer information for later IOC_P2P_GET_REQ_DEVICE_INFO access */
    prGlueInfo->prP2PInfo->u4ConnReqNameLength = u4NameLength > 32 ? 32 : u4NameLength;
    kalMemCopy(prGlueInfo->prP2PInfo->aucConnReqDevName,
            pucDevName,
            prGlueInfo->prP2PInfo->u4ConnReqNameLength);
    COPY_MAC_ADDR(prGlueInfo->prP2PInfo->rConnReqPeerAddr, rPeerAddr);
    prGlueInfo->prP2PInfo->ucConnReqDevType = ucDevType;
    prGlueInfo->prP2PInfo->i4ConnReqConfigMethod = i4ConfigMethod;
    prGlueInfo->prP2PInfo->i4ConnReqActiveConfigMethod = i4ActiveConfigMethod;

    // prepare event structure
    memset(&evt, 0, sizeof(evt));

    snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_DVC_REQ");
    evt.data.length = strlen(aucBuffer);

    /* indicate in IWEVCUSTOM event */
    wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler,
            IWEVCUSTOM,
            &evt,
            aucBuffer);

    return;
} /* end of kalP2PIndicateConnReq() */
开发者ID:JaMByDev,项目名称:Fly_IQ441_kernel-3.4.5,代码行数:41,代码来源:gl_p2p_kal.c


示例12: PeerP2pPresReqAction

VOID PeerP2pPresReqAction(
	IN PRTMP_ADAPTER pAd, 
	IN MLME_QUEUE_ELEM *Elem) 
{
	MLME_P2P_ACTION_STRUCT	P2PActReq;	
	MAC_TABLE_ENTRY		*pEntry;
	PFRAME_P2P_ACTION		pFrame;
	PP2P_NOA_DESC	pNoADesc;	
	
	pFrame = (PFRAME_P2P_ACTION)Elem->Msg;

	if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
	{
		DBGPRINT(RT_DEBUG_ERROR, ("PeerP2pPresReqAction. unknown Elem->Wcid  = %d \n", Elem->Wcid ));
	}
		
	DBGPRINT(RT_DEBUG_ERROR, ("PeerP2pPresReqAction. Send back to Elem->Wcid  = %d \n", Elem->Wcid ));
		
	pEntry = &pAd->MacTab.Content[Elem->Wcid];

	pNoADesc = (PP2P_NOA_DESC)(&Elem->Msg[11 + sizeof(FRAME_P2P_ACTION)]);
	pEntry->P2pInfo.NoADesc[0].Count = pNoADesc->Count;
	pEntry->P2pInfo.NoADesc[0].Duration = *(PULONG)&pNoADesc->Duration[0];
	pEntry->P2pInfo.NoADesc[0].Interval = *(PULONG)&pNoADesc->Interval[0];
	pEntry->P2pInfo.NoADesc[0].StartTime = *(PULONG)&pNoADesc->StartTime[0];
	DBGPRINT(RT_DEBUG_ERROR,(" pP2pEntry->NoADesc[0].Count = %d, \n", pEntry->P2pInfo.NoADesc[0].Count));
	DBGPRINT(RT_DEBUG_ERROR,(" pP2pEntry->NoADesc[0].Duration = %d, \n", pEntry->P2pInfo.NoADesc[0].Duration));
	DBGPRINT(RT_DEBUG_ERROR,(" pP2pEntry->NoADesc[0].Interval = %d, \n", pEntry->P2pInfo.NoADesc[0].Interval));
	DBGPRINT(RT_DEBUG_ERROR,(" pP2pEntry->NoADesc[0].StartTime = %d, \n", pEntry->P2pInfo.NoADesc[0].StartTime));
	DBGPRINT(RT_DEBUG_ERROR,("pFrame->Token  = %d \n", pFrame->Token));

	pEntry->P2pInfo.NoAToken = pFrame->Token;
/*	pP2pEntry->NoADesc[0].Duration = Elem->Msg; */
	NdisZeroMemory(&P2PActReq, sizeof(P2PActReq));
	COPY_MAC_ADDR(P2PActReq.Addr, pEntry->Addr);
	P2PActReq.TabIndex = Elem->Wcid;
	MlmeEnqueue(pAd, P2P_ACTION_STATE_MACHINE, MT2_MLME_P2P_PRESENCE_RSP, sizeof(MLME_P2P_ACTION_STRUCT), (PVOID)&P2PActReq, 0);
	MlmeHandler(pAd);

}
开发者ID:aircross,项目名称:ray,代码行数:40,代码来源:p2p_action.c


示例13: BndStrg_IsClientStay

BOOLEAN BndStrg_IsClientStay(
			PRTMP_ADAPTER pAd,
			PMAC_TABLE_ENTRY pEntry)
{
	PBND_STRG_CLI_TABLE table = P_BND_STRG_TABLE;
	CHAR Rssi = RTMPAvgRssi(pAd, &pEntry->RssiSample);
	
	if (table->AlgCtrl.ConditionCheck & fBND_STRG_CND_5G_RSSI &&
		table->Band == BAND_5G &&
		(Rssi < (table->RssiLow - 10/*Test*/)))
	{
		BNDSTRG_MSG msg;

		msg.Action = CLI_DEL;
		COPY_MAC_ADDR(msg.Addr, pEntry->Addr);
		 /* we don't know the index, daemon should look it up */
		msg.TalbeIndex = BND_STRG_MAX_TABLE_SIZE;

		BND_STRG_DBGPRINT(RT_DEBUG_TRACE,
				(YLW("%s(): Kick client (%02x:%02x:%02x:%02x:%02x:%02x)")
				 YLW(" due to low Rssi(%d).\n")
				 , __FUNCTION__, PRINT_MAC(pEntry->Addr), Rssi));

		RtmpOSWrielessEventSend(
			pAd->net_dev,
			RT_WLAN_EVENT_CUSTOM,
			OID_BNDSTRG_MSG,
			NULL,
			(UCHAR *) &msg,
			sizeof(BNDSTRG_MSG));

		table->Ops->TableEntryDel(table, pEntry->Addr, BND_STRG_MAX_TABLE_SIZE);

		return FALSE;
	}

	return TRUE;
}
开发者ID:23171580,项目名称:ralink,代码行数:38,代码来源:ap_band_steering.c


示例14: FT_OTA_PeerAuthAckAction

/*
    ==========================================================================
    Description:
        
	IRQL = DISPATCH_LEVEL

    ==========================================================================
 */
VOID FT_OTA_PeerAuthAckAction(
    IN PRTMP_ADAPTER pAd, 
    IN MLME_QUEUE_ELEM *Elem) 
{
    UCHAR         Addr2[MAC_ADDR_LEN];
    USHORT        Alg, Seq, Status;
    BOOLEAN       TimerCancelled;

    if (PeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status, NULL)) 
    {
        if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && 
			(Alg == AUTH_MODE_FT) &&
			(Seq == 4))
        {
            MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("FT_OTA_AUTH - Receive FT_OTA_AUTH_ACK to me\n"));
            RTMPCancelTimer(&pAd->MlmeAux.FtOtaAuthTimer, &TimerCancelled);
            pAd->StaCfg.Dot11RCommInfo.FtRspSuccess = FT_OTA_RESPONSE;
            if (Status == MLME_SUCCESS) 
            {
                /* Retrieve Reassociation Deadline */
				
				/* Check RIC-Response */
            }
			else
			{				
				pAd->StaCfg.AuthFailReason = Status;
                COPY_MAC_ADDR(pAd->StaCfg.AuthFailSta, Addr2);
			}

            pAd->Mlme.FtOtaAuthMachine.CurrState = FT_OTA_AUTH_REQ_IDLE;
            MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status, 0);
        }
    }
    else
    {
        MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("FT_OTA_AUTH - FT_OTA_PeerAuthAckAction() sanity check fail\n"));
    }
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:46,代码来源:ft_auth.c


示例15: FT_OTD_ActParmFill

VOID FT_OTD_ActParmFill(
    IN PRTMP_ADAPTER pAd,
    IN OUT MLME_FT_REQ_STRUCT *FtReq,
    IN PUCHAR pAddr,
    IN NDIS_802_11_AUTHENTICATION_MODE AuthMode,
    IN PFT_MDIE_INFO FtMdieInfo,
    IN PFT_FTIE_INFO FtFtieInfo,
    IN UCHAR VarIeLen,
    IN PUCHAR pVarIe)
{
    RTMPZeroMemory(FtReq, sizeof (MLME_FT_REQ_STRUCT));
    COPY_MAC_ADDR(FtReq->TargetAddr, pAddr);
    if (AuthMode >= Ndis802_11AuthModeWPA)
        FtReq->HaveRSN = 1;
    FtReq->Timeout = FT_ACT_TIMEOUT;
    FT_SET_MDID(FtReq->MdIe.MdId, FtMdieInfo->MdId);
    FtReq->MdIe.FtCapPlc.word = FtMdieInfo->FtCapPlc.word;
    RTMPMoveMemory(&FtReq->SNonce[0], FtFtieInfo->SNonce, 32);
    RTMPMoveMemory(&FtReq->R0khId[0], FtFtieInfo->R0khId,
                   FtFtieInfo->R0khIdLen);
    FtReq->R0khIdLen = FtFtieInfo->R0khIdLen;
    RTMPMoveMemory(&FtReq->VIe[0], pVarIe, VarIeLen);
}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:23,代码来源:ft_action.c


示例16: Cls2errAction

void Cls2errAction(struct rt_rtmp_adapter *pAd, u8 *pAddr)
{
	struct rt_header_802_11 DeauthHdr;
	u8 *pOutBuffer = NULL;
	int NStatus;
	unsigned long FrameLen = 0;
	u16 Reason = REASON_CLS2ERR;

	NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);	/*Get an unused nonpaged memory */
	if (NStatus != NDIS_STATUS_SUCCESS)
		return;

	DBGPRINT(RT_DEBUG_TRACE,
		 ("AUTH - Class 2 error, Send DEAUTH frame...\n"));
	MgtMacHeaderInit(pAd, &DeauthHdr, SUBTYPE_DEAUTH, 0, pAddr,
			 pAd->MlmeAux.Bssid);
	MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof(struct rt_header_802_11),
			  &DeauthHdr, 2, &Reason, END_OF_ARGS);
	MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
	MlmeFreeMemory(pAd, pOutBuffer);

	pAd->StaCfg.DeauthReason = Reason;
	COPY_MAC_ADDR(pAd->StaCfg.DeauthSta, pAddr);
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:24,代码来源:auth.c


示例17: CheckParam

static VOID CheckParam(PNV_INFO pNvInfo)
{
extern BOOL_T CheckAuthCode(VOID);
extern  const UINT8    ZERO_MAC_ADDR[MAC_ADDR_LEN];
#define COPY_MAC_ADDR(Addr1, Addr2)             NST_MOVE_MEM((Addr1), (Addr2), MAC_ADDR_LEN)
#define MAC_ADDR_IS_GROUP(Addr)       (((Addr[0]) & 0x01))
#define TX_GAIN_MAP_TBL_SIZE     0x28//0x26

    UINT32  i = 0;

    // CHECK TX PWR
    for (i=0; i<MAX_TXPOWER_ARRAY_SIZE*MAX_CH_NUM; i++)
        if (*((PUINT8)&pNvInfo->MaxTxPwr[0] + i) > (TX_GAIN_MAP_TBL_SIZE-1))
        {
            *((PUINT8)&pNvInfo->MaxTxPwr[0] + i) = *((PUINT8)&DefaultTxPwrIdxTbl[0] + i);
        }
    if (i != MAX_TXPOWER_ARRAY_SIZE*MAX_CH_NUM)
    {
        DBGPRINT(DEBUG_INFO, "Power of NvInfo is invalid [%d] = 0x%0x \n", i, *((PUINT8)&pNvInfo->MaxTxPwr[0] + i));
        NST_MOVE_MEM(pNvInfo->MaxTxPwr, DefaultTxPwrIdxTbl, sizeof(pNvInfo->MaxTxPwr));
    }

    // CHECK MAC ADDR
    if ((!MAC_ADDR_IS_GROUP(pNvInfo->MacAddr)) && (!NST_EQUAL_MEM(pNvInfo->MacAddr, ZERO_MAC_ADDR, MAC_ADDR_LEN)))
        COPY_MAC_ADDR(PermanentAddress, pNvInfo->MacAddr);

#ifdef CHECK_AUTH_CODE
    if (CheckAuthCode() == NST_FALSE)
    {
        DBGPRINT(DEBUG_TRACE, "Check auth code failed, dead loop\n");
        while (1)
            ;
    }
#endif

}
开发者ID:AgingChan,项目名称:NL6621_StandardSDK,代码行数:36,代码来源:bsp.c


示例18: PeerAssocRspSanity

/* 
    ==========================================================================
    Description:
        MLME message sanity check
    Return:
        TRUE if all parameters are OK, FALSE otherwise
        
    IRQL = DISPATCH_LEVEL

    ==========================================================================
 */
BOOLEAN PeerAssocRspSanity(
	IN PRTMP_ADAPTER pAd,
	IN VOID *pMsg,
	IN ULONG MsgLen,
	OUT PUCHAR pAddr2,
	OUT USHORT *pCapabilityInfo,
	OUT USHORT *pStatus,
	OUT USHORT *pAid,
	OUT UCHAR SupRate[],
	OUT UCHAR *pSupRateLen,
	OUT UCHAR ExtRate[],
	OUT UCHAR *pExtRateLen,
	OUT HT_CAPABILITY_IE *pHtCapability,
	OUT ADD_HT_INFO_IE *pAddHtInfo,	/* AP might use this additional ht info IE */
	OUT UCHAR *pHtCapabilityLen,
	OUT UCHAR *pAddHtInfoLen,
	OUT UCHAR *pNewExtChannelOffset,
	OUT PEDCA_PARM pEdcaParm,
	OUT EXT_CAP_INFO_ELEMENT *pExtCapInfo,
	OUT UCHAR *pCkipFlag)
{
	CHAR IeType, *Ptr;
	PFRAME_802_11 pFrame = (PFRAME_802_11) pMsg;
	PEID_STRUCT pEid;
	ULONG Length = 0;

	*pNewExtChannelOffset = 0xff;
	*pHtCapabilityLen = 0;
	*pAddHtInfoLen = 0;
	COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
	Ptr = (PCHAR) pFrame->Octet;
	Length += LENGTH_802_11;

	NdisMoveMemory(pCapabilityInfo, &pFrame->Octet[0], 2);
	Length += 2;
	NdisMoveMemory(pStatus, &pFrame->Octet[2], 2);
	Length += 2;
	*pCkipFlag = 0;
	*pExtRateLen = 0;
	pEdcaParm->bValid = FALSE;

	if (*pStatus != MLME_SUCCESS)
		return TRUE;

	NdisMoveMemory(pAid, &pFrame->Octet[4], 2);
	Length += 2;

	/* Aid already swaped byte order in RTMPFrameEndianChange() for big endian platform */
	*pAid = (*pAid) & 0x3fff;	/* AID is low 14-bit */

	/* -- get supported rates from payload and advance the pointer */
	IeType = pFrame->Octet[6];
	*pSupRateLen = pFrame->Octet[7];
	if ((IeType != IE_SUPP_RATES)
	    || (*pSupRateLen > MAX_LEN_OF_SUPPORTED_RATES)) {
		DBGPRINT(RT_DEBUG_TRACE,
			 ("PeerAssocRspSanity fail - wrong SupportedRates IE\n"));
		return FALSE;
	} else
		NdisMoveMemory(SupRate, &pFrame->Octet[8], *pSupRateLen);


	Length = Length + 2 + *pSupRateLen;

	/*
	   many AP implement proprietary IEs in non-standard order, we'd better
	   tolerate mis-ordered IEs to get best compatibility
	 */
	pEid = (PEID_STRUCT) & pFrame->Octet[8 + (*pSupRateLen)];

	/* get variable fields from payload and advance the pointer */
	while ((Length + 2 + pEid->Len) <= MsgLen) {
		switch (pEid->Eid) {
		case IE_EXT_SUPP_RATES:
			if (pEid->Len <= MAX_LEN_OF_SUPPORTED_RATES) {
				NdisMoveMemory(ExtRate, pEid->Octet, pEid->Len);
				*pExtRateLen = pEid->Len;
			}
			break;

		case IE_HT_CAP:
		case IE_HT_CAP2:
			if (pEid->Len >= SIZE_HT_CAP_IE) {	/* Note: allow extension.!! */
				NdisMoveMemory(pHtCapability, pEid->Octet,
					       SIZE_HT_CAP_IE);

				*(USHORT *) (&pHtCapability->HtCapInfo) =
				    cpu2le16(*(USHORT *)
					     (&pHtCapability->HtCapInfo));
//.........这里部分代码省略.........
开发者ID:cmusicjohn,项目名称:rt3572sta,代码行数:101,代码来源:sanity.c


示例19: MulticastFilterTableInsertEntry


//.........这里部分代码省略.........
				return FALSE;
			}

			pMemberEntry = pMemberEntry->pNext;
		}
	}

	RTMP_SEM_LOCK(&pMulticastFilterTable->MulticastFilterTabLock);
	do
	{
		ULONG Now;
		/* the multicast entry already exist but doesn't include the member yet. */
		if (pEntry != NULL && pMemberAddr != NULL)
		{
			InsertIgmpMember(pMulticastFilterTable, &pEntry->MemberList, pMemberAddr);
			break;
		}

		/* allocate one MAC entry */
		for (i = 0; i < MAX_LEN_OF_MULTICAST_FILTER_TABLE; i++)
		{
			/* pick up the first available vacancy */
			pEntry = &pMulticastFilterTable->Content[i];
			NdisGetSystemUpTime(&Now);
			if ((pEntry->Valid == TRUE) && (pEntry->type == MCAT_FILTER_DYNAMIC)
				&& ((Now - pEntry->lastTime) > IGMPMAC_TB_ENTRY_AGEOUT_TIME))
			{
				PMULTICAST_FILTER_TABLE_ENTRY pHashEntry;

				HashIdx = MULTICAST_ADDR_HASH_INDEX(pEntry->Addr);
				pHashEntry = pMulticastFilterTable->Hash[HashIdx];

				if ((pEntry->net_dev == pHashEntry->net_dev)
					&& MAC_ADDR_EQUAL(pEntry->Addr, pHashEntry->Addr))
				{
					pMulticastFilterTable->Hash[HashIdx] = pHashEntry->pNext;
					pMulticastFilterTable->Size --;
					DBGPRINT(RT_DEBUG_TRACE, ("MCastFilterTableDeleteEntry 1 - Total= %d\n", pMulticastFilterTable->Size));
				} else
				{
					while (pHashEntry->pNext)
					{
						pPrevEntry = pHashEntry;
						pHashEntry = pHashEntry->pNext;
						if ((pEntry->net_dev == pHashEntry->net_dev)
							&& MAC_ADDR_EQUAL(pEntry->Addr, pHashEntry->Addr))
						{
							pPrevEntry->pNext = pHashEntry->pNext;
							pMulticastFilterTable->Size --;
							DBGPRINT(RT_DEBUG_TRACE, ("MCastFilterTableDeleteEntry 2 - Total= %d\n", pMulticastFilterTable->Size));
							break;
						}
					}
				}
				pEntry->Valid = FALSE;
				DeleteIgmpMemberList(pMulticastFilterTable, &pEntry->MemberList);
			}

			if (pEntry->Valid == FALSE)
			{
				NdisZeroMemory(pEntry, sizeof(MULTICAST_FILTER_TABLE_ENTRY));
				pEntry->Valid = TRUE;

				COPY_MAC_ADDR(pEntry->Addr, pGrpId);
				pEntry->net_dev = dev;
				NdisGetSystemUpTime(&Now);
				pEntry->lastTime = Now;
				pEntry->type = type;
				initList(&pEntry->MemberList);
				if (pMemberAddr != NULL)
					InsertIgmpMember(pMulticastFilterTable, &pEntry->MemberList, pMemberAddr);

				pMulticastFilterTable->Size ++;

				DBGPRINT(RT_DEBUG_TRACE, ("MulticastFilterTableInsertEntry -IF(%s) allocate entry #%d, Total= %d\n", RTMP_OS_NETDEV_GET_DEVNAME(dev), i, pMulticastFilterTable->Size));
				break;
			}
		}

		/* add this MAC entry into HASH table */
		if (pEntry)
		{
			HashIdx = MULTICAST_ADDR_HASH_INDEX(pGrpId);
			if (pMulticastFilterTable->Hash[HashIdx] == NULL)
			{
				pMulticastFilterTable->Hash[HashIdx] = pEntry;
			} else
			{
				pCurrEntry = pMulticastFilterTable->Hash[HashIdx];
				while (pCurrEntry->pNext != NULL)
					pCurrEntry = pCurrEntry->pNext;
				pCurrEntry->pNext = pEntry;
			}
		}
	}while(FALSE);

	RTMP_SEM_UNLOCK(&pMulticastFilterTable->MulticastFilterTabLock);

	return TRUE;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:101,代码来源:igmp_snoop.c


示例20: Set_IgmpSn_DelEntry_Proc

int Set_IgmpSn_DelEntry_Proc(
	IN PRTMP_ADAPTER pAd, 
	IN PSTRING arg)
{
	int i, memberCnt = 0;
	BOOLEAN bGroupId = 1;
	PSTRING value;
	PSTRING thisChar;
	UCHAR IpAddr[4];
	UCHAR Addr[ETH_LENGTH_OF_ADDRESS];
	UCHAR GroupId[ETH_LENGTH_OF_ADDRESS];
	PUCHAR *pAddr = (PUCHAR *)&Addr;
	PNET_DEV pDev;
	POS_COOKIE pObj;
	UCHAR ifIndex;

	pObj = (POS_COOKIE) pAd->OS_Cookie;
	ifIndex = pObj->ioctl_if;

	pDev = (ifIndex == MAIN_MBSSID) ? (pAd->net_dev) : (pAd->ApCfg.MBSSID[ifIndex].MSSIDDev);

	while ((thisChar = strsep((char **)&arg, "-")) != NULL)
	{
		/* refuse the Member if it's not a MAC address. */
		if((bGroupId == 0) && (strlen(thisChar) != 17))
			continue;

		if(strlen(thisChar) == 17)  /*Mac address acceptable format 01:02:03:04:05:06 length 17 */
		{
			for (i=0, value = rstrtok(thisChar,":"); value; value = rstrtok(NULL,":")) 
			{
				if((strlen(value) != 2) || (!isxdigit(*value)) || (!isxdigit(*(value+1))) ) 
					return FALSE;  /*Invalid */

				AtoH(value, &Addr[i++], 1);
			}

			if(i != 6)
				return FALSE;  /*Invalid */
		}
		else
		{
			for (i=0, value = rstrtok(thisChar,"."); value; value = rstrtok(NULL,".")) 
			{
				if((strlen(value) > 0) && (strlen(value) <= 3)) 
				{
					int ii;
					for(ii=0; ii<strlen(value); ii++)
						if (!isxdigit(*(value + ii)))
							return FALSE;
				}
				else
					return FALSE;  /*Invalid */

				IpAddr[i] = (UCHAR)simple_strtol(value, NULL, 10);
				i++;
			}

			if(i != 4)
				return FALSE;  /*Invalid */

			ConvertMulticastIP2MAC(IpAddr, (PUCHAR *)&pAddr, ETH_P_IP);
		}

		if(bGroupId == 1)
			COPY_MAC_ADDR(GroupId, Addr);
		else
			memberCnt++;

		if (memberCnt > 0 )
			MulticastFilterTableDeleteEntry(pAd, (PUCHAR)GroupId, Addr, pDev);

		bGroupId = 0;
	}

	if(memberCnt == 0)
		MulticastFilterTableDeleteEntry(pAd, (PUCHAR)GroupId, NULL, pDev);

	DBGPRINT(RT_DEBUG_TRACE, ("%s (%2X:%2X:%2X:%2X:%2X:%2X)\n",
		__FUNCTION__, Addr[0], Addr[1], Addr[2], Addr[3], Addr[4], Addr[5]));

	return TRUE;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:83,代码来源:igmp_snoop.c



注:本文中的COPY_MAC_ADDR函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ COPY_TO_USER_STRING函数代码示例发布时间:2022-05-30
下一篇:
C++ COPY_4V函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap