Signed-off-by: Jiri Benc <[email protected]>
---
port.c | 7 +++++++
port.h | 8 ++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/port.c b/port.c
index 164de9b6898d..d5650ac7172e 100644
--- a/port.c
+++ b/port.c
@@ -2170,6 +2170,13 @@ int port_forward(struct port *p, struct ptp_message *msg)
return cnt <= 0 ? -1 : 0;
}
+int port_forward_to(struct port *p, struct ptp_message *msg)
+{
+ int cnt;
+ cnt = transport_sendto(p->trp, &p->fda, 0, msg);
+ return cnt <= 0 ? -1 : 0;
+}
+
int port_prepare_and_send(struct port *p, struct ptp_message *msg, int event)
{
int cnt;
diff --git a/port.h b/port.h
index 86a6f173bf98..34103a6a24ee 100644
--- a/port.h
+++ b/port.h
@@ -92,6 +92,14 @@ enum fsm_event port_event(struct port *port, int fd_index);
int port_forward(struct port *p, struct ptp_message *msg);
/**
+ * Forward a message on a given port to the address stored in the message.
+ * @param port A pointer previously obtained via port_open().
+ * @param msg The message to send. Must be in network byte order.
+ * @return Zero on success, non-zero otherwise.
+ */
+int port_forward_to(struct port *p, struct ptp_message *msg);
+
+/**
* Prepare message for transmission and send it to a given port. Note that
* a single message cannot be sent several times using this function, that
* would lead to corrupted data being sent. Use msg_pre_send and
--
1.7.6.5
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel