Пример #1
0
Baseline *  Array::GetBaseline(int sta1, int sta2)
{
    // First enforce sta1 < sta2
    Sort(sta1, sta2);

    string sta1name = GetStation(sta1)->GetName();
    string sta2name = GetStation(sta2)->GetName();
    
    return GetBaseline(sta1name + "-" + sta2name);
}
Пример #2
0
Triplet *   Array::GetTriplet(int sta1, int sta2, int sta3)
{
    // Enforce sta1 < sta2 < sta3
    Sort(sta1, sta2, sta3);

    string sta1name = GetStation(sta1)->GetName();
    string sta2name = GetStation(sta2)->GetName();
    string sta3name = GetStation(sta3)->GetName();
    
    return GetTriplet(sta1name + '-' + sta2name + '-' + sta3name);
}
Пример #3
0
Quadruplet *   Array::GetQuadruplet(int sta1, int sta2, int sta3, int sta4)
{
    // Enforce sta1 < sta2 < sta3 < sta4
    Sort(sta1, sta2, sta3, sta4);

    string sta1name = GetStation(sta1)->GetName();
    string sta2name = GetStation(sta2)->GetName();
    string sta3name = GetStation(sta3)->GetName();
    string sta4name = GetStation(sta4)->GetName();
    
    return GetQuadruplet(sta1name + '-' + sta2name + '-' + sta3name +  '-' + sta4name);
}
Пример #4
0
void
CAR6KMini::car6k_sendEapolKeyMsg (A_UINT8 descType,
                            A_BOOL secure, A_BOOL mic, A_BOOL ack, A_BOOL tx,
                            A_UINT32 index, A_UINT8 isPW,
                            A_BOOL doEncrypt,
                            A_UINT64 keyRSC,
                            const A_UINT8 nonce[],
                            const A_UINT32 keyLength,
                            A_UINT32 keyDataLen,
                            const A_UINT8 *keyData,
                            const A_UINT32 keyBufferLength,
                            A_UINT8  *bssid)
{
    STATION *station;
    station = GetStation(bssid,0);
    NDIS_STATUS Status;
    PNDIS_PACKET pPacket;
    PNDIS_BUFFER pBuffer;
    A_UINT32 *magic;
    A_UINT16 length;

    memset (m_wpa_buffer, 0 , sizeof (m_wpa_buffer));
    crypto_sendEapolKeyMsg ( descType,secure, mic, ack,  tx,
                             index, isPW,doEncrypt,keyRSC,
                             nonce,keyLength,keyDataLen,
                             keyData, keyBufferLength,
                             bssid,m_CurrentAddress,m_keyCounter,&replayCtr,
                             station,m_wpa_buffer,&length);

    NdisAllocatePacket (&Status, &pPacket, m_TxPacketPool);
    magic = (UINT32 *) pPacket->ProtocolReserved;
    if (NDIS_STATUS_SUCCESS != Status)
    {
        NDIS_DEBUG_PRINTF (ATH_LOG_ERR, "AR6K: ERROR - NdisAllocatePacket failed\n");
        return;
    }

    NdisAllocateBuffer (&Status, &pBuffer, m_TxBufferPool, m_wpa_buffer, length);

    if (NDIS_STATUS_SUCCESS != Status)
    {
        NdisFreePacket (pPacket);
        NDIS_DEBUG_PRINTF (ATH_LOG_ERR, "AR6K: ERROR - NdisAllocateBuffer failed\n");
        return;
    }

    pBuffer->Next = NULL;
    NdisChainBufferAtFront (pPacket,pBuffer);
    *(magic) = TAG_WPA_SEND_PCK;
    SendPackets (&pPacket,1);
    return;
}
Пример #5
0
void CJqBoard::Init()
{
	
	for(int i=0;i<MAX_I;i++)
		for(int j=0;j<MAX_J;j++)
	        mBoard[i][j]=JQ_TYPE_NONE;

	m_bFinishBuzhen=false;
	m_iJingQiI=m_iJingQiJ=m_iStartI =m_iStartJ= m_iEndI = m_iEndJ = -1;
	
	m_bShowStartChess = true;
	m_bICanMove=false;
	m_iNowOutPeople=-1;
	m_viewstation = 2;
	m_startqi=m_endqi=JQ_TYPE_NONE;
	m_station=GetStation(m_viewstation);

	 m_MyColor= GetColorFromStation(m_station);
	 if(m_MyColor< 0)return;

	 mBoard[11][6]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_YZ);
	 mBoard[11][7]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_GB);
	 mBoard[11][8]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_JZ);
	 mBoard[11][9]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_GB);
	 mBoard[11][10]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_YZ);

	 mBoard[12][6]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_PZ);
	 mBoard[12][8]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_LIANZ);
	 mBoard[12][10]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_PZ);

	 mBoard[13][6]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_SZ);
	 mBoard[13][7]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_ZD);
	 mBoard[13][9]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_ZD);
	 mBoard[13][10]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_SZ);

	 mBoard[14][6]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_TZ);
	 mBoard[14][8]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_LIANZ);
	 mBoard[14][10]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_TZ);

	 mBoard[15][6]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_LIZ);
	 mBoard[15][7]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_SL);
	 mBoard[15][8]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_GB);
	 mBoard[15][9]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_LIZ);
	 mBoard[15][10]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_DL);

	 mBoard[16][6]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_DL);
	 mBoard[16][7]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_JQ);
	 mBoard[16][8]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_DL);
	 mBoard[16][9]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_PZ);
	 mBoard[16][10]=MAKE_A_JQ(m_MyColor,JQ_TYPE_NAME_LIANZ);
}
Пример #6
0
void
CAR6KMini::car6k_rekeying_Sending_Group_Msg_1_of_2 ()
{
    A_UINT8 i;
    A_STATUS wmiStatus;

    m_current_grp_index = (m_current_grp_index == GROUPKEY_IDX_A)? GROUPKEY_IDX_B : GROUPKEY_IDX_A;
    car6k_GMKGenerate (m_CurrentAddress);
    car6k_GNonceCalc (m_CurrentAddress);
    car6k_GTKCalc (m_crypt_type,m_CurrentAddress,m_current_grp_index);

    if(m_AP_conn_sta != 0)
    {
        wmiStatus = wmi_addKey_cmd  ((wmi_t *)m_pWMI,
                                     m_current_grp_index,
                                     (CRYPTO_TYPE)m_apCmd.groupCryptoType,
                                     GROUP_USAGE,
                                     m_key_size,
                                     (UINT8 *)&replayCtr,
                                     &GTK[m_current_grp_index - 1][0],KEY_OP_INIT_VAL,NULL,
                                     SYNC_BOTH_WMIFLAG);
         if (wmiStatus != A_OK)
         {
             printf("AR6K: ERROR - wmi_addKey_cmd failed = %u\n", wmiStatus);

         }

        for(i = 0; i < AP_MAX_NUM_STA; i++)
        {
            STATION *station;
            station = GetStation (m_staList[i].mac, 0);
            if (station == NULL)
            {
                continue ;
            }
            if (IS_MAC_NULL (station->mac))
            {
                continue ;
            }
            car6k_Sending_Group_Msg_1_of_2 (station, m_crypt_type);
        }
    }
 }
