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 /* Bogus procedure to get internet address of host */
21 GetIpAddress(char *hostname)
23 struct hostent *hostent;
25 hostent = gethostbyname(hostname);
27 printf("host %s not found", hostname);
30 if (hostent->h_length != sizeof(unsigned int)) {
31 printf("host address is disagreeable length (%d)", hostent->h_length);
34 memcpy((char *)&host, hostent->h_addr, sizeof(host));
39 main(int argc, char **argv)
41 struct rx_connection *conn;
43 struct rx_securityClass *null_securityObject;
47 host = GetIpAddress(argv[1]);
48 null_securityObject = rxnull_NewClientSecurityObject();
50 rx_NewConnection(host, SAMPLE_SERVER_PORT, SAMPLE_SERVICE_ID,
51 null_securityObject, RX_SECIDX_NULL);
52 for (i = 1; i < 10; i++) {
54 printf("add(%d,%d)", i, i * 2);
55 error = TEST_Add(conn, i, i * 2, &result);
56 printf(" ==> %d, error %d\n", result, error);
57 printf("sub(%d,%d)", i, i * 2);
58 error = TEST_Sub(conn, i, i * 2, &result);
59 printf(" ==> %d, error %d\n", result, error);