0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #include <sys/socket.h>
0036 #include <sys/time.h>
0037 #include <sys/types.h>
0038 #include <arpa/inet.h>
0039 #include <netinet/in.h>
0040 #include <errno.h>
0041 #include <fcntl.h>
0042 #include <netdb.h>
0043 #include <string.h>
0044 #include <unistd.h>
0045
0046 #include <stdio.h>
0047 #include <stdlib.h>
0048 #include <ndebug.h>
0049 #include <atmi.h>
0050 #include <ndrstandard.h>
0051 #include <ubf.h>
0052 #include <test.fd.h>
0053
0054
0055 extern expublic void (*___G_test_delayed_startup)(void);
0056
0057 expublic void G_test_delayed_startup(void)
0058 {
0059 sleep (40);
0060 }
0061
0062
0063
0064
0065 void SVCBAD (TPSVCINFO *p_svc)
0066 {
0067 int ret=EXSUCCEED;
0068 UBFH *p_ub = (UBFH *)p_svc->data;
0069
0070 NDRX_LOG(log_debug, "SVCBAD got call");
0071
0072
0073 out:
0074 tpreturn( ret==EXSUCCEED?TPSUCCESS:TPFAIL,
0075 0L,
0076 (char *)p_ub,
0077 0L,
0078 0L);
0079 }
0080
0081
0082
0083
0084 void SVCOK (TPSVCINFO *p_svc)
0085 {
0086 int ret=EXSUCCEED;
0087 UBFH *p_ub = (UBFH *)p_svc->data;
0088
0089 NDRX_LOG(log_debug, "SVCBAD got call");
0090
0091
0092 out:
0093 tpreturn( ret==EXSUCCEED?TPSUCCESS:TPFAIL,
0094 0L,
0095 (char *)p_ub,
0096 0L,
0097 0L);
0098 }
0099
0100
0101
0102
0103 int NDRX_INTEGRA(tpsvrinit)(int argc, char **argv)
0104 {
0105 int first = EXTRUE;
0106 NDRX_LOG(log_debug, "tpsvrinit called, mode: [%s]", argv[9]);
0107
0108 if (0==strcmp(argv[9], "BAD"))
0109 {
0110
0111 if (EXSUCCEED!=tpadvertise("SVCBAD", SVCBAD))
0112 {
0113 NDRX_LOG(log_error, "TESTERROR: Failed to initialise SVCBAD!");
0114 }
0115
0116
0117 ___G_test_delayed_startup = G_test_delayed_startup;
0118
0119 }
0120 else
0121 {
0122 if (EXSUCCEED!=tpadvertise("SVCOK", SVCOK))
0123 {
0124 NDRX_LOG(log_error, "TESTERROR: Failed to initialise TESTSV!");
0125 }
0126 }
0127
0128 return EXSUCCEED;
0129 }
0130
0131
0132
0133
0134 void NDRX_INTEGRA(tpsvrdone)(void)
0135 {
0136 NDRX_LOG(log_debug, "tpsvrdone called");
0137 }
0138