57#include "xdr_gen/xcom_vp.h"
59#define WORKING_BUFFER_SIZE 1024 * 1024
85 ULONG
flags = GAA_FLAG_INCLUDE_PREFIX, family = AF_UNSPEC, out_buflen = 0;
87 PIP_ADAPTER_ADDRESSES curr_addresses;
101 while (curr_addresses) {
102 PIP_ADAPTER_UNICAST_ADDRESS_LH curr_unicast_address;
105 if (curr_addresses->OperStatus == IfOperStatusUp)
STRLIT(
"UP");
108 curr_unicast_address = curr_addresses->FirstUnicastAddress;
109 while (curr_unicast_address) {
110 if (curr_unicast_address->Address.lpSockaddr->sa_family == AF_INET ||
111 curr_unicast_address->Address.lpSockaddr->sa_family == AF_INET6) {
114 curr_unicast_address = curr_unicast_address->Next;
117 curr_addresses = curr_addresses->Next;
120 return retval != NO_ERROR;
159 PIP_ADAPTER_ADDRESSES curr_addresses = s->
addresses;
160 while (curr_addresses && (i <=
count)) {
161 PIP_ADAPTER_UNICAST_ADDRESS_LH curr_unicast_address =
162 curr_addresses->FirstUnicastAddress;
163 while (curr_unicast_address && (i <=
count)) {
164 if (curr_unicast_address->Address.lpSockaddr->sa_family == AF_INET ||
165 curr_unicast_address->Address.lpSockaddr->sa_family == AF_INET6) {
172 curr_unicast_address = curr_unicast_address->Next;
175 curr_addresses = curr_addresses->Next;
210 switch (addr_operation) {
228 struct sockaddr_in *out_value =
229 (
struct sockaddr_in *)
xcom_malloc(
sizeof(
struct sockaddr_in));
230 ConvertLengthToIpv4Mask(
232 &out_value->sin_addr.s_addr);
233 *out = (
struct sockaddr *)out_value;
236 struct sockaddr_in6 *out_value =
237 (
struct sockaddr_in6 *)
xcom_calloc(1,
sizeof(
struct sockaddr_in6));
239 i > 0; i -= 8, ++j) {
240 out_value->sin6_addr.s6_addr[j] =
241 i >= 8 ? 0xff : (ULONG)((0xffU << (8 - i)));
243 *out = (
struct sockaddr *)out_value;
#define IFDBG(mask, body)
Definition: gcs_debug.h:278
@ D_TRANSPORT
Definition: gcs_debug.h:177
#define STRLIT(x)
Definition: gcs_debug.h:315
static int flags[50]
Definition: hp_test1.cc:39
#define free(A)
Definition: lexyy.cc:915
static int count
Definition: myisam_ftdump.cc:42
SockaddrOp
Definition: sock_probe_ix.h:66
SockaddrOp
Definition: sock_probe_win32.h:78
@ kSockaddrOpAddress
Definition: sock_probe_win32.h:79
@ kSockaddrOpNetmask
Definition: sock_probe_win32.h:80
#define WORKING_BUFFER_SIZE
Definition: sock_probe_win32.h:59
static char * get_if_name(sock_probe *s, int count)
Definition: sock_probe_win32.h:261
static int init_sock_probe(sock_probe *s)
Definition: sock_probe_win32.h:84
struct sockaddr_in SOCKADDR_IN
Definition: sock_probe_win32.h:61
static void close_sock_probe(sock_probe *s)
Definition: sock_probe_win32.h:124
struct sockaddr sockaddr
Definition: sock_probe_win32.h:62
static void get_sockaddr_netmask(sock_probe *s, int count, struct sockaddr **out)
Definition: sock_probe_win32.h:256
static bool_t is_if_running(sock_probe *s, int)
Definition: sock_probe_win32.h:138
static interface_info get_interface(sock_probe *s, int count)
Definition: sock_probe_win32.h:152
struct interface_info interface_info
Definition: sock_probe_win32.h:150
static void get_sockaddr_address(sock_probe *s, int count, struct sockaddr **out)
Definition: sock_probe_win32.h:251
static void get_sockaddr(sock_probe *s, int count, struct sockaddr **out, SockaddrOp addr_operation)
Get the sockaddr object that pertains to a certain interface index Depending of the addr_operation pa...
Definition: sock_probe_win32.h:195
static int number_of_interfaces(sock_probe *s)
Definition: sock_probe_win32.h:130
struct in_addr in_addr
Definition: sock_probe_win32.h:64
Definition: sock_probe_win32.h:146
PIP_ADAPTER_ADDRESSES network_interface
Definition: sock_probe_win32.h:147
PIP_ADAPTER_UNICAST_ADDRESS_LH network_address
Definition: sock_probe_win32.h:148
Definition: sock_probe_ix.h:53
PIP_ADAPTER_ADDRESSES addresses
Definition: sock_probe_win32.h:72
int number_of_interfaces
Definition: sock_probe_win32.h:73
Rudimentary task system in portable C, based on Tom Duff's switch-based coroutine trick and a stack o...
#define NULL
Definition: types.h:54
int bool_t
Definition: types.h:34
#define idx_check_fail(x, limit)
Definition: xcom_common.h:70
static void * xcom_malloc(size_t size)
Definition: xcom_memory.h:45
static void * xcom_calloc(size_t nmemb, size_t size)
Definition: xcom_memory.h:53