Mykola Zhuravel
2017-07-17 14:22:29 UTC
Signed-off-by: Mykola Zhuravel <***@mellanox.com>
---
pmc.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/pmc.c b/pmc.c
index af9cc63..0faa770 100644
--- a/pmc.c
+++ b/pmc.c
@@ -107,6 +107,7 @@ struct management_id idtab[] = {
{ "DELAY_MECHANISM", TLV_DELAY_MECHANISM, do_get_action },
{ "LOG_MIN_PDELAY_REQ_INTERVAL", TLV_LOG_MIN_PDELAY_REQ_INTERVAL, do_get_action },
{ "PORT_DATA_SET_NP", TLV_PORT_DATA_SET_NP, do_set_action },
+ { "PORT_PROPERTIES_NP", TLV_PORT_PROPERTIES_NP, do_get_action },
};
static const char *action_string[] = {
@@ -196,6 +197,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
struct mgmt_clock_description *cd;
struct portDS *p;
struct port_ds_np *pnp;
+ struct port_properties_np *ppnp;
if (msg_type(msg) != MANAGEMENT) {
return;
}
@@ -477,6 +479,19 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
fprintf(fp, "LOG_MIN_PDELAY_REQ_INTERVAL "
IFMT "logMinPdelayReqInterval %hhd", mtd->val);
break;
+ case TLV_PORT_PROPERTIES_NP:
+ ppnp = (struct port_properties_np *) mgt->data;
+ if (ppnp->port_state > PS_SLAVE) {
+ ppnp->port_state = 0;
+ }
+ fprintf(fp, "PORT_PROPERTIES_NP "
+ IFMT "portIdentity %s"
+ IFMT "portState %s"
+ IFMT "timestamping %hhu"
+ IFMT "interface %s",
+ pid2str(&ppnp->portIdentity), ps_str[ppnp->port_state],
+ ppnp->timestamping, text2str(&ppnp->interface));
+ break;
}
out:
fprintf(fp, "\n");
---
pmc.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/pmc.c b/pmc.c
index af9cc63..0faa770 100644
--- a/pmc.c
+++ b/pmc.c
@@ -107,6 +107,7 @@ struct management_id idtab[] = {
{ "DELAY_MECHANISM", TLV_DELAY_MECHANISM, do_get_action },
{ "LOG_MIN_PDELAY_REQ_INTERVAL", TLV_LOG_MIN_PDELAY_REQ_INTERVAL, do_get_action },
{ "PORT_DATA_SET_NP", TLV_PORT_DATA_SET_NP, do_set_action },
+ { "PORT_PROPERTIES_NP", TLV_PORT_PROPERTIES_NP, do_get_action },
};
static const char *action_string[] = {
@@ -196,6 +197,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
struct mgmt_clock_description *cd;
struct portDS *p;
struct port_ds_np *pnp;
+ struct port_properties_np *ppnp;
if (msg_type(msg) != MANAGEMENT) {
return;
}
@@ -477,6 +479,19 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
fprintf(fp, "LOG_MIN_PDELAY_REQ_INTERVAL "
IFMT "logMinPdelayReqInterval %hhd", mtd->val);
break;
+ case TLV_PORT_PROPERTIES_NP:
+ ppnp = (struct port_properties_np *) mgt->data;
+ if (ppnp->port_state > PS_SLAVE) {
+ ppnp->port_state = 0;
+ }
+ fprintf(fp, "PORT_PROPERTIES_NP "
+ IFMT "portIdentity %s"
+ IFMT "portState %s"
+ IFMT "timestamping %hhu"
+ IFMT "interface %s",
+ pid2str(&ppnp->portIdentity), ps_str[ppnp->port_state],
+ ppnp->timestamping, text2str(&ppnp->interface));
+ break;
}
out:
fprintf(fp, "\n");
--
2.8.4
2.8.4