Skip to content

Commit

Permalink
Add support for the version number 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 4, 2013
1 parent 06a6500 commit d30d397
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct management_id idtab[] = {
{ "LOG_ANNOUNCE_INTERVAL", LOG_ANNOUNCE_INTERVAL, do_get_action },
{ "ANNOUNCE_RECEIPT_TIMEOUT", ANNOUNCE_RECEIPT_TIMEOUT, do_get_action },
{ "LOG_SYNC_INTERVAL", LOG_SYNC_INTERVAL, do_get_action },
{ "VERSION_NUMBER", VERSION_NUMBER, not_supported },
{ "VERSION_NUMBER", VERSION_NUMBER, do_get_action },
{ "ENABLE_PORT", ENABLE_PORT, not_supported },
{ "DISABLE_PORT", DISABLE_PORT, not_supported },
{ "UNICAST_NEGOTIATION_ENABLE", UNICAST_NEGOTIATION_ENABLE, not_supported },
Expand Down Expand Up @@ -410,6 +410,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
fprintf(fp, "ANNOUNCE_RECEIPT_TIMEOUT "
IFMT "logSyncInterval %hhd", mtd->val);
break;
case VERSION_NUMBER:
mtd = (struct management_tlv_datum *) mgt->data;
fprintf(fp, "VERSION_NUMBER "
IFMT "versionNumber %hhu", mtd->val);
break;
}
out:
fprintf(fp, "\n");
Expand Down
6 changes: 6 additions & 0 deletions port.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,12 @@ static int port_management_get_response(struct port *target,
datalen = sizeof(*mtd);
respond = 1;
break;
case VERSION_NUMBER:
mtd = (struct management_tlv_datum *) tlv->data;
mtd->val = target->versionNumber;
datalen = sizeof(*mtd);
respond = 1;
break;
}
if (respond) {
if (datalen % 2) {
Expand Down

0 comments on commit d30d397

Please sign in to comment.