[ovs-dev] [PATCH 14/14] socket-util: af_inet_ioctl() for Windows.

Gurucharan Shetty shettyg at nicira.com
Wed Feb 19 23:36:25 UTC 2014


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 at nicira.com>
---
 lib/socket-util.c |    2 ++
 lib/socket-util.h |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/lib/socket-util.c b/lib/socket-util.c
index 3a8a1f7..69783a8 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -1331,6 +1331,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
@@ -1369,6 +1370,7 @@ af_inet_ifreq_ioctl(const char *name, struct ifreq *ifr, unsigned long int cmd,
     }
     return error;
 }
+#endif
 
 /* sockaddr_storage helpers. */
 
diff --git a/lib/socket-util.h b/lib/socket-util.h
index 2257759..674e266 100644
--- a/lib/socket-util.h
+++ b/lib/socket-util.h
@@ -76,11 +76,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. */
-- 
1.7.9.5




More information about the dev mailing list