|
16 | 16 | #include <zephyr/net/net_if.h> |
17 | 17 | #include <zephyr/net/ieee802154_mgmt.h> |
18 | 18 |
|
| 19 | +#if defined(CONFIG_NET_CONFIG_SETTINGS) |
| 20 | +#include <net_init_config.inc> |
| 21 | +#else |
| 22 | +struct net_init_config; |
| 23 | +#endif |
| 24 | + |
19 | 25 | #ifdef __cplusplus |
20 | 26 | extern "C" { |
21 | 27 | #endif |
@@ -99,6 +105,37 @@ int net_config_init_by_iface(struct net_if *iface, const char *app_info, |
99 | 105 | */ |
100 | 106 | int net_config_init_app(const struct device *dev, const char *app_info); |
101 | 107 |
|
| 108 | +/* @brief Get network initialization configuration. |
| 109 | + * |
| 110 | + * @details This network configuration consists of initial read-only |
| 111 | + * configuration and read-write configuration when the |
| 112 | + * configuration is changed at runtime. |
| 113 | + * |
| 114 | + * @param cfg Caller supplied pointer to struct net_init_config where |
| 115 | + * the configuration will be stored. |
| 116 | + */ |
| 117 | +int net_config_get(struct net_init_config *cfg); |
| 118 | + |
| 119 | +/* @brief Set network initialization configuration. |
| 120 | + * |
| 121 | + * @details The user supplied configuration is saved to permanent |
| 122 | + * storage. How this works: |
| 123 | + * - If the config option in struct net_init_config is different |
| 124 | + * than the default one, then change the option and enable the _changed flag. |
| 125 | + * - If the config option in struct net_init_config is the same |
| 126 | + * as the default one. |
| 127 | + * |
| 128 | + * @param cfg Caller supplied pointer to struct net_init_config where |
| 129 | + * the configuration will be read. |
| 130 | + */ |
| 131 | +int net_config_set(const struct net_init_config *cfg); |
| 132 | + |
| 133 | +/* @brief Clear all network configuration. |
| 134 | + * |
| 135 | + * @details This will reset all runtime configuration back to defaults. |
| 136 | + */ |
| 137 | +int net_config_clear(void); |
| 138 | + |
102 | 139 | /** |
103 | 140 | * @} |
104 | 141 | */ |
|
0 commit comments