From ded5127fc0ccfd6845c24eec41ed3bd52858606a Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Wed, 17 Oct 2001 17:43:17 +0000 Subject: [PATCH] cmdebug-addrs-option-20011017 This patch adds an "-addrs" option to cmdebug, which lists the interfaces of a remote cache manager, via the WhoAreYou AFSCB RPC. --- src/venus/cmdebug.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/venus/cmdebug.c b/src/venus/cmdebug.c index 182f5a4..465d3b9 100644 --- a/src/venus/cmdebug.c +++ b/src/venus/cmdebug.c @@ -29,6 +29,31 @@ RCSID("$Header$"); extern struct rx_securityClass *rxnull_NewServerSecurityObject(); extern struct hostent *hostutil_GetHostByName(); +static PrintInterfaces(aconn) + struct rx_connection *aconn; +{ + struct interfaceAddr addr; + int i, code; + + code = RXAFSCB_WhoAreYou(aconn, &addr); + if (code) { + printf("cmdebug: error checking locks: %s\n", error_message(code)); + return 0; + } + + printf("Host interfaces:\n"); + for (i=0; iwaitStates || alock->exclLocked @@ -172,6 +197,11 @@ struct cmd_syndesc *as; { printf("cmdebug: failed to create connection for host %s\n", hostName); exit(1); } + if (as->parms[3].items) { + /* -addrs */ + PrintInterfaces(conn); + return 0; + } if (as->parms[2].items) int32p = 1; else int32p = 0; PrintLocks(conn, int32p); @@ -206,6 +236,7 @@ char **argv; { cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine"); cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port"); cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info"); + cmd_AddParm(ts, "-addrs", CMD_FLAG, CMD_OPTIONAL, "print only host interfaces"); cmd_Dispatch(argc, argv); exit(0); -- 1.9.4