Skip to content

Commit b54f438

Browse files
Freey0cfriedt
authored andcommitted
net: shell: Move to a separate Kconfig file
Move it to a separate Kconfig file and move it under the net/lib/shell. When using menuconfig, it helps to reduce the confusion of network configuration options. Signed-off-by: WenBin Zhang <[email protected]>
1 parent 9ce6d35 commit b54f438

File tree

3 files changed

+177
-171
lines changed

3 files changed

+177
-171
lines changed

subsys/net/ip/Kconfig

Lines changed: 0 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -181,177 +181,6 @@ config NET_IPV4_MAPPING_TO_IPV6
181181
option, then you can still control the behaviour of the socket
182182
via the IPV6_V6ONLY option at runtime.
183183

184-
config 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-
193-
if NET_SHELL
194-
195-
config 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-
206-
config NET_SHELL_ETHERNET_SUPPORTED
207-
bool "Ethernet related configuration"
208-
default y
209-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_L2_ETHERNET
210-
211-
config NET_SHELL_CAPTURE_SUPPORTED
212-
bool "Packet capture configuration"
213-
default y
214-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_CAPTURE
215-
216-
config 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-
221-
config NET_SHELL_DHCPV6_SUPPORTED
222-
bool "DHCPv6 start / stop"
223-
default y
224-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_DHCPV6
225-
226-
config NET_SHELL_DNS_RESOLVER_SUPPORTED
227-
bool "DNS resolver"
228-
default y
229-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || DNS_RESOLVER
230-
231-
config 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-
236-
config NET_SHELL_GPTP_SUPPORTED
237-
bool "gPTP monitoring"
238-
default y
239-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_GPTP
240-
241-
config NET_SHELL_HTTP_SERVER_SUPPORTED
242-
bool "HTTP server status"
243-
default y
244-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || HTTP_SERVER
245-
246-
config 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-
251-
config 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-
256-
config 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-
261-
config NET_SHELL_IP_SUPPORTED
262-
bool "Generic IP utilities"
263-
default y
264-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_IP
265-
266-
config 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-
271-
config NET_SHELL_PKT_FILTER_SUPPORTED
272-
bool "Network packet filter related configuration"
273-
default y
274-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_PKT_FILTER
275-
276-
config NET_SHELL_PMTU_SUPPORTED
277-
bool "PMTU config"
278-
default y
279-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_PMTU
280-
281-
config NET_SHELL_PPP_SUPPORTED
282-
bool "PPP config"
283-
default y
284-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_L2_PPP
285-
286-
config NET_SHELL_POWER_MANAGEMENT_SUPPORTED
287-
bool "Network power management resume / suspend"
288-
default y
289-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_POWER_MANAGEMENT
290-
291-
config NET_SHELL_ROUTE_SUPPORTED
292-
bool "IP routing config"
293-
default y
294-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || (NET_ROUTE && NET_NATIVE)
295-
296-
config NET_SHELL_SOCKETS_SERVICE_SUPPORTED
297-
bool "Socket service status"
298-
default y
299-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_SOCKETS_SERVICE
300-
301-
config NET_SHELL_STATISTICS_SUPPORTED
302-
bool "Network statistics monitoring"
303-
default y
304-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_STATISTICS
305-
306-
config NET_SHELL_TCP_SUPPORTED
307-
bool "Send / receive TCP data"
308-
default y
309-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || (NET_NATIVE_TCP && NET_TCP)
310-
311-
config NET_SHELL_UDP_SUPPORTED
312-
bool "Send / receive UDP data"
313-
default y
314-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || (NET_NATIVE_UDP && NET_UDP)
315-
316-
config NET_SHELL_VIRTUAL_SUPPORTED
317-
bool "Virtual network interface management"
318-
default y
319-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_L2_VIRTUAL
320-
321-
config NET_SHELL_VLAN_SUPPORTED
322-
bool "Virtual LAN config"
323-
default y
324-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_VLAN
325-
326-
config NET_SHELL_WEBSOCKET_SUPPORTED
327-
bool "Websocket client status"
328-
default y
329-
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || WEBSOCKET_CLIENT
330-
331-
config NET_SHELL_DYN_CMD_COMPLETION
332-
bool "Network shell dynamic command completion"
333-
default y
334-
help
335-
Enable various net-shell command to support dynamic command
336-
completion. This means that for example the nbr command can
337-
automatically complete the neighboring IPv6 address and user
338-
does not need to type it manually.
339-
Please note that this uses more memory in order to save the
340-
dynamic command strings. For example for nbr command the
341-
increase is 320 bytes (8 neighbors * 40 bytes for IPv6 address
342-
length) by default. Other dynamic completion commands in
343-
net-shell require also some smaller amount of memory.
344-
345-
config NET_SHELL_REQUIRE_TX_THREAD
346-
bool
347-
depends on SHELL_BACKEND_TELNET || SHELL_BACKEND_MQTT
348-
default y if NET_ARP
349-
help
350-
Hidden symbol indicating that network shell requires separate TX
351-
thread due to possible deadlocks during shell/net stack operations.
352-
353-
endif # NET_SHELL
354-
355184
config NET_TC_TX_COUNT
356185
int "How many Tx traffic classes to have for each network device"
357186
default 1 if USERSPACE || USB_DEVICE_NETWORK || \

