1.. _net_config_interface: 2 3Network Configuration Library 4############################# 5 6.. contents:: 7 :local: 8 :depth: 2 9 10Overview 11******** 12 13The network configuration library sets up networking devices in a 14semi-automatic way during the system boot, based on user-supplied 15Kconfig options. 16 17The following Kconfig options affect how configuration library will 18setup the system: 19 20.. csv-table:: Kconfig options for network configuration library 21 :header: "Option name", "Description" 22 :widths: 45 55 23 24 ":kconfig:option:`CONFIG_NET_CONFIG_SETTINGS`", "This option controls whether the 25 network system is configured or initialized at all. If not set, then the 26 config library is not used for initialization and the application needs to 27 do all the network related configuration itself. If this option is set, 28 then the user can optionally configure static IP addresses to be set to the 29 first network interface in the system. Typically setting static IP addresses 30 is only usable in testing and should not be used in production code. See 31 the config library Kconfig file :zephyr_file:`subsys/net/lib/config/Kconfig` 32 for specific options to set the static IP addresses." 33 ":kconfig:option:`CONFIG_NET_CONFIG_AUTO_INIT`", "The networking system is 34 automatically configured when the device is started." 35 ":kconfig:option:`CONFIG_NET_CONFIG_INIT_TIMEOUT`", "This tells how long to wait for 36 the networking to be ready and available. If for example IPv4 address from 37 DHCPv4 is not received within this limit, then a call to 38 ``net_config_init()`` will return error during the device startup." 39 ":kconfig:option:`CONFIG_NET_CONFIG_NEED_IPV4`", "The network application needs IPv4 40 support to function properly. This option makes sure the network application 41 is initialized properly in order to use IPv4. 42 If :kconfig:option:`CONFIG_NET_IPV4` is not enabled, then setting this option will 43 automatically enable IPv4." 44 ":kconfig:option:`CONFIG_NET_CONFIG_NEED_IPV6`", "The network application needs IPv6 45 support to function properly. This option makes sure the network application 46 is initialized properly in order to use IPv6. 47 If :kconfig:option:`CONFIG_NET_IPV6` is not enabled, then setting this option will 48 automatically enable IPv6." 49 ":kconfig:option:`CONFIG_NET_CONFIG_NEED_IPV6_ROUTER`", "If IPv6 is enabled, then 50 this option tells that the network application needs IPv6 router to exists 51 before continuing. This means in practice that the application wants to wait 52 until it receives IPv6 router advertisement message before continuing." 53 ":kconfig:option:`CONFIG_NET_CONFIG_BT_NODE`", "Enables application to operate in 54 Bluetooth node mode which requires GATT service to be registered and start 55 advertising as peripheral." 56 57Sample usage 58************ 59 60If :kconfig:option:`CONFIG_NET_CONFIG_AUTO_INIT` is set, then the configuration library 61is automatically enabled and run during the device boot. In this case, 62the library will call ``net_config_init()`` automatically and the application 63does not need to do any network configuration. 64 65If you want to use the network configuration library but without automatic 66initialization, you can call ``net_config_init()`` manually. The ``flags`` 67parameter can be used to give hints to the library about what kind of 68functionality the application wishes to have before the actual application 69starts. 70 71API Reference 72************* 73 74.. doxygengroup:: net_config 75