aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-11-17 16:39:10 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-11-17 16:39:10 +0000
commitf3fdda9eec15076d54f296a7418b1984a8beba66 (patch)
treec304978bce5b744b30d32d9082998f044933df5e /src/util
parent782f3c0ce710d67c869d92078c6d64c55992997f (diff)
downloadgnunet-f3fdda9eec15076d54f296a7418b1984a8beba66.tar.gz
gnunet-f3fdda9eec15076d54f296a7418b1984a8beba66.zip
api change for network interface iterations to support broadcast address and network mask
Diffstat (limited to 'src/util')
-rw-r--r--src/util/os_network.c20
-rw-r--r--src/util/test_os_network.c6
2 files changed, 21 insertions, 5 deletions
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,
157 if (GNUNET_OK != 157 if (GNUNET_OK !=
158 proc (proc_cls, szEntry, 158 proc (proc_cls, szEntry,
159 pTable->table[dwIfIdx].dwIndex == dwExternalNIC, 159 pTable->table[dwIfIdx].dwIndex == dwExternalNIC,
160 (const struct sockaddr *) &sa, sizeof (sa))) 160 (const struct sockaddr *) &sa,
161 NULL,
162 NULL,
163 sizeof (sa)))
161 break; 164 break;
162 } 165 }
163 } 166 }
@@ -190,7 +193,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
190 if (GNUNET_OK != 193 if (GNUNET_OK !=
191 proc (proc_cls, ifa_ptr->ifa_name, 194 proc (proc_cls, ifa_ptr->ifa_name,
192 0 == strcmp (ifa_ptr->ifa_name, GNUNET_DEFAULT_INTERFACE), 195 0 == strcmp (ifa_ptr->ifa_name, GNUNET_DEFAULT_INTERFACE),
193 ifa_ptr->ifa_addr, alen)) 196 ifa_ptr->ifa_addr,
197 NULL,
198 NULL,
199 alen))
194 break; 200 break;
195 } 201 }
196 } 202 }
@@ -262,7 +268,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
262 a4.sin_addr = v4; 268 a4.sin_addr = v4;
263 if (GNUNET_OK != 269 if (GNUNET_OK !=
264 proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE), 270 proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
265 (const struct sockaddr *) &a4, sizeof (a4))) 271 (const struct sockaddr *) &a4,
272 NULL,
273 NULL,
274 sizeof (a4)))
266 break; 275 break;
267 continue; 276 continue;
268 } 277 }
@@ -277,7 +286,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
277 a6.sin6_addr = v6; 286 a6.sin6_addr = v6;
278 if (GNUNET_OK != 287 if (GNUNET_OK !=
279 proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE), 288 proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
280 (const struct sockaddr *) &a6, sizeof (a6))) 289 (const struct sockaddr *) &a6,
290 NULL,
291 NULL,
292 sizeof (a6)))
281 break; 293 break;
282 continue; 294 continue;
283 } 295 }
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 @@
34 * (success). 34 * (success).
35 */ 35 */
36static int 36static int
37proc (void *cls, const char *name, int isDefault, const struct sockaddr *addr, 37proc (void *cls, const char *name,
38 int isDefault,
39 const struct sockaddr * addr,
40 const struct sockaddr * broadcast_addr,
41 const struct sockaddr * netmask,
38 socklen_t addrlen) 42 socklen_t addrlen)
39{ 43{
40 int *ok = cls; 44 int *ok = cls;