Add support for the log announce interval management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-03-04 20:06:36 +01:00
parent 2044d045b4
commit 555c42e3d0
2 changed files with 13 additions and 1 deletions

7
pmc.c
View File

@ -89,7 +89,7 @@ struct management_id idtab[] = {
{ "NULL_MANAGEMENT", NULL_MANAGEMENT, null_management }, { "NULL_MANAGEMENT", NULL_MANAGEMENT, null_management },
{ "CLOCK_DESCRIPTION", CLOCK_DESCRIPTION, do_get_action }, { "CLOCK_DESCRIPTION", CLOCK_DESCRIPTION, do_get_action },
{ "PORT_DATA_SET", PORT_DATA_SET, do_get_action }, { "PORT_DATA_SET", PORT_DATA_SET, do_get_action },
{ "LOG_ANNOUNCE_INTERVAL", LOG_ANNOUNCE_INTERVAL, not_supported }, { "LOG_ANNOUNCE_INTERVAL", LOG_ANNOUNCE_INTERVAL, do_get_action },
{ "ANNOUNCE_RECEIPT_TIMEOUT", ANNOUNCE_RECEIPT_TIMEOUT, not_supported }, { "ANNOUNCE_RECEIPT_TIMEOUT", ANNOUNCE_RECEIPT_TIMEOUT, not_supported },
{ "LOG_SYNC_INTERVAL", LOG_SYNC_INTERVAL, not_supported }, { "LOG_SYNC_INTERVAL", LOG_SYNC_INTERVAL, not_supported },
{ "VERSION_NUMBER", VERSION_NUMBER, not_supported }, { "VERSION_NUMBER", VERSION_NUMBER, not_supported },
@ -395,6 +395,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
p->logSyncInterval, p->delayMechanism, p->logSyncInterval, p->delayMechanism,
p->logMinPdelayReqInterval, p->versionNumber); p->logMinPdelayReqInterval, p->versionNumber);
break; break;
case LOG_ANNOUNCE_INTERVAL:
mtd = (struct management_tlv_datum *) mgt->data;
fprintf(fp, "LOG_ANNOUNCE_INTERVAL "
IFMT "logAnnounceInterval %hhd", mtd->val);
break;
} }
out: out:
fprintf(fp, "\n"); fprintf(fp, "\n");

7
port.c
View File

@ -447,6 +447,7 @@ static int port_management_get_response(struct port *target,
{ {
int datalen = 0, err, pdulen, respond = 0; int datalen = 0, err, pdulen, respond = 0;
struct management_tlv *tlv; struct management_tlv *tlv;
struct management_tlv_datum *mtd;
struct ptp_message *rsp; struct ptp_message *rsp;
struct portDS *pds; struct portDS *pds;
struct PortIdentity pid = port_identity(target); struct PortIdentity pid = port_identity(target);
@ -557,6 +558,12 @@ static int port_management_get_response(struct port *target,
datalen = sizeof(*pds); datalen = sizeof(*pds);
respond = 1; respond = 1;
break; break;
case LOG_ANNOUNCE_INTERVAL:
mtd = (struct management_tlv_datum *) tlv->data;
mtd->val = target->logAnnounceInterval;
datalen = sizeof(*mtd);
respond = 1;
break;
} }
if (respond) { if (respond) {
if (datalen % 2) { if (datalen % 2) {