58#include "xdr_gen/xcom_vp.h"
60#define WORKING_BUFFER_SIZE 1024 * 1024
86 ULONG
flags = GAA_FLAG_INCLUDE_PREFIX, family = AF_UNSPEC, out_buflen = 0;
88 PIP_ADAPTER_ADDRESSES curr_addresses;
102 while (curr_addresses) {
103 PIP_ADAPTER_UNICAST_ADDRESS_LH curr_unicast_address;
106 if (curr_addresses->OperStatus == IfOperStatusUp)
STRLIT(
"UP");
109 curr_unicast_address = curr_addresses->FirstUnicastAddress;
110 while (curr_unicast_address) {
111 if (curr_unicast_address->Address.lpSockaddr->sa_family == AF_INET ||
112 curr_unicast_address->Address.lpSockaddr->sa_family == AF_INET6) {
115 curr_unicast_address = curr_unicast_address->Next;
118 curr_addresses = curr_addresses->Next;
121 return retval != NO_ERROR;
160 PIP_ADAPTER_ADDRESSES curr_addresses = s->
addresses;
161 while (curr_addresses && (i <=
count)) {
162 PIP_ADAPTER_UNICAST_ADDRESS_LH curr_unicast_address =
163 curr_addresses->FirstUnicastAddress;
164 while (curr_unicast_address && (i <=
count)) {
165 if (curr_unicast_address->Address.lpSockaddr->sa_family == AF_INET ||
166 curr_unicast_address->Address.lpSockaddr->sa_family == AF_INET6) {
173 curr_unicast_address = curr_unicast_address->Next;
176 curr_addresses = curr_addresses->Next;
211 switch (addr_operation) {
229 struct sockaddr_in *out_value =
230 (
struct sockaddr_in *)
xcom_malloc(
sizeof(
struct sockaddr_in));
231 ConvertLengthToIpv4Mask(
233 &out_value->sin_addr.s_addr);
234 *out = (
struct sockaddr *)out_value;
237 struct sockaddr_in6 *out_value =
238 (
struct sockaddr_in6 *)
xcom_calloc(1,
sizeof(
struct sockaddr_in6));
240 i > 0; i -= 8, ++j) {
241 out_value->sin6_addr.s6_addr[j] =
242 i >= 8 ? 0xff : (ULONG)((0xffU << (8 - i)));
244 *out = (
struct sockaddr *)out_value;
#define IFDBG(mask, body)
Definition: gcs_debug.h:279
@ D_TRANSPORT
Definition: gcs_debug.h:178
#define STRLIT(x)
Definition: gcs_debug.h:316
static int flags[50]
Definition: hp_test1.cc:40
#define free(A)
Definition: lexyy.cc:915
static int count
Definition: myisam_ftdump.cc:43
SockaddrOp
Definition: sock_probe_ix.h:67
SockaddrOp
Definition: sock_probe_win32.h:79
@ kSockaddrOpAddress
Definition: sock_probe_win32.h:80
@ kSockaddrOpNetmask
Definition: sock_probe_win32.h:81
#define WORKING_BUFFER_SIZE
Definition: sock_probe_win32.h:60
static char * get_if_name(sock_probe *s, int count)
Definition: sock_probe_win32.h:262
static int init_sock_probe(sock_probe *s)
Definition: sock_probe_win32.h:85
struct sockaddr_in SOCKADDR_IN
Definition: sock_probe_win32.h:62
static void close_sock_probe(sock_probe *s)
Definition: sock_probe_win32.h:125
struct sockaddr sockaddr
Definition: sock_probe_win32.h:63
static void get_sockaddr_netmask(sock_probe *s, int count, struct sockaddr **out)
Definition: sock_probe_win32.h:257
static bool_t is_if_running(sock_probe *s, int)
Definition: sock_probe_win32.h:139
static interface_info get_interface(sock_probe *s, int count)
Definition: sock_probe_win32.h:153
struct interface_info interface_info
Definition: sock_probe_win32.h:151
static void get_sockaddr_address(sock_probe *s, int count, struct sockaddr **out)
Definition: sock_probe_win32.h:252
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:196
static int number_of_interfaces(sock_probe *s)
Definition: sock_probe_win32.h:131
struct in_addr in_addr
Definition: sock_probe_win32.h:65
Definition: sock_probe_win32.h:147
PIP_ADAPTER_ADDRESSES network_interface
Definition: sock_probe_win32.h:148
PIP_ADAPTER_UNICAST_ADDRESS_LH network_address
Definition: sock_probe_win32.h:149
Definition: sock_probe_ix.h:54
PIP_ADAPTER_ADDRESSES addresses
Definition: sock_probe_win32.h:73
int number_of_interfaces
Definition: sock_probe_win32.h:74
Rudimentary task system in portable C, based on Tom Duff's switch-based coroutine trick and a stack o...
#define NULL
Definition: types.h:55
int bool_t
Definition: types.h:35
#define idx_check_fail(x, limit)
Definition: xcom_common.h:71
static void * xcom_malloc(size_t size)
Definition: xcom_memory.h:46
static void * xcom_calloc(size_t nmemb, size_t size)
Definition: xcom_memory.h:54