socket-util: af_inet_ioctl() for Windows.
authorGurucharan Shetty <gshetty@nicira.com>
Wed, 19 Feb 2014 20:41:04 +0000 (12:41 -0800)
committerGurucharan Shetty <gshetty@nicira.com>
Fri, 21 Feb 2014 16:25:42 +0000 (08:25 -0800)
There is no direct mapping for the ioctl function in
Windows.  As of now, af_inet_ioctl() is being used for Linux
and BSD. So, don't try to compile it for Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/socket-util.c
lib/socket-util.h

index 861cd9d..20caddd 100644 (file)
@@ -1267,6 +1267,7 @@ describe_fd(int fd)
     return ds_steal_cstr(&string);
 }
 
+#ifndef _WIN32
 /* Calls ioctl() on an AF_INET sock, passing the specified 'command' and
  * 'arg'.  Returns 0 if successful, otherwise a positive errno value. */
 int
@@ -1305,6 +1306,7 @@ af_inet_ifreq_ioctl(const char *name, struct ifreq *ifr, unsigned long int cmd,
     }
     return error;
 }
+#endif
 \f
 /* sockaddr_storage helpers. */
 
index 126f730..1695985 100644 (file)
@@ -74,11 +74,13 @@ char *describe_fd(int fd);
  * in <netinet/ip.h> is used. */
 #define DSCP_DEFAULT (IPTOS_PREC_INTERNETCONTROL >> 2)
 
+#ifndef _WIN32
 /* Helpers for calling ioctl() on an AF_INET socket. */
 struct ifreq;
 int af_inet_ioctl(unsigned long int command, const void *arg);
 int af_inet_ifreq_ioctl(const char *name, struct ifreq *,
                         unsigned long int cmd, const char *cmd_name);
+#endif
 
 /* Functions for working with sockaddr_storage that might contain an IPv4 or
  * IPv6 address. */