nuttx/net/socket/Kconfig
wenquan1 cf78962356 net/socket: merge CONFIG_NET_TIMESTAMPING into CONFIG_NET_TIMESTAMP
Consolidate the two separate timestamp Kconfig options into a single
CONFIG_NET_TIMESTAMP option that covers SO_TIMESTAMP, SO_TIMESTAMPNS
and SO_TIMESTAMPING socket options.

Previously CONFIG_NET_TIMESTAMPING was a separate option only used by
PKT sockets for hardware TX/RX timestamps and error queue support.
Since both options guard the same io_time field in iob_s and share
the s_options bitmask, merging them simplifies configuration without
functional impact.

Changes:
- Replace all CONFIG_NET_TIMESTAMPING with CONFIG_NET_TIMESTAMP in
  pkt_input.c, pkt_recvmsg.c, pkt_sendmsg_buffered.c,
  pkt_sendmsg_unbuffered.c, pkt_sockif.c, pkt_netpoll.c, pkt.h,
  setsockopt.c, getsockopt.c
- Simplify iob.h conditional from OR of both to single option
- Remove NET_TIMESTAMPING Kconfig entry, update NET_TIMESTAMP
  description to cover all three socket options

Signed-off-by: wenquan1 <wenquan1@xiaomi.com>
2026-09-18 20:00:49 +08:00

99 lines
2.7 KiB
Text

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menu "Socket Support"
config NET_PREALLOC_DEVIF_CALLBACKS
int "Preallocated socket callbacks"
default 16 if !DEFAULT_SMALL
default 4 if DEFAULT_SMALL
---help---
Number of preallocated socket callbacks (all tasks).
This number of callbacks will be pre-allocated during system boot.
If dynamic callbacks allocation is enabled, more callbacks may be
allocated at a later time, as the system needs them. Else this
will be the maximum number of callbacks available to the system
at all times.
Set to 0 to disable (and rely only on dynamic allocations).
config NET_ALLOC_DEVIF_CALLBACKS
int "Dynamic socket callbacks allocation"
default 0
---help---
Dynamic memory allocations for socket callbacks.
When set to 0 all dynamic allocations are disabled.
When set to 1 a new callback will be allocated every time, and
it will be free'd when no longer needed.
Setting this to 2 or more will allocate the callbacks in batches
(with batch size equal to this config). When a callback is no
longer needed, it will be returned to the free callbacks pool,
and it will never be deallocated!
config NET_SOCKOPTS
bool "Socket options"
default n
---help---
Enable or disable support for socket options
config NET_TCPPROTO_OPTIONS
bool "TCP proto socket options"
default n
---help---
Enable or disable support for TCP protocol level socket options.
config NET_UDPPROTO_OPTIONS
bool
default n
---help---
Enable or disable support for UDP protocol level socket options.
config NET_CANPROTO_OPTIONS
bool
default n
---help---
Enable or disable support for CAN protocol level socket option
config NET_PKTPROTO_OPTIONS
bool "PACKET proto socket options"
default n
---help---
Enable or disable support for PKT protocol level socket option
if NET_SOCKOPTS
config NET_SOLINGER
bool "SO_LINGER socket option"
default n
depends on NET_TCP_WRITE_BUFFERS || NET_UDP_WRITE_BUFFERS
select NET_UDP_NOTIFIER if NET_UDP && !NET_UDP_NO_STACK
---help---
Enable or disable support for the SO_LINGER socket option. Requires
write buffer support.
config NET_TIMESTAMP
bool "SO_TIMESTAMP/SO_TIMESTAMPING socket option"
default n
---help---
Enable or disable support for the SO_TIMESTAMP,
SO_TIMESTAMPNS and SO_TIMESTAMPING socket options.
Supported on SocketCAN, Ethernet/UDP and Ethernet/PKT.
config NET_BINDTODEVICE
bool "SO_BINDTODEVICE socket option Bind-to-device support"
default n
select NETDEV_IFINDEX
---help---
Enable support for the NET_BINDTODEVICE socket option.
Linux has SO_BINDTODEVICE but in NuttX this option is instead
specific to the UDP protocol.
endif # NET_SOCKOPTS
endmenu # Socket Support