2017-02-10 16:32:55 +01:00
|
|
|
#
|
|
|
|
# For a description of the syntax of this configuration file,
|
|
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
|
|
#
|
|
|
|
|
|
|
|
config LIBC_NETDB
|
2022-10-02 13:26:21 +02:00
|
|
|
bool "netdb support"
|
2023-06-28 10:05:08 +02:00
|
|
|
depends on NET_IPv4 || NET_IPv6
|
2017-02-10 16:32:55 +01:00
|
|
|
default n
|
|
|
|
|
2017-02-10 17:04:56 +01:00
|
|
|
menu "NETDB Support"
|
|
|
|
|
2018-06-08 15:07:21 +02:00
|
|
|
config LIBC_GAISTRERROR
|
|
|
|
bool "Enable gai_strerror"
|
2022-09-22 07:01:45 +02:00
|
|
|
depends on LIBC_NETDB
|
2018-06-08 15:07:21 +02:00
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
The gai_strerror() function shall return a text string describing an error
|
|
|
|
value for the getaddrinfo() and getnameinfo(). But it can also require a lot
|
|
|
|
of memory. If this option is not selected, gai_strerror() will still exist in
|
|
|
|
the build but it will not decode error values.
|
|
|
|
|
2023-03-22 09:20:05 +01:00
|
|
|
config LIBC_GAISTRERROR_ERRNUM
|
|
|
|
bool "Print unknown error code in gai_strerror()"
|
|
|
|
default !LIBC_GAISTRERROR
|
|
|
|
---help---
|
|
|
|
If this option is selected, then gai_strerror() will print error code
|
|
|
|
for unknown errors like "Unknown error 11". Default enabled when
|
|
|
|
LIBC_GAISTRERROR is not selected.
|
|
|
|
|
2020-03-29 17:15:18 +02:00
|
|
|
config NETDB_BUFSIZE
|
|
|
|
int "gethostbyname/gethostbyaddr buffer size"
|
2022-09-22 07:01:45 +02:00
|
|
|
depends on LIBC_NETDB
|
2020-05-15 05:25:10 +02:00
|
|
|
default 256
|
2020-03-29 17:15:18 +02:00
|
|
|
|
2021-08-26 10:07:41 +02:00
|
|
|
if NET_IPv4
|
|
|
|
|
|
|
|
config NETDB_MAX_IPv4ADDR
|
|
|
|
int "Max number of IPv4 addresses per host"
|
2022-09-22 07:01:45 +02:00
|
|
|
depends on LIBC_NETDB
|
2020-03-29 17:15:18 +02:00
|
|
|
default 1
|
|
|
|
---help---
|
2021-08-26 10:07:41 +02:00
|
|
|
This setting determines the maximum number of IPv4 addresses
|
2020-03-29 17:15:18 +02:00
|
|
|
stored to the name resolution cache for a given host.
|
|
|
|
|
2021-08-26 10:07:41 +02:00
|
|
|
endif # NET_IPv4
|
|
|
|
|
|
|
|
if NET_IPv6
|
|
|
|
|
|
|
|
config NETDB_MAX_IPv6ADDR
|
|
|
|
int "Max number of IPv6 addresses per host"
|
|
|
|
depends on LIBC_NETDB
|
|
|
|
default 1
|
|
|
|
---help---
|
|
|
|
This setting determines the maximum number of IPv6 addresses
|
|
|
|
stored to the name resolution cache for a given host.
|
|
|
|
|
|
|
|
endif # NET_IPv6
|
|
|
|
|
2017-02-10 16:32:55 +01:00
|
|
|
menuconfig NETDB_HOSTFILE
|
|
|
|
bool "Network host file support"
|
|
|
|
default n
|
|
|
|
select LIBC_NETDB
|
|
|
|
---help---
|
|
|
|
Enable network host table look ups via gethostbyname() and
|
|
|
|
gethostbyaddr().
|
|
|
|
|
|
|
|
if NETDB_HOSTFILE
|
|
|
|
|
|
|
|
config NETDB_HOSTCONF_PATH
|
|
|
|
string "Path to host configuration file"
|
|
|
|
default "/etc/hosts"
|
|
|
|
|
|
|
|
config NETDB_MAX_ALTNAMES
|
|
|
|
int "Max number of alternate host names"
|
|
|
|
default 4
|
|
|
|
|
|
|
|
endif # NETDB_HOSTFILE
|
|
|
|
|
|
|
|
menuconfig NETDB_DNSCLIENT
|
|
|
|
bool "DNS Name resolution"
|
|
|
|
default n
|
|
|
|
depends on NET && NET_UDP
|
|
|
|
select LIBC_NETDB
|
2021-06-03 05:37:26 +02:00
|
|
|
select NET_SOCKOPTS
|
2017-02-10 16:32:55 +01:00
|
|
|
---help---
|
|
|
|
Enable support for the name resolution; Enable network host
|
|
|
|
resolution via gethostbyname().
|
|
|
|
|
|
|
|
if NETDB_DNSCLIENT
|
|
|
|
|
|
|
|
config NETDB_DNSCLIENT_ENTRIES
|
|
|
|
int "Number of DNS resolver entries"
|
|
|
|
default 0 if DEFAULT_SMALL
|
|
|
|
default 8 if !DEFAULT_SMALL
|
|
|
|
range 0 255
|
|
|
|
---help---
|
|
|
|
Number of cached DNS resolver entries. Default: 8. Zero disables
|
|
|
|
all cached name resolutions.
|
|
|
|
|
|
|
|
Disabling the DNS cache means that each access call to
|
|
|
|
gethostbyname() will result in a new DNS network query. If
|
|
|
|
CONFIG_NETDB_DNSCLIENT_ENTRIES is non-zero, then entries will be
|
|
|
|
cached and if the name mapping can be found in that cache, the
|
|
|
|
network query can be avoid. Of course, this is only useful if you
|
|
|
|
query the same name often and if the IP address of the name is
|
2020-04-24 11:21:37 +02:00
|
|
|
stable. If the IP address can change, then caching DNS address
|
2017-02-10 16:32:55 +01:00
|
|
|
might have undesirable side-effects (see help for
|
|
|
|
CONFIG_NETDB_DNSCLIENT_LIFESEC).
|
|
|
|
|
|
|
|
config NETDB_DNSCLIENT_NAMESIZE
|
|
|
|
int "Max size of a cached hostname"
|
2021-10-25 14:08:43 +02:00
|
|
|
default PATH_MAX
|
2017-02-10 16:32:55 +01:00
|
|
|
---help---
|
|
|
|
The size of a hostname string in the DNS resolver cache is fixed.
|
|
|
|
This setting provides the maximum size of a hostname. Names longer
|
|
|
|
than this will be aliased! Default: 32
|
|
|
|
|
|
|
|
config NETDB_DNSCLIENT_LIFESEC
|
|
|
|
int "Life of a DNS cache entry (seconds)"
|
|
|
|
default 3600
|
|
|
|
---help---
|
|
|
|
Cached entries in the name resolution cache older than this will not
|
|
|
|
be used. Default: 1 hour. Zero means that entries will not expire.
|
|
|
|
|
|
|
|
Small values of CONFIG_NETDB_DNSCLIENT_LIFESEC may result in more
|
|
|
|
network DNS queries; larger values can make a host unreachable for
|
|
|
|
the entire duration of the timeout value. This might happen, for
|
|
|
|
example, if the remote host was assigned a different IP address by
|
|
|
|
a DHCP server.
|
|
|
|
|
|
|
|
config NETDB_DNSCLIENT_MAXRESPONSE
|
|
|
|
int "Max response size"
|
2023-08-28 06:03:57 +02:00
|
|
|
default 512
|
2017-02-10 16:32:55 +01:00
|
|
|
---help---
|
|
|
|
This setting determines the maximum size of response message that
|
2020-05-15 07:11:54 +02:00
|
|
|
can be received by the DNS resolver. The default used to be 96,
|
|
|
|
which might be enough if you have a control on the DNS servers.
|
|
|
|
It may need to be larger on enterprise networks.
|
2017-02-10 16:32:55 +01:00
|
|
|
|
2018-11-14 13:30:49 +01:00
|
|
|
config NETDB_DNSCLIENT_RECV_TIMEOUT
|
|
|
|
int "DNS receive timeout"
|
|
|
|
default 30
|
|
|
|
---help---
|
|
|
|
This is the timeout value when DNS receives response after
|
|
|
|
dns_send_query, unit: seconds
|
|
|
|
|
2022-12-14 11:49:22 +01:00
|
|
|
config NETDB_DNSCLIENT_SEND_TIMEOUT
|
|
|
|
int "DNS send timeout"
|
|
|
|
default NETDB_DNSCLIENT_RECV_TIMEOUT
|
|
|
|
---help---
|
|
|
|
This is the timeout value when DNS send request on dns_send_query,
|
|
|
|
unit: seconds
|
|
|
|
|
2018-11-14 13:30:49 +01:00
|
|
|
config NETDB_DNSCLIENT_RETRIES
|
|
|
|
int "Number of retries for DNS request"
|
|
|
|
default 3
|
|
|
|
---help---
|
|
|
|
This setting determines how many times resolver retries request
|
|
|
|
until failing.
|
2017-02-10 16:32:55 +01:00
|
|
|
|
|
|
|
config NETDB_RESOLVCONF
|
|
|
|
bool "DNS resolver file support"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
Enable DNS server look ups in resolver file like /etc/resolv.conf.
|
|
|
|
|
|
|
|
if NETDB_RESOLVCONF
|
|
|
|
|
|
|
|
config NETDB_RESOLVCONF_PATH
|
|
|
|
string "Path to host configuration file"
|
|
|
|
default "/etc/resolv.conf"
|
|
|
|
|
|
|
|
config NETDB_RESOLVCONF_NONSTDPORT
|
|
|
|
bool "Non-standard port support"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
By default, the resolv.conf file will hold only records like:
|
|
|
|
|
|
|
|
nameserver xx.xx.xx.xx
|
|
|
|
nameserver xxxx:::::::xxxx
|
|
|
|
|
|
|
|
The default port of 53 is always assumed.
|
|
|
|
|
|
|
|
If this option is selected, then OpenBSD style resolv.conf files
|
|
|
|
will be supported. This adds logic for a bracket port notation
|
|
|
|
like:
|
|
|
|
|
|
|
|
nameserver [xx.xx.xx.xx]:ppppp
|
|
|
|
nameserver [xxxx:::::::xxxx]:ppppp
|
|
|
|
|
|
|
|
endif # NETDB_RESOLVCONF
|
|
|
|
|
2020-04-24 11:21:37 +02:00
|
|
|
config NETDB_DNSSERVER_NAMESERVERS
|
|
|
|
int "Max number of configured nameservers"
|
|
|
|
default 1
|
|
|
|
depends on !NETDB_RESOLVCONF
|
|
|
|
---help---
|
|
|
|
This setting determines how many nameservers there can be
|
|
|
|
in use concurrently.
|
|
|
|
|
2017-02-10 16:32:55 +01:00
|
|
|
choice
|
|
|
|
prompt "DNS server address type"
|
|
|
|
default NETDB_DNSSERVER_IPv4 if NET_IPv4
|
|
|
|
default NETDB_DNSSERVER_IPv6 if !NET_IPv4 && NET_IPv6
|
|
|
|
default NETDB_DNSSERVER_NOADDR if !NET_IPv4 && !NET_IPv6
|
|
|
|
depends on !NETDB_RESOLVCONF
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_NOADDR
|
|
|
|
bool "No default DNS server address"
|
|
|
|
---help---
|
|
|
|
There is not default DNS nameserver address. Application must call
|
2020-04-24 11:21:37 +02:00
|
|
|
dns_add_nameserver() at runtime to add the DNS server address.
|
2017-02-10 16:32:55 +01:00
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv4
|
|
|
|
bool "IPv4 DNS server address"
|
|
|
|
depends on NET_IPv4
|
|
|
|
---help---
|
|
|
|
An IPv4 default DNS nameserver address will be provided. Application
|
|
|
|
may overwrite this start default server address by calling
|
2020-04-24 11:21:37 +02:00
|
|
|
dns_add_nameserver() at runtime.
|
2017-02-10 16:32:55 +01:00
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6
|
|
|
|
bool "IPv6 DNS server address"
|
|
|
|
depends on NET_IPv6
|
|
|
|
---help---
|
|
|
|
An IPv6 default DNS nameserver address will be provided. Application
|
|
|
|
may overwrite this start default server address by calling
|
2020-04-24 11:21:37 +02:00
|
|
|
dns_add_nameserver() at runtime.
|
2017-02-10 16:32:55 +01:00
|
|
|
|
|
|
|
endchoice # DNS server address type
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv4ADDR
|
|
|
|
hex "Target IPv4 address"
|
|
|
|
default 0x0a000001
|
|
|
|
depends on NETDB_DNSSERVER_IPv4
|
|
|
|
---help---
|
|
|
|
Default DNS server IPv4 address in host byte order. Default value
|
2020-04-01 11:00:01 +02:00
|
|
|
10.0.0.1. This may be changed via dns_add_nameserver().
|
2017-02-10 16:32:55 +01:00
|
|
|
|
|
|
|
if NETDB_DNSSERVER_IPv6
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6ADDR_1
|
|
|
|
hex "[0]"
|
|
|
|
default 0xfc00
|
|
|
|
range 0x0 0xffff
|
|
|
|
---help---
|
|
|
|
This is the default IP address of the DNS server. This is a 16-bit
|
|
|
|
integer value in host order. Each of the eight values forming the
|
|
|
|
full IPv6 address must be specified individually. This is the first
|
|
|
|
of the 8-values. The default for all eight values is fc00::1.
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6ADDR_2
|
|
|
|
hex "[1]"
|
|
|
|
default 0x0000
|
|
|
|
range 0x0 0xffff
|
|
|
|
---help---
|
|
|
|
This is the default IP address of the DNS server. This is a 16-bit
|
|
|
|
integer value in host order. Each of the eight values forming the
|
|
|
|
full IPv6 address must be specified individually. This is the second
|
|
|
|
of the 8-values. The default for all eight values is fc00::1.
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6ADDR_3
|
|
|
|
hex "[2]"
|
|
|
|
default 0x0000
|
|
|
|
range 0x0 0xffff
|
|
|
|
---help---
|
|
|
|
This is the default IP address of the DNS server. This is a 16-bit
|
|
|
|
integer value in host order. Each of the eight values forming the
|
|
|
|
full IPv6 address must be specified individually. This is the third
|
|
|
|
of the 8-values. The default for all eight values is fc00::1.
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6ADDR_4
|
|
|
|
hex "[3]"
|
|
|
|
default 0x0000
|
|
|
|
range 0x0 0xffff
|
|
|
|
---help---
|
|
|
|
This is the default IP address of the DNS server. This is a 16-bit
|
|
|
|
integer value in host order. Each of the eight values forming the
|
|
|
|
full IPv6 address must be specified individually. This is the fourth
|
|
|
|
of the 8-values. The default for all eight values is fc00::1.
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6ADDR_5
|
|
|
|
hex "[4]"
|
|
|
|
default 0x0000
|
|
|
|
range 0x0 0xffff
|
|
|
|
---help---
|
|
|
|
This is the default IP address of the DNS server. This is a 16-bit
|
|
|
|
integer value in host order. Each of the eight values forming the
|
|
|
|
full IPv6 address must be specified individually. This is the fifth
|
|
|
|
of the 8-values. The default for all eight values is fc00::1.
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6ADDR_6
|
|
|
|
hex "[5]"
|
|
|
|
default 0x0000
|
|
|
|
range 0x0 0xffff
|
|
|
|
---help---
|
|
|
|
This is the default IP address of the DNS server. This is a 16-bit
|
|
|
|
integer value in host order. Each of the eight values forming the
|
|
|
|
full IPv6 address must be specified individually. This is the sixth
|
|
|
|
of the 8-values. The default for all eight values is fc00::1.
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6ADDR_7
|
|
|
|
hex "[6]"
|
|
|
|
default 0x0000
|
|
|
|
range 0x0 0xffff
|
|
|
|
---help---
|
|
|
|
This is the default IP address of the DNS server. This is a 16-bit
|
|
|
|
integer value in host order. Each of the eight values forming the
|
|
|
|
full IPv6 address must be specified individually. This is the seventh
|
|
|
|
of the 8-values. The default for all eight values is fc00::1.
|
|
|
|
|
|
|
|
config NETDB_DNSSERVER_IPv6ADDR_8
|
|
|
|
hex "[7]"
|
|
|
|
default 0x0001
|
|
|
|
range 0x0 0xffff
|
|
|
|
---help---
|
|
|
|
This is the default IP address of the DNS server. This is a 16-bit
|
|
|
|
integer value in host order. Each of the eight values forming the
|
|
|
|
full IPv6 address must be specified individually. This is the last
|
|
|
|
of the 8-values. The default for all eight values is fc00::1.
|
|
|
|
|
|
|
|
endif # NETDB_DNSSERVER_IPv6
|
|
|
|
endif # NETDB_DNSCLIENT
|
2017-02-10 17:04:56 +01:00
|
|
|
endmenu # NETDB Support
|