Skip to content

Commit

Permalink
interface: Introduce a method to get the PHC index.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
  • Loading branch information
richardcochran committed Mar 4, 2020
1 parent e43a76c commit a228de7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ const char *interface_name(struct interface *iface)
return iface->name;
}

int interface_phc_index(struct interface *iface)
{
return iface->ts_info.phc_index;
}

void interface_set_label(struct interface *iface, const char *label)
{
strncpy(iface->ts_label, label, MAX_IFNAME_SIZE);
Expand Down
7 changes: 7 additions & 0 deletions interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ const char *interface_label(struct interface *iface);
*/
const char *interface_name(struct interface *iface);

/**
* Obtains the index of a PTP Hardware Clock device from a network interface.
* @param iface The interface of interest.
* @return The PHC index of the interface.
*/
int interface_phc_index(struct interface *iface);

/**
* Set the time stamping label of a given interface.
* @param iface The interface of interest.
Expand Down

0 comments on commit a228de7

Please sign in to comment.