aboutsummaryrefslogtreecommitdiff
path: root/src/nat
diff options
context:
space:
mode:
authorNils Durner <durner@gnunet.org>2010-11-27 15:47:58 +0000
committerNils Durner <durner@gnunet.org>2010-11-27 15:47:58 +0000
commit8de189bfcf8a5d6d4713c9151a7746a94c54c9a8 (patch)
tree5591dbf648d393fee1bf79d3c899c3a5e6288619 /src/nat
parentba52efc2cea97fa337aa850f3cb23ecde0443a3b (diff)
downloadgnunet-8de189bfcf8a5d6d4713c9151a7746a94c54c9a8.tar.gz
gnunet-8de189bfcf8a5d6d4713c9151a7746a94c54c9a8.zip
MinGW
Diffstat (limited to 'src/nat')
-rw-r--r--src/nat/nat.c2
-rw-r--r--src/nat/upnp-commands.c4
-rw-r--r--src/nat/upnp-discover.c5
-rw-r--r--src/nat/upnp.c5
4 files changed, 13 insertions, 3 deletions
diff --git a/src/nat/nat.c b/src/nat/nat.c
index eb203265c..ca6df0573 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -131,7 +131,7 @@ get_nat_state_str (enum GNUNET_NAT_PortState state)
131static int 131static int
132get_traversal_status (const struct GNUNET_NAT_Handle *h) 132get_traversal_status (const struct GNUNET_NAT_Handle *h)
133{ 133{
134 return MAX (h->natpmp_status, h->upnp_status); 134 return GNUNET_MAX (h->natpmp_status, h->upnp_status);
135} 135}
136 136
137 137
diff --git a/src/nat/upnp-commands.c b/src/nat/upnp-commands.c
index d9962117d..00655f753 100644
--- a/src/nat/upnp-commands.c
+++ b/src/nat/upnp-commands.c
@@ -320,12 +320,12 @@ parse_url (const char *url, char *hostname, unsigned short *port, char **path)
320 320
321 if (!p2 || (p2 > p3)) 321 if (!p2 || (p2 > p3))
322 { 322 {
323 strncpy (hostname, p1, MIN (MAX_HOSTNAME_LEN, (int) (p3 - p1))); 323 strncpy (hostname, p1, GNUNET_MIN (MAX_HOSTNAME_LEN, (int) (p3 - p1)));
324 *port = 80; 324 *port = 80;
325 } 325 }
326 else 326 else
327 { 327 {
328 strncpy (hostname, p1, MIN (MAX_HOSTNAME_LEN, (int) (p2 - p1))); 328 strncpy (hostname, p1, GNUNET_MIN (MAX_HOSTNAME_LEN, (int) (p2 - p1)));
329 *port = 0; 329 *port = 0;
330 p2++; 330 p2++;
331 331
diff --git a/src/nat/upnp-discover.c b/src/nat/upnp-discover.c
index 5e955db45..cb1855ccd 100644
--- a/src/nat/upnp-discover.c
+++ b/src/nat/upnp-discover.c
@@ -1201,7 +1201,12 @@ UPNP_discover_ (const char *multicastif,
1201 { 1201 {
1202 if (multicastif) 1202 if (multicastif)
1203 { 1203 {
1204#ifndef MINGW
1204 if_index = if_nametoindex (multicastif); 1205 if_index = if_nametoindex (multicastif);
1206#else
1207 // FIXME
1208 if_index = 0;
1209#endif
1205 if (!if_index) 1210 if (!if_index)
1206 PRINT_SOCKET_ERROR ("if_nametoindex"); 1211 PRINT_SOCKET_ERROR ("if_nametoindex");
1207 1212
diff --git a/src/nat/upnp.c b/src/nat/upnp.c
index 8dd7d626c..23168d20a 100644
--- a/src/nat/upnp.c
+++ b/src/nat/upnp.c
@@ -302,7 +302,12 @@ get_ip_address_cb (int error, char *ext_addr, void *cls)
302 } 302 }
303 303
304 /* Try IPv4 and IPv6 as we don't know what's the format */ 304 /* Try IPv4 and IPv6 as we don't know what's the format */
305#ifndef MINGW
305 if (inet_aton (ext_addr, &addr) != 0) 306 if (inet_aton (ext_addr, &addr) != 0)
307#else
308 addr.S_un.S_addr = inet_addr(ext_addr);
309 if (addr.S_un.S_addr == INADDR_NONE)
310#endif
306 { 311 {
307 handle->ext_addr = GNUNET_malloc (sizeof (struct sockaddr_in)); 312 handle->ext_addr = GNUNET_malloc (sizeof (struct sockaddr_in));
308 handle->ext_addr->sa_family = AF_INET; 313 handle->ext_addr->sa_family = AF_INET;