Add support for the domain management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-03-03 19:54:17 +01:00
parent 8cc3a1f3b8
commit bed1067d2b
2 changed files with 12 additions and 1 deletions

View File

@ -210,6 +210,12 @@ static int clock_management_get_response(struct clock *c, struct port *p,
datalen = sizeof(*mtd); datalen = sizeof(*mtd);
respond = 1; respond = 1;
break; 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: case TIME_STATUS_NP:
tsn = (struct time_status_np *) tlv->data; tsn = (struct time_status_np *) tlv->data;
tsn->master_offset = c->master_offset; tsn->master_offset = c->master_offset;

7
pmc.c
View File

@ -66,7 +66,7 @@ struct management_id idtab[] = {
{ "TIME_PROPERTIES_DATA_SET", TIME_PROPERTIES_DATA_SET, do_get_action }, { "TIME_PROPERTIES_DATA_SET", TIME_PROPERTIES_DATA_SET, do_get_action },
{ "PRIORITY1", PRIORITY1, do_get_action }, { "PRIORITY1", PRIORITY1, do_get_action },
{ "PRIORITY2", PRIORITY2, do_get_action }, { "PRIORITY2", PRIORITY2, do_get_action },
{ "DOMAIN", DOMAIN, not_supported }, { "DOMAIN", DOMAIN, do_get_action },
{ "SLAVE_ONLY", SLAVE_ONLY, not_supported }, { "SLAVE_ONLY", SLAVE_ONLY, not_supported },
{ "TIME", TIME, not_supported }, { "TIME", TIME, not_supported },
{ "CLOCK_ACCURACY", CLOCK_ACCURACY, 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 " fprintf(fp, "PRIORITY2 "
IFMT "priority2 %hhu", mtd->val); IFMT "priority2 %hhu", mtd->val);
break; break;
case DOMAIN:
mtd = (struct management_tlv_datum *) mgt->data;
fprintf(fp, "DOMAIN "
IFMT "domainNumber %hhu", mtd->val);
break;
case TIME_STATUS_NP: case TIME_STATUS_NP:
tsn = (struct time_status_np *) mgt->data; tsn = (struct time_status_np *) mgt->data;
fprintf(fp, "TIME_STATUS_NP " fprintf(fp, "TIME_STATUS_NP "