[net] adjust folder structure (#5587)

* [net] adjust folder structure
- 将lwip相关的文件夹,移入lwip文件夹
- Kconfig 分散到at netdev lwip sal文件夹中,使用menuconfig代替menu
This commit is contained in:
Man, Jianting (Meco) 2022-02-19 11:07:45 -05:00 committed by GitHub
parent 5a61304a09
commit 6895da5307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
893 changed files with 7133 additions and 531 deletions

View File

@ -1,495 +1,8 @@
menu "Network" menu "Network"
menu "Socket abstraction layer" source "$RTT_DIR/components/net/sal/Kconfig"
source "$RTT_DIR/components/net/netdev/Kconfig"
config RT_USING_SAL source "$RTT_DIR/components/net/lwip/Kconfig"
bool "Enable socket abstraction layer"
select RT_USING_NETDEV
select RT_USING_SYSTEM_WORKQUEUE
default n
if RT_USING_SAL
config SAL_INTERNET_CHECK
bool "Enable the ability that check internet status"
default y
help
The ability that check internet status is provided by RT-Thread.
if RT_USING_LWIP || AT_USING_SOCKET
menu "protocol stack implement"
config SAL_USING_LWIP
bool "Support lwIP stack"
default y
depends on RT_USING_LWIP
config SAL_USING_AT
bool "Support AT Commands stack"
default y
depends on AT_USING_SOCKET
config SAL_USING_TLS
bool "Support MbedTLS protocol"
default y
depends on PKG_USING_MBEDTLS
endmenu
endif
config SAL_USING_POSIX
bool "Enable BSD socket operated by file system API"
default n
select RT_USING_POSIX_FS
select RT_USING_POSIX_SELECT
help
Let BSD socket operated by file system API, such as read/write and involveed in select/poll POSIX APIs.
if !SAL_USING_POSIX
config SAL_SOCKETS_NUM
int "the maximum number of sockets"
default 16
endif
endif
endmenu
menu "Network interface device"
config RT_USING_NETDEV
bool "Enable network interface device"
default n
if RT_USING_NETDEV
config NETDEV_USING_IFCONFIG
bool "Enable ifconfig features"
default y
config NETDEV_USING_PING
bool "Enable ping features"
default y
config NETDEV_USING_NETSTAT
bool "Enable netstat features"
default y
config NETDEV_USING_AUTO_DEFAULT
bool "Enable default netdev automatic change features"
default y
config NETDEV_USING_IPV6
bool "Enable IPV6 protocol support"
default n
config NETDEV_IPV4
int
default 1
config NETDEV_IPV6
int
default 1 if NETDEV_USING_IPV6
default 0 if !NETDEV_USING_IPV6
config NETDEV_IPV6_SCOPES
bool
help
Defined to synchronize the ip6_addr structure state
default n
endif
endmenu
menu "light weight TCP/IP stack"
config RT_USING_LWIP
bool "Enable lwIP stack"
select RT_USING_DEVICE
default n
if RT_USING_LWIP
choice
prompt "lwIP version"
default RT_USING_LWIP203
help
Select the lwIP version
config RT_USING_LWIP141
bool "lwIP v1.4.1"
config RT_USING_LWIP203
bool "lwIP v2.0.3"
config RT_USING_LWIP212
bool "lwIP v2.1.2"
endchoice
if (RT_USING_LWIP203 || RT_USING_LWIP212)
config RT_USING_LWIP_IPV6
bool "IPV6 protocol"
default n
select NETDEV_USING_IPV6
select NETDEV_IPV6_SCOPES if RT_USING_LWIP212
endif
config RT_LWIP_MEM_ALIGNMENT
int "Memory alignment"
default 8 if ARCH_CPU_64BIT
default 4
config RT_LWIP_IGMP
bool "IGMP protocol"
default y
config RT_LWIP_ICMP
bool "ICMP protocol"
default y
config RT_LWIP_SNMP
bool "SNMP protocol"
select RT_LWIP_STATS
default n
config RT_LWIP_DNS
bool "Enble DNS for name resolution"
select RT_LWIP_UDP
default y
config RT_LWIP_DHCP
bool "Enable alloc ip address through DHCP"
select RT_LWIP_UDP
default y
if RT_LWIP_DHCP
config IP_SOF_BROADCAST
int "SOF broadcast"
default 1
config IP_SOF_BROADCAST_RECV
int "SOF broadcast recv"
default 1
endif
menu "Static IPv4 Address"
config RT_LWIP_IPADDR
string "IPv4: IP address"
default 192.168.1.30
config RT_LWIP_GWADDR
string "IPv4: Gateway address"
default 192.168.1.1
config RT_LWIP_MSKADDR
string "IPv4: Mask address"
default 255.255.255.0
endmenu
config RT_LWIP_UDP
bool "UDP protocol"
default y
config RT_LWIP_TCP
bool "TCP protocol"
default y
config RT_LWIP_RAW
bool "RAW protocol"
default n
config RT_LWIP_PPP
bool "PPP protocol"
default n
if RT_LWIP_PPP
config RT_LWIP_PPPOE
bool "PPPoE protocol"
default n
config RT_LWIP_PPPOS
bool "PPPoS protocol"
default n
endif
config RT_MEMP_NUM_NETCONN
int "the number of struct netconns"
default 8
config RT_LWIP_PBUF_NUM
int "the number of PBUF"
default 16
config RT_LWIP_RAW_PCB_NUM
int "the number of raw connection"
default 4
config RT_LWIP_UDP_PCB_NUM
int "the number of UDP socket"
default 8 if RT_USING_DFS_NFS
default 4
if RT_LWIP_TCP
config RT_LWIP_TCP_PCB_NUM
int "the number of TCP socket"
default 4
config RT_LWIP_TCP_SEG_NUM
int "the number of TCP segment"
default 40
config RT_LWIP_TCP_SND_BUF
int "the size of send buffer"
default 8196
config RT_LWIP_TCP_WND
int "the size of TCP send window"
default 8196
endif
config RT_LWIP_TCPTHREAD_PRIORITY
int "the priority level value of lwIP thread"
default 10
config RT_LWIP_TCPTHREAD_MBOX_SIZE
int "the number of mail in the lwIP thread mailbox"
default 8
config RT_LWIP_TCPTHREAD_STACKSIZE
int "the stack size of lwIP thread"
default 2048 if ARCH_CPU_64BIT
default 1024
config LWIP_NO_RX_THREAD
bool "Not use Rx thread"
default n
config LWIP_NO_TX_THREAD
bool "Not use Tx thread"
default n
config RT_LWIP_ETHTHREAD_PRIORITY
int "the priority level value of ethernet thread"
default 12
config RT_LWIP_ETHTHREAD_STACKSIZE
int "the stack size of ethernet thread"
default 2048 if ARCH_CPU_64BIT
default 1024
config RT_LWIP_ETHTHREAD_MBOX_SIZE
int "the number of mail in the ethernet thread mailbox"
default 8
config RT_LWIP_REASSEMBLY_FRAG
bool "Enable IP reassembly and frag"
default n
config LWIP_NETIF_STATUS_CALLBACK
int "Enable netif status callback"
default 1
config LWIP_NETIF_LINK_CALLBACK
int "Enable netif link status callback"
default 1
config SO_REUSE
int "Enable SO_REUSEADDR option"
default 1
config LWIP_SO_RCVTIMEO
int "Enable receive timeout for sockets/netconns and SO_RCVTIMEO processing."
default 1
config LWIP_SO_SNDTIMEO
int "Enable send timeout for sockets/netconns and SO_SNDTIMEO processing."
default 1
config LWIP_SO_RCVBUF
int "Enable SO_RCVBUF processing"
default 1
config LWIP_SO_LINGER
int "Enable SO_LINGER processing"
default 0
config RT_LWIP_NETIF_LOOPBACK
bool "Enable netif loopback"
default n
config LWIP_NETIF_LOOPBACK
int
default 1 if RT_LWIP_NETIF_LOOPBACK
default 0 if !RT_LWIP_NETIF_LOOPBACK
config RT_LWIP_STATS
bool "Enable lwIP statistics"
default n
config RT_LWIP_USING_HW_CHECKSUM
bool "Enable hardware checksum"
default n
config RT_LWIP_USING_PING
bool "Enable ping features"
default y
select NETDEV_USING_PING
select RT_LWIP_ICMP
select RT_LWIP_RAW
menuconfig RT_LWIP_DEBUG
bool "Enable lwIP Debugging Options"
default n
if RT_LWIP_DEBUG
config RT_LWIP_SYS_DEBUG
bool "Enable Debugging of sys.c"
default n
config RT_LWIP_ETHARP_DEBUG
bool "Enable Debugging of etharp.c"
default n
config RT_LWIP_PPP_DEBUG
bool "Enable Debugging of PPP"
default n
config RT_LWIP_MEM_DEBUG
bool "Enable Debugging of mem.c"
default n
config RT_LWIP_MEMP_DEBUG
bool "Enable Debugging of memp.c"
default n
config RT_LWIP_PBUF_DEBUG
bool "Enable Debugging of pbuf.c"
default n
config RT_LWIP_API_LIB_DEBUG
bool "Enable Debugging of api_lib.c"
default n
config RT_LWIP_API_MSG_DEBUG
bool "Enable Debugging of api_msg.c"
default n
config RT_LWIP_TCPIP_DEBUG
bool "Enable Debugging of tcpip.c"
default n
config RT_LWIP_NETIF_DEBUG
bool "Enable Debugging of netif.c"
default n
config RT_LWIP_SOCKETS_DEBUG
bool "Enable Debugging of sockets.c"
default n
config RT_LWIP_DNS_DEBUG
bool "Enable Debugging of DNS"
default n
config RT_LWIP_AUTOIP_DEBUG
bool "Enable Debugging of autoip.c"
default n
config RT_LWIP_DHCP_DEBUG
bool "Enable Debugging of dhcp.c"
default n
config RT_LWIP_IP_DEBUG
bool "Enable Debugging of IP"
default n
config RT_LWIP_IP_REASS_DEBUG
bool "Enable debugging in ip_frag.c for both frag & reass"
default n
config RT_LWIP_ICMP_DEBUG
bool "Enable Debugging of icmp.c"
default n
config RT_LWIP_IGMP_DEBUG
bool "Enable Debugging of igmp.c"
default n
config RT_LWIP_UDP_DEBUG
bool "Enable Debugging of UDP"
default n
config RT_LWIP_TCP_DEBUG
bool "Enable Debugging of TCP"
default n
config RT_LWIP_TCP_INPUT_DEBUG
bool "Enable Debugging of tcp_in.c"
default n
config RT_LWIP_TCP_OUTPUT_DEBUG
bool "Enable Debugging of tcp_out.c"
default n
config RT_LWIP_TCP_RTO_DEBUG
bool "Enable debugging in TCP for retransmit"
default n
config RT_LWIP_TCP_CWND_DEBUG
bool "Enable debugging for TCP congestion window"
default n
config RT_LWIP_TCP_WND_DEBUG
bool "Enable debugging in tcp_in.c for window updating"
default n
config RT_LWIP_TCP_FR_DEBUG
bool "Enable debugging in tcp_in.c for fast retransmit"
default n
config RT_LWIP_TCP_QLEN_DEBUG
bool "Enable debugging for TCP queue lengths"
default n
config RT_LWIP_TCP_RST_DEBUG
bool "Enable debugging for TCP with the RST message"
default n
endif
endif
endmenu
source "$RTT_DIR/components/net/at/Kconfig" source "$RTT_DIR/components/net/at/Kconfig"
if RT_USING_LWIP
config LWIP_USING_DHCPD
bool "Enable DHCP server"
default n
if LWIP_USING_DHCPD
config DHCPD_SERVER_IP
string "DHCPD SERVER IP address"
default 192.168.169.1
config DHCPD_USING_ROUTER
bool "alloc gateway ip for router"
default y
config LWIP_USING_CUSTOMER_DNS_SERVER
bool "Enable customer DNS server config"
default n
if LWIP_USING_CUSTOMER_DNS_SERVER
config DHCP_DNS_SERVER_IP
string "Custom DNS server IP address"
default 1.1.1.1
endif
endif
endif
endmenu endmenu

View File

@ -1,6 +1,5 @@
# for network related component # for network related component
import os import os
Import('RTT_ROOT')
from building import * from building import *
objs = [] objs = []

View File

@ -1,6 +1,4 @@
menu "AT commands" menuconfig RT_USING_AT
config RT_USING_AT
bool "Enable AT commands" bool "Enable AT commands"
default n default n
@ -87,5 +85,3 @@ if RT_USING_AT
software module version number software module version number
endif endif
endmenu

View File

@ -1,20 +0,0 @@
cmake_minimum_required(VERSION 3.7)
project(lwIP)
set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
include(src/Filelists.cmake)
# Package generation
set(CPACK_SOURCE_GENERATOR "ZIP")
set(CPACK_SOURCE_PACKAGE_DESCRIPTION_SUMMARY "lwIP lightweight IP stack")
set(CPACK_PACKAGE_VERSION_MAJOR "${LWIP_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${LWIP_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${LWIP_VERSION_REVISION}")
set(CPACK_SOURCE_IGNORE_FILES "/build/;${CPACK_SOURCE_IGNORE_FILES};.git")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "lwip-${LWIP_VERSION_MAJOR}.${LWIP_VERSION_MINOR}.${LWIP_VERSION_REVISION}")
include(CPack)
# Target for package generation
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
add_dependencies(dist lwipdocs)

