GATE
C/C++ Framework
Loading...
Searching...
No Matches
netconfigs.h File Reference

Network configuration utilities. More...

Data Structures

struct  gate_netconfig_nif_t
 NetworkInterFace record. More...
struct  gate_netconfig_address_t
 Network address record. More...

Macros

#define GATE_NETCONFIG_STATUS_DISABLED   0x0001
#define GATE_NETCONFIG_STATUS_ENABLED   0x0002
#define GATE_NETCONFIG_STATUS_NONFUNCT   0x0004
#define GATE_NETCONFIG_STATUS_OPERATIONAL   0x0008
#define GATE_NETCONFIG_STATUS_CONNECTING   0x0010
#define GATE_NETCONFIG_STATUS_CONNECTED   0x0020
#define GATE_NETCONFIG_STATUS_DISCONNECTED   0x0040
#define GATE_NETCONFIG_STATUS_ERROR   0x8000

Typedefs

typedef gate_bool_t(* gate_netcfg_enum_nif_callback_t) (gate_netconfig_nif_t const *nif, void *userparam)
 Callback function type for NIF enumeration.
typedef gate_bool_t(* gate_netcfg_enum_addresses_callback_t) (gate_netconfig_address_t const *addr, void *userparam)
 Callback function type for address enumeration.

Functions

GATE_SYSTEM_API char const * gate_netconfig_print_status (gate_enumint_t status)
 Returns a static human readable string for a GATE_NETCONFIG_STATUS_* value.
GATE_SYSTEM_API char const * gate_netconfig_print_type (gate_enumint_t tp)
 Returns a static human readable string for a GATE_NETCONFIG_TYPE_* value.
GATE_SYSTEM_API gate_result_t gate_netconfig_enum_nifs (gate_netcfg_enum_nif_callback_t callback, void *userparam)
 Enumerate all available network interfaces.
GATE_SYSTEM_API gate_result_t gate_netconfig_enum_addresses (gate_netconfig_nif_t const *nif, gate_netcfg_enum_addresses_callback_t callback, void *userparam)
 Enumerates all addresses associated with a network interface.
GATE_SYSTEM_API gate_result_t gate_netconfig_enable_nif (gate_netconfig_nif_t const *nif, gate_bool_t enabled)
 Enables or disables a network interface.
GATE_SYSTEM_API gate_result_t gate_netconfig_setup_nif_addresses (gate_netconfig_nif_t const *nif, gate_netconfig_address_t const *addresses, gate_size_t addresses_count)
 Changes the address configuration of a network interface.

Detailed Description

Network configuration utilities.

Macro Definition Documentation

◆ GATE_NETCONFIG_STATUS_DISABLED

#define GATE_NETCONFIG_STATUS_DISABLED   0x0001

NIF is disabled

◆ GATE_NETCONFIG_STATUS_ENABLED

#define GATE_NETCONFIG_STATUS_ENABLED   0x0002

NIF is enabled

◆ GATE_NETCONFIG_STATUS_NONFUNCT

#define GATE_NETCONFIG_STATUS_NONFUNCT   0x0004

NIF is non-operational

◆ GATE_NETCONFIG_STATUS_OPERATIONAL

#define GATE_NETCONFIG_STATUS_OPERATIONAL   0x0008

NIF is operational

◆ GATE_NETCONFIG_STATUS_CONNECTING

#define GATE_NETCONFIG_STATUS_CONNECTING   0x0010

NIF is currently connecting

◆ GATE_NETCONFIG_STATUS_CONNECTED

#define GATE_NETCONFIG_STATUS_CONNECTED   0x0020

NIF is connected to a network

◆ GATE_NETCONFIG_STATUS_DISCONNECTED

#define GATE_NETCONFIG_STATUS_DISCONNECTED   0x0040

NIF is disconnected

◆ GATE_NETCONFIG_STATUS_ERROR

#define GATE_NETCONFIG_STATUS_ERROR   0x8000

NIF is in error state

Function Documentation

◆ gate_netconfig_enum_nifs()

GATE_SYSTEM_API gate_result_t gate_netconfig_enum_nifs ( gate_netcfg_enum_nif_callback_t callback,
void * userparam )

Enumerate all available network interfaces.

Parameters
[in]callbackCallback function to be called for each found network interface
[in]userparamUser parameter attached to each callback call
Returns
GATE_RESULT_* result code

◆ gate_netconfig_enum_addresses()

GATE_SYSTEM_API gate_result_t gate_netconfig_enum_addresses ( gate_netconfig_nif_t const * nif,
gate_netcfg_enum_addresses_callback_t callback,
void * userparam )

Enumerates all addresses associated with a network interface.

Parameters
[in]nifPointer to network interface record to be accessed
[in]callbackCallback function to be called with each found address
[in]userparamUser parameter attached to each callback call
Returns
GATE_RESULT_* result code

◆ gate_netconfig_enable_nif()

GATE_SYSTEM_API gate_result_t gate_netconfig_enable_nif ( gate_netconfig_nif_t const * nif,
gate_bool_t enabled )

Enables or disables a network interface.

Parameters
[in]nifPointer to network interface record to be accessed
[in]enabledNew state to be applied
Returns
GATE_RESULT_* result code

◆ gate_netconfig_setup_nif_addresses()

GATE_SYSTEM_API gate_result_t gate_netconfig_setup_nif_addresses ( gate_netconfig_nif_t const * nif,
gate_netconfig_address_t const * addresses,
gate_size_t addresses_count )

Changes the address configuration of a network interface.

Parameters
[in]nifPointer to network interface record to be accessed
[in]addressesPointer to address array with new configuration
[in]addresses_countAmount of entries in addresses
Returns
GATE_RESULT_* result code