From 5505be384cc74328c9b400bea60cf0054d04ab76 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 7 Feb 2006 06:05:08 +0000 Subject: [PATCH] STABLE14-viced-more-dbg-improvements-20060207 convert the rest of the addresses output in hex to dotted notation (cherry picked from commit 6909509eca2a22b4b7003be60e0dbda75a30949c) --- src/viced/host.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/viced/host.c b/src/viced/host.c index 0deead52f..7d7ff208b 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -966,11 +966,14 @@ addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port) int number; int found; struct Interface *interface; + char hoststr[16], hoststr2[16]; assert(host); assert(host->interface); - ViceLog(125, ("addInterfaceAddr : host %x addr %x:%d\n", host->host, addr, ntohs(port))); + ViceLog(125, ("addInterfaceAddr : host %s:d addr %s:%d\n", + afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port), + afs_inet_ntoa_r(addr, hoststr2), ntohs(port))); /* * Make sure this address is on the list of known addresses @@ -1902,11 +1905,12 @@ h_DumpHost(register struct host *host, int held, StreamHandle_t * file) { int i; char tmpStr[256]; + char hoststr[16]; H_LOCK; (void)afs_snprintf(tmpStr, sizeof tmpStr, - "ip:%x port:%d hidx:%d cbid:%d lock:%x last:%u active:%u down:%d del:%d cons:%d cldel:%d\n\t hpfailed:%d hcpsCall:%u hcps [", - host->host, ntohs(host->port), host->index, + "ip:%s port:%d hidx:%d cbid:%d lock:%x last:%u active:%u down:%d del:%d cons:%d cldel:%d\n\t hpfailed:%d hcpsCall:%u hcps [", + afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port), host->index, host->cblist, CheckLock(&host->lock), host->LastCall, host->ActiveCall, (host->hostFlags & VENUSDOWN), host->hostFlags & HOSTDELETED, host->Console, @@ -1923,7 +1927,9 @@ h_DumpHost(register struct host *host, int held, StreamHandle_t * file) (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file); if (host->interface) for (i = 0; i < host->interface->numberOfInterfaces; i++) { - sprintf(tmpStr, " %x:%d", host->interface->interface[i].addr, + char hoststr[16]; + sprintf(tmpStr, " %s:%d", + afs_inet_ntoa_r(host->interface->interface[i].addr, hoststr), ntohs(host->interface->interface[i].port)); (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file); } @@ -2391,7 +2397,9 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf) host->interface = interface; for (i = 0; i < host->interface->numberOfInterfaces; i++) { - ViceLog(125, ("--- alt address %x:%d\n", host->interface->interface[i].addr, + char hoststr[16]; + ViceLog(125, ("--- alt address %s:%d\n", + afs_inet_ntoa_r(host->interface->interface[i].addr, hoststr), ntohs(host->interface->interface[i].port))); } @@ -2429,12 +2437,14 @@ void printInterfaceAddr(struct host *host, int level) { int i, number; + char hoststr[16]; + if (host->interface) { /* check alternate addresses */ number = host->interface->numberOfInterfaces; assert(number > 0); for (i = 0; i < number; i++) - ViceLog(level, ("%x:%d ", host->interface->interface[i].addr, + ViceLog(level, ("%s:%d ", afs_inet_ntoa_r(host->interface->interface[i].addr, hoststr), ntohs(host->interface->interface[i].port))); } ViceLog(level, ("\n")); -- 2.39.5