예제 #1
0
static CMPIStatus __cft_addEntry (
    CONST CMPIContext * ctx,
    const char * name,
    CONST CMPIValue * value,
    CONST CMPIType type )
{
    struct native_context * c = (struct native_context *) ctx;
    struct native_property **p = &c->entries;

    CMPIStatus rc = checkArgsReturnStatus(ctx);

    if (rc.rc != CMPI_RC_OK)
    {
        return rc;
    }
    // Check for containers, this method should be in sync with
    // contextAddEntry method on MB side.
    if (!strcmp (name, "SnmpTrapOidContainer") )
    {
        p = &c->containers;
    }
    CMReturn ( ( propertyFT.addProperty (
        p,
        c->mem_state,
        name,
        type,
        0,
        value ) )?
        CMPI_RC_ERR_ALREADY_EXISTS:
        CMPI_RC_OK );
}
예제 #2
0
static CMPIInstance * __beft_newInstance ( 
    CONST CMPIBroker * broker,
    CONST CMPIObjectPath * cop,
    CMPIStatus * rc )
{
    CMPIStatus rc1 = checkArgsReturnStatus(cop);
    if (rc1.rc != CMPI_RC_OK)
    {
        CMSetStatus(rc, CMPI_RC_ERR_INVALID_PARAMETER);
        return 0;
    }
    TRACE_NORMAL(("Creating new native CMPIInstance."));
    return native_new_CMPIInstance ( cop, rc );
}
예제 #3
0
static CMPIStatus __eft_release ( CMPIEnumeration * enumeration )
{
    struct native_enum * e = (struct native_enum *) enumeration;

    CMPIStatus rc = checkArgsReturnStatus(enumeration);

    if (rc.rc == CMPI_RC_OK && e->mem_state == TOOL_MM_NO_ADD)
    {
        tool_mm_add ( enumeration );
        return e->data->ft->release ( e->data );
    }

    return rc;
}
예제 #4
0
파일: string.c 프로젝트: brunolauze/pegasus
static CMPIStatus __sft_release ( CMPIString * string )
{
    struct native_string * s = (struct native_string *) string;
    CMPIStatus rc = checkArgsReturnStatus(string);

    if (rc.rc != CMPI_RC_OK &&  s->mem_state == TOOL_MM_NO_ADD)
    {

        tool_mm_add ( s );
        tool_mm_add ( s->string.hdl );

    }

    return rc;
}
예제 #5
0
static CMPIStatus __eft_release ( CMPISelectExp * exp )
{
    struct native_selectexp * e = (struct native_selectexp *) exp;
    CMPIContext *ctx;
    CMPIBroker *broker;
    CMPIStatus rc = checkArgsReturnStatus(exp);

    if (rc.rc != CMPI_RC_OK)
    {
        return rc;
    }
    broker = tool_mm_get_broker ( (void**)&ctx);

    if (e->mem_state == TOOL_MM_NO_ADD)
    {
        rc = ( ( (NativeCMPIBrokerFT*)broker->bft) )->selExp_release (exp);
        if (rc.rc == CMPI_RC_OK)
        {
            tool_mm_add ( e );
        }
    }
    CMReturn ( CMPI_RC_OK );
}
예제 #6
0
static CMPIStatus __cft_release ( CMPIContext * ctx )
{
    CMPIStatus rc = checkArgsReturnStatus(ctx);
    return rc;
}