From bed1067d2b3087fa6a713c9fe1fcae03871fe2d7 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 3 Mar 2013 19:54:17 +0100 Subject: [PATCH] Add support for the domain management request. Signed-off-by: Richard Cochran --- clock.c | 6 ++++++ pmc.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/clock.c b/clock.c index 02b3a0f..f5aa3c4 100644 --- a/clock.c +++ b/clock.c @@ -210,6 +210,12 @@ static int clock_management_get_response(struct clock *c, struct port *p, datalen = sizeof(*mtd); respond = 1; break; + case DOMAIN: + mtd = (struct management_tlv_datum *) tlv->data; + mtd->val = c->dds.domainNumber; + datalen = sizeof(*mtd); + respond = 1; + break; case TIME_STATUS_NP: tsn = (struct time_status_np *) tlv->data; tsn->master_offset = c->master_offset; diff --git a/pmc.c b/pmc.c index 169b0a6..7d56183 100644 --- a/pmc.c +++ b/pmc.c @@ -66,7 +66,7 @@ struct management_id idtab[] = { { "TIME_PROPERTIES_DATA_SET", TIME_PROPERTIES_DATA_SET, do_get_action }, { "PRIORITY1", PRIORITY1, do_get_action }, { "PRIORITY2", PRIORITY2, do_get_action }, - { "DOMAIN", DOMAIN, not_supported }, + { "DOMAIN", DOMAIN, do_get_action }, { "SLAVE_ONLY", SLAVE_ONLY, not_supported }, { "TIME", TIME, not_supported }, { "CLOCK_ACCURACY", CLOCK_ACCURACY, not_supported }, @@ -323,6 +323,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp) fprintf(fp, "PRIORITY2 " IFMT "priority2 %hhu", mtd->val); break; + case DOMAIN: + mtd = (struct management_tlv_datum *) mgt->data; + fprintf(fp, "DOMAIN " + IFMT "domainNumber %hhu", mtd->val); + break; case TIME_STATUS_NP: tsn = (struct time_status_np *) mgt->data; fprintf(fp, "TIME_STATUS_NP "