"ListAttributes",
"LinkedList",
"GetStats",
- "Probe",
+ "Probe", /* RPC is ProbeServer */
"GetAddrs",
"ChangeAddr",
"CreateEntryN",
exit(1);
}
- if (as->parms[5].items) { /* -gstats */
+ if (as->parms[6].items) { /* -probe */
+ int nconns = 0;
+ int status = 0;
+ int i;
+ char hoststr[16];
+ afs_uint32 addr;
+
+ for (i = 0; cstruct->conns[i]; i++, nconns++) {
+ rx_SetConnDeadTime(cstruct->conns[i], 6);
+ addr = rx_HostOf(rx_PeerOf(cstruct->conns[i]));
+ if (!nconns) {
+ printf("probing");
+ }
+ printf(" %s", afs_inet_ntoa_r(addr, hoststr));
+ }
+ if (nconns == 0) {
+ printf("no connections\n");
+ return 255;
+ }
+ printf("\n");
+ multi_Rx(cstruct->conns, nconns) {
+ multi_VL_ProbeServer();
+ addr = rx_HostOf(rx_PeerOf(cstruct->conns[multi_i]));
+ if (!multi_error) {
+ printf(" ok: %s\n", afs_inet_ntoa_r(addr, hoststr));
+ } else {
+ status = 255;
+ printf(" not ok (%d): %s\n", multi_error,
+ afs_inet_ntoa_r(addr, hoststr));
+ }
+ }
+ multi_End;
+ return status;
+ }
+
+ if (as->parms[5].items) { /* -getstats */
vldstats stats;
vital_vlheader vital_header;
code = ubik_VL_GetStats(cstruct, 0, &stats, &vital_header);
printf("[0x%x %u] (special multi-homed entry)\n",
*addrp, *addrp);
+ memset(&attrs, 0, sizeof(attrs));
attrs.Mask = VLADDR_INDEX;
mhaddrs.bulkaddrs_val = 0;
mhaddrs.bulkaddrs_len = 0;
addrs2.bulkaddrs_val = 0;
addrs2.bulkaddrs_len = 0;
+ memset(&attrs, 0, sizeof(attrs));
attrs.Mask = VLADDR_INDEX;
attrs.index = (base * VL_MHSRV_PERBLK) + index;
code =
afs_int32 code;
strcpy(confdir, AFSDIR_CLIENT_ETC_DIRPATH);
- ts = cmd_CreateSyntax("initcmd", handleit, NULL, "initialize the program");
+ ts = cmd_CreateSyntax("initcmd", handleit, NULL, 0, "initialize the program");
cmd_AddParm(ts, "-cellpath", CMD_LIST, CMD_OPTIONAL,
"Cell configuration directory");
cmd_AddParm(ts, "-server", CMD_LIST, CMD_OPTIONAL,
"cellname '-host' belongs to (required for auth conns)");
cmd_AddParm(ts, "-getstats", CMD_FLAG, CMD_OPTIONAL,
"print vldb statistics (non interactive)");
+ cmd_AddParm(ts, "-probe", CMD_FLAG, CMD_OPTIONAL,
+ "probe vldb servers, use with -host to probe only one. (non interactive)");
code = cmd_Dispatch(argc, argv);
exit(code);
}