Пример #7
0
		m_pComponentCount->InitializeNew();
	}

	m_pComponentCount->SetValue(CountSubrecords(SR_NAME_CNTO));
}


/*===========================================================================
 *
 * Begin CSrCobjRecord Get Field Methods
 *
 *=========================================================================*/
DEFINE_SRGETFIELD(CSrCobjRecord::GetFieldComponentCount,	String.Format("%u", GetComponentCount()))
DEFINE_SRGETFIELD(CSrCobjRecord::GetFieldResultCount,		String.Format("%u",(dword)GetResultCount()))
DEFINE_SRGETFIELD(CSrCobjRecord::GetFieldResultItem,		String = GetResultItem())
DEFINE_SRGETFIELD(CSrCobjRecord::GetFieldStation,			String = GetStation())
/*===========================================================================
 *		End of CSrCobjRecord Get Field Methods
 *=========================================================================*/


/*===========================================================================
 *
 * Begin CSrCobjRecord Compare Field Methods
 *
 *=========================================================================*/
DEFINE_SRCOMPFIELDDWORD(CSrCobjRecord,  CompareFieldComponentCount,		GetComponentCount)
DEFINE_SRCOMPFIELDDWORD(CSrCobjRecord,  CompareFieldResultCount,		GetResultCount)
DEFINE_SRCOMPFIELDSTRING(CSrCobjRecord, CompareFieldResultItem,			GetResultItem)
DEFINE_SRCOMPFIELDSTRING(CSrCobjRecord, CompareFieldStation,			GetStation)
/*===========================================================================