Petri needs to decide, but for consistency with other accessors, this
should be odp_pktio_name().


On Mon, Nov 24, 2014 at 5:54 AM, Maxim Uvarov <[email protected]>
wrote:

> Signed-off-by: Maxim Uvarov <[email protected]>
> ---
>  platform/linux-generic/include/api/odp_packet_io.h | 10 ++++++++++
>  platform/linux-generic/odp_packet_io.c             | 11 +++++++++++
>  2 files changed, 21 insertions(+)
>
> diff --git a/platform/linux-generic/include/api/odp_packet_io.h
> b/platform/linux-generic/include/api/odp_packet_io.h
> index 667395c..b3b7ea6 100644
> --- a/platform/linux-generic/include/api/odp_packet_io.h
> +++ b/platform/linux-generic/include/api/odp_packet_io.h
> @@ -148,6 +148,16 @@ int odp_pktio_set_mtu(odp_pktio_t id, int mtu);
>   */
>  int odp_pktio_mtu(odp_pktio_t id);
>
> +/*
> + * Return the interface name from a pktio handle. This is the
> + * name that was passed to the odp_pktio_open() call.
> + *
> + * @param[in] id ODP Packet IO handle.
> + *
> + * @return pointer to the iface name or NULL.
> + */
> +const char *odp_pktio_get_name(odp_pktio_t id);
> +
>  /**
>   * @}
>   */
> diff --git a/platform/linux-generic/odp_packet_io.c
> b/platform/linux-generic/odp_packet_io.c
> index c523350..9ceb989 100644
> --- a/platform/linux-generic/odp_packet_io.c
> +++ b/platform/linux-generic/odp_packet_io.c
> @@ -542,3 +542,14 @@ int odp_pktio_mtu(odp_pktio_t id)
>
>         return ifr.ifr_mtu;
>  }
> +
> +const char *odp_pktio_get_name(odp_pktio_t id)
> +{
> +       pktio_entry_t *entry;
> +
> +       entry = get_entry(id);
> +       if (entry == NULL)
> +               return NULL;
> +
> +       return entry->s.name;
> +}
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to