diff --git a/clock.c b/clock.c index f5aa3c4..4913d02 100644 --- a/clock.c +++ b/clock.c @@ -216,6 +216,12 @@ static int clock_management_get_response(struct clock *c, struct port *p, datalen = sizeof(*mtd); respond = 1; break; + case SLAVE_ONLY: + mtd = (struct management_tlv_datum *) tlv->data; + mtd->val = c->dds.flags & DDS_SLAVE_ONLY; + datalen = sizeof(*mtd); + respond = 1; + break; case TIME_STATUS_NP: tsn = (struct time_status_np *) tlv->data; tsn->master_offset = c->master_offset; diff --git a/pmc.c b/pmc.c index 7d56183..cd48e19 100644 --- a/pmc.c +++ b/pmc.c @@ -67,7 +67,7 @@ struct management_id idtab[] = { { "PRIORITY1", PRIORITY1, do_get_action }, { "PRIORITY2", PRIORITY2, do_get_action }, { "DOMAIN", DOMAIN, do_get_action }, - { "SLAVE_ONLY", SLAVE_ONLY, not_supported }, + { "SLAVE_ONLY", SLAVE_ONLY, do_get_action }, { "TIME", TIME, not_supported }, { "CLOCK_ACCURACY", CLOCK_ACCURACY, not_supported }, { "UTC_PROPERTIES", UTC_PROPERTIES, not_supported }, @@ -328,6 +328,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) fprintf(fp, "DOMAIN " IFMT "domainNumber %hhu", mtd->val); break; + case SLAVE_ONLY: + mtd = (struct management_tlv_datum *) mgt->data; + fprintf(fp, "SLAVE_ONLY " + IFMT "slaveOnly %d", mtd->val & DDS_SLAVE_ONLY ? 1 : 0); + break; case TIME_STATUS_NP: tsn = (struct time_status_np *) mgt->data; fprintf(fp, "TIME_STATUS_NP "