Lely core libraries 2.3.4
if.h
Go to the documentation of this file.
1
22#ifndef LELY_IO_IF_H_
23#define LELY_IO_IF_H_
24
25#include <lely/io/addr.h>
26
31#if _WIN32
32#define IO_IF_NAME_STRLEN 256
33#else
34#define IO_IF_NAME_STRLEN 16
35#endif
36
37enum {
39 IO_IF_UP = 1 << 0,
47 IO_IF_MULTICAST = 1 << 4
48};
49
74
76#define IO_IFINFO_INIT \
77 { \
78 0, { '\0' }, 0, 0, IO_ADDR_INIT, IO_ADDR_INIT, IO_ADDR_INIT \
79 }
80
81#ifdef __cplusplus
82extern "C" {
83#endif
84
97int io_get_ifinfo(int maxinfo, struct io_ifinfo *info);
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif // !LELY_IO_IF_H_
This header file is part of the I/O library; it contains the network address declarations.
int io_get_ifinfo(int maxinfo, struct io_ifinfo *info)
Obtains a list of network interfaces.
Definition if.c:60
#define IO_IF_NAME_STRLEN
The maximum number of bytes required to hold the name of a network interface, including the terminati...
Definition if.h:34
@ IO_IF_UP
The interface is running.
Definition if.h:39
@ IO_IF_POINTTOPOINT
The interface is a point-to-point link.
Definition if.h:45
@ IO_IF_LOOPBACK
The interface is a loopback interface.
Definition if.h:43
@ IO_IF_BROADCAST
A valid broadcast address is set.
Definition if.h:41
@ IO_IF_MULTICAST
The interface supports multicast.
Definition if.h:47
An opaque network address type.
Definition addr.h:30
A structure describing a network interface.
Definition if.h:51
io_addr_t addr
The address of the interface.
Definition if.h:68
char name[IO_IF_NAME_STRLEN]
The interface name.
Definition if.h:55
unsigned int index
The interface index.
Definition if.h:53
io_addr_t netmask
The netmask used by the interface.
Definition if.h:70
int flags
The status of the interface (any combination of IO_IF_UP, IO_IF_BROADCAST, IO_IF_LOOPBACK,...
Definition if.h:66
io_addr_t broadaddr
The broadcast address of the interface.
Definition if.h:72
int domain
The domain of the interface (one of IO_SOCK_BTH, IO_SOCK_IPV4, IO_SOCK_IPV6 or IO_SOCK_UNIX).
Definition if.h:60