Part 1
요약·해설
자동 초기화, timeout, IPv4·IPv6·router 요구 조건과 test용 static address option을 설명합니다.
Auto initialization
Timeout · Router
IPv4 · IPv6
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
562346A444ED2B827BFB012BD3F3CC391DDA61928345FC4C0A4AE428A6E9230E
.. _net_config_interface:
Network Configuration Library
#############################
.. contents::
:local:
:depth: 2
Overview
********
The network configuration library sets up networking devices in a
semi-automatic way during the system boot, based on user-supplied
Kconfig options.
The following Kconfig options affect how configuration library will
setup the system:
.. csv-table:: Kconfig options for network configuration library
:header: "Option name", "Description"
:widths: 45 55
":kconfig:option:`CONFIG_NET_CONFIG_SETTINGS`", "This option controls whether the
network system is configured or initialized at all. If not set, then the
config library is not used for initialization and the application needs to
do all the network related configuration itself. If this option is set,
then the user can optionally configure static IP addresses to be set to the
first network interface in the system. Typically setting static IP addresses
is only usable in testing and should not be used in production code. See
the config library Kconfig file :zephyr_file:`subsys/net/lib/config/Kconfig`
for specific options to set the static IP addresses."
":kconfig:option:`CONFIG_NET_CONFIG_AUTO_INIT`", "The networking system is
automatically configured when the device is started."
":kconfig:option:`CONFIG_NET_CONFIG_INIT_TIMEOUT`", "This tells how long to wait for
the networking to be ready and available. If for example IPv4 address from
DHCPv4 is not received within this limit, then a call to
``net_config_init()`` will return error during the device startup."
":kconfig:option:`CONFIG_NET_CONFIG_NEED_IPV4`", "The network application needs IPv4
support to function properly. This option makes sure the network application
is initialized properly in order to use IPv4.
If :kconfig:option:`CONFIG_NET_IPV4` is not enabled, then setting this option will
automatically enable IPv4."
":kconfig:option:`CONFIG_NET_CONFIG_NEED_IPV6`", "The network application needs IPv6
support to function properly. This option makes sure the network application
is initialized properly in order to use IPv6.
If :kconfig:option:`CONFIG_NET_IPV6` is not enabled, then setting this option will
automatically enable IPv6."
":kconfig:option:`CONFIG_NET_CONFIG_NEED_IPV6_ROUTER`", "If IPv6 is enabled, then
this option tells that the network application needs IPv6 router to exists
before continuing. This means in practice that the application wants to wait
until it receives IPv6 router advertisement message before continuing."
":kconfig:option:`CONFIG_NET_CONFIG_MY_IPV6_ADDR`","Local static IPv6 address assigned to
the default network interface."
":kconfig:option:`CONFIG_NET_CONFIG_PEER_IPV6_ADDR`","Peer static IPv6 address. This is mainly
useful in testing setups where the application can connect to a pre-defined host."
":kconfig:option:`CONFIG_NET_CONFIG_MY_IPV4_ADDR`","Local static IPv4 address assigned to
the default network interface."
":kconfig:option:`CONFIG_NET_CONFIG_MY_IPV4_NETMASK`","Static IPv4 netmask assigned to the IPv4
address."
":kconfig:option:`CONFIG_NET_CONFIG_MY_IPV4_GW`","Static IPv4 gateway address assigned to the
default network interface."
":kconfig:option:`CONFIG_NET_CONFIG_PEER_IPV4_ADDR`","Peer static IPv4 address. This is mainly
useful in testing setups where the application can connect to a pre-defined host."
Sample usage
************
If :kconfig:option:`CONFIG_NET_CONFIG_AUTO_INIT` is set, then the configuration library
is automatically enabled and run during the device boot. In this case,
the library will call ``net_config_init()`` automatically and the application
does not need to do any network configuration.
If you want to use the network configuration library but without automatic
initialization, you can call ``net_config_init()`` manually. The ``flags``
parameter can be used to give hints to the library about what kind of
functionality the application wishes to have before the actual application
starts.
API Reference
*************
.. doxygengroup:: net_config
Part 3
한국어 전문 번역
Network Configuration Library
Overview
Network configuration library는 user가 제공한 Kconfig option을 바탕으로 system boot 중 networking device를 semi-automatic 방식으로 설정합니다.
다음 Kconfig option이 library의 system setup 방식에 영향을 줍니다.
| Option name | Description |
|---|---|
CONFIG_NET_CONFIG_SETTINGS | Network system을 configuration 또는 initialization할지 제어합니다. 끄면 config library를 initialization에 사용하지 않으며 application이 모든 network configuration을 직접 해야 합니다. 켜면 system의 첫 network interface에 static IP address를 선택적으로 설정할 수 있습니다. Static address는 주로 test용이고 production code에는 사용하지 않아야 합니다. 세부 option은 subsys/net/lib/config/Kconfig에 있습니다. |
CONFIG_NET_CONFIG_AUTO_INIT | Device가 시작될 때 networking system을 자동으로 configure합니다. |
CONFIG_NET_CONFIG_INIT_TIMEOUT | Networking이 ready·available 상태가 될 때까지 기다릴 시간입니다. 예를 들어 이 시간 안에 DHCPv4 address를 받지 못하면 device startup 중 net_config_init()이 error를 반환합니다. |
CONFIG_NET_CONFIG_NEED_IPV4 | Application 동작에 IPv4가 필요함을 표시해 IPv4 사용에 맞게 initialize합니다. CONFIG_NET_IPV4가 꺼져 있으면 자동으로 활성화합니다. |
CONFIG_NET_CONFIG_NEED_IPV6 | Application 동작에 IPv6가 필요함을 표시해 IPv6 사용에 맞게 initialize합니다. CONFIG_NET_IPV6가 꺼져 있으면 자동으로 활성화합니다. |
CONFIG_NET_CONFIG_NEED_IPV6_ROUTER | IPv6가 활성화된 경우 application이 계속하기 전에 IPv6 router가 필요함을 표시합니다. 실제로는 IPv6 router advertisement message를 받을 때까지 기다립니다. |
CONFIG_NET_CONFIG_MY_IPV6_ADDR | Default network interface에 할당할 local static IPv6 address입니다. |
CONFIG_NET_CONFIG_PEER_IPV6_ADDR | Peer static IPv6 address입니다. Application이 미리 정한 host에 연결하는 test setup에서 주로 유용합니다. |
CONFIG_NET_CONFIG_MY_IPV4_ADDR | Default network interface에 할당할 local static IPv4 address입니다. |
CONFIG_NET_CONFIG_MY_IPV4_NETMASK | Static IPv4 address에 할당할 IPv4 netmask입니다. |
CONFIG_NET_CONFIG_MY_IPV4_GW | Default network interface에 할당할 static IPv4 gateway address입니다. |
CONFIG_NET_CONFIG_PEER_IPV4_ADDR | Peer static IPv4 address입니다. Application이 미리 정한 host에 연결하는 test setup에서 주로 유용합니다. |
Sample usage
CONFIG_NET_CONFIG_AUTO_INIT을 설정하면 device boot 중 configuration library가 자동으로 활성화되고 실행됩니다. Library가 net_config_init()을 호출하므로 application은 network configuration을 수행할 필요가 없습니다.
Automatic initialization 없이 network configuration library를 쓰려면 net_config_init()을 직접 호출합니다. flags parameter로 실제 application 시작 전에 필요한 기능을 library에 hint로 전달할 수 있습니다.
API Reference
Doxygen group net_config가 API reference를 제공합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.