From: Vincent Cheng <vincent.cheng...@renesas.com>

Signed-off-by: Vincent Cheng <vincent.cheng...@renesas.com>
---
 unicast_client.c | 16 ++++++++++++++++
 unicast_client.h | 11 +++++++++++
 2 files changed, 27 insertions(+)

diff --git a/unicast_client.c b/unicast_client.c
index 87d8471..4d6386e 100644
--- a/unicast_client.c
+++ b/unicast_client.c
@@ -547,3 +547,19 @@ int unicast_client_timer(struct port *p)
        unicast_client_set_tmo(p);
        return err;
 }
+
+int unicast_client_unicast_master_table_received(struct port *p, struct 
ptp_message *m)
+{
+       struct unicast_master_address *ucma;
+
+       if (!unicast_client_enabled(p)) {
+               return 0;
+       }
+       STAILQ_FOREACH(ucma, &p->unicast_master_table->addrs, list) {
+               if (addreq(transport_type(p->trp), &ucma->address, 
&m->address)) {
+                       break;
+               }
+       }
+       return ucma ? 1 : 0;
+}
+
diff --git a/unicast_client.h b/unicast_client.h
index 16e291f..b24c4eb 100644
--- a/unicast_client.h
+++ b/unicast_client.h
@@ -82,4 +82,15 @@ void unicast_client_state_changed(struct port *p);
  */
 int unicast_client_timer(struct port *p);
 
+/**
+ * Check whether a message was received from an entry in the unicast
+ * master table.
+ * @param p      The port in question.
+ * @param m      The message in question.
+ * @return       One (1) if the message is from an entry in the unicast
+ *               master table, or zero otherwise.
+ */
+int unicast_client_unicast_master_table_received(struct port *p, 
+                                                struct ptp_message *m);
+
 #endif
-- 
2.34.1



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to