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>
16 #include <afs/afsint.h>
17 #include <rx/rx_globals.h>
20 struct ubik_client *cstruct;
21 struct rx_connection *serverconns[MAXSERVERS];
25 pxclient_Initialize(int auth, afs_int32 serverAddr)
28 rx_securityIndex scIndex;
29 struct rx_securityClass *sc;
31 code = rx_Init(htons(2115) /*0 */ );
33 fprintf(stderr, "pxclient_Initialize: Could not initialize rx.\n");
36 scIndex = RX_SECIDX_NULL;
38 sc = rxnull_NewClientSecurityObject();
40 rx_NewConnection(serverAddr, htons(7000), 1, sc, scIndex);
42 code = ubik_ClientInit(serverconns, &cstruct);
45 fprintf(stderr, "pxclient_Initialize: ubik client init failed.\n");
53 #include "AFS_component_version_number.c"
56 main(int argc, char **argv)
59 struct sockaddr_in host;
63 int noAuth = 1; /* Default is authenticated connections */
67 printf("usage: fsprobe <serverHost>\n");
70 memset(&host, 0, sizeof(struct sockaddr_in));
71 host.sin_family = AF_INET;
72 host.sin_addr.s_addr = inet_addr(av[0]);
73 #ifdef STRUCT_SOCKADDR_HAS_SA_LEN
74 host.sin_len = sizeof(struct sockaddr_in);
76 if (host.sin_addr.s_addr == -1) {
77 hp = gethostbyname(av[0]);
79 host.sin_family = hp->h_addrtype;
80 memcpy((caddr_t) & host.sin_addr, hp->h_addr, hp->h_length);
82 printf("unknown server host %s\n", av[0]);
86 if ((code = pxclient_Initialize(noAuth, host.sin_addr.s_addr)) != 0) {
87 printf("Couldn't initialize fs library (code=%d).\n", code);
91 code = RXAFS_GetTime(cstruct->conns[0], (afs_uint32 *)&tv.tv_sec, (afs_uint32 *)&tv.tv_usec);
93 printf("AFS_GetTime on %s sec=%ld, usec=%ld\n", av[0], (long)tv.tv_sec,
96 printf("return code is %d\n", code);
103 GetArgs(char *line, char **args, int *nargs)
114 *args++ = line, (*nargs)++;
115 while (*line && *line != ' ')