Re: [Linuxptp-devel] [PATCH RFC 08/30] interface: Introduce an access method for the time stamping label.

2020-02-18 Thread Jacob Keller



On 2/11/2020 6:03 AM, Richard Cochran wrote:
> 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 

Makes sense.

> ---
>  interface.c | 5 +
>  interface.h | 9 +
>  2 files changed, 14 insertions(+)
> 
> diff --git a/interface.c b/interface.c
> index 1231db9..7909a5e 100644
> --- a/interface.c
> +++ b/interface.c
> @@ -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;
> diff --git a/interface.h b/interface.h
> index 94d5b8f..89f3e94 100644
> --- a/interface.h
> +++ b/interface.h
> @@ -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);
> +

Nice to see this documented, and explaining why it might be different.

Thanks,
Jake

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


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH RFC 08/30] interface: Introduce an access method for the time stamping label.

2020-02-18 Thread Jacob Keller



On 2/11/2020 6:03 AM, Richard Cochran wrote:
> 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 

Reviewed-by: Jacob Keller 


___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel