From f3fdda9eec15076d54f296a7418b1984a8beba66 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 17 Nov 2011 16:39:10 +0000 Subject: api change for network interface iterations to support broadcast address and network mask --- src/util/os_network.c | 20 ++++++++++++++++---- src/util/test_os_network.c | 6 +++++- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'src/util') diff --git a/src/util/os_network.c b/src/util/os_network.c index 70d143ba1..1fd55ff04 100644 --- a/src/util/os_network.c +++ b/src/util/os_network.c @@ -157,7 +157,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, if (GNUNET_OK != proc (proc_cls, szEntry, pTable->table[dwIfIdx].dwIndex == dwExternalNIC, - (const struct sockaddr *) &sa, sizeof (sa))) + (const struct sockaddr *) &sa, + NULL, + NULL, + sizeof (sa))) break; } } @@ -190,7 +193,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, if (GNUNET_OK != proc (proc_cls, ifa_ptr->ifa_name, 0 == strcmp (ifa_ptr->ifa_name, GNUNET_DEFAULT_INTERFACE), - ifa_ptr->ifa_addr, alen)) + ifa_ptr->ifa_addr, + NULL, + NULL, + alen)) break; } } @@ -262,7 +268,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, a4.sin_addr = v4; if (GNUNET_OK != proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE), - (const struct sockaddr *) &a4, sizeof (a4))) + (const struct sockaddr *) &a4, + NULL, + NULL, + sizeof (a4))) break; continue; } @@ -277,7 +286,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, a6.sin6_addr = v6; if (GNUNET_OK != proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE), - (const struct sockaddr *) &a6, sizeof (a6))) + (const struct sockaddr *) &a6, + NULL, + NULL, + sizeof (a6))) break; continue; } diff --git a/src/util/test_os_network.c b/src/util/test_os_network.c index 315f97d97..ab39e5eda 100644 --- a/src/util/test_os_network.c +++ b/src/util/test_os_network.c @@ -34,7 +34,11 @@ * (success). */ static int -proc (void *cls, const char *name, int isDefault, const struct sockaddr *addr, +proc (void *cls, const char *name, + int isDefault, + const struct sockaddr * addr, + const struct sockaddr * broadcast_addr, + const struct sockaddr * netmask, socklen_t addrlen) { int *ok = cls; -- cgit v1.2.3