Skip to content

Commit

Permalink
Add support for the slave_only management request.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Mar 3, 2013
1 parent bed1067 commit 78e37eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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 "
Expand Down

0 comments on commit 78e37eb

Please sign in to comment.