2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
14 #include <sys/types.h>
19 #define N_SECURITY_OBJECTS 1
21 static void Quit(char *);
24 main(int argc, char **argv)
26 struct rx_securityClass *(securityObjects[N_SECURITY_OBJECTS]);
27 struct rx_service *service;
29 /* Initialize Rx, telling it port number this server will use for its single service */
30 if (rx_Init(SAMPLE_SERVER_PORT) < 0)
33 /* Create a single security object, in this case the null security object, for unauthenticated connections, which will be used to control security on connections made to this server */
34 securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
35 if (securityObjects[RX_SECIDX_NULL] == (struct rx_securityClass *)0)
36 Quit("rxnull_NewServerSecurityObject");
38 /* Instantiate a single sample service. The rxgen-generated procedure which is called to decode requests is passed in here (TEST_ExecuteRequest). */
40 rx_NewService(0, SAMPLE_SERVICE_ID, "sample", securityObjects,
41 N_SECURITY_OBJECTS, TEST_ExecuteRequest);
42 if (service == (struct rx_service *)0)
43 Quit("rx_NewService");
45 rx_StartServer(1); /* Donate this process to the server process pool */
46 Quit("StartServer returned?");
52 STEST_Add(struct rx_call *call, int a, int b, int *result)
54 printf("TEST_Add(%d,%d)\n", a, b);
60 STEST_Sub(struct rx_call *call, int a, int b, int *result)
62 printf("TEST_Sub(%d,%d)\n", a, b);
70 fprintf(stderr, "%s", msg);