pmc: support getting the port data set.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-12-02 21:07:43 +01:00
parent 0e244e7f36
commit 2352c05a3b
1 changed files with 21 additions and 1 deletions

22
pmc.c
View File

@ -92,7 +92,7 @@ struct management_id idtab[] = {
/* Port management ID values */
{ "NULL_MANAGEMENT", NULL_MANAGEMENT, null_management },
{ "CLOCK_DESCRIPTION", CLOCK_DESCRIPTION, not_supported },
{ "PORT_DATA_SET", PORT_DATA_SET, not_supported },
{ "PORT_DATA_SET", PORT_DATA_SET, do_get_action },
{ "LOG_ANNOUNCE_INTERVAL", LOG_ANNOUNCE_INTERVAL, not_supported },
{ "ANNOUNCE_RECEIPT_TIMEOUT", ANNOUNCE_RECEIPT_TIMEOUT, not_supported },
{ "LOG_SYNC_INTERVAL", LOG_SYNC_INTERVAL, not_supported },
@ -175,6 +175,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
struct parentDS *pds;
struct timePropertiesDS *tp;
struct time_status_np *tsn;
struct portDS *p;
if (msg_type(msg) != MANAGEMENT) {
return;
}
@ -294,6 +295,25 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
tsn->gmPresent ? "true" : "false",
cid2str(&tsn->gmIdentity));
break;
case PORT_DATA_SET:
p = (struct portDS *) mgt->data;
fprintf(fp, "PORT_DATA_SET "
IFMT "portIdentity %s"
IFMT "portState %hhu"
IFMT "logMinDelayReqInterval %hhd"
IFMT "peerMeanPathDelay %lld"
IFMT "logAnnounceInterval %hhd"
IFMT "announceReceiptTimeout %hhu"
IFMT "logSyncInterval %hhd"
IFMT "delayMechanism %hhu"
IFMT "logMinPdelayReqInterval %hhd"
IFMT "versionNumber %hhu",
pid2str(&p->portIdentity), p->portState,
p->logMinDelayReqInterval, p->peerMeanPathDelay >> 16,
p->logAnnounceInterval, p->announceReceiptTimeout,
p->logSyncInterval, p->delayMechanism,
p->logMinPdelayReqInterval, p->versionNumber);
break;
}
out:
fprintf(fp, "\n");