View File

@ -4,6 +4,5 @@
dir_path: dir_path:
- lwip-1.4.1 - lwip-1.4.1
- lwip-2.0.2
- lwip-2.0.3 - lwip-2.0.3
- lwip-2.1.2 - lwip-2.1.2

378
components/net/lwip/Kconfig Normal file
View File

@ -0,0 +1,378 @@
menuconfig RT_USING_LWIP
bool "Enable light weight TCP/IP stack (lwIP)"
select RT_USING_DEVICE
default n
if RT_USING_LWIP
choice
prompt "lwIP version"
default RT_USING_LWIP203
help
Select the lwIP version
config RT_USING_LWIP141
bool "lwIP v1.4.1"
config RT_USING_LWIP203
bool "lwIP v2.0.3"
config RT_USING_LWIP212
bool "lwIP v2.1.2"
endchoice
if (RT_USING_LWIP203 || RT_USING_LWIP212)
config RT_USING_LWIP_IPV6
bool "IPV6 protocol"
default n
select NETDEV_USING_IPV6
select NETDEV_IPV6_SCOPES if RT_USING_LWIP212
endif
config RT_LWIP_MEM_ALIGNMENT
int "Memory alignment"
default 8 if ARCH_CPU_64BIT
default 4
config RT_LWIP_IGMP
bool "IGMP protocol"
default y
config RT_LWIP_ICMP
bool "ICMP protocol"
default y
config RT_LWIP_SNMP
bool "SNMP protocol"
select RT_LWIP_STATS
default n
config RT_LWIP_DNS
bool "Enble DNS for name resolution"
select RT_LWIP_UDP
default y
config RT_LWIP_DHCP
bool "Enable alloc ip address through DHCP"
select RT_LWIP_UDP
default y
if RT_LWIP_DHCP
config IP_SOF_BROADCAST
int "SOF broadcast"
default 1
config IP_SOF_BROADCAST_RECV
int "SOF broadcast recv"
default 1
endif
menu "Static IPv4 Address"
config RT_LWIP_IPADDR
string "IPv4: IP address"
default 192.168.1.30
config RT_LWIP_GWADDR
string "IPv4: Gateway address"
default 192.168.1.1
config RT_LWIP_MSKADDR
string "IPv4: Mask address"
default 255.255.255.0
endmenu
config RT_LWIP_UDP
bool "UDP protocol"
default y
config RT_LWIP_TCP
bool "TCP protocol"
default y
config RT_LWIP_RAW
bool "RAW protocol"
default n
config RT_LWIP_PPP
bool "PPP protocol"
default n
if RT_LWIP_PPP
config RT_LWIP_PPPOE
bool "PPPoE protocol"
default n
config RT_LWIP_PPPOS
bool "PPPoS protocol"
default n
endif
config RT_MEMP_NUM_NETCONN
int "the number of struct netconns"
default 8
config RT_LWIP_PBUF_NUM
int "the number of PBUF"
default 16
config RT_LWIP_RAW_PCB_NUM
int "the number of raw connection"
default 4
config RT_LWIP_UDP_PCB_NUM
int "the number of UDP socket"
default 8 if RT_USING_DFS_NFS
default 4
if RT_LWIP_TCP
config RT_LWIP_TCP_PCB_NUM
int "the number of TCP socket"
default 4
config RT_LWIP_TCP_SEG_NUM
int "the number of TCP segment"
default 40
config RT_LWIP_TCP_SND_BUF
int "the size of send buffer"
default 8196
config RT_LWIP_TCP_WND
int "the size of TCP send window"
default 8196
endif
config RT_LWIP_TCPTHREAD_PRIORITY
int "the priority level value of lwIP thread"
default 10
config RT_LWIP_TCPTHREAD_MBOX_SIZE
int "the number of mail in the lwIP thread mailbox"
default 8
config RT_LWIP_TCPTHREAD_STACKSIZE
int "the stack size of lwIP thread"
default 2048 if ARCH_CPU_64BIT
default 1024
config LWIP_NO_RX_THREAD
bool "Not use Rx thread"
default n
config LWIP_NO_TX_THREAD
bool "Not use Tx thread"
default n
config RT_LWIP_ETHTHREAD_PRIORITY
int "the priority level value of ethernet thread"
default 12
config RT_LWIP_ETHTHREAD_STACKSIZE
int "the stack size of ethernet thread"
default 2048 if ARCH_CPU_64BIT
default 1024
config RT_LWIP_ETHTHREAD_MBOX_SIZE
int "the number of mail in the ethernet thread mailbox"
default 8
config RT_LWIP_REASSEMBLY_FRAG
bool "Enable IP reassembly and frag"
default n
config LWIP_NETIF_STATUS_CALLBACK
int "Enable netif status callback"
default 1
config LWIP_NETIF_LINK_CALLBACK
int "Enable netif link status callback"
default 1
config SO_REUSE
int "Enable SO_REUSEADDR option"
default 1
config LWIP_SO_RCVTIMEO
int "Enable receive timeout for sockets/netconns and SO_RCVTIMEO processing."
default 1
config LWIP_SO_SNDTIMEO
int "Enable send timeout for sockets/netconns and SO_SNDTIMEO processing."
default 1
config LWIP_SO_RCVBUF
int "Enable SO_RCVBUF processing"
default 1
config LWIP_SO_LINGER
int "Enable SO_LINGER processing"
default 0
config RT_LWIP_NETIF_LOOPBACK
bool "Enable netif loopback"
default n
config LWIP_NETIF_LOOPBACK
int
default 1 if RT_LWIP_NETIF_LOOPBACK
default 0 if !RT_LWIP_NETIF_LOOPBACK
config RT_LWIP_STATS
bool "Enable lwIP statistics"
default n
config RT_LWIP_USING_HW_CHECKSUM
bool "Enable hardware checksum"
default n
config RT_LWIP_USING_PING
bool "Enable ping features"
default y
select NETDEV_USING_PING
select RT_LWIP_ICMP
select RT_LWIP_RAW
config LWIP_USING_DHCPD
bool "Enable DHCP server"
default n
if LWIP_USING_DHCPD
config DHCPD_SERVER_IP
string "DHCPD SERVER IP address"
default 192.168.169.1
config DHCPD_USING_ROUTER
bool "alloc gateway ip for router"
default y
config LWIP_USING_CUSTOMER_DNS_SERVER
bool "Enable customer DNS server config"
default n
if LWIP_USING_CUSTOMER_DNS_SERVER
config DHCP_DNS_SERVER_IP
string "Custom DNS server IP address"
default 1.1.1.1
endif
endif
menuconfig RT_LWIP_DEBUG
bool "Enable lwIP Debugging Options"
default n
if RT_LWIP_DEBUG
config RT_LWIP_SYS_DEBUG
bool "Enable Debugging of sys.c"
default n
config RT_LWIP_ETHARP_DEBUG
bool "Enable Debugging of etharp.c"
default n
config RT_LWIP_PPP_DEBUG
bool "Enable Debugging of PPP"
default n
config RT_LWIP_MEM_DEBUG
bool "Enable Debugging of mem.c"
default n
config RT_LWIP_MEMP_DEBUG
bool "Enable Debugging of memp.c"
default n
config RT_LWIP_PBUF_DEBUG
bool "Enable Debugging of pbuf.c"
default n
config RT_LWIP_API_LIB_DEBUG
bool "Enable Debugging of api_lib.c"
default n
config RT_LWIP_API_MSG_DEBUG
bool "Enable Debugging of api_msg.c"
default n
config RT_LWIP_TCPIP_DEBUG
bool "Enable Debugging of tcpip.c"
default n
config RT_LWIP_NETIF_DEBUG
bool "Enable Debugging of netif.c"
default n
config RT_LWIP_SOCKETS_DEBUG
bool "Enable Debugging of sockets.c"
default n
config RT_LWIP_DNS_DEBUG
bool "Enable Debugging of DNS"
default n
config RT_LWIP_AUTOIP_DEBUG
bool "Enable Debugging of autoip.c"
default n
config RT_LWIP_DHCP_DEBUG
bool "Enable Debugging of dhcp.c"
default n
config RT_LWIP_IP_DEBUG
bool "Enable Debugging of IP"
default n
config RT_LWIP_IP_REASS_DEBUG
bool "Enable debugging in ip_frag.c for both frag & reass"
default n
config RT_LWIP_ICMP_DEBUG
bool "Enable Debugging of icmp.c"
default n
config RT_LWIP_IGMP_DEBUG
bool "Enable Debugging of igmp.c"
default n
config RT_LWIP_UDP_DEBUG
bool "Enable Debugging of UDP"
default n
config RT_LWIP_TCP_DEBUG
bool "Enable Debugging of TCP"
default n
config RT_LWIP_TCP_INPUT_DEBUG
bool "Enable Debugging of tcp_in.c"
default n
config RT_LWIP_TCP_OUTPUT_DEBUG
bool "Enable Debugging of tcp_out.c"
default n
config RT_LWIP_TCP_RTO_DEBUG
bool "Enable debugging in TCP for retransmit"
default n
config RT_LWIP_TCP_CWND_DEBUG
bool "Enable debugging for TCP congestion window"
default n
config RT_LWIP_TCP_WND_DEBUG
bool "Enable debugging in tcp_in.c for window updating"
default n
config RT_LWIP_TCP_FR_DEBUG
bool "Enable debugging in tcp_in.c for fast retransmit"
default n
config RT_LWIP_TCP_QLEN_DEBUG
bool "Enable debugging for TCP queue lengths"
default n
config RT_LWIP_TCP_RST_DEBUG
bool "Enable debugging for TCP with the RST message"
default n
endif
endif

View File

@ -0,0 +1,14 @@
# for network related component
import os
from building import *
objs = []
cwd = GetCurrentDir()
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs')

View File

@ -6,16 +6,6 @@ HISTORY
++ New features: ++ New features:
++ Bugfixes:
(STABLE-1.4.1)
++ New features:
2012-03-25: Simon Goldschmidt (idea by Mason) 2012-03-25: Simon Goldschmidt (idea by Mason)
* posix/*: added posix-compatibility include files posix/netdb.h and posix/sys/socket.h * posix/*: added posix-compatibility include files posix/netdb.h and posix/sys/socket.h
which are a simple wrapper to the correct lwIP include files. which are a simple wrapper to the correct lwIP include files.

View File

@ -10,3 +10,4 @@ The specific changes are as follows:
by ChenYong 2019/3/26 10:00 AM by ChenYong 2019/3/26 10:00 AM
chenyong@rt-thread.com chenyong@rt-thread.com

Some files were not shown because too many files have changed in this diff Show More