parent
d6e4173e19
commit
d0a67e8b1a
7
port.c
7
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;
|
||||
|
|
8
port.h
8
port.h
|
@ -91,6 +91,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
|
||||
|
|
Loading…
Reference in New Issue