From 822eb164a15ae746c5a8c514f581fb47200fe463 Mon Sep 17 00:00:00 2001 From: Inaky Perez-Gonzalez Date: Mon, 20 Apr 2009 16:58:35 -0700 Subject: libwimaxll: add wimaxll_ifidx() to report the interface index the handle refers to Signed-off-by: Inaky Perez-Gonzalez --- include/wimaxll.h | 1 + lib/wimax.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/wimaxll.h b/include/wimaxll.h index 5396c16..c2469f2 100644 --- a/include/wimaxll.h +++ b/include/wimaxll.h @@ -308,6 +308,7 @@ void *wimaxll_priv_get(struct wimaxll_handle *); void wimaxll_priv_set(struct wimaxll_handle *, void *); void wimaxll_close(struct wimaxll_handle *); const char *wimaxll_ifname(const struct wimaxll_handle *); +unsigned wimaxll_ifidx(const struct wimaxll_handle *); /* Wait for data from the kernel, execute callbacks */ int wimaxll_recv_fd(struct wimaxll_handle *); diff --git a/lib/wimax.c b/lib/wimax.c index d579d8c..83bc16e 100644 --- a/lib/wimax.c +++ b/lib/wimax.c @@ -271,6 +271,26 @@ const char *wimaxll_ifname(const struct wimaxll_handle *wmx) } +/** + * Return the interface index of the system's WiMAX interface + * associated to an open handle + * + * \param wmx WiMAX device handle + * \return Interface index + * + * Note that if this is an \e any interface (open for all devices), + * this will vary. When not processing a callback, it will be + * zero. When processing a callback, this call will return the + * interface for which the callback was executed. + * + * \ingroup device_management + */ +unsigned wimaxll_ifidx(const struct wimaxll_handle *wmx) +{ + return wmx->ifidx; +} + + /** * Set the private data associated to a WiMAX device handle * -- cgit v1.2.3