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