diff --git a/port.c b/port.c index fe44c7a..2e00ffb 100644 --- a/port.c +++ b/port.c @@ -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; diff --git a/port.h b/port.h index 852bf8b..2fc71e4 100644 --- a/port.h +++ b/port.h @@ -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().