From 04fe330e8125b0db4fc738085cc6a126232e78d9 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 2 Dec 2012 10:09:30 +0100 Subject: [PATCH] pmc: support getting the parent data set. Signed-off-by: Richard Cochran --- pmc.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/pmc.c b/pmc.c index 5aa5b5f..5aad661 100644 --- a/pmc.c +++ b/pmc.c @@ -66,7 +66,7 @@ struct management_id idtab[] = { { "FAULT_LOG_RESET", FAULT_LOG_RESET, not_supported }, { "DEFAULT_DATA_SET", DEFAULT_DATA_SET, do_get_action }, { "CURRENT_DATA_SET", CURRENT_DATA_SET, do_get_action }, - { "PARENT_DATA_SET", PARENT_DATA_SET, not_supported }, + { "PARENT_DATA_SET", PARENT_DATA_SET, do_get_action }, { "TIME_PROPERTIES_DATA_SET", TIME_PROPERTIES_DATA_SET, not_supported }, { "PRIORITY1", PRIORITY1, not_supported }, { "PRIORITY2", PRIORITY2, not_supported }, @@ -172,6 +172,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) struct management_tlv *mgt; struct defaultDS *dds; struct currentDS *cds; + struct parentDS *pds; struct time_status_np *tsn; if (msg_type(msg) != MANAGEMENT) { return; @@ -226,6 +227,30 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) cds->stepsRemoved, cds->offsetFromMaster / 65536.0, cds->meanPathDelay / 65536.0); break; + case PARENT_DATA_SET: + pds = (struct parentDS *) mgt->data; + fprintf(fp, "PARENT_DATA_SET " + IFMT "parentPortIdentity %s" + IFMT "parentStats %hhu" + IFMT "observedParentOffsetScaledLogVariance 0x%04hx" + IFMT "observedParentClockPhaseChangeRate %d" + IFMT "grandmasterPriority1 %hhu" + IFMT "gm.ClockClass 0x%02hhx" + IFMT "gm.ClockAccuracy %hhu" + IFMT "gm.OffsetScaledLogVariance 0x%04hx" + IFMT "grandmasterPriority2 %hhu" + IFMT "grandmasterIdentity %s", + pid2str(&pds->parentPortIdentity), + pds->parentStats, + pds->observedParentOffsetScaledLogVariance, + pds->observedParentClockPhaseChangeRate, + pds->grandmasterPriority1, + pds->grandmasterClockQuality.clockClass, + pds->grandmasterClockQuality.clockAccuracy, + pds->grandmasterClockQuality.offsetScaledLogVariance, + pds->grandmasterPriority2, + cid2str(&pds->grandmasterIdentity)); + break; case TIME_STATUS_NP: tsn = (struct time_status_np *) mgt->data; fprintf(fp, "TIME_STATUS_NP "