Add support for the delay mechanism management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-03-04 20:23:32 +01:00
parent d30d397c2b
commit 9b5e37bbf8
2 changed files with 15 additions and 1 deletions

7
pmc.c
View File

@ -101,7 +101,7 @@ struct management_id idtab[] = {
{ "ACCEPTABLE_MASTER_TABLE_ENABLED", ACCEPTABLE_MASTER_TABLE_ENABLED, not_supported }, { "ACCEPTABLE_MASTER_TABLE_ENABLED", ACCEPTABLE_MASTER_TABLE_ENABLED, not_supported },
{ "ALTERNATE_MASTER", ALTERNATE_MASTER, not_supported }, { "ALTERNATE_MASTER", ALTERNATE_MASTER, not_supported },
{ "TRANSPARENT_CLOCK_PORT_DATA_SET", TRANSPARENT_CLOCK_PORT_DATA_SET, not_supported }, { "TRANSPARENT_CLOCK_PORT_DATA_SET", TRANSPARENT_CLOCK_PORT_DATA_SET, not_supported },
{ "DELAY_MECHANISM", DELAY_MECHANISM, not_supported }, { "DELAY_MECHANISM", DELAY_MECHANISM, do_get_action },
{ "LOG_MIN_PDELAY_REQ_INTERVAL", LOG_MIN_PDELAY_REQ_INTERVAL, not_supported }, { "LOG_MIN_PDELAY_REQ_INTERVAL", LOG_MIN_PDELAY_REQ_INTERVAL, not_supported },
}; };
@ -415,6 +415,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
fprintf(fp, "VERSION_NUMBER " fprintf(fp, "VERSION_NUMBER "
IFMT "versionNumber %hhu", mtd->val); IFMT "versionNumber %hhu", mtd->val);
break; break;
case DELAY_MECHANISM:
mtd = (struct management_tlv_datum *) mgt->data;
fprintf(fp, "DELAY_MECHANISM "
IFMT "delayMechanism %hhu", mtd->val);
break;
} }
out: out:
fprintf(fp, "\n"); fprintf(fp, "\n");

9
port.c
View File

@ -582,6 +582,15 @@ static int port_management_get_response(struct port *target,
datalen = sizeof(*mtd); datalen = sizeof(*mtd);
respond = 1; respond = 1;
break; break;
case DELAY_MECHANISM:
mtd = (struct management_tlv_datum *) tlv->data;
if (target->delayMechanism)
mtd->val = target->delayMechanism;
else
mtd->val = DM_E2E;
datalen = sizeof(*mtd);
respond = 1;
break;
} }
if (respond) { if (respond) {
if (datalen % 2) { if (datalen % 2) {