From d2f8bc5e3863fb2cea1d99939eb2eb50e245bc5e Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Mon, 4 Mar 2013 20:10:51 +0100 Subject: [PATCH] Add support for the announce receipt timeout management request. Signed-off-by: Richard Cochran --- pmc.c | 7 ++++++- port.c | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pmc.c b/pmc.c index e163c3a..641b507 100644 --- a/pmc.c +++ b/pmc.c @@ -90,7 +90,7 @@ struct management_id idtab[] = { { "CLOCK_DESCRIPTION", CLOCK_DESCRIPTION, do_get_action }, { "PORT_DATA_SET", PORT_DATA_SET, do_get_action }, { "LOG_ANNOUNCE_INTERVAL", LOG_ANNOUNCE_INTERVAL, do_get_action }, - { "ANNOUNCE_RECEIPT_TIMEOUT", ANNOUNCE_RECEIPT_TIMEOUT, not_supported }, + { "ANNOUNCE_RECEIPT_TIMEOUT", ANNOUNCE_RECEIPT_TIMEOUT, do_get_action }, { "LOG_SYNC_INTERVAL", LOG_SYNC_INTERVAL, not_supported }, { "VERSION_NUMBER", VERSION_NUMBER, not_supported }, { "ENABLE_PORT", ENABLE_PORT, not_supported }, @@ -400,6 +400,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) fprintf(fp, "LOG_ANNOUNCE_INTERVAL " IFMT "logAnnounceInterval %hhd", mtd->val); break; + case ANNOUNCE_RECEIPT_TIMEOUT: + mtd = (struct management_tlv_datum *) mgt->data; + fprintf(fp, "ANNOUNCE_RECEIPT_TIMEOUT " + IFMT "announceReceiptTimeout %hhu", mtd->val); + break; } out: fprintf(fp, "\n"); diff --git a/port.c b/port.c index f6e6a9b..63b5ebd 100644 --- a/port.c +++ b/port.c @@ -564,6 +564,12 @@ static int port_management_get_response(struct port *target, datalen = sizeof(*mtd); respond = 1; break; + case ANNOUNCE_RECEIPT_TIMEOUT: + mtd = (struct management_tlv_datum *) tlv->data; + mtd->val = target->announceReceiptTimeout; + datalen = sizeof(*mtd); + respond = 1; + break; } if (respond) { if (datalen % 2) {