#include <windows.h>
#include <assert.h>
#include <errno.h>
#include <iphlpapi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include "xcom/node_no.h"
#include "xcom/simset.h"
#include "xcom/sock_probe.h"
#include "xcom/task.h"
#include "xcom/task_debug.h"
#include "xcom/task_net.h"
#include "xcom/task_os.h"
#include "xcom/xcom_base.h"
#include "xcom/xcom_common.h"
#include "xcom/xcom_memory.h"
#include "xcom/xcom_profile.h"
#include "xcom/xcom_transport.h"
#include "xdr_gen/xcom_vp.h"
Go to the source code of this file.
|
static int | init_sock_probe (sock_probe *s) |
|
static void | close_sock_probe (sock_probe *s) |
|
static int | number_of_interfaces (sock_probe *s) |
|
static bool_t | is_if_running (sock_probe *s, int) |
|
static interface_info | get_interface (sock_probe *s, int count) |
|
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 parameter value, it can be from: More...
|
|
static void | get_sockaddr_address (sock_probe *s, int count, struct sockaddr **out) |
|
static void | get_sockaddr_netmask (sock_probe *s, int count, struct sockaddr **out) |
|
static char * | get_if_name (sock_probe *s, int count) |
|
◆ BSD_COMP
◆ FD_SETSIZE
Utility functions to check if a network address or name matches an interface on the machine we are running on.
This is useful to deduce the node number from a list of network addresses or names. The node number is the index of the list element which matches.
◆ WORKING_BUFFER_SIZE
#define WORKING_BUFFER_SIZE 1024 * 1024 |
◆ in_addr
◆ interface_info
◆ sock_probe
◆ sockaddr
◆ SOCKADDR_IN
◆ SockaddrOp
◆ SockaddrOp
Enumerator |
---|
kSockaddrOpAddress | |
kSockaddrOpNetmask | |
kSockaddrOpAddress | |
kSockaddrOpNetmask | |
◆ close_sock_probe()
◆ get_if_name()
static char * get_if_name |
( |
sock_probe * |
s, |
|
|
int |
count |
|
) |
| |
|
static |
◆ get_interface()
◆ get_sockaddr()
Get the sockaddr object that pertains to a certain interface index Depending of the addr_operation parameter value, it can be from:
- Parameters
-
s | an initialized sock_probe structure |
count | the interface index to return |
out | the return value sockaddr. nullptr in case of error. |
addr_operation | either request the sockaddr for the physical address or for a netmask |
◆ get_sockaddr_address()
◆ get_sockaddr_netmask()
◆ init_sock_probe()
◆ is_if_running()
◆ number_of_interfaces()