summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/wimaxll.h1
-rw-r--r--lib/wimax.c20
2 files changed, 21 insertions, 0 deletions
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
@@ -272,6 +272,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
*
* @param wmx WiMAX device handle