Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions include/zephyr/net/net_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
#include <zephyr/net/net_if.h>
#include <zephyr/net/ieee802154_mgmt.h>

#if defined(CONFIG_NET_CONFIG_SETTINGS)
#include <network_config.inc>
#else
struct networking;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be a more unique name for this, networking is very plain and non-descriptive

#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -99,6 +105,37 @@ int net_config_init_by_iface(struct net_if *iface, const char *app_info,
*/
int net_config_init_app(const struct device *dev, const char *app_info);

/* @brief Get network initialization configuration.
*
* @details This network configuration consists of initial read-only
* configuration and read-write configuration when the
* configuration is changed at runtime.
*
* @param cfg Caller supplied pointer to struct net_init_config where
* the configuration will be stored.
*/
int net_config_get(struct networking *cfg);

/* @brief Set network initialization configuration.
*
* @details The user supplied configuration is saved to permanent
* storage. How this works:
* - If the config option in struct networking is different
* than the default one, then change the option and enable the _changed flag.
* - If the config option in struct networking is the same
* as the default one.
*
* @param cfg Caller supplied pointer to struct networking where
* the configuration will be read.
*/
int net_config_set(const struct networking *cfg);

/* @brief Clear all network configuration.
*
* @details This will reset all runtime configuration back to defaults.
*/
int net_config_clear(void);

/**
* @}
*/
Expand Down
5 changes: 5 additions & 0 deletions subsys/net/lib/config/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ menuconfig NET_CONFIG_SETTINGS

if NET_CONFIG_SETTINGS

config HEAP_MEM_POOL_ADD_SIZE_NET_CONFIG
int "Amount of heap needed for storing user configuration data"
default 1024
depends on SETTINGS

config NET_CONFIG_AUTO_INIT
bool "Init networking support automatically during device startup"
default y if !(USB_DEVICE_NETWORK || USBD_CDC_ECM_CLASS || USBD_CDC_NCM_CLASS)
Expand Down
Loading