]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: convert all code to use virsocket.h
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 14 Jan 2020 17:38:59 +0000 (17:38 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 29 Jan 2020 14:51:40 +0000 (14:51 +0000)
There are a large number of different header files that
are related to the sockets APIs. The virsocket.h header
includes all of the relevant headers for Windows and UNIX
in one convenient place. If virsocketaddr.h is already
included, then there's no need for virsocket.h

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
41 files changed:
configure.ac
src/conf/network_conf.c
src/esx/esx_util.c
src/esx/esx_util.h
src/libxl/libxl_conf.c
src/lxc/lxc_controller.c
src/lxc/lxc_driver.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_learnipaddr.c
src/qemu/qemu_agent.c
src/qemu/qemu_conf.c
src/qemu/qemu_driver.c
src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c
src/remote/qemu_protocol.x
src/remote/remote_protocol.x
src/rpc/virnetprotocol.x
src/rpc/virnetsocket.c
src/util/virarptable.c
src/util/virfdstream.c
src/util/virfile.c
src/util/virlog.c
src/util/virnetdevbridge.c
src/util/virnetdevmacvlan.c
src/util/virnetdevvportprofile.c
src/util/virnetlink.c
src/util/virsocket.h
src/util/virsocketaddr.c
src/util/virsocketaddr.h
src/util/virsystemd.c
src/util/virutil.c
src/vbox/vbox_MSCOMGlue.c
tests/libxlmock.c
tests/nsstest.c
tests/virnetsockettest.c
tests/virnettlscontexttest.c
tests/virnettlshelpers.c
tests/virnettlssessiontest.c
tests/virportallocatormock.c
tests/virtestmock.c

index adfd9502600310300e7aad0b62a5c69531b89372..b1f75fa7511963a2ab0e86a9fcf02a67c504535f 100644 (file)
@@ -231,9 +231,13 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
 AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
 AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"])
 
-# We don't support the daemon yet
 if test "$with_win" = "yes" ; then
+  # We don't support the daemon yet
   with_libvirtd=no
+
+  # For AI_ADDRCONFIG
+  AC_DEFINE([_WIN32_WINNT], [0x0600], [Win Vista / Server 2008])
+  AC_DEFINE([WINVER], [0x0600], [Win Vista / Server 2008])
 fi
 
 # The daemon requires remote support.  Likewise, if we are not using
@@ -382,7 +386,6 @@ AC_CHECK_HEADERS([\
   linux/magic.h \
   mntent.h \
   net/ethernet.h \
-  netinet/tcp.h \
   net/if.h \
   pty.h \
   pwd.h \
@@ -393,7 +396,6 @@ AC_CHECK_HEADERS([\
   sys/syscall.h \
   sys/sysctl.h \
   sys/ucred.h \
-  sys/un.h \
   ])
 dnl Check whether endian provides handy macros.
 AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])
index 27e83b7d855098b81a4dde33de84535d0f18dff6..1f14a964a27d9be95b9cafe33f238c144070a2e9 100644 (file)
@@ -22,8 +22,6 @@
 #include <config.h>
 
 #include <unistd.h>
-#include <arpa/inet.h>
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
index c265528056706565c5b655a6bd22c51a3f57bbfa..89d136248f3c93b36b580c3a4582b1210f2b231a 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <config.h>
 
-#include <netdb.h>
-
 #include "internal.h"
 #include "datatypes.h"
 #include "viralloc.h"
@@ -34,6 +32,7 @@
 #include "esx_private.h"
 #include "esx_util.h"
 #include "virstring.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
index d80093dcb5a35182faa5971948f95b4ce0e6c971..97b6d82a2be125f5714a5f16aef7c2b9fa7bb693 100644 (file)
@@ -21,7 +21,6 @@
 
 #pragma once
 
-#include <netdb.h>
 #include "internal.h"
 #include "viruri.h"
 
index e41e84e3e2abd3dd6b47def2c8b0c7fb6611ca5e..b4462a6291f7d8d64ca20765a9489a03f7ea9588 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <libxl.h>
 #include <sys/types.h>
-#include <sys/socket.h>
 
 #include "internal.h"
 #include "virlog.h"
@@ -48,7 +47,6 @@
 #include "virnetdevvportprofile.h"
 #include "virenum.h"
 
-
 #define VIR_FROM_THIS VIR_FROM_LIBXL
 
 VIR_LOG_INIT("libxl.libxl_conf");
index 42c631ed0b2d9d31cbcbd7bd874fa4c043699f13..558a964fca008d4a8eeab26c63301029de19c13e 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <sys/epoll.h>
 #include <sys/wait.h>
-#include <sys/socket.h>
 
 #ifdef MAJOR_IN_MKDEV
 # include <sys/mkdev.h>
@@ -31,8 +30,6 @@
 # include <sys/sysmacros.h>
 #endif
 
-#include <sys/types.h>
-#include <sys/un.h>
 #include <sys/personality.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -69,6 +66,7 @@
 #include "rpc/virnetdaemon.h"
 #include "virstring.h"
 #include "virgettext.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_LXC
 
index e73583daed1f8ccc55718a8c6c1fcbb6de6bf7b6..bc86f35f52cbc11813dbd3dda97b10b7535d8635 100644 (file)
 # include <sys/sysmacros.h>
 #endif
 
-#include <sys/types.h>
-#include <sys/socket.h>
 #include <sys/stat.h>
-#include <sys/un.h>
 #include <sys/poll.h>
 #include <unistd.h>
 #include <wait.h>
@@ -75,6 +72,7 @@
 #include "viraccessapichecklxc.h"
 #include "virhostdev.h"
 #include "netdev_bandwidth_conf.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_LXC
 
index 629f974177dccf467335e4fdd8d20bc89626fb0c..10567e9cd3d5b9b7a15dae55ffec8e6c89c00b15 100644 (file)
@@ -43,9 +43,6 @@
 #include <fcntl.h>
 #include <poll.h>
 
-#include <arpa/inet.h>
-#include <netinet/ip.h>
-#include <netinet/udp.h>
 #include <net/if.h>
 
 #include "viralloc.h"
index 5791724cf4470d6196c3786fc1c6e6d7963f62f2..f2d5e60d43d39ceaf384ba546d3999f833e02b51 100644 (file)
 #include <sys/ioctl.h>
 #include <poll.h>
 
-#include <arpa/inet.h>
 #include <net/ethernet.h>
-#include <netinet/ip.h>
-#include <netinet/udp.h>
 #include <net/if_arp.h>
 
 #include "internal.h"
@@ -53,6 +50,7 @@
 #include "nwfilter_ipaddrmap.h"
 #include "nwfilter_learnipaddr.h"
 #include "virstring.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_NWFILTER
 
index b6556ffbafac3044de24ace6c9708cd24b90b12c..4374235d340dcd3e08b07bab32e0a163389873b1 100644 (file)
@@ -21,9 +21,6 @@
 
 #include <config.h>
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
 #include <poll.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -41,6 +38,7 @@
 #include "virobject.h"
 #include "virstring.h"
 #include "virenum.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
index 00801ef01bbeba236a32abbfc27ba4d0f27d5ee2..e5051027fc1f0642595725c85f773b2cfdcd1fdd 100644 (file)
@@ -26,7 +26,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/wait.h>
-#include <arpa/inet.h>
 
 #include "virerror.h"
 #include "qemu_conf.h"
@@ -44,7 +43,7 @@
 #include "cpu/cpu.h"
 #include "domain_nwfilter.h"
 #include "virfile.h"
-#include "virsocketaddr.h"
+#include "virsocket.h"
 #include "virstring.h"
 #include "viratomic.h"
 #include "storage_conf.h"
index 3e6d14ead802c927ba862c9329a3849c69029a46..8bf8ab7eb4fb31f96727ad42b18cb18bf50f5ffa 100644 (file)
@@ -32,8 +32,6 @@
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/ioctl.h>
-#include <sys/un.h>
-
 
 #include "qemu_driver.h"
 #include "qemu_agent.h"
 #include "virdomainsnapshotobjlist.h"
 #include "virenum.h"
 #include "virdomaincheckpointobjlist.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
index d7814208a2eec136ae5097474d12349fd269be69..76dcd36266f1fe4b4801eb389699832590dc54cd 100644 (file)
@@ -21,8 +21,6 @@
 
 #include <config.h>
 
-#include <netdb.h>
-#include <sys/socket.h>
 #include <sys/time.h>
 #include <fcntl.h>
 #include <poll.h>
@@ -62,6 +60,7 @@
 #include "virprocess.h"
 #include "nwfilter_conf.h"
 #include "virdomainsnapshotobjlist.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
index e3bd000ccb16467cb662816b79381033c4706905..267ccccc8c512fe06345a8d771302c2bf393c358 100644 (file)
@@ -22,8 +22,6 @@
 #include <config.h>
 
 #include <poll.h>
-#include <sys/socket.h>
-#include <sys/un.h>
 #include <unistd.h>
 #include <fcntl.h>
 
@@ -41,6 +39,7 @@
 #include "virprobe.h"
 #include "virstring.h"
 #include "virtime.h"
+#include "virsocket.h"
 
 #ifdef WITH_DTRACE_PROBES
 # include "libvirt_qemu_probes.h"
index e5164d218aa6955d37e9d0ebd554c96f437a418a..b74633441f540c3c40d95ad41dc00f54c01c208b 100644 (file)
@@ -21,9 +21,6 @@
 
 #include <config.h>
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
 #include <poll.h>
 #include <unistd.h>
 #include <sys/time.h>
@@ -41,6 +38,7 @@
 #include "virstring.h"
 #include "cpu/cpu_x86.h"
 #include "virenum.h"
+#include "virsocket.h"
 
 #ifdef WITH_DTRACE_PROBES
 # include "libvirt_qemu_probes.h"
index 423e8fadaf6a0552d2817df5f51edfe7fd84d35c..8ff5dc856862371614b7fcdb553b91bfb0d89ca5 100644 (file)
@@ -22,7 +22,6 @@
 
 %#include "internal.h"
 %#include "remote_protocol.h"
-%#include <arpa/inet.h>
 
 /*----- Protocol. -----*/
 struct qemu_domain_monitor_command_args {
index 79cdb13a90b0e8564d8c3eb735abb6d520e12525..1f7963510a9ae3006739b93b6f8b31beb7de694e 100644 (file)
@@ -37,7 +37,7 @@
 %#include <libvirt/libvirt.h>
 %#include "internal.h"
 %#include "virxdrdefs.h"
-%#include <arpa/inet.h>
+%#include "virsocket.h"
 
 /*----- Data types. -----*/
 
index 99f4f2e539b1cb8f7a2fe22be0451ab19bf530f0..2d9b23ca1898754a4bf781dff3c18a90ab471d27 100644 (file)
@@ -20,7 +20,7 @@
 
 %#include "internal.h"
 %#include "virxdrdefs.h"
-%#include <arpa/inet.h>
+%#include "virsocket.h"
 
 /*----- Data types. -----*/
 
index a286f0ce02ff427565ae729043f7298f98a1eafc..b0af7d4dfa70ed404af965fa1e639566274b5e8a 100644 (file)
@@ -22,7 +22,6 @@
 #include <config.h>
 
 #include <sys/stat.h>
-#include <sys/socket.h>
 #include <unistd.h>
 #include <sys/wait.h>
 #include <signal.h>
 #ifdef HAVE_IFADDRS_H
 # include <ifaddrs.h>
 #endif
-#include <netdb.h>
-
-#ifdef HAVE_NETINET_TCP_H
-# include <netinet/tcp.h>
-#endif
 
 #ifdef HAVE_SYS_UCRED_H
 # include <sys/ucred.h>
@@ -459,7 +453,7 @@ int virNetSocketNewListenTCP(const char *nodename,
 }
 
 
-#if HAVE_SYS_UN_H
+#ifndef WIN32
 int virNetSocketNewListenUNIX(const char *path,
                               mode_t mask,
                               uid_t user,
@@ -645,7 +639,7 @@ int virNetSocketNewConnectTCP(const char *nodename,
 }
 
 
-#ifdef HAVE_SYS_UN_H
+#ifndef WIN32
 int virNetSocketNewConnectUNIX(const char *path,
                                bool spawnDaemon,
                                const char *binary,
@@ -1345,7 +1339,7 @@ void virNetSocketDispose(void *obj)
         sock->watch = -1;
     }
 
-#ifdef HAVE_SYS_UN_H
+#ifndef WIN32
     /* If a server socket, then unlink UNIX path */
     if (sock->unlinkUNIX &&
         sock->localAddr.data.sa.sa_family == AF_UNIX &&
@@ -2273,7 +2267,7 @@ void virNetSocketClose(virNetSocketPtr sock)
         sock->fd = -1;
     }
 
-#ifdef HAVE_SYS_UN_H
+#ifndef WIN32
     /* If a server socket, then unlink UNIX path */
     if (sock->unlinkUNIX &&
         sock->localAddr.data.sa.sa_family == AF_UNIX &&
index 265f60d64533fa57c7511e702954a04a091249e8..c4b46604a9fbecaea74907a228ccaf0325b5ca63 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <arpa/inet.h>
 #ifdef __linux__
 # include <linux/rtnetlink.h>
 #endif
index 58b77aa6fafbe3070525de1bdd40a1e9b519938c..c094876dee6224556ecbf956ab2eb42d08764adc 100644 (file)
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <sys/socket.h>
 #include <sys/wait.h>
-#if HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
-#include <netinet/in.h>
 #ifndef WIN32
 # include <termios.h>
 #endif
@@ -46,6 +41,7 @@
 #include "virstring.h"
 #include "virtime.h"
 #include "virprocess.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_STREAMS
 
@@ -1163,7 +1159,7 @@ int virFDStreamOpen(virStreamPtr st,
 }
 
 
-#if HAVE_SYS_UN_H
+#ifndef WIN32
 int virFDStreamConnectUNIX(virStreamPtr st,
                            const char *path,
                            bool abstract)
index f8d6cfc4b8f0fd3a7d34b5a50a767330b18e769e..54079f6ade85f603d5552c164affea1a5eb61f94 100644 (file)
@@ -42,8 +42,6 @@
 # include <libutil.h>
 #endif /* !HAVE_LIBUTIL_H */
 #include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/socket.h>
 #include <sys/wait.h>
 #if defined(HAVE_SYS_MOUNT_H)
 # include <sys/mount.h>
@@ -90,6 +88,7 @@
 #include "virprocess.h"
 #include "virstring.h"
 #include "virutil.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
index 8c17d666deecd3505f66b428a8d9b412f8a85c54..e4944d1258b756d05c5aa4723b875540322150a2 100644 (file)
 #include <stdarg.h>
 #include <time.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
 #if HAVE_SYSLOG_H
 # include <syslog.h>
 #endif
-#include <sys/socket.h>
-#if HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
 
 #include "virerror.h"
 #include "virlog.h"
@@ -46,6 +41,7 @@
 #include "virtime.h"
 #include "virstring.h"
 #include "configmake.h"
+#include "virsocket.h"
 
 /* Journald output is only supported on Linux new enough to expose
  * htole64.  */
index 5a0fb5f42fbc8c7e5f330cd955956370b070c3dc..769289ae0b7cad5245efcc49f70c33451bc4ab3e 100644 (file)
 #include "viralloc.h"
 #include "virlog.h"
 #include "virstring.h"
+#include "virsocket.h"
 
-#ifndef WIN32
-# include <sys/ioctl.h>
-#endif
-#include <sys/socket.h>
 #ifdef HAVE_NET_IF
 # include <net/if.h>
 #endif
-#include <netinet/in.h>
 
 #ifdef __linux__
 # if defined(HAVE_LIBNL)
index 3ca568fb44fc0c9bd6cd1db33892155d0f2915b8..dcea93a5fe62cfcb7b73be504609954be7c9f9ba 100644 (file)
@@ -42,8 +42,6 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode,
 
 #if WITH_MACVTAP
 # include <fcntl.h>
-# include <sys/socket.h>
-# include <sys/ioctl.h>
 
 # include <net/if.h>
 # include <linux/if_tun.h>
@@ -61,6 +59,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode,
 # include "virnetdev.h"
 # include "virpidfile.h"
 # include "virbitmap.h"
+# include "virsocket.h"
 
 VIR_LOG_INIT("util.netdevmacvlan");
 
index 5ca96132c45042c3095cc93b3a1e1740cd823e4e..475a0d9cbcd5c534b520eb7f87412417d9af9b41 100644 (file)
@@ -49,8 +49,6 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp,
 #if WITH_VIRTUALPORT
 
 # include <fcntl.h>
-# include <sys/socket.h>
-# include <sys/ioctl.h>
 
 # include <net/if.h>
 # include <linux/if_tun.h>
@@ -59,6 +57,7 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp,
 # include "virfile.h"
 # include "virlog.h"
 # include "virnetdev.h"
+# include "virsocket.h"
 
 VIR_LOG_INIT("util.netdevvportprofile");
 
index 710b4f5f51b1a2927d4e53b4bc75134b05ebaa2f..2ce3d0fae9a974f3ad2a5b19d41b8fedcefe89fa 100644 (file)
@@ -24,8 +24,6 @@
 #include <config.h>
 
 #include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
 
 #include "virnetlink.h"
 #include "virnetdev.h"
@@ -34,6 +32,7 @@
 #include "virmacaddr.h"
 #include "virerror.h"
 #include "viralloc.h"
+#include "virsocket.h"
 
 #define VIR_FROM_THIS VIR_FROM_NET
 
index e1e7d08bb48aa9b9adb19d6d28b02379ed3f23c7..6d323e0a1274f69713bdbfbacabad15eb4bb72fa 100644 (file)
@@ -79,13 +79,14 @@ int vir_socket(int domain, int type, int protocol);
 #else
 
 # include <sys/socket.h>
-# include <unistd.h>
 # include <sys/ioctl.h>
 # include <arpa/inet.h>
+# include <netinet/ip.h>
 # include <netinet/in.h>
 # include <netinet/udp.h>
 # include <netinet/tcp.h>
 # include <sys/un.h>
+# include <netdb.h>
 
 # define closesocket close
 # define ioctlsocket ioctl
index f90022827ef0ad1a2df98f21d0c122037cb6f794..4cad329d159ddc6fda299a9b3be0abbb32365f8b 100644 (file)
@@ -24,8 +24,6 @@
 #include "virbuffer.h"
 #include "viralloc.h"
 
-#include <netdb.h>
-
 #define VIR_FROM_THIS VIR_FROM_NONE
 
 /*
index 66aee2abcd6374fe8cb8e27482be57f51f7c5067..d06e751f73e0c7dc3151ec6045deec60d889ae75 100644 (file)
 
 #pragma once
 
-#include <netinet/in.h>
-#include <sys/socket.h>
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
-
-#include "internal.h"
+#include "virsocket.h"
 
 #define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1"
 
@@ -34,7 +28,7 @@ typedef struct {
         struct sockaddr_storage stor;
         struct sockaddr_in inet4;
         struct sockaddr_in6 inet6;
-#ifdef HAVE_SYS_UN_H
+#ifndef WIN32
         struct sockaddr_un un;
 #endif
     } data;
index 96d43e544072c1fe39970b84e4a2f486be73a163..a9ff782fb8ed7e6cff752fcc17425f974438b657 100644 (file)
 
 #include <config.h>
 
-#include <sys/socket.h>
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
-
 #define LIBVIRT_VIRSYSTEMDPRIV_H_ALLOW
 #include "virsystemdpriv.h"
 
@@ -515,7 +510,7 @@ int virSystemdTerminateMachine(const char *name)
 void
 virSystemdNotifyStartup(void)
 {
-#ifdef HAVE_SYS_UN_H
+#ifndef WIN32
     const char *path;
     const char *msg = "READY=1";
     int fd;
@@ -559,7 +554,7 @@ virSystemdNotifyStartup(void)
         VIR_WARN("Failed to notify systemd");
 
     VIR_FORCE_CLOSE(fd);
-#endif /* HAVE_SYS_UN_H */
+#endif /* !WIN32 */
 }
 
 static int
index 77460c9577e16effe085b2a62dc3f18608cdb759..830f082a771bd2e80dba81f0f5228017e9f01924 100644 (file)
@@ -44,7 +44,6 @@
 # include <libdevmapper.h>
 #endif
 
-#include <netdb.h>
 #ifdef HAVE_GETPWUID_R
 # include <pwd.h>
 # include <grp.h>
 # include <sys/prctl.h>
 #endif
 
-#ifdef WIN32
-# ifdef HAVE_WINSOCK2_H
-#  include <winsock2.h>
-# endif
-# include <windows.h>
-# include <shlobj.h>
-#endif
-
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
-
 #include "virerror.h"
 #include "virlog.h"
 #include "virbuffer.h"
index 5cc3f5c7c89e6462b398d0cb52497c120e7363be..18dbb0ffe145223df89d93564bc907ac5b688c86 100644 (file)
 
 #include <config.h>
 
-#ifdef HAVE_WINSOCK2_H
-# include <winsock2.h>
-#endif
-#include <windows.h>
-
 #define nsCID CLSID
 
 #include "internal.h"
@@ -35,6 +30,7 @@
 #include "virerror.h"
 #include "virstring.h"
 #include "virutil.h"
+#include "virsocket.h"
 #include "vbox_MSCOMGlue.h"
 
 #define VIR_FROM_THIS VIR_FROM_VBOX
index 38302b2ae82e3790a9b997116c1e32b4268114ab..b995b34cc5b2d5497c240f6ed3cf871d61371418 100644 (file)
@@ -27,9 +27,9 @@
 # include <libxl.h>
 # include <xenstore.h>
 # include <xenctrl.h>
-# include <sys/socket.h>
 
 # include "virfile.h"
+# include "virsocket.h"
 
 VIR_MOCK_IMPL_RET_VOID(xs_daemon_open,
                        struct xs_handle *)
index d146100747031d4750657b9c33ad371785f8f4aa..514b4f7195d0222863e3ae5377ded19d8bde1462 100644 (file)
@@ -22,9 +22,8 @@
 
 #ifdef NSS
 
-# include <arpa/inet.h>
 # include "libvirt_nss.h"
-# include "virsocketaddr.h"
+# include "virsocket.h"
 
 # define VIR_FROM_THIS VIR_FROM_NONE
 
index 42a3971d416c7e5a62f6e35484b68b8e741114da..af11a0f6e8379038d660ddfcf33e483b60f43ef2 100644 (file)
@@ -22,7 +22,6 @@
 #ifdef HAVE_IFADDRS_H
 # include <ifaddrs.h>
 #endif
-#include <netdb.h>
 
 #include "testutils.h"
 #include "virutil.h"
index 8013f9eda8fb36c25961e83c417850aa5d198a8a..328b1340d6acb5c3f9d9ce5756a7760c026b1f66 100644 (file)
@@ -19,7 +19,6 @@
 #include <config.h>
 
 #include <fcntl.h>
-#include <sys/socket.h>
 
 #include "testutils.h"
 #include "virnettlshelpers.h"
@@ -29,7 +28,7 @@
 #include "virlog.h"
 #include "virfile.h"
 #include "vircommand.h"
-#include "virsocketaddr.h"
+#include "virsocket.h"
 
 #if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
 
index a6aacf4cc33734ffc2c03c1ca09bea156448b658..5aaf98e3450b27cc216679e399b8464de77da146 100644 (file)
@@ -19,7 +19,6 @@
 #include <config.h>
 
 #include <fcntl.h>
-#include <sys/socket.h>
 
 #include "virnettlshelpers.h"
 #include "viralloc.h"
index 4f1b2aa8d2e5e757fa7de519137aafb83418d338..6807581d700821556ef6b98c1e719597049a65b2 100644 (file)
@@ -19,7 +19,6 @@
 #include <config.h>
 
 #include <fcntl.h>
-#include <sys/socket.h>
 
 #include "testutils.h"
 #include "virnettlshelpers.h"
@@ -29,7 +28,7 @@
 #include "virlog.h"
 #include "virfile.h"
 #include "vircommand.h"
-#include "virsocketaddr.h"
+#include "virsocket.h"
 
 #if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
 
index e715f34e04f0dad60fc85348008c2211d46d6c17..28fe89200e0b56f8f92a299d273dd1263ce9a1ca 100644 (file)
 #endif
 
 #if defined(__linux__) && defined(RTLD_NEXT)
-# include "internal.h"
-# include <sys/socket.h>
-# include <arpa/inet.h>
-# include <netinet/in.h>
+# include "virsocket.h"
 # include <unistd.h>
 
 static bool host_has_ipv6;
index 046898dbe10404e5d61eb1016418ecded8d8b30f..e5dccae2a87eb7d1d98a0a488ca06a6b98892426 100644 (file)
 
 #include "virmock.h"
 #include <unistd.h>
-#include <sys/types.h>
 #include <fcntl.h>
 #include <sys/file.h>
 #include <sys/stat.h>
-#include <sys/socket.h>
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
 
-#include "internal.h"
+#include "virsocket.h"
 #include "configmake.h"
 #include "virstring.h"
 #include "viralloc.h"
@@ -202,7 +197,7 @@ int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
 {
     init_syms();
 
-#ifdef HAVE_SYS_UN_H
+#ifndef WIN32
     if (addrlen == sizeof(struct sockaddr_un)) {
         struct sockaddr_un *tmp = (struct sockaddr_un *) addr;
         if (tmp->sun_family == AF_UNIX)