1# IP stack config
2
3# Copyright (c) 2016 Intel Corporation.
4# Copyright (c) 2021 Nordic Semiconductor
5# Copyright (c) 2023 Arm Limited (or its affiliates). All rights reserved.
6# Copyright 2025 NXP
7# SPDX-License-Identifier: Apache-2.0
8
9menu "IP stack"
10
11config NET_NAMESPACE_COMPAT_MODE
12	bool "Network namespace compatibility mode"
13	# Disable the compatibility mode for network tests. But if the tests
14	# uses POSIX APIs, then currently the compat mode is needed.
15	depends on !NET_TEST || POSIX_API
16	default y
17	help
18	  The networking APIs and code is now namespaced i.e., relevant network
19	  APIs now have either net_, NET_ or ZSOCK_ prefixes. This avoids
20	  circular dependency against a Posix subsystem which might define
21	  duplicate symbols. The compatibility mode will be deprecated in the
22	  future and eventually removed.
23
24# Hidden option enabled whenever an IP stack is available.
25config NET_IP
26	bool
27	default y if NET_IPV6 || NET_IPV4
28
29# Hidden option enabled whenever an IP fragmentation is enabled.
30config NET_IP_FRAGMENT
31	bool
32	default y if NET_IPV6_FRAGMENT || NET_IPV4_FRAGMENT
33
34# Hidden option selected by net connection based socket implementations
35# to draw in all code required for connection infrastructure.
36config NET_CONNECTION_SOCKETS
37	bool
38
39config NET_NATIVE
40	bool "Native network stack support"
41	default y
42	help
43	  Enables Zephyr native IP stack. If you disable this, then
44	  you need to enable the offloading support if you want to
45	  have IP connectivity.
46
47# Hidden options for enabling native IPv6/IPv4. Using these options
48# avoids having "defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_NATIVE)"
49# in the code as we can have "defined(CONFIG_NET_NATIVE_IPV6)" instead.
50config NET_NATIVE_IP
51	bool
52	depends on NET_NATIVE
53	default y if NET_IP
54
55config NET_NATIVE_IPV6
56	bool
57	depends on NET_NATIVE
58	default y if NET_IPV6
59
60config NET_NATIVE_IPV4
61	bool
62	depends on NET_NATIVE
63	default y if NET_IPV4
64
65config NET_PMTU
66	bool
67	select NET_MGMT
68	select NET_MGMT_EVENT
69	select NET_MGMT_EVENT_INFO
70	default y
71	depends on NET_IPV6_PMTU || NET_IPV4_PMTU
72
73if NET_PMTU
74module = NET_PMTU
75module-dep = NET_LOG
76module-str = Log level for PMTU
77module-help = Enables PMTU to output debug messages.
78source "subsys/net/Kconfig.template.log_config.net"
79endif # NET_PMTU
80
81config NET_NATIVE_TCP
82	bool
83	depends on NET_NATIVE
84	default y if NET_TCP
85
86config NET_NATIVE_UDP
87	bool
88	depends on NET_NATIVE
89	default y if NET_UDP
90
91config NET_OFFLOAD
92	bool "Offload IP stack"
93	help
94	  Enables TCP/IP stack to be offload to a co-processor.
95
96config NET_OFFLOADING_SUPPORT
97	bool
98	default y if NET_OFFLOAD || NET_SOCKETS_OFFLOAD
99	help
100	  Hidden option that is set if either NET_OFFLOAD or
101	  NET_SOCKETS_OFFLOAD is set. This allows us to check
102	  only one option instead of two.
103
104if NET_OFFLOAD
105module = NET_OFFLOAD
106module-dep = NET_LOG
107module-str = Log level for offload layer
108module-help = Enables offload layer to output debug messages.
109source "subsys/net/Kconfig.template.log_config.net"
110endif # NET_OFFLOAD
111
112config NET_RAW_MODE
113	bool
114	help
115	  This is a very specific option used to built only the very minimal
116	  part of the net stack in order to get network drivers working without
117	  any net stack above: core, L2 etc... Basically this will build only
118	  net_pkt part. It is currently used only by IEEE 802.15.4 drivers,
119	  though any type of net drivers could use it.
120
121choice NET_QEMU_NETWORKING
122	prompt "Qemu networking"
123	default NET_QEMU_PPP if NET_PPP
124	default NET_QEMU_SLIP
125	depends on QEMU_TARGET
126	help
127	  Can be used to select how the network connectivity is established
128	  from inside qemu to host system. This can be done either via
129	  serial connection (SLIP) or via Qemu ethernet driver.
130
131config NET_QEMU_SLIP
132	bool "SLIP"
133	help
134	  Connect to host or to another Qemu via SLIP.
135
136config NET_QEMU_PPP
137	bool "PPP"
138	help
139	  Connect to host via PPP.
140
141config NET_QEMU_ETHERNET
142	bool "Ethernet"
143	help
144	  Connect to host system via Qemu ethernet driver support. One such
145	  driver that Zephyr supports is Intel e1000 ethernet driver.
146
147config NET_QEMU_USER
148	bool "SLIRP"
149	help
150	  Connect to host system via Qemu's built-in User Networking support. This
151	  is implemented using "slirp", which provides a full TCP/IP stack within
152	  QEMU and uses that stack to implement a virtual NAT'd network.
153
154endchoice
155
156config NET_QEMU_USER_EXTRA_ARGS
157	string "Qemu User Networking Args"
158	depends on NET_QEMU_USER
159	default ""
160	help
161	  Extra arguments passed to QEMU when User Networking is enabled. This may
162	  include host / guest port forwarding, device id, Network address
163	  information etc. This string is appended to the QEMU "-net user" option.
164
165if !NET_RAW_MODE
166
167config NET_INIT_PRIO
168	int
169	default 90
170	help
171	  Network initialization priority level. This number tells how
172	  early in the boot the network stack is initialized.
173
174config NET_IP_DSCP_ECN
175	bool "DSCP/ECN processing at IP layer"
176	depends on NET_IP
177	default y
178	help
179	  Specify whether DSCP/ECN values are processed at IP layer. The values
180	  are encoded within ToS field in IPv4 and TC field in IPv6.
181
182source "subsys/net/ip/Kconfig.ipv6"
183
184source "subsys/net/ip/Kconfig.ipv4"
185
186config NET_IPV4_MAPPING_TO_IPV6
187	bool "Support IPv4 mapped on IPv6 addresses"
188	depends on NET_NATIVE_IPV6
189	help
190	  Support v4-mapped-on-v6 address type. This allows IPv4 and IPv6
191	  to share a local port space. When the application gets an IPv4
192	  connection or packet to an IPv6 socket, its source address will
193	  be mapped to IPv6. This is turned off by default which means
194	  that IPV6_V6ONLY socket option is always on. If you enable this
195	  option, then you can still control the behaviour of the socket
196	  via the IPV6_V6ONLY option at runtime.
197
198config NET_TC_TX_COUNT
199	int "How many Tx traffic classes to have for each network device"
200	default 1 if USERSPACE || USB_DEVICE_NETWORK || \
201		     NET_SHELL_REQUIRE_TX_THREAD
202	default 0
203	range 1 NET_TC_NUM_PRIORITIES if NET_TC_NUM_PRIORITIES<=8 && \
204		(USERSPACE || NET_SHELL_REQUIRE_TX_THREAD)
205	range 0 NET_TC_NUM_PRIORITIES if NET_TC_NUM_PRIORITIES<=8
206	range 1 8 if USERSPACE || NET_SHELL_REQUIRE_TX_THREAD
207	range 0 8
208	help
209	  Define how many Tx traffic classes (queues) the system should have
210	  when sending a network packet. The network packet priority can then
211	  be mapped to this traffic class so that higher prioritized packets
212	  can be processed before lower prioritized ones. Each queue is handled
213	  by a separate thread which will need RAM for stack space.
214	  Only increase the value from 1 if you really need this feature.
215	  The default value is 1 which means that all the network traffic is
216	  handled equally. In this implementation, the higher traffic class
217	  value corresponds to lower thread priority.
218	  If you select 0 here, then it means that all the network traffic
219	  is pushed to the driver directly without any queues.
220	  Note that if USERSPACE support is enabled, then currently we need to
221	  enable at least 1 TX thread.
222
223config NET_TC_RX_COUNT
224	int "How many Rx traffic classes to have for each network device"
225	default 1
226	range 1 NET_TC_NUM_PRIORITIES if NET_TC_NUM_PRIORITIES<=8 && USERSPACE
227	range 0 NET_TC_NUM_PRIORITIES if NET_TC_NUM_PRIORITIES<=8
228	range 1 8 if USERSPACE
229	range 0 8
230	help
231	  Define how many Rx traffic classes (queues) the system should have
232	  when receiving a network packet. The network packet priority can then
233	  be mapped to this traffic class so that higher prioritized packets
234	  can be processed before lower prioritized ones. Each queue is handled
235	  by a separate thread which will need RAM for stack space.
236	  Only increase the value from 1 if you really need this feature.
237	  The default value is 1 which means that all the network traffic is
238	  handled equally. In this implementation, the higher traffic class
239	  value corresponds to lower thread priority.
240	  If you select 0 here, then it means that all the network traffic
241	  is pushed from the driver to application thread without any
242	  intermediate RX queue. There is always a receive socket queue between
243	  device driver and application. Disabling RX thread means that the
244	  network device driver, that is typically running in IRQ context, will
245	  handle the packet all the way to the application. This might cause
246	  other incoming packets to be lost if the RX processing takes long
247	  time.
248	  Note that if USERSPACE support is enabled, then currently we need to
249	  enable at least 1 RX thread.
250
251config NET_TC_SKIP_FOR_HIGH_PRIO
252	bool "Push high priority packets directly to network driver [DEPRECATED]"
253	select DEPRECATED
254	help
255	  Deprecated, use NET_TC_TX_SKIP_FOR_HIGH_PRIO instead.
256
257config NET_TC_TX_SKIP_FOR_HIGH_PRIO
258	bool "Push high priority packets directly to network driver"
259	default NET_TC_SKIP_FOR_HIGH_PRIO
260	help
261	  If this is set, then high priority (>= NET_PRIORITY_CA) net_pkt will
262	  be pushed directly to network driver and will skip the traffic class
263	  queues. This is currently not enabled by default.
264
265config NET_TC_RX_SKIP_FOR_HIGH_PRIO
266	bool "Push high priority packets directly to the application"
267	help
268	  If this is set, then high priority (>= NET_PRIORITY_CA) net_pkt will
269	  be pushed directly to the application and will skip the traffic class
270	  queues. If you select this option, then it means that high priority
271	  network traffic is pushed from the driver to the application thread
272	  without any intermediate RX queue. If the network device driver is
273	  running in IRQ context, it will handle the packet all the way to the
274	  application. This might cause other incoming packets to be lost if
275	  the RX processing takes long time.
276	  This is currently not enabled by default.
277
278choice NET_TC_THREAD_TYPE
279	prompt "How the network RX/TX threads should work"
280	help
281	  Please select the RX/TX threads to be either pre-emptive or
282	  co-operative.
283
284config NET_TC_THREAD_COOPERATIVE
285	bool "Use co-operative TX/RX threads"
286	depends on COOP_ENABLED
287	help
288	  With co-operative threads, the thread cannot be pre-empted.
289
290config NET_TC_THREAD_PREEMPTIVE
291	bool "Use pre-emptive TX/RX threads [EXPERIMENTAL]"
292	depends on PREEMPT_ENABLED
293	select EXPERIMENTAL
294	help
295	  With pre-emptive threads, the thread can be pre-empted.
296
297endchoice
298
299config NET_TC_NUM_PRIORITIES
300	int
301	default NUM_COOP_PRIORITIES if NET_TC_THREAD_COOPERATIVE
302	default NUM_PREEMPT_PRIORITIES if NET_TC_THREAD_PREEMPTIVE
303
304config NET_TC_THREAD_PRIO_CUSTOM
305	bool "Customize traffic class thread priority"
306	help
307	  Customise net threads priority by each.
308
309if NET_TC_THREAD_PRIO_CUSTOM
310
311config NET_TC_TX_THREAD_PRIO_SPREAD
312	int "Transmit traffic class thread priority spread"
313	default 1
314	range 1 255
315	help
316	  Transmit traffic class threads priority will increase/decrease
317	  by this step. They will be separated by this many levels.
318
319config NET_TC_RX_THREAD_PRIO_SPREAD
320	int "Receive traffic class thread priority spread"
321	default 1
322	range 1 255
323	help
324	  Receive traffic class threads priority will increase/decrease
325	  by this step. They will be separated by this many levels.
326
327config NET_TC_TX_THREAD_BASE_PRIO
328	int "Transmit traffic class base thread priority"
329	default 0
330	help
331	  Transmit traffic class threads priority will increase/decrease
332	  from this priority.
333	  If NET_TC_TX_COUNT is 1, this will be transmit traffic class
334	  thread priority.
335
336config NET_TC_RX_THREAD_BASE_PRIO
337	int "Receive traffic class base thread priority"
338	default 0
339	help
340	  Receive traffic class threads priority will increase/decrease
341	  from this priority.
342	  If NET_TC_RX_COUNT is 1, this will be receive traffic class
343	  thread priority.
344
345endif # NET_TC_THREAD_CUSTOM_PRIO
346
347choice
348	prompt "Priority to traffic class mapping"
349	help
350	  Select mapping to use to map network packet priorities to traffic
351	  classes.
352
353config NET_TC_MAPPING_STRICT
354	bool "Strict priority mapping"
355	help
356	  This is the recommended default priority to traffic class mapping.
357	  Use it for implementations that do not support the credit-based
358	  shaper transmission selection algorithm.
359	  See 802.1Q, chapter 8.6.6 for more information.
360
361config NET_TC_MAPPING_SR_CLASS_A_AND_B
362	bool "SR class A and class B mapping"
363	depends on NET_TC_TX_COUNT >= 2
364	depends on NET_TC_RX_COUNT >= 2
365	help
366	  This is the recommended priority to traffic class mapping for a
367	  system that supports SR (Stream Reservation) class A and SR class B.
368	  See 802.1Q, chapter 34.5 for more information.
369
370config NET_TC_MAPPING_SR_CLASS_B_ONLY
371	bool "SR class B only mapping"
372	depends on NET_TC_TX_COUNT >= 2
373	depends on NET_TC_RX_COUNT >= 2
374	help
375	  This is the recommended priority to traffic class mapping for a
376	  system that supports SR (Stream Reservation) class B only.
377	  See 802.1Q, chapter 34.5 for more information.
378endchoice
379
380config NET_TX_DEFAULT_PRIORITY
381	int "Default network TX packet priority if none have been set"
382	default 1
383	range 0 7
384	help
385	  What is the default network packet priority if user has not specified
386	  one. The value 0 means lowest priority and 7 is the highest.
387
388config NET_RX_DEFAULT_PRIORITY
389	int "Default network RX packet priority if none have been set"
390	default 0
391	range 0 7
392	help
393	  What is the default network RX packet priority if user has not set
394	  one. The value 0 means lowest priority and 7 is the highest.
395
396config NET_ALLOW_ANY_PRIORITY
397	bool "Allow any network packet priority to be used"
398	help
399	  If this is set, then any user given network packet priority can be used. Otherwise
400	  the network packet priorities are limited to 0-7 range.
401
402config NET_IP_ADDR_CHECK
403	bool "Check IP address validity before sending IP packet"
404	default y
405	help
406	  Check that either the source or destination address is
407	  correct before sending either IPv4 or IPv6 network packet.
408
409config NET_MAX_ROUTERS
410	int "How many routers are supported"
411	default 2 if NET_IPV4 && NET_IPV6
412	default 1 if NET_IPV4 && !NET_IPV6
413	default 1 if !NET_IPV4 && NET_IPV6
414	range 1 254
415	help
416	  The value depends on your network needs.
417
418# Normally the route support is enabled by RPL or similar technology
419# that needs to use the routing infrastructure.
420config NET_ROUTE
421	bool
422	depends on NET_IPV6_NBR_CACHE
423	default y if NET_IPV6_NBR_CACHE
424
425config NET_ROUTING
426	bool "IP routing between interfaces"
427	depends on NET_ROUTE
428	help
429	  Allow IPv6 routing between different network interfaces and
430	  technologies. Currently this has limited use as some entity
431	  would need to populate the routing table. RPL used to do that
432	  earlier but currently there is no RPL support in Zephyr.
433
434config NET_MAX_ROUTES
435	int "Max number of routing entries stored."
436	default NET_IPV6_MAX_NEIGHBORS
437	depends on NET_ROUTE
438	help
439	  This determines how many entries can be stored in routing table.
440
441config NET_MAX_NEXTHOPS
442	int "Max number of next hop entries stored."
443	default NET_MAX_ROUTES
444	depends on NET_ROUTE
445	help
446	  This determines how many entries can be stored in nexthop table.
447
448config NET_ROUTE_MCAST
449	bool "Multicast Routing / Forwarding"
450	depends on NET_ROUTE
451	help
452	  Activates multicast routing/forwarding
453
454config NET_MAX_MCAST_ROUTES
455	int "Max number of multicast routing entries stored."
456	default 1
457	depends on NET_ROUTE_MCAST
458	help
459	  This determines how many entries can be stored in multicast
460	  routing table.
461
462config NET_MCAST_ROUTE_MAX_IFACES
463	int "Max number of network interfaces per multicast routing entry"
464	default 1
465	range 1 8
466	depends on NET_ROUTE_MCAST
467	help
468	  Determines how many network interfaces can be assigned to a
469	  single multicast route entry.
470
471config NET_MCAST_ROUTE_MLD_REPORTS
472	bool "Report multicast routes as a part of MLDv2 reports"
473	depends on NET_ROUTE_MCAST
474	depends on NET_IPV6_MLD
475	help
476	  Determines whether a multicast route entry should be advertised
477	  in MLDv2 reports.
478
479source "subsys/net/ip/Kconfig.tcp"
480
481config NET_TEST_PROTOCOL
482	bool "JSON based test protocol (UDP)"
483	help
484	  Enable JSON based test protocol (UDP).
485
486config NET_UDP
487	bool "UDP"
488	default y
489	depends on NET_IP
490	help
491	  The value depends on your network needs.
492
493config NET_UDP_CHECKSUM
494	bool "Check UDP checksum"
495	default y
496	depends on NET_UDP
497	help
498	  Enables UDP handler to check UDP checksum. If the checksum is invalid,
499	  then the packet is discarded.
500
501config NET_UDP_MISSING_CHECKSUM
502	bool "Accept missing checksum (IPv4 only)"
503	default y
504	depends on NET_UDP && NET_IPV4
505	help
506	  RFC 768 states the possibility to have a missing checksum, for
507	  debugging purposes for instance. That feature is however valid only
508	  for IPv4 and on reception only, since Zephyr will always compute the
509	  UDP checksum in transmission path.
510
511if NET_UDP
512module = NET_UDP
513module-dep = NET_LOG
514module-str = Log level for UDP
515module-help = Enables UDP handler output debug messages
516source "subsys/net/Kconfig.template.log_config.net"
517endif # NET_UDP
518
519config NET_MAX_CONN
520	int "How many network connections are supported"
521	depends on NET_UDP || NET_TCP || NET_SOCKETS_PACKET || NET_SOCKETS_CAN
522	default 8 if NET_IPV6 && NET_IPV4
523	default 4
524	help
525	  The value depends on your network needs. The value
526	  should include both UDP and TCP connections.
527
528config NET_CONN_PACKET_CLONE_TIMEOUT
529	int "Timeout value in milliseconds for cloning a packet"
530	default 100
531	help
532	  Maximum wait time when cloning a packet for a network connection.
533
534config NET_MAX_CONTEXTS
535	int "Number of network contexts to allocate"
536	default 6
537	help
538	  Each network context is used to describe a network 5-tuple that
539	  is used when listening or sending network traffic. This is very
540	  similar as one could call a network socket in some other systems.
541
542config ZVFS_OPEN_ADD_SIZE_NET
543	int "Number of network sockets to allocate"
544	default NET_MAX_CONTEXTS
545
546config NET_CONTEXT_NET_PKT_POOL
547	bool "Net_buf TX pool / context"
548	default y if NET_TCP && NET_6LO
549	help
550	  If enabled, then it is possible to fine-tune network packet pool
551	  for each context when sending network data. If this setting is
552	  enabled, then you should define the context pools in your application
553	  using NET_PKT_TX_POOL_DEFINE() and NET_PKT_DATA_POOL_DEFINE()
554	  macros and tie these pools to desired context using the
555	  net_context_setup_pools() function.
556
557config NET_CONTEXT_SYNC_RECV
558	bool "Support synchronous functionality in net_context_recv() API"
559	default y
560	help
561	  You can disable sync support to save some memory if you are calling
562	  net_context_recv() in async way only when timeout is set to 0.
563
564config NET_CONTEXT_CHECK
565	bool "Check options when calling various net_context functions"
566	default y
567	help
568	  If you know that the options passed to net_context...() functions
569	  are ok, then you can disable the checks to save some memory.
570
571config NET_CONTEXT_PRIORITY
572	bool "Add priority support to net_context"
573	help
574	  It is possible to prioritize network traffic. This requires
575	  also traffic class support to work as expected.
576
577config NET_CONTEXT_TXTIME
578	bool "Add TXTIME support to net_context"
579	select NET_PKT_TXTIME
580	help
581	  It is possible to add information when the outgoing network packet
582	  should be sent. The TX time information should be placed into
583	  ancillary data field in sendmsg call.
584
585config NET_CONTEXT_RCVTIMEO
586	bool "Add RCVTIMEO support to net_context"
587	help
588	  It is possible to time out receiving a network packet. The timeout
589	  time is configurable run-time in the application code. For network
590	  sockets timeout is configured per socket with
591	  setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, ...) function.
592
593config NET_CONTEXT_SNDTIMEO
594	bool "Add SNDTIMEO support to net_context"
595	help
596	  It is possible to time out sending a network packet. The timeout
597	  time is configurable run-time in the application code. For network
598	  sockets timeout is configured per socket with
599	  setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, ...) function.
600
601config NET_CONTEXT_RCVBUF
602	bool "Add RCVBUF support to net_context"
603	help
604	  If is possible to define the maximum socket receive buffer per socket.
605	  The default value is set by CONFIG_NET_TCP_MAX_RECV_WINDOW_SIZE. For
606	  TCP sockets, the rcvbuf will determine the receive window size.
607
608config NET_CONTEXT_SNDBUF
609	bool "Add SNDBUF support to net_context"
610	help
611	  It is possible to define the maximum socket send buffer per socket.
612	  For TCP sockets, the sndbuf will determine the total size of queued
613	  data in the TCP layer.
614
615config NET_CONTEXT_DSCP_ECN
616	bool "Add support for setting DSCP/ECN IP properties on net_context"
617	depends on NET_IP_DSCP_ECN
618	default y
619	help
620	  Allow to set Differentiated Services and Explicit Congestion
621	  Notification values on net_context. Those values are then used in
622	  IPv4/IPv6 header when sending packets over net_context.
623
624config NET_CONTEXT_REUSEADDR
625	bool "Add REUSEADDR support to net_context"
626	default y if NET_TCP || NET_UDP
627	help
628	  Allow to set the SO_REUSEADDR flag on a socket. This enables multiple
629	  sockets to bind to the same local IP address.
630
631config NET_CONTEXT_REUSEPORT
632	bool "Add REUSEPORT support to net_context"
633	default y if NET_TCP || NET_UDP
634	help
635	  Allow to set the SO_REUSEPORT flag on a socket. This enables multiple
636	  sockets to bind to the same local IP address and port combination.
637
638config NET_CONTEXT_RECV_PKTINFO
639	bool "Add receive PKTINFO support to net_context"
640	depends on NET_UDP
641	help
642	  Allow to set the IP_PKTINFO or IPV6_RECVPKTINFO flags on a socket.
643	  This way user can get extra information about the received data in the
644	  socket.
645
646config NET_CONTEXT_RECV_HOPLIMIT
647	bool "Add receive hop limit (IPv6) or TTL (IPv4) support to net_context"
648	depends on NET_UDP
649	help
650	  Allow to set the IPV6_RECVHOPLIMIT or IP_RECVTTL flags on a socket.
651	  This way user can get extra information about hop limit (IPv6) or TTL (IPv4) in the
652	  socket.
653
654config NET_CONTEXT_TIMESTAMPING
655	bool "Add TIMESTAMPING support to net_context"
656	default y if (NET_UDP && NET_PKT_TIMESTAMP)
657	help
658	  Allow to set the TIMESTAMPING option on a socket. This way timestamp for a network
659	  packet will be added to the net_pkt structure.
660
661config NET_CONTEXT_CLAMP_PORT_RANGE
662	bool "Allow clamping down the global local port range for net_context"
663	depends on NET_UDP || NET_TCP
664	help
665	  Set or get the per-context default local port range. This
666	  option can be used to clamp down the global local UDP/TCP port
667	  range for a given context. The port range is typically set by
668	  IP_LOCAL_PORT_RANGE socket option.
669
670endif # NET_RAW_MODE
671
672config NET_SLIP_TAP
673	bool "TAP SLIP driver"
674	depends on NET_QEMU_SLIP
675	depends on NET_NATIVE
676	select SLIP
677	select UART_PIPE
678	select UART_INTERRUPT_DRIVEN
679	select SLIP_TAP
680	select NET_L2_ETHERNET
681	default y if (QEMU_TARGET && !NET_TEST)
682	help
683	  SLIP TAP support is necessary when testing with QEMU. The host
684	  needs to have tunslip6 with TAP support running in order to
685	  communicate via the SLIP driver. See net-tools project at
686	  https://github.com/zephyrproject-rtos/net-tools for more details.
687
688config NET_TEST
689	bool "Network Testing"
690	help
691	  Used for self-contained networking tests that do not require a
692	  network device.
693
694config NET_PKT_RX_COUNT
695	int "How many packet receives can be pending at the same time"
696	default 14 if NET_L2_ETHERNET
697	default 4
698	help
699	  Each RX buffer will occupy smallish amount of memory.
700	  See include/net/net_pkt.h and the sizeof(struct net_pkt)
701
702config NET_PKT_TX_COUNT
703	int "How many packet sends can be pending at the same time"
704	default 14 if NET_L2_ETHERNET
705	default 4
706	help
707	  Each TX buffer will occupy smallish amount of memory.
708	  See include/net/net_pkt.h and the sizeof(struct net_pkt)
709
710config NET_BUF_RX_COUNT
711	int "How many network buffers are allocated for receiving data"
712	default 36 if NET_L2_ETHERNET
713	default 16
714	help
715	  Each data buffer will occupy CONFIG_NET_BUF_DATA_SIZE + smallish
716	  header (sizeof(struct net_buf)) amount of data.
717
718config NET_BUF_TX_COUNT
719	int "How many network buffers are allocated for sending data"
720	default 36 if NET_L2_ETHERNET
721	default 16
722	help
723	  Each data buffer will occupy CONFIG_NET_BUF_DATA_SIZE + smallish
724	  header (sizeof(struct net_buf)) amount of data.
725
726choice NET_PKT_DATA_ALLOC_TYPE
727	prompt "Network packet data allocator type"
728	default NET_BUF_FIXED_DATA_SIZE
729	help
730	  Select the memory allocator for the network buffers that hold the
731	  packet data.
732
733config NET_BUF_FIXED_DATA_SIZE
734	bool "Fixed data size buffer"
735	help
736	  Each buffer comes with a built time configured size. If runtime
737	  requested is bigger than that, it will allocate as many net_buf
738	  as necessary to reach that request.
739
740config NET_BUF_VARIABLE_DATA_SIZE
741	bool "Variable data size buffer [EXPERIMENTAL]"
742	select EXPERIMENTAL
743	help
744	  The buffer is dynamically allocated from runtime requested size.
745
746endchoice
747
748config NET_BUF_DATA_SIZE
749	int "Size of each network data fragment"
750	default 128
751	depends on NET_BUF_FIXED_DATA_SIZE
752	help
753	  This value tells what is the fixed size of each network buffer.
754
755config NET_PKT_BUF_RX_DATA_POOL_SIZE
756	int "Size of the RX memory pool where buffers are allocated from"
757	default 4096 if NET_L2_ETHERNET
758	default 2048
759	depends on NET_BUF_VARIABLE_DATA_SIZE
760	help
761	  This value tell what is the size of the RX memory pool where each
762	  network buffer is allocated from.
763
764config NET_PKT_BUF_TX_DATA_POOL_SIZE
765	int "Size of the TX memory pool where buffers are allocated from"
766	default 4096 if NET_L2_ETHERNET
767	default 2048
768	depends on NET_BUF_VARIABLE_DATA_SIZE
769	help
770	  This value tell what is the size of the TX memory pool where each
771	  network buffer is allocated from.
772
773config NET_PKT_BUF_USER_DATA_SIZE
774	int "Size of user_data available in rx and tx network buffers"
775	default 4
776	range 4 16
777	help
778	  User data size used in rx and tx network buffers.
779
780config NET_PKT_BUF_TX_DATA_ALLOC_ALIGN_LEN
781	int "Amount of alignment for TX net_buf allocations"
782	default 0
783	range 0 8
784	depends on NET_BUF_VARIABLE_DATA_SIZE
785	help
786	  This value tell amount of alignment of buffer length when allocating
787	  net_buf data for sending. By default there is no special alignment.
788	  This is needed for example with Nordic Wi-Fi chip that uses SPI driver
789	  that expects 4 byte alignment for the length of the data and the start
790	  of the data that is being sent.
791
792config NET_PKT_CONTROL_BLOCK
793	bool "pkt control block"
794	help
795	  This is to enable control block which can be used by any layer.
796
797config NET_PKT_CONTROL_BLOCK_SIZE
798	int "Size of pkt control block in bytes"
799	depends on NET_PKT_CONTROL_BLOCK
800	default 1 if DSA_TAG_PROTOCOL_NETC
801	default 1
802	help
803	  Size of pkt control block in bytes if there are no other specific control blocks
804	  enabled. If there are already specific control blocks enabled, like
805	  net_pkt_cb_ieee802154, the actual pkt control block size will be the
806	  maximum of them.
807
808config NET_HEADERS_ALWAYS_CONTIGUOUS
809	bool
810	help
811	  This a hidden option, which one should use with a lot of care.
812	  NO bug reports will be accepted if that option is enabled!
813	  You are warned.
814	  If you are 100% sure the headers memory space is always in a
815	  contiguous space, this will save stack usage and ROM in net core.
816	  This is a possible case when using IPv4 only, with
817	  NET_BUF_FIXED_DATA_SIZE enabled and NET_BUF_DATA_SIZE of 128 for
818	  instance.
819
820config NET_LINK_ADDR_CUSTOM_LENGTH
821	int "Size of custom link layer address length"
822	default 0
823	help
824	  This option allows to define custom link layer address length
825	  if your link layer technology is not supported directly.
826	  As a default, custom link layer address length is not used.
827
828# If we are running network tests found in tests/net, then the NET_TEST is
829# set and in that case we default to Dummy L2 layer as typically the tests
830# use that by default.
831choice NET_DEFAULT_IF
832	prompt "Default Network Interface"
833	default NET_DEFAULT_IF_DUMMY if NET_TEST
834	default NET_DEFAULT_IF_FIRST
835	help
836	  If system has multiple interfaces enabled, then user shall be able
837	  to choose default interface. Otherwise first interface will be the
838	  default interface.
839
840config NET_DEFAULT_IF_FIRST
841	bool "First available interface"
842
843config NET_DEFAULT_IF_UP
844	bool "First interface which is up"
845
846config NET_DEFAULT_IF_ETHERNET
847	bool "Ethernet"
848	depends on NET_L2_ETHERNET
849
850config NET_DEFAULT_IF_IEEE802154
851	bool "IEEE 802.15.4"
852	depends on NET_L2_IEEE802154
853
854config NET_DEFAULT_IF_OFFLOAD
855	bool "Offloaded interface"
856	depends on NET_OFFLOAD
857
858config NET_DEFAULT_IF_DUMMY
859	bool "Dummy testing interface"
860	depends on NET_L2_DUMMY
861
862config NET_DEFAULT_IF_CANBUS_RAW
863	bool "Socket CAN interface"
864	depends on NET_L2_CANBUS_RAW
865
866config NET_DEFAULT_IF_PPP
867	bool "PPP interface"
868	depends on NET_L2_PPP
869
870config NET_DEFAULT_IF_OFFLOADED_NETDEV
871	bool "Offloaded network device"
872
873config NET_DEFAULT_IF_WIFI
874	bool "WiFi interface"
875	depends on NET_L2_ETHERNET
876
877endchoice
878
879config NET_INTERFACE_NAME
880	bool "Allow setting a name to a network interface"
881	default y
882	help
883	  Allow application to set a name to the network interface in order
884	  to simplify network interface management.
885
886config NET_INTERFACE_NAME_LEN
887	int "Network interface max name length"
888	default 8
889	range 2 15
890	depends on NET_INTERFACE_NAME
891	help
892	  Maximum length of the network interface name.
893
894config NET_PKT_TIMESTAMP
895	bool "Network packet timestamp support"
896	help
897	  Enable network packet timestamp support. This is needed for
898	  example in gPTP which needs to know how long it takes to send
899	  a network packet or for timed radio protocols like IEEE 802.15.4
900	  CSL and TSCH.
901
902config NET_PKT_TIMESTAMP_THREAD
903	bool "Create TX timestamp thread"
904	depends on NET_PKT_TIMESTAMP
905	help
906	  Create a TX timestamp thread that will pass the timestamped network
907	  packets to some other module like gPTP for further processing.
908	  If you just want to timestamp network packets and get information
909	  how long the network packets flow in the system, you can disable
910	  the thread support.
911
912config NET_PKT_TIMESTAMP_STACK_SIZE
913	int "Timestamp thread stack size"
914	default 1024
915	depends on NET_PKT_TIMESTAMP_THREAD
916	help
917	  Set the timestamp thread stack size in bytes. The timestamp
918	  thread waits for timestamped TX frames and calls registered
919	  callbacks.
920
921config NET_PKT_TXTIME
922	bool "Network packet TX time support"
923	help
924	  Enable network packet TX time support. This is needed for
925	  when the application wants to set the exact time when the network
926	  packet should be sent.
927
928config NET_PKT_RXTIME_STATS
929	bool "Network packet RX time statistics"
930	select NET_PKT_TIMESTAMP
931	select NET_STATISTICS
932	depends on (NET_UDP || NET_TCP || NET_SOCKETS_PACKET) && NET_NATIVE
933	help
934	  Enable network packet RX time statistics support. This is used to
935	  calculate how long on average it takes for a packet to travel from
936	  device driver to just before it is given to application. The RX
937	  timing information can then be seen in network interface statistics
938	  in net-shell.
939	  The RX statistics are only calculated for UDP and TCP packets.
940
941config NET_PKT_RXTIME_STATS_DETAIL
942	bool "Get extra receive detail statistics in RX path"
943	depends on NET_PKT_RXTIME_STATS
944	help
945	  Store receive statistics detail information in certain key points
946	  in RX path. This is very special configuration and will increase
947	  the size of net_pkt so in typical cases you should not enable it.
948	  The extra statistics can be seen in net-shell using "net stats"
949	  command.
950
951config NET_PKT_TXTIME_STATS
952	bool "Network packet TX time statistics"
953	select NET_PKT_TIMESTAMP
954	select NET_STATISTICS
955	depends on (NET_UDP || NET_TCP || NET_SOCKETS_PACKET) && NET_NATIVE
956	help
957	  Enable network packet TX time statistics support. This is used to
958	  calculate how long on average it takes for a packet to travel from
959	  application to just before it is sent to network. The TX timing
960	  information can then be seen in network interface statistics in
961	  net-shell.
962	  The RX calculation is done only for UDP, TCP or RAW packets,
963	  but for TX we do not know the protocol so the TX packet timing is
964	  done for all network protocol packets.
965
966config NET_PKT_TXTIME_STATS_DETAIL
967	bool "Get extra transmit detail statistics in TX path"
968	depends on NET_PKT_TXTIME_STATS
969	help
970	  Store receive statistics detail information in certain key points
971	  in TX path. This is very special configuration and will increase
972	  the size of net_pkt so in typical cases you should not enable it.
973	  The extra statistics can be seen in net-shell using "net stats"
974	  command.
975
976config NET_PKT_ALLOC_STATS
977	bool "Get net_pkt allocation statistics"
978	help
979	  Collect net_pkt allocation statistics, like number of allocations,
980	  average allocation size, average allocation time in usec, for both
981	  succeeded and failed allocations.
982	  The extra statistics can be seen in net-shell using "net mem"
983	  command.
984
985config NET_PROMISCUOUS_MODE
986	bool "Promiscuous mode support"
987	select NET_MGMT
988	select NET_MGMT_EVENT
989	select NET_L2_ETHERNET_MGMT if NET_L2_ETHERNET
990	help
991	  Enable promiscuous mode support. This only works if the network
992	  device driver supports promiscuous mode. The user application
993	  also needs to read the promiscuous mode data.
994
995if NET_PROMISCUOUS_MODE
996module = NET_PROMISC
997module-dep = NET_LOG
998module-str = Log level for promiscuous mode
999module-help = Enables promiscuous mode to output debug messages.
1000source "subsys/net/Kconfig.template.log_config.net"
1001endif # NET_PROMISCUOUS_MODE
1002
1003config NET_DISABLE_ICMP_DESTINATION_UNREACHABLE
1004	bool "Disable destination unreachable ICMP errors"
1005	help
1006	  Suppress the generation of ICMP destination unreachable errors
1007	  when ports that are not in a listening state receive packets.
1008
1009source "subsys/net/ip/Kconfig.stack"
1010
1011source "subsys/net/ip/Kconfig.mgmt"
1012
1013source "subsys/net/ip/Kconfig.stats"
1014
1015source "subsys/net/ip/Kconfig.debug"
1016
1017endmenu
1018