virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
-#ifdef HAVE_NET_IF_H
+#if defined(HAVE_STRUCT_IFREQ)
static int virNetDevSetupControlFull(const char *ifname,
struct ifreq *ifr,
int domain,
#endif
-#ifdef SIOCGIFFLAGS
+#if defined(SIOCGIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevExists:
* @ifname
#endif
-#ifdef SIOCGIFHWADDR
+#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevSetMAC:
* @ifname: interface name to set MTU for
#endif
-#ifdef SIOCGIFHWADDR
+#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevGetMAC:
* @ifname: interface name to set MTU for
}
-#ifdef SIOCGIFMTU
+#if defined(SIOCGIFMTU) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevGetMTU:
* @ifname: interface name get MTU for
#endif
-#ifdef SIOCSIFMTU
+#if defined(SIOCSIFMTU) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevSetMTU:
* @ifname: interface name to set MTU for
return rc;
}
-#ifdef SIOCSIFNAME
+#if defined(SIOCSIFNAME) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevSetName:
* @ifname: name of device
#endif
-#ifdef SIOCSIFFLAGS
+#if defined(SIOCSIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevSetOnline:
* @ifname: the interface name
#endif
-#ifdef SIOCGIFFLAGS
+#if defined(SIOCGIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevIsOnline:
* @ifname: the interface name
*
* Returns 0 on success, -1 on failure
*/
-#ifdef __linux__
+#if defined(SIOCGIFINDEX) && defined(HAVE_STRUCT_IFREQ)
int virNetDevGetIndex(const char *ifname, int *ifindex)
{
int ret = -1;
VIR_FORCE_CLOSE(fd);
return ret;
}
-#else /* ! __linux__ */
+#else /* ! SIOCGIFINDEX */
int virNetDevGetIndex(const char *ifname ATTRIBUTE_UNUSED,
int *ifindex ATTRIBUTE_UNUSED)
{
_("Unable to get interface index on this platform"));
return -1;
}
-#endif /* ! __linux__ */
+#endif /* ! SIOCGIFINDEX */
-#ifdef __linux__
+#if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ)
int virNetDevGetVLanID(const char *ifname, int *vlanid)
{
struct vlan_ioctl_args vlanargs = {
return ret;
}
-#else /* ! __linux__ */
+#else /* ! SIOCGIFVLAN */
int virNetDevGetVLanID(const char *ifname ATTRIBUTE_UNUSED,
int *vlanid ATTRIBUTE_UNUSED)
{
_("Unable to get VLAN on this platform"));
return -1;
}
-#endif /* ! __linux__ */
+#endif /* ! SIOCGIFVLAN */
*
* Returns 0 on success, -errno on failure.
*/
-#ifdef __linux__
+#if defined(SIOCGIFADDR) && defined(HAVE_STRUCT_IFREQ)
int virNetDevGetIPv4Address(const char *ifname,
virSocketAddrPtr addr)
{
return ret;
}
-#else
+#else /* ! SIOCGIFADDR */
int virNetDevGetIPv4Address(const char *ifname ATTRIBUTE_UNUSED,
virSocketAddrPtr addr ATTRIBUTE_UNUSED)
return -1;
}
-#endif /* __linux__ */
+#endif /* ! SIOCGIFADDR */
/**
*
* Returns 1 if the config matches, 0 if the config does not match, or interface does not exist, -1 on error
*/
-#ifdef __linux__
+#if defined(HAVE_STRUCT_IFREQ)
int virNetDevValidateConfig(const char *ifname,
const unsigned char *macaddr, int ifindex)
{
VIR_FORCE_CLOSE(fd);
return ret;
}
-#else /* ! __linux__ */
+#else /* ! HAVE_STRUCT_IFREQ */
int virNetDevValidateConfig(const char *ifname ATTRIBUTE_UNUSED,
const unsigned char *macaddr ATTRIBUTE_UNUSED,
int ifindex ATTRIBUTE_UNUSED)
_("Unable to check interface config on this platform"));
return -1;
}
-#endif /* ! __linux__ */
+#endif /* ! HAVE_STRUCT_IFREQ */
#ifdef __linux__