Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Network Configuration Library

Network configuration library. More...

Macros

#define NET_CONFIG_NEED_ROUTER   0x00000001
 Application needs routers to be set so that connectivity to remote network is possible.
 
#define NET_CONFIG_NEED_IPV6   0x00000002
 Application needs IPv6 subsystem configured and initialized.
 
#define NET_CONFIG_NEED_IPV4   0x00000004
 Application needs IPv4 subsystem configured and initialized.
 

Functions

int net_config_init (const char *app_info, uint32_t flags, int32_t timeout)
 Initialize this network application.
 
int net_config_init_by_iface (struct net_if *iface, const char *app_info, uint32_t flags, int32_t timeout)
 Initialize this network application using a specific network interface.
 
int net_config_init_app (const struct device *dev, const char *app_info)
 Initialize this network application.
 

Detailed Description

Network configuration library.

Macro Definition Documentation

◆ NET_CONFIG_NEED_IPV4

#define NET_CONFIG_NEED_IPV4   0x00000004

#include <zephyr/net/net_config.h>

Application needs IPv4 subsystem configured and initialized.

Typically this means that the device has IPv4 address set.

◆ NET_CONFIG_NEED_IPV6

#define NET_CONFIG_NEED_IPV6   0x00000002

#include <zephyr/net/net_config.h>

Application needs IPv6 subsystem configured and initialized.

Typically this means that the device has IPv6 address set.

◆ NET_CONFIG_NEED_ROUTER

#define NET_CONFIG_NEED_ROUTER   0x00000001

#include <zephyr/net/net_config.h>

Application needs routers to be set so that connectivity to remote network is possible.

For IPv6 networks, this means that the device should receive IPv6 router advertisement message before continuing.

Function Documentation

◆ net_config_init()

int net_config_init ( const char *  app_info,
uint32_t  flags,
int32_t  timeout 
)

#include <zephyr/net/net_config.h>

Initialize this network application.

This will call net_config_init_by_iface() with NULL network interface.

Parameters
app_infoString describing this application.
flagsFlags related to services needed by the client.
timeoutHow long to wait the network setup before continuing the startup.
Returns
0 if ok, <0 if error.

◆ net_config_init_app()

int net_config_init_app ( const struct device dev,
const char *  app_info 
)

#include <zephyr/net/net_config.h>

Initialize this network application.

If CONFIG_NET_CONFIG_AUTO_INIT is set, then this function is called automatically when the device boots. If that is not desired, unset the config option and call the function manually when the application starts.

Parameters
devNetwork device to use. The function will figure out what network interface to use based on the device. If the device is NULL, then default network interface is used by the function.
app_infoString describing this application.
Returns
0 if ok, <0 if error.

◆ net_config_init_by_iface()

int net_config_init_by_iface ( struct net_if iface,
const char *  app_info,
uint32_t  flags,
int32_t  timeout 
)

#include <zephyr/net/net_config.h>

Initialize this network application using a specific network interface.

If network interface is set to NULL, then the default one is used in the configuration.

Parameters
ifaceInitialize networking using this network interface.
app_infoString describing this application.
flagsFlags related to services needed by the client.
timeoutHow long to wait the network setup before continuing the startup.
Returns
0 if ok, <0 if error.