Skip to content

Commit

Permalink
Provide a method to obtain a port's identity.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Aug 26, 2012
1 parent b9c4fbc commit 9da511d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions port.h
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down

0 comments on commit 9da511d

Please sign in to comment.