subsys/net/lib/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ source "subsys/net/lib/sockets/Kconfig"
3737

3838
source "subsys/net/lib/tls_credentials/Kconfig"
3939

40+
source "subsys/net/lib/shell/Kconfig"
41+
4042
endmenu
4143

4244
menu "Network additional services"

subsys/net/lib/shell/Kconfig

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Copyright (c) 2016 Intel Corporation.
2+
# Copyright (c) 2021 Nordic Semiconductor
3+
# Copyright (c) 2023 Arm Limited (or its affiliates). All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
menuconfig NET_SHELL
7+
bool "Network shell utilities"
8+
select SHELL
9+
select NET_IPV4_IGMP if NET_NATIVE_IPV4
10+
select REQUIRES_FLOAT_PRINTF
11+
help
12+
Activate shell module that provides network commands like
13+
ping to the console.
14+
15+
if NET_SHELL
16+
17+
config NET_SHELL_SHOW_DISABLED_COMMANDS
18+
bool "Show disabled command information"
19+
default y
20+
help
21+
By default all the network shell commands are there and the
22+
command itself will print out that it is disabled and how to
23+
enable it. If you do not need this and only want to see the
24+
commands that you can actively use, then you can save a little
25+
bit of flash by not showing commands that cannot be used with
26+
current configuration.
27+
28+
config NET_SHELL_ETHERNET_SUPPORTED
29+
bool "Ethernet related configuration"
30+
default y
31+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_L2_ETHERNET
32+
33+
config NET_SHELL_CAPTURE_SUPPORTED
34+
bool "Packet capture configuration"
35+
default y
36+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_CAPTURE
37+
38+
config NET_SHELL_DHCPV4_SUPPORTED
39+
bool "DHCPv4 start / stop"
40+
default y
41+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_DHCPV4_SERVER || NET_DHCPV4
42+
43+
config NET_SHELL_DHCPV6_SUPPORTED
44+
bool "DHCPv6 start / stop"
45+
default y
46+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_DHCPV6
47+
48+
config NET_SHELL_DNS_RESOLVER_SUPPORTED
49+
bool "DNS resolver"
50+
default y
51+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || DNS_RESOLVER
52+
53+
config NET_SHELL_EVENT_MONITOR_SUPPORTED
54+
bool "Network management event monitoring configuration"
55+
default y
56+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_MGMT_EVENT_MONITOR
57+
58+
config NET_SHELL_GPTP_SUPPORTED
59+
bool "gPTP monitoring"
60+
default y
61+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_GPTP
62+
63+
config NET_SHELL_HTTP_SERVER_SUPPORTED
64+
bool "HTTP server status"
65+
default y
66+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || HTTP_SERVER
67+
68+
config NET_SHELL_CONNECTION_MANAGER_SUPPORTED
69+
bool "Connection manager status"
70+
default y
71+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_CONNECTION_MANAGER
72+
73+
config NET_SHELL_IPV4_SUPPORTED
74+
bool "IPv4 config"
75+
default y
76+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || (NET_NATIVE_IPV4 && NET_IPV4)
77+
78+
config NET_SHELL_IPV6_SUPPORTED
79+
bool "IPv6 config"
80+
default y
81+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || (NET_NATIVE_IPV6 && NET_IPV6)
82+
83+
config NET_SHELL_IP_SUPPORTED
84+
bool "Generic IP utilities"
85+
default y
86+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_IP
87+
88+
config NET_SHELL_PKT_ALLOC_SUPPORTED
89+
bool "Packet allocation monitoring"
90+
default y
91+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_DEBUG_NET_PKT_ALLOC
92+
93+
config NET_SHELL_PKT_FILTER_SUPPORTED
94+
bool "Network packet filter related configuration"
95+
default y
96+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_PKT_FILTER
97+
98+
config NET_SHELL_PMTU_SUPPORTED
99+
bool "PMTU config"
100+
default y
101+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_PMTU
102+
103+
config NET_SHELL_PPP_SUPPORTED
104+
bool "PPP config"
105+
default y
106+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_L2_PPP
107+
108+
config NET_SHELL_POWER_MANAGEMENT_SUPPORTED
109+
bool "Network power management resume / suspend"
110+
default y
111+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_POWER_MANAGEMENT
112+
113+
config NET_SHELL_ROUTE_SUPPORTED
114+
bool "IP routing config"
115+
default y
116+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || (NET_ROUTE && NET_NATIVE)
117+
118+
config NET_SHELL_SOCKETS_SERVICE_SUPPORTED
119+
bool "Socket service status"
120+
default y
121+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_SOCKETS_SERVICE
122+
123+
config NET_SHELL_STATISTICS_SUPPORTED
124+
bool "Network statistics monitoring"
125+
default y
126+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_STATISTICS
127+
128+
config NET_SHELL_TCP_SUPPORTED
129+
bool "Send / receive TCP data"
130+
default y
131+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || (NET_NATIVE_TCP && NET_TCP)
132+
133+
config NET_SHELL_UDP_SUPPORTED
134+
bool "Send / receive UDP data"
135+
default y
136+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || (NET_NATIVE_UDP && NET_UDP)
137+
138+
config NET_SHELL_VIRTUAL_SUPPORTED
139+
bool "Virtual network interface management"
140+
default y
141+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_L2_VIRTUAL
142+
143+
config NET_SHELL_VLAN_SUPPORTED
144+
bool "Virtual LAN config"
145+
default y
146+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || NET_VLAN
147+
148+
config NET_SHELL_WEBSOCKET_SUPPORTED
149+
bool "Websocket client status"
150+
default y
151+
depends on NET_SHELL_SHOW_DISABLED_COMMANDS || WEBSOCKET_CLIENT
152+
153+
config NET_SHELL_DYN_CMD_COMPLETION
154+
bool "Network shell dynamic command completion"
155+
default y
156+
help
157+
Enable various net-shell command to support dynamic command
158+
completion. This means that for example the nbr command can
159+
automatically complete the neighboring IPv6 address and user
160+
does not need to type it manually.
161+
Please note that this uses more memory in order to save the
162+
dynamic command strings. For example for nbr command the
163+
increase is 320 bytes (8 neighbors * 40 bytes for IPv6 address
164+
length) by default. Other dynamic completion commands in
165+
net-shell require also some smaller amount of memory.
166+
167+
config NET_SHELL_REQUIRE_TX_THREAD
168+
bool
169+
depends on SHELL_BACKEND_TELNET || SHELL_BACKEND_MQTT
170+
default y if NET_ARP
171+
help
172+
Hidden symbol indicating that network shell requires separate TX
173+
thread due to possible deadlocks during shell/net stack operations.
174+
175+
endif # NET_SHELL

0 commit comments

Comments
 (0)