Skip to content

Commit

Permalink
interface: Introduce an access method for the time stamping label.
Browse files Browse the repository at this point in the history
Many of the users only require a read only reference to the time
stamping label of the interface.  This patch adds an appropriate
method.

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 3494567 commit a3c0a88
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
*/
#include "interface.h"

const char *interface_label(struct interface *iface)
{
return iface->ts_label;
}

const char *interface_name(struct interface *iface)
{
return iface->name;
Expand Down
9 changes: 9 additions & 0 deletions interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ struct interface {
struct sk_ts_info ts_info;
};

/**
* Obtain the time stamping label of a network interface. This can be
* different from the name of the interface when bonding is in effect.
*
* @param iface The interface of interest.
* @return The time stamping device name of the network interface.
*/
const char *interface_label(struct interface *iface);

/**
* Obtains the name of a network interface.
* @param iface The interface of interest.
Expand Down

0 comments on commit a3c0a88

Please sign in to comment.