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

C++ AnscFreeMemory函数代码示例

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

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



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

示例1: AnscFreeMemory

ANSC_STATUS
HttpSmpoRemove
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PHTTP_SIMPLE_MSG_PARSER         pMyObject    = (PHTTP_SIMPLE_MSG_PARSER)hThisObject;

    if (pMyObject->hHfpIf)
    {
        PHTTP_HFP_INTERFACE         pHfpIf;

        pHfpIf = (PHTTP_HFP_INTERFACE)(pMyObject->hHfpIf);
        AnscFreeMemory(pHfpIf);
    }

    pMyObject->RemoveXTable((ANSC_HANDLE)pMyObject);

    AnscCoRemove((ANSC_HANDLE)pMyObject);

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:23,代码来源:http_smpo_base.c


示例2: AnscFreeMemory

ANSC_STATUS
SysIroV2Remove
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PSYS_IROV2_OBJECT               pMyObject    = (PSYS_IROV2_OBJECT            )hThisObject;
    PSYS_IRA_INTERFACE              pIraIf       = (PSYS_IRA_INTERFACE           )pMyObject->hIraIf;

    pMyObject->Cancel((ANSC_HANDLE)pMyObject);
    pMyObject->Reset ((ANSC_HANDLE)pMyObject);

    if ( pIraIf )
    {
        AnscFreeMemory(pIraIf);
    }

    AnscFreeLock     (&pMyObject->AccessLock     );
    AnscCoRemove     ((ANSC_HANDLE)pMyObject     );

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:23,代码来源:sys_irov2_base.c


示例3: AnscAsn1FreeOid

