Exemplo n.º 1
0
/**
 * Do initialization
 */
int tpsvrinit(int argc, char **argv)
{
    char svcnm[16];
    int i;
    int ret = SUCCEED;
    NDRX_LOG(log_debug, "tpsvrinit called");
    
    
    if (SUCCEED!=tpopen())
    {
        NDRX_LOG(log_error, "TESTERROR: tpopen() fail: %d:[%s]", 
                                            tperrno, tpstrerror(tperrno));
        ret=FAIL;
        goto out;
    }

    if (SUCCEED!=tpadvertise("RUNTX", RUNTX))
    {
        NDRX_LOG(log_error, "Failed to initialize RUNTX!");
    }
    
    if (SUCCEED!=tpadvertise("RUNTXFAIL", RUNTXFAIL))
    {
        NDRX_LOG(log_error, "Failed to initialize RUNTXFAIL!");
    }

    if (SUCCEED!=tpadvertise("NOTRANFAIL", NOTRANFAIL))
    {
        NDRX_LOG(log_error, "Failed to initialize NOTRANFAIL!");
    }
    
out:
    return ret;
}
Exemplo n.º 2
0
/*
 * Do initialization
 */
int NDRX_INTEGRA(tpsvrinit)(int argc, char **argv)
{
    int ret=SUCCEED;
    TPEVCTL evctl;

    NDRX_LOG(log_debug, "tpsvrinit called");
    memset(&evctl, 0, sizeof(evctl));

    if (SUCCEED!=tpadvertise("TEST4_2ND", TEST4_2ND))
    {
        NDRX_LOG(log_error, "Failed to initialize TEST2_2ND (first)!");
        ret=FAIL;
        goto out;
    }
    else if (SUCCEED!=tpadvertise("TEST4_2ND_AL", TEST4_2ND))
    {
        NDRX_LOG(log_error, "Failed to initialize TEST4_2ND_AL (alias)!");
        ret=FAIL;
        goto out;
    }


    strcpy(evctl.name1, "TEST4_2ND");
    evctl.flags|=TPEVSERVICE;
    /* Subscribe to event server */
    if (FAIL==tpsubscribe("EV..TEST", "1==1 && T_DOUBLE_FLD==5", &evctl, 0L))
    {
        NDRX_LOG(log_error, "Failed to subscribe TEST4_1ST "
                                        "to EV..TEST event failed");
        ret=FAIL;
    }
    
out:
    return ret;
}
Exemplo n.º 3
0
/*
 * Do initialization
 */
int NDRX_INTEGRA(tpsvrinit)(int argc, char **argv)
{
    NDRX_LOG(log_debug, "tpsvrinit called");

    if (SUCCEED!=tpadvertise("TEST2_1ST", TEST2_1ST))
    {
        NDRX_LOG(log_error, "Failed to initialize TEST2_1ST (first)!");
    }
    else if (SUCCEED!=tpadvertise("TEST2_1ST_AL", TEST2_1ST))
    {
        NDRX_LOG(log_error, "Failed to initialize TEST2_1ST_AL (alias)!");
    }

    return SUCCEED;
}
Exemplo n.º 4
0
/**
 * Initialize the application
 * @param argc	argument count
 * @param argv	argument values
 * @return SUCCEED/FAIL
 */
int init(int argc, char** argv)
{
	int ret = SUCCEED;

	TP_LOG(log_info, "Initialising...");

	if (SUCCEED!=tpinit(NULL))
	{
		TP_LOG(log_error, "Failed to Initialise: %s", 
			tpstrerror(tperrno));
		ret = FAIL;
		goto out;
	}
	

	
	/* Advertise our service */
	if (SUCCEED!=tpadvertise(msg_service(), USERREGSV))
	{
		TP_LOG(log_error, "Failed to initialise USERREGSV_UBF!");
		ret=FAIL;
		goto out;
	}	

out:

	
	return ret;
}
Exemplo n.º 5
0
/*
 * Do initialization
 */
int NDRX_INTEGRA(tpsvrinit)(int argc, char **argv)
{
    int ret = SUCCEED;
    NDRX_LOG(log_debug, "tpsvrinit called");

    if (SUCCEED!=tpadvertise("DOADV", DOADV))
    {
        NDRX_LOG(log_error, "Failed to initialize DOADV!");
        ret=FAIL;
    }
    else if (SUCCEED!=tpadvertise("UNADV", UNADV))
    {
        NDRX_LOG(log_error, "Failed to initialize UNADV (first)!");
        ret=FAIL;
    }
    
    return ret;
}
Exemplo n.º 6
0
/*
 * Do initialization
 */
int NDRX_INTEGRA(tpsvrinit)(int argc, char **argv)
{
    int ret = SUCCEED;
    NDRX_LOG(log_debug, "tpsvrinit called");

    if (SUCCEED!=tpadvertise("TESTSV", TESTSVFN))
    {
        NDRX_LOG(log_error, "Failed to initialize TESTSV (first)!");
        ret=FAIL;
    }
    
    return ret;
}
Exemplo n.º 7
0
/**
 * Advertise the service.
 * @param p_svc
 */
void DOADV(TPSVCINFO *p_svc)
{
    int ret=SUCCEED;
    UBFH *p_ub = (UBFH *)p_svc->data;
	
    /* Advertise test service */
    ret=tpadvertise("TESTSVFN", TESTSVFN);

    tpreturn(  ret==SUCCEED?TPSUCCESS:TPFAIL,
                0L,
                (char *)p_ub,
                0L,
                0L);
}