nuttx/net/icmp/Kconfig

102 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menu "ICMP Networking Support"
config NET_ICMP
bool "Enable ICMP networking"
default NET_IPv4
---help---
Enable minimal ICMP support. Includes built-in support
for sending replies to received ECHO (ping) requests.
config NET_ICMP_NO_STACK
bool "Disable ICMP stack"
default n
select NET_ICMP
---help---
Build without ICMP stack even if ICMP networking support enabled.
if NET_ICMP && !NET_ICMP_NO_STACK
nuttx/net:Support to PMTUD RFC 1191 When a router is unable to forward a datagram because it exceeds the MTU of the next-hop network and its Don't Fragment bit is set, the router is required to return an ICMP Destination Unreachable message to the source of the datagram, with the Code indicating "fragmentation needed and DF set". To support the Path MTU Discovery technique specified in this memo, the router MUST include the MTU of that next-hop network in the low-order 16 bits of the ICMP header field that is labelled "unused" in the ICMP specification [7]. The high-order 16 bits remain unused, and MUST be set to zero. Thus, the message has the following format: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 3 | Code = 4 | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | unused = 0 | Next-Hop MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Internet Header + 64 bits of Original Datagram Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ RFC 1185 Packet Too Big Message 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | As much of invoking packet | + as will fit without the ICMPv6 packet + | exceeding 576 octets | IPv6 Fields: Destination Address Copied from the Source Address field of the invoking packet. ICMPv6 Fields: Type 2 Code 0 MTU The Maximum Transmission Unit of the next-hop link. Description A Packet Too Big MUST be sent by a router in response to a packet that it cannot forward because the packet is larger than the MTU of the outgoing link. The information in this message is used as part of the Path MTU Discovery process [RFC-1191]. Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-05-11 13:32:30 +02:00
config NET_ICMP_PMTU_ENTRIES
int "Path MTU Discovery (PMTUD) ICMP pmtu entry number"
default 0
---help---
The number of the ICMP pmtu entry
config NET_ICMP_PMTU_TIMEOUT
int "Path MTU Discovery (PMTUD) ICMP pmtu entry timeout (Time Unit:minute)"
default 10
depends on NET_ICMP_PMTU_ENTRIES != 0
---help---
The timout of the ICMP pmtu entry
config NET_ICMP_SOCKET
bool "IPPROTO_ICMP socket support"
default n
select MM_IOB
---help---
Enable support for IPPROTO_ICMP sockets. These sockets are needed
for application level support for sending ECHO (ping) requests and
receiving associated ECHO replies.
config NET_ICMP_CHECKSUMS
bool "ICMP checksums"
default y
---help---
Enable/disable ICMP checksum support.
if NET_ICMP_SOCKET
config NET_ICMP_PREALLOC_CONNS
int "Preallocated ICMP packet sockets"
default 4
---help---
Number of ICMP connections (all tasks).
This number of connections will be pre-allocated during system boot.
If dynamic connections allocation is enabled, more connections may
be allocated at a later time, as the system needs them. Else this
will be the maximum number of connections available to the system
at all times.
Set to 0 to disable (and rely only on dynamic allocations).
config NET_ICMP_ALLOC_CONNS
int "Dynamic ICMP connections allocation"
default 0
---help---
Dynamic memory allocations for ICMP.
When set to 0 all dynamic allocations are disabled.
When set to 1 a new connection will be allocated every time,
and it will be free'd when no longer needed.
Setting this to 2 or more will allocate the connections in
batches (with batch size equal to this config). When a
connection is no longer needed, it will be returned to the
free connections pool, and it will never be deallocated!
config NET_ICMP_MAX_CONNS
int "Maximum number of ICMP connections"
default 0
depends on NET_ICMP_ALLOC_CONNS > 0
---help---
If dynamic connections allocation is selected (NET_ICMP_ALLOC_CONNS > 0)
this will limit the number of connections that can be allocated.
This is useful in case the system is under very heavy load (or
under attack), ensuring that the heap will not be exhausted.
config NET_ICMP_NPOLLWAITERS
int "Number of ICMP poll waiters"
default 1
endif # NET_ICMP_SOCKET
endif # NET_ICMP && !NET_ICMP_NO_STACK
endmenu # ICMP Networking Support