void
AnscAsn1FreeOidArray
    (
        ANSC_ASN1_OID**             asn1_oid_array,
        ULONG                       array_size
    )
{
    ULONG                           i = 0;

    for ( i = 0; i < array_size; i++ )
    {
        if ( asn1_oid_array[i] )
        {
            AnscAsn1FreeOid(asn1_oid_array[i]);

            asn1_oid_array[i] = NULL;
        }
    }

    AnscFreeMemory(asn1_oid_array);

    return;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:23,代码来源:ansc_asn1.c


示例4: AnscSizeOfString

BOOL
DslhVarroIsValidBase64String
    (
        PCHAR                       pString
    )
{
    ULONG                           length   = 0;
    PUCHAR                          pNewBuf  = NULL;

    if( pString == NULL)
    {
        return TRUE; /* empty string is fine */
    }

    length = AnscSizeOfString(pString);

    if( length == 0)
    {
        return TRUE; /* empty string is fine */
    }

    pNewBuf =
        AnscBase64Decode
            (
                (PCHAR)pString,
                &length
            );

    if( pNewBuf == NULL)
    {
        return FALSE;
    }

    AnscFreeMemory(pNewBuf);

    return TRUE;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:37,代码来源:dslh_varro_utility.c


示例5: DslhCwmpFreeParamDescr

ANSC_STATUS
DslhVareoReset
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PDSLH_VAR_ENTITY_OBJECT         pMyObject    = (PDSLH_VAR_ENTITY_OBJECT)hThisObject;
    PDSLH_VAREO_TOKEN_VALUE         pTokenValue  = (PDSLH_VAREO_TOKEN_VALUE)NULL;
    PSINGLE_LINK_ENTRY              pSLinkEntry  = (PSINGLE_LINK_ENTRY     )NULL;
    ULONG                           i            = 0;

    if ( pMyObject->ParamDescr )
    {
    	DslhCwmpFreeParamDescr(pMyObject->ParamDescr);
    	pMyObject->ParamDescr = NULL;
    }

    if ( pMyObject->TokenTable )
    {
        pSLinkEntry = AnscQueuePopEntry(pMyObject->TokenTable);

        while ( pSLinkEntry )
        {
            pTokenValue = ACCESS_DSLH_VAREO_TOKEN_VALUE(pSLinkEntry);
            pSLinkEntry = AnscQueuePopEntry(pMyObject->TokenTable);

            DslhVareoFreeTokenValue(pTokenValue);
        }

        AnscFreeMemory(pMyObject->TokenTable);

        pMyObject->TokenTable = NULL;
    }

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:37,代码来源:dslh_vareo_states.c


示例6: AnscFreeMemory

ANSC_STATUS
AnscAsn1PKCS10BeforeDecodingChild
    (
        ANSC_HANDLE                 hThisObject,
        int                         index,
        PVOID*                      ppEncoding
    )
{
    PANSC_ASN1_CERTIFICATEREQUEST   pThisObject  = (PANSC_ASN1_CERTIFICATEREQUEST)hThisObject;

    if( pThisObject != NULL && index == 0)
    {
        /* free the signed data part */
        if( pThisObject->pSignedData != NULL && pThisObject->uSignedLength > 0)
        {
            AnscFreeMemory(pThisObject->pSignedData);
        }

        pThisObject->pSignedData    = *ppEncoding;
        pThisObject->uSignedLength  = 0;
    }

    return ANSC_STATUS_SUCCESS;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:24,代码来源:ansc_asn1_certificaterequest.c


示例7: AnscFreeMemory

ANSC_STATUS
AnscScuoShutdown
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PANSC_SIMPLE_CLIENT_UDP_OBJECT  pMyObject    = (PANSC_SIMPLE_CLIENT_UDP_OBJECT)hThisObject;
    PANSC_SCUO_WORKER_OBJECT        pWorker      = (PANSC_SCUO_WORKER_OBJECT      )pMyObject->hWorker;

    pMyObject->Reset((ANSC_HANDLE)pMyObject);

    if ( pWorker )
    {
        AnscFreeMemory(pWorker);

        pMyObject->hWorker = (ANSC_HANDLE)NULL;
    }

    AnscFreeLock      (&pMyObject->OpLock    );
    AnscCoVer3Shutdown((ANSC_HANDLE)pMyObject);

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:24,代码来源:ansc_scuo_base.c


示例8: AnscFreeMemory

ANSC_STATUS
AnscLpccoImcSetPartyName
    (
        ANSC_HANDLE                 hThisObject,
        char*                       party_name
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PANSC_LPC_CONNECTOR_OBJECT      pMyObject    = (PANSC_LPC_CONNECTOR_OBJECT)hThisObject;

    if ( pMyObject->PartyName )
    {
        AnscFreeMemory(pMyObject->PartyName);

        pMyObject->PartyName = NULL;
    }

    if ( party_name )
    {
        pMyObject->PartyName = AnscCloneString(party_name);
    }

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:24,代码来源:ansc_lpcco_imcif.c


示例9: AnscFreeMemory

ANSC_STATUS
BwrmCpoSetPagePath
    (
        ANSC_HANDLE                 hThisObject,
        char*                       page_path
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PBWRM_COOKED_PAGE_OBJECT        pMyObject    = (PBWRM_COOKED_PAGE_OBJECT)hThisObject;

    if ( pMyObject->PagePath )
    {
        AnscFreeMemory(pMyObject->PagePath);

        pMyObject->PagePath = NULL;
    }

    if ( page_path )
    {
        pMyObject->PagePath = AnscCloneString(page_path);
    }

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:24,代码来源:bwrm_cpo_states.c


示例10: AnscFreeMemory

ANSC_STATUS
SlapOwoSetLpcPartyName
    (
        ANSC_HANDLE                 hThisObject,
        char*                       party_name
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PSLAP_OBJ_WRAPPER_OBJECT        pMyObject    = (PSLAP_OBJ_WRAPPER_OBJECT)hThisObject;

    if ( pMyObject->LpcPartyName )
    {
        AnscFreeMemory(pMyObject->LpcPartyName);

        pMyObject->LpcPartyName = NULL;
    }

    if ( party_name )
    {
        pMyObject->LpcPartyName = AnscCloneString(party_name);
    }

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:24,代码来源:slap_owo_states.c


示例11: _ansc_sprintf

ANSC_STATUS
ssp_cancel_wifi
    (
        PCCSP_COMPONENT_CFG         pStartCfg
    )
{
	int                             nRet  = 0;
    char                            CrName[256];
    char                            CpName[256];

    if( pDslhCpeController == NULL)
    {
        return ANSC_STATUS_SUCCESS;
    }

    if ( g_Subsystem[0] != 0 )
    {
        _ansc_sprintf(CrName, "%s%s", g_Subsystem, CCSP_DBUS_INTERFACE_CR);
        _ansc_sprintf(CpName, "%s%s", g_Subsystem, pStartCfg->ComponentName);
    }
    else
    {
        _ansc_sprintf(CrName, "%s", CCSP_DBUS_INTERFACE_CR);
        _ansc_sprintf(CpName, "%s", pStartCfg->ComponentName);
    }
    /* unregister component */
    nRet = CcspBaseIf_unregisterComponent(bus_handle, CrName, CpName );  
    AnscTrace("unregisterComponent returns %d\n", nRet);


    pDslhCpeController->Cancel((ANSC_HANDLE)pDslhCpeController);
    AnscFreeMemory(pDslhCpeController);
    pDslhCpeController = NULL;

    return ANSC_STATUS_SUCCESS;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspWifiAgent,代码行数:36,代码来源:ssp_action.c


示例12: CcspTraceWarning

ANSC_STATUS
CosaNatRegGetNatInfo
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus      = ANSC_STATUS_SUCCESS;
    PCOSA_DATAMODEL_NAT             pMyObject         = ( PCOSA_DATAMODEL_NAT )hThisObject;

    PPOAM_IREP_FOLDER_OBJECT        pPoamIrepFoNat      = (PPOAM_IREP_FOLDER_OBJECT )pMyObject->hIrepFolderNat;
    PPOAM_IREP_FOLDER_OBJECT        pPoamIrepFoNatPt    = (PPOAM_IREP_FOLDER_OBJECT )pMyObject->hIrepFolderNatPt;
    PPOAM_IREP_FOLDER_OBJECT        pPoamIrepFoEnumNat  = (PPOAM_IREP_FOLDER_OBJECT )NULL;
    PCOSA_CONTEXT_PMAPPING_LINK_OBJECT     pCosaNatContext   = NULL;
    PCOSA_CONTEXT_LINK_OBJECT       pCosaNatPtContext   = NULL;
    PCOSA_DML_NAT_PMAPPING          pCosaNat          = NULL;
    PCOSA_DML_NAT_PTRIGGER          pCosaNatPt        = NULL;
    PSLAP_VARIABLE                  pSlapVariable     = NULL;
    ULONG                           ulEntryCount      = 0;
    ULONG                           ulIndex           = 0;
    ULONG                           uInstanceNumber   = 0;
    BOOL                            bNew              = FALSE;
    char*                           pAliasNat         = NULL;
    char*                           pFolderName       = NULL;

    CcspTraceWarning(("!!!!!! In CosaNatRegGetNatInfo !!!!!!\n"));

    if ( !pPoamIrepFoNat || !pPoamIrepFoNatPt )
    {
        CcspTraceWarning(("!!!!!! pPoamIrepFoNat: %p, pPoamIrepFoNatPt: %p !!!!!!\n", pPoamIrepFoNat, pPoamIrepFoNatPt));
        return ANSC_STATUS_FAILURE;
    }

    /* This is saved structure for nat
        *****************************************
              <Nat>
                  <1>
                       <alias>xxx</>
                       <bNew>false</>
                 </1>
                 <2>
                      <alias>xxx</>
                      <bNew>false</>
                 </2>
            </Nat>
      ****************************************************
      */

    /* enumerate Portmapping.{i} */
    ulEntryCount = pPoamIrepFoNat->GetFolderCount((ANSC_HANDLE)pPoamIrepFoNat);
    for ( ulIndex = 0; ulIndex < ulEntryCount; ulIndex++ )
    {
        /* Get i in Portmapping.{i} */
        pFolderName =
            pPoamIrepFoNat->EnumFolder
                (
                    (ANSC_HANDLE)pPoamIrepFoNat,
                    ulIndex
                );

        if ( !pFolderName )
        {
            continue;
        }

        uInstanceNumber = _ansc_atol(pFolderName);

        if ( uInstanceNumber == 0 )
        {
            AnscFreeMemory(pFolderName);
            continue;
        }

        pPoamIrepFoEnumNat = pPoamIrepFoNat->GetFolder((ANSC_HANDLE)pPoamIrepFoNat, pFolderName);

        AnscFreeMemory(pFolderName);

        if ( !pPoamIrepFoEnumNat )
        {
            continue;
        }

        /* Get PortMapping.{i}.Alias value*/
        if ( TRUE )
        {
            pSlapVariable =
                (PSLAP_VARIABLE)pPoamIrepFoEnumNat->GetRecord
                    (
                        (ANSC_HANDLE)pPoamIrepFoEnumNat,
                        COSA_DML_RR_NAME_NATAlias,
                        NULL
                    );

            if ( pSlapVariable )
            {
                pAliasNat = AnscCloneString(pSlapVariable->Variant.varString);

                SlapFreeVariable(pSlapVariable);
            }
        }

//.........这里部分代码省略.........
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:101,代码来源:cosa_nat_internal.c


示例13: AnscFreeMemory

ANSC_STATUS
StunScoRetryTimerInvoke
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus      = ANSC_STATUS_SUCCESS;
    PSTUN_SIMPLE_CLIENT_OBJECT      pMyObject         = (PSTUN_SIMPLE_CLIENT_OBJECT    )hThisObject;
    PSTUN_SIMPLE_CLIENT_PROPERTY    pProperty         = (PSTUN_SIMPLE_CLIENT_PROPERTY  )&pMyObject->Property;
    PANSC_TIMER_DESCRIPTOR_OBJECT   pRetryTimerObj    = (PANSC_TIMER_DESCRIPTOR_OBJECT )pMyObject->hRetryTimerObj;
    PANSC_SIMPLE_CLIENT_UDP_OBJECT  pSimpleClientUdp1 = (PANSC_SIMPLE_CLIENT_UDP_OBJECT)pMyObject->hSimpleClientUdp1;
    PSTUN_BSM_INTERFACE             pStunBsmIf        = (PSTUN_BSM_INTERFACE           )pMyObject->hStunBsmIf;

    /*
     * Reliability is accomplished through client retransmissions. Clients SHOULD retransmit the
     * request starting with an interval of 100ms, doubling every retransmit until the interval
     * reaches 1.6s. Retransmissions continue with intervals of 1.6s until a response is received,
     * or a total of 9 requests have been sent. If no response is received by 1.6 seconds after the
     * last request has been sent, the client SHOULD consider the transaction to have failed. In
     * other words, requests would be sent at times 0ms, 100ms, 300ms, 700ms, 1500ms, 3100ms,
     * 4700ms, 6300ms, and 7900ms. At 9500ms, the client considers the transaction to have failed
     * if no response has been received.
     */
    if ( pMyObject->SocketState1 == STUN_SCO_SOCKET_STATE_Requesting )
    {
        if ( pMyObject->RetransTime1 >= STUN_MIN_RETRANSMISSION_TIMES )
        {
            pMyObject->ClientState      = STUN_SCO_CLIENT_STATE_Idle;
            pMyObject->SocketState1     = STUN_SCO_SOCKET_STATE_Idle;
            pMyObject->RetransInterval1 = STUN_MIN_RETRANSMISSION_INTERVAL;
            pMyObject->RetransTime1     = 0;
            pMyObject->bMsgIntegrity1   = FALSE;

            if ( pMyObject->LastSendMsg1 )
            {
                AnscFreeMemory(pMyObject->LastSendMsg1);

                pMyObject->LastSendMsg1 = NULL;
                pMyObject->LastMsgSize1 = 0;
            }

            if ( pStunBsmIf )
            {
                returnStatus =
                    pStunBsmIf->Notify
                        (
                            pStunBsmIf->hOwnerContext,
                            STUN_BSM_EVENT_serverUnreachable,
                            (ANSC_HANDLE)NULL
                        );
            }

            return  ANSC_STATUS_SUCCESS;
        }

        if ( pMyObject->LastSendMsg1 )
        {
            pMyObject->RetransInterval1 = AnscGetMin2(pMyObject->RetransInterval1 * 2, STUN_MAX_RETRANSMISSION_INTERVAL);
            pMyObject->RetransTime1    += 1;
            returnStatus                =
                pSimpleClientUdp1->Send2
                    (
                        (ANSC_HANDLE)pSimpleClientUdp1,
                        pProperty->ServerAddr.Value,
                        pProperty->ServerPort,
                        pMyObject->LastSendMsg1,
                        pMyObject->LastMsgSize1,
                        (ANSC_HANDLE)NULL
                    );

            pRetryTimerObj->SetInterval((ANSC_HANDLE)pRetryTimerObj, pMyObject->RetransInterval1);
            pRetryTimerObj->Start      ((ANSC_HANDLE)pRetryTimerObj);
        }
    }

    return  returnStatus;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:77,代码来源:stun_sco_operation.c


示例14: CosaDmlDdnsInit


//.........这里部分代码省略.........
    /* Initialize middle layer */

    ulServiceCount = CosaDmlDdnsGetNumberOfServices(NULL);

    for ( ulIndex = 0; ulIndex < ulServiceCount; ulIndex++ )
    {
        pDdnsService = (PCOSA_DML_DDNS_SERVICE)AnscAllocateMemory(sizeof(COSA_DML_DDNS_SERVICE));

        if ( !pDdnsService )
        {
            returnStatus = ANSC_STATUS_RESOURCES;

            goto EXIT1;
        }

        returnStatus = CosaDmlDdnsGetService(NULL, ulIndex, pDdnsService);

        if ( returnStatus == ANSC_STATUS_SUCCESS )
        {
            pCosaContext = (PCOSA_CONTEXT_LINK_OBJECT)AnscAllocateMemory(sizeof(COSA_CONTEXT_LINK_OBJECT));

            if ( !pCosaContext )
            {
                returnStatus = ANSC_STATUS_RESOURCES;

                goto EXIT2;
            }

            if ( pDdnsService->InstanceNumber != 0 )
            {
                pCosaContext->InstanceNumber = pDdnsService->InstanceNumber;

                if ( pMyObject->ulNextInstance <= pDdnsService->InstanceNumber )
                {
                    pMyObject->ulNextInstance = pDdnsService->InstanceNumber + 1;

                    if ( pMyObject->ulNextInstance == 0 )
                    {
                        pMyObject->ulNextInstance = 1;
                    }
                }  
            }
            else
            {
                pDdnsService->InstanceNumber = pCosaContext->InstanceNumber = pMyObject->ulNextInstance;

                pMyObject->ulNextInstance++;

                if ( pMyObject->ulNextInstance == 0 )
                {
                    pMyObject->ulNextInstance = 1;
                }

                /* Generate Alias */
                _ansc_sprintf(pDdnsService->Alias, "DdnsService%d", pCosaContext->InstanceNumber);

                returnStatus = 
                    CosaDmlDdnsServiceSetValues
                        (
                            NULL, 
                            ulIndex, 
                            pCosaContext->InstanceNumber, 
                            pDdnsService->Alias
                        );

                if ( returnStatus != ANSC_STATUS_SUCCESS )
                {
                    CcspTraceWarning(("!!! CosaDmlDdnsServiceSetValues index: %d-- fail !!!\n", ulIndex));
                    
                    AnscFreeMemory(pDdnsService);
                    AnscFreeMemory(pCosaContext);

                    continue;
                }
            }

            pCosaContext->hContext     = (ANSC_HANDLE)pDdnsService;
            pCosaContext->hParentTable = NULL;
            pCosaContext->bNew         = FALSE;

            CosaSListPushEntryByInsNum(pListHead, pCosaContext);
        }
    }

    /* Load the newly added but not yet committed entries, if exist */

    CosaDdnsRegGetDdnsInfo((ANSC_HANDLE)pMyObject);

    goto EXIT1;

EXIT2:

    AnscFreeMemory(pDdnsService);

EXIT1:

    AnscFreeMemory(pDdnsCfg);

    return returnStatus;
}
开发者ID:davekimble,项目名称:CcspPandM,代码行数:101,代码来源:cosa_x_cisco_com_ddns_internal.c


示例15: while

BOOL
DslhVarroIsValidMaskString
    (
        PCHAR                           pStringValue
    )
{
    PANSC_TOKEN_CHAIN                   pAddrListTokenChain = (PANSC_TOKEN_CHAIN         )NULL;
    PANSC_STRING_TOKEN                  pAddrStringToken    = (PANSC_STRING_TOKEN        )NULL;
    ULONG                               ulMaskValue         = 0;
    ULONG                               i                   = 0;
    BOOL                                bIsValid            = FALSE;

    if ( !pStringValue || (AnscSizeOfString(pStringValue) == 0) )
    {
        return TRUE;
    }

    if ( pAddrListTokenChain = AnscTcAllocate(pStringValue, ".") )
    {
        if (pAddrListTokenChain->TokensQueue.Depth != 0x4)
        {
            goto EXIT;
        }

        while ( pAddrStringToken = AnscTcUnlinkToken(pAddrListTokenChain) )
        {
            ulMaskValue = (ulMaskValue<<0x8) + AnscGetStringUlong(pAddrStringToken->Name);

            AnscFreeMemory(pAddrStringToken);
        }

        if ( ! ulMaskValue )
        {
            bIsValid = TRUE;
            goto EXIT;
        }

        for ( i = 0; !(ulMaskValue & 0x1); i++)
        {
            ulMaskValue >>= 0x1;
        }

        /* Subnet mask shorter than 8 bits is rejected */
        if ( i > 24)
        {
            goto EXIT;
        }

        else if ( (!i && !(~(0x0 ^ ulMaskValue)))           /* 255.255.255.255 */
                  ||
                  ! (~( ( (~0x0<<(32-i))) ^ ulMaskValue ))  /* Other subnet masks */
                )
        {
            bIsValid = TRUE;
            goto EXIT;
        }
    }

EXIT:

    if ( pAddrListTokenChain )
    {
        AnscTcFree((ANSC_HANDLE)pAddrListTokenChain);
    }

    return bIsValid;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:67,代码来源:dslh_varro_utility.c


示例16: CosaDmlUserGetNumberOfEntries

ANSC_STATUS
CosaUsersBackendGetUserInfo
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus      = ANSC_STATUS_SUCCESS;    
    PCOSA_DATAMODEL_USERS           pMyObject         = (PCOSA_DATAMODEL_USERS)hThisObject;
    PCOSA_DML_USER                  pCosaUser         = NULL;
    ULONG                           clientCount       = 0;
    ULONG                           count             = 0;
    ULONG                           ulIndex           = 0;

    PCOSA_CONTEXT_LINK_OBJECT       pUserCxtLink      = NULL;    
    PCOSA_CONTEXT_LINK_OBJECT       pUserCxtLink2     = NULL;    
    PCOSA_CONTEXT_LINK_OBJECT       pCxtLink          = NULL;
    BOOL                            bNeedSave         = FALSE;

    /* Get Users.user.{i} */
    clientCount = CosaDmlUserGetNumberOfEntries(NULL);
    for ( ulIndex = 0; ulIndex < clientCount; ulIndex++ )
    {
        pCosaUser  = (PCOSA_DML_USER)AnscAllocateMemory( sizeof(COSA_DML_USER) );
        if ( !pCosaUser )
        {
            break;
        }

        USERS_USER_SET_DEFAULTVALUE(pCosaUser);
        pCosaUser->NumOfFailedAttempts=0;     
        returnStatus = CosaDmlUserGetEntry(NULL, ulIndex, pCosaUser);
        if ( returnStatus != ANSC_STATUS_SUCCESS )
        {
            AnscFreeMemory(pCosaUser);
            break;
        }
        if (ulIndex == 2)
        {
           char buff[128]={'\0'};
           syscfg_get( NULL, "hash_password_3",buff, sizeof(buff));
           if( buff[0] != '\0' && pCosaUser->HashedPassword[0]== '\0')
           {
             _ansc_strncpy(pCosaUser->HashedPassword,buff,sizeof(pCosaUser->HashedPassword));
           }
        }
#if defined(_COSA_FOR_BCI_)
        if (ulIndex == 1)
        {
           char buff[128]={'\0'};
           syscfg_get( NULL, "hash_password_2",buff, sizeof(buff));
           if( buff[0] != '\0' && pCosaUser->HashedPassword[0]== '\0')
           {
             _ansc_strncpy(pCosaUser->HashedPassword,buff,sizeof(pCosaUser->HashedPassword));
           }
           pCosaUser->LockOutRemainingTime = 0 ;
           memset(buff,0,sizeof(buff));
           syscfg_get( NULL, "PasswordLockoutAttempts", buff, sizeof(buff));
           if( atoi ( buff ) != 10 )
           {
		memset(buff,0,sizeof(buff));
		sprintf(buff, "%d", 10);
		syscfg_set(NULL, "PasswordLockoutAttempts", buff) ;
		syscfg_commit() ;
           }

           memset(buff,0,sizeof(buff));
           syscfg_get( NULL, "NumOfFailedAttempts_2", buff, sizeof(buff));
           if( buff[0] != '\0' )
           {
               pCosaUser->NumOfFailedAttempts = atoi(buff) ;
           }
           memset(buff,0,sizeof(buff));
           syscfg_get( NULL, "PasswordLoginCounts_2", buff, sizeof(buff));
           if( buff[0] != '\0' )
           {
               pCosaUser->LoginCounts = atoi(buff) ;
           }
        }
#endif
        pUserCxtLink = (PCOSA_CONTEXT_LINK_OBJECT)AnscAllocateMemory( sizeof(COSA_CONTEXT_LINK_OBJECT) );
        if ( !pUserCxtLink )
        {
            AnscFreeMemory(pCosaUser);
            break;
        }

        COSA_CONTEXT_LINK_INITIATION_CONTENT(pUserCxtLink)
        pUserCxtLink->hContext       = (ANSC_HANDLE)pCosaUser;
        pUserCxtLink->bNew           = FALSE;

        if ( !pCosaUser->InstanceNumber )
        {
            if ( !++pMyObject->maxInstanceOfUser )
            {
                pMyObject->maxInstanceOfUser = 1;
            }
            bNeedSave                    = TRUE;

            pCosaUser->InstanceNumber    = pMyObject->maxInstanceOfUser;
            pUserCxtLink->InstanceNumber = pCosaUser->InstanceNumber;
//.........这里部分代码省略.........
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:101,代码来源:cosa_users_internal.c


示例17: AnscTraceFlow

ANSC_STATUS
BbhmDiagipStartDiag
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus        = ANSC_STATUS_SUCCESS;
    PBBHM_DIAG_IP_PING_OBJECT       pMyObject           = (PBBHM_DIAG_IP_PING_OBJECT  )hThisObject;
    PDSLH_PING_INFO                 pDiagInfo           = (PDSLH_PING_INFO)pMyObject->hDslhDiagInfo;

    if ( pMyObject->CheckCanStart((ANSC_HANDLE)pMyObject) )
    {
        AnscTraceFlow(("BbhmDiagipStartDiag -- enter...\n"));

        pMyObject->SetEnv(pMyObject);
        pMyObject->ResetProperty((ANSC_HANDLE)pMyObject);

        /* TODO set source interface name here */
        pMyObject->SetSrcIp((ANSC_HANDLE)pMyObject, pDiagInfo->IfAddrName);

        if ( pMyObject->SetDstIp((ANSC_HANDLE)pMyObject, pDiagInfo->Host) == ANSC_STATUS_SUCCESS)
        {
            pMyObject->SetNumPkts((ANSC_HANDLE)pMyObject, pDiagInfo->NumberOfRepetitions);
            pMyObject->SetPktSize((ANSC_HANDLE)pMyObject, pDiagInfo->DataBlockSize);
            pMyObject->SetTimeOut((ANSC_HANDLE)pMyObject, pDiagInfo->Timeout);

            pMyObject->Open(pMyObject);

            if ( pMyObject->hSendBuffer )
            {
                AnscFreeMemory(pMyObject->hSendBuffer);
                pMyObject->hSendBuffer = NULL;
            }

            pMyObject->hSendBuffer = (PCHAR)AnscAllocateMemory(pDiagInfo->DataBlockSize + sizeof(ICMPV4_HEADER));

            if ( !pMyObject->hSendBuffer )
            {
                return  ANSC_STATUS_RESOURCES;
            }

            returnStatus =
                pMyObject->SetControl
                    (
                        (ANSC_HANDLE)pMyObject,
                        BBHM_IP_PING_CONTROL_START
                    );

            if ( returnStatus == ANSC_STATUS_SUCCESS )
            {
                BbhmDiageoStartDiag((ANSC_HANDLE)pMyObject);
            }
            else
            {
                return returnStatus;
            }
        }
        else
        {
            pDiagInfo->DiagnosticState = DSLH_DIAG_STATE_TYPE_PING_Error_HostName;
        }

        return ANSC_STATUS_SUCCESS;
    }
    else
    {
        AnscTraceFlow(("BbhmDiagipStartDiag -- query task is running...\n"));

        return  ANSC_STATUS_PENDING;
    }
}
开发者ID:rdkcmf,项目名称:rdkb-TestAndDiagnostic,代码行数:71,代码来源:bbhm_diagip_process.c


示例18: return

ANSC_HANDLE
Bmc2ReqcoPecGetCookedPage
    (
        ANSC_HANDLE                 hThisObject,
        char*                       page_path
    )
{
    ANSC_STATUS                     returnStatus       = ANSC_STATUS_SUCCESS;
    PBMC2_REQ_CONTROLLER_OBJECT     pMyObject          = (PBMC2_REQ_CONTROLLER_OBJECT)hThisObject;
    PBMC2_ENV_CONTROLLER_OBJECT     pBmc2EnvController = (PBMC2_ENV_CONTROLLER_OBJECT)pMyObject->hBmc2EnvController;
    PBMC2_COM_DOMAIN_OBJECT         pBmc2ComDomain     = (PBMC2_COM_DOMAIN_OBJECT    )pMyObject->hBmc2ComDomain;
    PBMC2_COM_TERMINAL_OBJECT       pBmc2ComTerminal   = (PBMC2_COM_TERMINAL_OBJECT  )pBmc2ComDomain->hBmc2ComTerminal;
    PBMC2_COM_EXECUTOR_OBJECT       pBmc2ComExecutor   = (PBMC2_COM_EXECUTOR_OBJECT  )pBmc2EnvController->hBmc2ComExecutor;
    PBWRM_ENV_CONTROLLER_OBJECT     pBwrmEnvController = (PBWRM_ENV_CONTROLLER_OBJECT)pBmc2EnvController->hBwrmEnvController;
    PBWRM_RAM_INTERFACE             pBwrmRamIf         = (PBWRM_RAM_INTERFACE        )pBwrmEnvController->GetBwrmRamIf((ANSC_HANDLE)pBwrmEnvController);
    char*                           pRootPath          = (char*                      )pBmc2EnvController->Property.RootPath;
    PBWRM_COOKED_PAGE_OBJECT        pBwrmCookedPage    = (PBWRM_COOKED_PAGE_OBJECT   )NULL;
    void*                           pPageBuffer        = (void*                      )NULL;
    ULONG                           ulPageSize         = (ULONG                      )0;

    /*
     * The script parsing can take fairly long time, which mandates some sort of page caching
     * mechanism to be used. The BWRM (BroadWay Web Resource Manager) module is responsible for
     * file-based page access and page caching. We first try to retrieve the requested page from
     * the in-memory cache, and only load the page from the underlying storage system if the
     * requested page is not in the cache.
     */
    returnStatus =
        pBwrmRamIf->GetCookedPage
            (
                pBwrmRamIf->hOwnerContext,
                pRootPath,
                page_path,
                &pBwrmCookedPage
            );

    if ( returnStatus != ANSC_STATUS_SUCCESS )
    {
        returnStatus =
            pBwrmRamIf->GetRawPage
                (
                    pBwrmRamIf->hOwnerContext,
                    pRootPath,
                    page_path,
                    &pPageBuffer,
                    &ulPageSize
                );

        if ( returnStatus != ANSC_STATUS_SUCCESS )
        {
            return  (ANSC_HANDLE)NULL;
        }
        else
        {
            pBwrmCookedPage =
                (PBWRM_COOKED_PAGE_OBJECT)pBmc2ComExecutor->PreparePage
                    (
                        (ANSC_HANDLE)pBmc2ComExecutor,
                        page_path,
                        pPageBuffer,
                        ulPageSize
                    );
        }

        if ( !pBwrmCookedPage )
        {
            AnscFreeMemory(pPageBuffer);

            return  (ANSC_HANDLE)NULL;
        }
        else if ( pBmc2EnvController->Property.bCacheScpPages || pBwrmRamIf->IsPageCacheForced(pBwrmRamIf->hOwnerContext, page_path) )
        {
            returnStatus =
                pBwrmRamIf->AddCookedPage
                    (
                        pBwrmRamIf->hOwnerContext,
                        pRootPath,
                        page_path,
                        (ANSC_HANDLE)pBwrmCookedPage
                    );
        }
        else
        {
            pBwrmCookedPage->SetRootPath ((ANSC_HANDLE)pBwrmCookedPage, pRootPath             );
            pBwrmCookedPage->SetPagePath ((ANSC_HANDLE)pBwrmCookedPage, page_path             );
            pBwrmCookedPage->SetTimestamp((ANSC_HANDLE)pBwrmCookedPage, AnscGetTickInSeconds());
        }
    }

    return  (ANSC_HANDLE)pBwrmCookedPage;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:91,代码来源:bmc2_reqco_pecif.c


示例19: AnscFreeMemory

ANSC_STATUS
CosaDdnsRegGetDdnsInfo
    (
        ANSC_HANDLE                 hThisObject
    )
{
    PCOSA_DATAMODEL_DDNS            pMyObject         = (PCOSA_DATAMODEL_DDNS     )hThisObject;
    PSLIST_HEADER                   pListHead         = (PSLIST_HEADER            )&pMyObject->ContextHead;
    PPOAM_IREP_FOLDER_OBJECT        pPoamIrepFoDdns   = (PPOAM_IREP_FOLDER_OBJECT )pMyObject->hIrepFolderDdns;
    PPOAM_IREP_FOLDER_OBJECT        pPoamIrepFoDdnsSp = (PPOAM_IREP_FOLDER_OBJECT )NULL;
    PCOSA_CONTEXT_LINK_OBJECT       pCosaContext      = (PCOSA_CONTEXT_LINK_OBJECT)NULL;
    PCOSA_DML_DDNS_SERVICE          pDdnsService      = (PCOSA_DML_DDNS_SERVICE   )NULL;
    PSINGLE_LINK_ENTRY              pSLinkEntry       = (PSINGLE_LINK_ENTRY       )NULL;
    PSLAP_VARIABLE                  pSlapVariable     = (PSLAP_VARIABLE           )NULL;
    ULONG                           ulEntryCount      = 0;
    ULONG                           ulIndex           = 0;
    ULONG                           ulInstanceNumber  = 0;
    char*                           pFolderName       = NULL;
    char*                           pAlias            = NULL;

    if ( !pPoamIrepFoDdns )
    {
        return ANSC_STATUS_FAILURE;
    }

    /* Load the newly added but not yet commited entries */

    ulEntryCount = pPoamIrepFoDdns->GetFolderCount((ANSC_HANDLE)pPoamIrepFoDdns);

    for ( ulIndex = 0; ulIndex < ulEntryCount; ulIndex++ )
    {
        pFolderName =
            pPoamIrepFoDdns->EnumFolder
                (
                    (ANSC_HANDLE)pPoamIrepFoDdns,
                    ulIndex
                );

        if ( !pFolderName )
        {
            continue;
        }

        pPoamIrepFoDdnsSp = pPoamIrepFoDdns->GetFolder((ANSC_HANDLE)pPoamIrepFoDdns, pFolderName);

        AnscFreeMemory(pFolderName);

        if ( !pPoamIrepFoDdnsSp )
        {
            continue;
        }

        if ( TRUE )
        {
            pSlapVariable =
                (PSLAP_VARIABLE)pPoamIrepFoDdnsSp->GetRecord
                    (
                        (ANSC_HANDLE)pPoamIrepFoDdnsSp,
                        COSA_DML_RR_NAME_DdnsServiceInsNum,
                        NULL
                    );

            if ( pSlapVariable )
            {
                ulInstanceNumber = pSlapVariable->Variant.varUint32;

                SlapFreeVariable(pSlapVariable);
            }
        }

        if ( TRUE )
        {
            pSlapVariable =
                (PSLAP_VARIABLE)pPoamIrepFoDdnsSp->GetRecord
                    (
                        (ANSC_HANDLE)pPoamIrepFoDdnsSp,
                        COSA_DML_RR_NAME_DdnsServiceAlias,
                        NULL
                    );

            if ( pSlapVariable )
            {
                pAlias = AnscCloneString(pSlapVariable->Variant.varString);

                SlapFreeVariable(pSlapVariable);
            }

            if ( pAlias == NULL )
            {
                continue;
            }
        }

        pPoamIrepFoDdnsSp->Remove((ANSC_HANDLE)pPoamIrepFoDdnsSp);

        pCosaContext = (PCOSA_CONTEXT_LINK_OBJECT)AnscAllocateMemory(sizeof(COSA_CONTEXT_LINK_OBJECT));

        if ( !pCosaContext )
        {
            AnscFreeMemory(pAlias);
//.........这里部分代码省略.........
开发者ID:davekimble,项目名称:CcspPandM,代码行数:101,代码来源:cosa_x_cisco_com_ddns_internal.c


示例20: AnscTrace

ANSC_STATUS
AnscBetoSendTask
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PANSC_BROKER_ENGINE_TCP_OBJECT  pMyObject    = (PANSC_BROKER_ENGINE_TCP_OBJECT)hThisObject;
    ansc_fd_set*                    pSendSet1    = (ansc_fd_set*                  )pMyObject->SendSocketSet;
    xskt_fd_set*                    pSendSet2    = (xskt_fd_set*                  )pMyObject->SendSocketSet;
    PANSC_BROKER_SERVER_TCP_OBJECT  pServer      = (PANSC_BROKER_SERVER_TCP_OBJECT)pMyObject->hBrokerServer;
    PANSC_BSTO_WORKER_OBJECT        pWorker      = (PANSC_BSTO_WORKER_OBJECT      )pServer->hWorker;
    PANSC_BETO_PACKET_OBJECT        pPacket      = NULL;
    PANSC_BROKER_SOCKET_TCP_OBJECT  pSocket      = NULL;
    PSINGLE_LINK_ENTRY              pSLinkEntry  = NULL;
    BOOL                            bSendable    = FALSE;
    int                             s_result     = 0;
    int                             s_error      = 0;

    AnscTrace("AnscBetoSendTask is activated ...!\n");

    /*
     * As a scalable server implemention, we shall accept as many incoming client connections as
     * possible and can only be limited by the system resources. Once the listening socket becomes
     * readable, which means an incoming connection attempt has arrived. We create a new socket
     * object and associate it with the client. This is a repeated process until the socket owner
     * closes the socket.
     */
    while ( pMyObject->bStarted )
    {
        AnscAcquireLock(&pMyObject->PacketQueueLock);
        pSLinkEntry = AnscQueuePopEntry(&pMyObject->PacketQueue);
        AnscReleaseLock(&pMyObject->PacketQueueLock);

        if ( !pSLinkEntry )
        {
            continue;
        }
        else
        {
            pPacket = ACCESS_ANSC_BETO_PACKET_OBJECT(pSLinkEntry);
            pSocket = (PANSC_BROKER_SOCKET_TCP_OBJECT)pPacket->hSocket;
        }

	#if !defined(_ANSC_KERNEL) || !defined(_ANSC_LINUX)
        AnscAcquireLock(&pMyObject->SendSocketSetLock);
        bSendable = (pServer->Mode & ANSC_BSTO_MODE_XSOCKET)? XSKT_SOCKET_FD_ISSET(pSocket->Socket, pSendSet2) : ANSC_SOCKET_FD_ISSET(pSocket->Socket, pSendSet1);
        AnscReleaseLock(&pMyObject->SendSocketSetLock);

        if ( !bSendable )
        {
            returnStatus =
                pWorker->SendComplete
                    (
                        pWorker->hWorkerContext,
                        (ANSC_HANDLE)pSocket,
                        pPacket->hWorkerReserved,
                        ANSC_STATUS_FAILURE
                    );

            AnscFreeMemory(pPacket);

            continue;
        }
	#endif

        if ( pServer->Mode & ANSC_BSTO_MODE_XSOCKET )
        {
            s_result = _xskt_send(((XSKT_SOCKET)pSocket->Socket), pPacket->PacketBuffer, (int)pPacket->PacketSize, 0);
        }
        else
        {
            s_result = _ansc_send(pSocket->Socket, pPacket->PacketBuffer, (int)pPacket->PacketSize, 0);
        }

        if ( ((s_result == XSKT_SOCKET_ERROR) &&  (pServer->Mode & ANSC_BSTO_MODE_XSOCKET)) ||
             ((s_result == ANSC_SOCKET_ERROR) && !(pServer->Mode & ANSC_BSTO_MODE_XSOCKET)) )
        {
            s_error = (pServer->Mode & ANSC_BSTO_MODE_XSOCKET)? _xskt_get_last_error() : _ansc_get_last_error();

            returnStatus =
                pWorker->SendComplete
  

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ AnscReleaseLock函数代码示例发布时间:2022-05-30
下一篇:
C++ AnscEqualString函数代码示例发布时间: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