diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2022-07-22 16:39:36 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2022-07-25 14:10:00 -0400 |
commit | a667957f7b23502da111dc2b314a6ad4120c590d (patch) | |
tree | dd382e0db731e57465581380ba79b427b26dde98 /agent/interfaces.h | |
parent | 15c8feae5516079aafec4134e823f7c927183fa5 (diff) | |
download | libnice-a667957f7b23502da111dc2b314a6ad4120c590d.tar.gz |
interfaces: Add API to find the interface index from a local address
This will find some interface that has the address and will not work
correctly if multiple interfaces have the same address. But in any
case, nothing in libnice expects that and we would need to break the
API to make that work.
Diffstat (limited to 'agent/interfaces.h')
-rw-r--r-- | agent/interfaces.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/agent/interfaces.h b/agent/interfaces.h index 50c627e..1bb3603 100644 --- a/agent/interfaces.h +++ b/agent/interfaces.h @@ -37,6 +37,7 @@ */ #include <glib.h> +#include <address.h> G_BEGIN_DECLS @@ -77,6 +78,21 @@ GList * nice_interfaces_get_local_ips (gboolean include_loopback); */ GList * nice_interfaces_get_local_interfaces (void); + +/** + * nice_interfaces_get_if_index_by_addr: + * @addr: A #NiceAddress for a local interface + * + * Returns the interface index match the local address passed. This can + * by used for APIs that need a specific address. + * + * Returns: The interface index or 0 on error + * + * Since: 0.1.20 + */ + +guint nice_interfaces_get_if_index_by_addr (NiceAddress *addr); + G_END_DECLS #endif /* __LIBNICE_INTERFACES_H__ */ |