aboutsummaryrefslogtreecommitdiff
path: root/src/util/os_network.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/util/os_network.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/util/os_network.c')
-rw-r--r--src/util/os_network.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/src/util/os_network.c b/src/util/os_network.c
index af8046814..21376f94c 100644
--- a/src/util/os_network.c
+++ b/src/util/os_network.c
@@ -131,15 +131,12 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
131 131
132 /* Set entry */ 132 /* Set entry */
133 memset (bPhysAddr, 0, MAXLEN_PHYSADDR); 133 memset (bPhysAddr, 0, MAXLEN_PHYSADDR);
134 memcpy (bPhysAddr, 134 memcpy (bPhysAddr, pTable->table[dwIfIdx].bPhysAddr,
135 pTable->table[dwIfIdx].bPhysAddr,
136 pTable->table[dwIfIdx].dwPhysAddrLen); 135 pTable->table[dwIfIdx].dwPhysAddrLen);
137 136
138 snprintf (szEntry, 1000, "%s (%s - %I64u)", 137 snprintf (szEntry, 1000, "%s (%s - %I64u)",
139 pszIfName ? pszIfName : (char *) 138 pszIfName ? pszIfName : (char *) pTable->table[dwIfIdx].
140 pTable->table[dwIfIdx].bDescr, inet_ntop (AF_INET, 139 bDescr, inet_ntop (AF_INET, &dwIP, dst, INET_ADDRSTRLEN),
141 &dwIP, dst,
142 INET_ADDRSTRLEN),
143 *((unsigned long long *) bPhysAddr)); 140 *((unsigned long long *) bPhysAddr));
144 szEntry[1000] = 0; 141 szEntry[1000] = 0;
145 142
@@ -153,8 +150,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
153 sa.sin_addr.S_un.S_addr = dwIP; 150 sa.sin_addr.S_un.S_addr = dwIP;
154 151
155 if (GNUNET_OK != 152 if (GNUNET_OK !=
156 proc (proc_cls, 153 proc (proc_cls, szEntry,
157 szEntry,
158 pTable->table[dwIfIdx].dwIndex == dwExternalNIC, 154 pTable->table[dwIfIdx].dwIndex == dwExternalNIC,
159 (const struct sockaddr *) &sa, sizeof (sa))) 155 (const struct sockaddr *) &sa, sizeof (sa)))
160 break; 156 break;
@@ -176,8 +172,8 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
176 { 172 {
177 for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next) 173 for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next)
178 { 174 {
179 if (ifa_ptr->ifa_name != NULL && 175 if (ifa_ptr->ifa_name != NULL && ifa_ptr->ifa_addr != NULL &&
180 ifa_ptr->ifa_addr != NULL && (ifa_ptr->ifa_flags & IFF_UP) != 0) 176 (ifa_ptr->ifa_flags & IFF_UP) != 0)
181 { 177 {
182 if ((ifa_ptr->ifa_addr->sa_family != AF_INET) && 178 if ((ifa_ptr->ifa_addr->sa_family != AF_INET) &&
183 (ifa_ptr->ifa_addr->sa_family != AF_INET6)) 179 (ifa_ptr->ifa_addr->sa_family != AF_INET6))
@@ -186,11 +182,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
186 alen = sizeof (struct sockaddr_in); 182 alen = sizeof (struct sockaddr_in);
187 else 183 else
188 alen = sizeof (struct sockaddr_in6); 184 alen = sizeof (struct sockaddr_in6);
189 if (GNUNET_OK != proc (proc_cls, 185 if (GNUNET_OK !=
190 ifa_ptr->ifa_name, 186 proc (proc_cls, ifa_ptr->ifa_name,
191 0 == strcmp (ifa_ptr->ifa_name, 187 0 == strcmp (ifa_ptr->ifa_name, GNUNET_DEFAULT_INTERFACE),
192 GNUNET_DEFAULT_INTERFACE), 188 ifa_ptr->ifa_addr, alen))
193 ifa_ptr->ifa_addr, alen))
194 break; 189 break;
195 } 190 }
196 } 191 }
@@ -261,9 +256,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
261#endif 256#endif
262 a4.sin_addr = v4; 257 a4.sin_addr = v4;
263 if (GNUNET_OK != 258 if (GNUNET_OK !=
264 proc (proc_cls, 259 proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
265 ifc,
266 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
267 (const struct sockaddr *) &a4, sizeof (a4))) 260 (const struct sockaddr *) &a4, sizeof (a4)))
268 break; 261 break;
269 continue; 262 continue;
@@ -278,9 +271,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
278#endif 271#endif
279 a6.sin6_addr = v6; 272 a6.sin6_addr = v6;
280 if (GNUNET_OK != 273 if (GNUNET_OK !=
281 proc (proc_cls, 274 proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
282 ifc,
283 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
284 (const struct sockaddr *) &a6, sizeof (a6))) 275 (const struct sockaddr *) &a6, sizeof (a6)))
285 break; 276 break;
286 continue; 277 continue;