Provide a method to obtain a port's identity.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-08-25 16:15:34 +02:00
parent b9c4fbc11d
commit 9da511d6f6
2 changed files with 12 additions and 0 deletions

5
port.c
View File

@ -1445,6 +1445,11 @@ int port_forward(struct port *p, struct ptp_message *msg, int msglen)
return cnt <= 0 ? -1 : 0;
}
struct PortIdentity port_identity(struct port *p)
{
return p->portIdentity;
}
int port_manage(struct port *p, struct port *ingress, struct ptp_message *msg)
{
struct management_tlv *mgt;

7
port.h
View File

@ -90,6 +90,13 @@ enum fsm_event port_event(struct port *port, int fd_index);
*/
int port_forward(struct port *p, struct ptp_message *msg, int msglen);
/**
* Obtain a port's identity.
* @param p A pointer previously obtained via port_open().
* @return The port identity of 'p'.
*/
struct PortIdentity port_identity(struct port *p);
/**
* Manage a port according to a given message.
* @param p A pointer previously obtained via port_open().