Add support for the log sync interval management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-03-04 20:14:05 +01:00
parent d2f8bc5e38
commit 06a65003f4
2 changed files with 12 additions and 1 deletions

7
pmc.c
View File

@ -91,7 +91,7 @@ struct management_id idtab[] = {
{ "PORT_DATA_SET", PORT_DATA_SET, do_get_action },
{ "LOG_ANNOUNCE_INTERVAL", LOG_ANNOUNCE_INTERVAL, do_get_action },
{ "ANNOUNCE_RECEIPT_TIMEOUT", ANNOUNCE_RECEIPT_TIMEOUT, do_get_action },
{ "LOG_SYNC_INTERVAL", LOG_SYNC_INTERVAL, not_supported },
{ "LOG_SYNC_INTERVAL", LOG_SYNC_INTERVAL, do_get_action },
{ "VERSION_NUMBER", VERSION_NUMBER, not_supported },
{ "ENABLE_PORT", ENABLE_PORT, not_supported },
{ "DISABLE_PORT", DISABLE_PORT, not_supported },
@ -405,6 +405,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
fprintf(fp, "ANNOUNCE_RECEIPT_TIMEOUT "
IFMT "announceReceiptTimeout %hhu", mtd->val);
break;
case LOG_SYNC_INTERVAL:
mtd = (struct management_tlv_datum *) mgt->data;
fprintf(fp, "ANNOUNCE_RECEIPT_TIMEOUT "
IFMT "logSyncInterval %hhd", mtd->val);
break;
}
out:
fprintf(fp, "\n");

6
port.c
View File

@ -570,6 +570,12 @@ static int port_management_get_response(struct port *target,
datalen = sizeof(*mtd);
respond = 1;
break;
case LOG_SYNC_INTERVAL:
mtd = (struct management_tlv_datum *) tlv->data;
mtd->val = target->logSyncInterval;
datalen = sizeof(*mtd);
respond = 1;
break;
}
if (respond) {
if (datalen % 2) {