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