26#include <sys/sockio.h>
51#include "xdr_gen/xcom_vp.h"
78 struct ifaddrs *ifa_tmp;
92 if ((ifa_tmp->ifa_addr) && ((ifa_tmp->ifa_addr->sa_family == AF_INET) ||
93 (ifa_tmp->ifa_addr->sa_family == AF_INET6))) {
96 ifa_tmp = ifa_tmp->ifa_next;
120 struct ifaddrs *net_if =
nullptr;
129 while (net_if !=
nullptr) {
130 if ((net_if->ifa_addr) && ((net_if->ifa_addr->sa_family == AF_INET) ||
131 (net_if->ifa_addr->sa_family == AF_INET6))) {
138 net_if = net_if->ifa_next;
146 struct ifaddrs *net_if =
nullptr;
153 return net_if !=
nullptr && (net_if->ifa_flags & IFF_UP) &&
154 (net_if->ifa_flags & IFF_RUNNING);
172 if (net_if ==
nullptr) {
177 switch (addr_operation) {
179 *out = (
struct sockaddr *)net_if->ifa_addr;
182 *out = (
struct sockaddr *)net_if->ifa_netmask;
192 return net_if !=
nullptr ? net_if->ifa_name :
nullptr;
#define free(A)
Definition: lexyy.cc:915
static int count
Definition: myisam_ftdump.cc:44
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:926
SockaddrOp
Definition: sock_probe_ix.h:66
@ kSockaddrOpAddress
Definition: sock_probe_ix.h:67
@ kSockaddrOpNetmask
Definition: sock_probe_ix.h:68
static char * get_if_name(sock_probe *s, int count)
Definition: sock_probe_ix.h:189
static bool_t is_if_running(sock_probe *s, int count)
Definition: sock_probe_ix.h:145
static int init_sock_probe(sock_probe *s)
Definition: sock_probe_ix.h:77
static void close_sock_probe(sock_probe *s)
Definition: sock_probe_ix.h:105
static void get_sockaddr_netmask(sock_probe *s, int count, struct sockaddr **out)
Definition: sock_probe_ix.h:162
static struct ifaddrs * get_interface(sock_probe *s, int count)
Definition: sock_probe_ix.h:119
static void get_sockaddr_address(sock_probe *s, int count, struct sockaddr **out)
Definition: sock_probe_ix.h:157
static void get_sockaddr(sock_probe *s, int count, struct sockaddr **out, SockaddrOp addr_operation)
Definition: sock_probe_ix.h:168
static int number_of_interfaces(sock_probe *s)
Definition: sock_probe_ix.h:111
struct sockaddr sockaddr
Definition: sock_probe_win32.h:62
Definition: sock_probe_ix.h:53
int nbr_ifs
Definition: sock_probe_ix.h:54
struct ifaddrs * interfaces
Definition: sock_probe_ix.h:55
Rudimentary task system in portable C, based on Tom Duff's switch-based coroutine trick and a stack o...
int bool_t
Definition: types.h:34
#define idx_check_ret(x, limit, ret)
Definition: xcom_common.h:64