From 5b099afec7aaa0db76ac900ef50aa4d1c7c22ede Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Tue, 4 Dec 2012 14:26:50 +0100 Subject: [PATCH] pmc: show the port state as a string. Signed-off-by: Richard Cochran --- pmc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pmc.c b/pmc.c index 3a70fac..2e2e18a 100644 --- a/pmc.c +++ b/pmc.c @@ -297,9 +297,12 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) break; case PORT_DATA_SET: p = (struct portDS *) mgt->data; + if (p->portState > PS_SLAVE) { + p->portState = 0; + } fprintf(fp, "PORT_DATA_SET " IFMT "portIdentity %s" - IFMT "portState %hhu" + IFMT "portState %s" IFMT "logMinDelayReqInterval %hhd" IFMT "peerMeanPathDelay %lld" IFMT "logAnnounceInterval %hhd" @@ -308,7 +311,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) IFMT "delayMechanism %hhu" IFMT "logMinPdelayReqInterval %hhd" IFMT "versionNumber %hhu", - pid2str(&p->portIdentity), p->portState, + pid2str(&p->portIdentity), ps_str[p->portState], p->logMinDelayReqInterval, p->peerMeanPathDelay >> 16, p->logAnnounceInterval, p->announceReceiptTimeout, p->logSyncInterval, p->delayMechanism,