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>
15 #include <sys/types.h>
20 /* Bogus procedure to get internet address of host */
21 static u_long GetIpAddress(hostname)
24 struct hostent *hostent;
26 hostent = gethostbyname(hostname);
27 if (!hostent) {printf("host %s not found", hostname);exit(1);}
28 if (hostent->h_length != sizeof(u_long)) {
29 printf("host address is disagreeable length (%d)", hostent->h_length);
32 memcpy((char *)&host, hostent->h_addr, sizeof(host));
39 struct rx_connection *conn;
41 struct rx_securityClass *null_securityObject;
45 host = GetIpAddress(argv[1]);
46 null_securityObject = rxnull_NewClientSecurityObject();
47 conn = rx_NewConnection(host, SAMPLE_SERVER_PORT, SAMPLE_SERVICE_ID, null_securityObject, SAMPLE_NULL);
50 printf("add(%d,%d)",i,i*2);
51 error = TEST_Add(conn, i,i*2,&result);
52 printf(" ==> %d, error %d\n", result, error);
53 printf("sub(%d,%d)",i,i*2);
54 error = TEST_Sub(conn, i, i*2, &result);
55 printf(" ==> %d, error %d\n", result, error);