Skip to content

Commit d46d9ab

Browse files
authored
Merge pull request #8 from moninom1/maintry2
Merging to main
2 parents f71fe91 + 1ceb4f0 commit d46d9ab

File tree

510 files changed

+94103
-14817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

510 files changed

+94103
-14817
lines changed

.github/lexicon.txt

100644100755
Lines changed: 475 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

100644100755
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,29 @@ jobs:
119119
run: |
120120
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL
121121
cmake --build build --target freertos_plus_tcp_build_test
122+
- name: Build checks (Enable all functionalities IPv4)
123+
run: |
124+
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4
125+
cmake --build build --target clean
126+
cmake --build build --target freertos_plus_tcp_build_test
127+
- name: Build checks (Enable all functionalities IPv6)
128+
run: |
129+
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6
130+
cmake --build build --target freertos_plus_tcp_build_test
131+
- name: Build checks (Enable all functionalities IPv4 IPv6)
132+
run: |
133+
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_IPV6
134+
cmake --build build --target clean
135+
cmake --build build --target freertos_plus_tcp_build_test
136+
- name: Build checks (Enable all functionalities IPv4 TCP)
137+
run: |
138+
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_TCP
139+
cmake --build build --target clean
140+
cmake --build build --target freertos_plus_tcp_build_test
141+
- name: Build checks (Enable all functionalities IPv6 TCP)
142+
run: |
143+
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6_TCP
144+
cmake --build build --target freertos_plus_tcp_build_test
122145
- name: Build checks (Disable all functionalities)
123146
run: |
124147
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DISABLE_ALL

CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,15 @@ endif()
147147
# on the config defined in the freertos_config
148148
set(FREERTOS_PLUS_TCP_TEST_CONFIGURATION "CUSTOM" CACHE STRING "FreeRTOS Plus TCP Build Test configuration")
149149
set(FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST
150-
CUSTOM # Custom (external) configuration -eg from a top-level project
151-
ENABLE_ALL # Enable all configuration settings
152-
DISABLE_ALL # Disable all configuration settings
153-
DEFAULT_CONF # Default (typical) configuration
150+
CUSTOM # Custom (external) configuration -eg from a top-level project
151+
ENABLE_ALL # Enable all configuration settings
152+
ENABLE_ALL_IPV4 # Enable all configuration settings IPv4 UDP
153+
ENABLE_ALL_IPV6 # Enable all configuration settings IPv6 UDP
154+
ENABLE_ALL_IPV4_TCP # Enable all configuration settings IPv4 TCP
155+
ENABLE_ALL_IPV6_TCP # Enable all configuration settings IPv6 TCP
156+
ENABLE_ALL_IPV4_IPV6 # Enable all configuration settings IPv4 IPv6 UDP
157+
DISABLE_ALL # Disable all configuration settings
158+
DEFAULT_CONF # Default (typical) configuration
154159
)
155160
if(NOT FREERTOS_PLUS_TCP_TEST_CONFIGURATION IN_LIST FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST)
156161
message(FATAL_ERROR "Invalid FREERTOS_PLUS_TCP_TEST_CONFIGURATION value '${FREERTOS_PLUS_TCP_TEST_CONFIGURATION}' should be one of: ${FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST}")
@@ -191,6 +196,7 @@ add_compile_options(
191196
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wall>
192197
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
193198
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
199+
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wunused-variable>
194200
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>
195201

196202
# TODO: Add in other Compilers here.

GettingStarted_4.0.0-rc3.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Moving to 4.0.0-rc1/rc2/rc3 from 3.x.x:
2+
--------------------------------
3+
4+
Version 4.0.0-rc1/rc2/rc3 adds new files to support IPv6 functionality, breaking each file into logically separated IPv4 and IPv6 files. The folder structure of FreeRTOS-Plus-TCP remains unchanged. Build separation is added to make the library modular, enabling users to compile and create a low-footprint binary with only the required functionalities. For more details on supported build combinations, see [History.txt](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/dev/IPv6_integration/History.txt) .
5+
6+
Some of the APIs have changed which is illustrated in the section below. However, there is a backward compatibility mode provided as well.
7+
8+
Backward Compatibility Mode:
9+
---------------------------
10+
If you are moving your code from V3.x.x to V4.0.0-rc1/rc2/rc3, then set the "ipconfigIPv4_BACKWARD_COMPATIBLE" macro to 1 in “FreeRTOSIPConfigDefaults.h” to run the code in backward compatible mode.
11+
The "Existing API's" defined in all the API changes below work only when the backward compatibility mode is enabled.
12+
13+
API changes in 4.0.0-rc1/rc2/rc3:
14+
----------------------
15+
16+
The changes mentioned below uses ipconfigIPv4_BACKWARD_COMPATIBLE flag to differentiate between old API and new API.
17+
18+
Change 1:
19+
20+
- Existing API: FreeRTOS_IPInit
21+
- Backward compatibility with the IPv4 FreeRTOS+TCP V3.x.x which only supports single network interface. This can be used for single interface IPv4 systems.
22+
- New API: FreeRTOS_IPInit_Multi
23+
- Supports multiple interfaces. Before calling this function, at least 1 interface and 1 end-point must have been set-up. FreeRTOS_IPInit_Multi() replaces the earlier FreeRTOS_IPInit().
24+
25+
Change 2:
26+
27+
- Existing API: FreeRTOS_GetAddressConfiguration/FreeRTOS_SetAddressConfiguration
28+
- Get/Set the address configuration from the global variables initialised during FreeRTOS_IPInit
29+
- New API: FreeRTOS_GetEndPointConfiguration/FreeRTOS_SetEndPointConfiguration
30+
- Get/Set the same address configuration from/to the end point
31+
32+
Change 3:
33+
34+
- Existing API: FreeRTOS_GetUDPPayloadBuffer
35+
- Backward compatibility with the IPv4 FreeRTOS+TCP V3.x.x. This can still be used for IPv4 use cases.
36+
- New API:FreeRTOS_GetUDPPayloadBuffer_Multi
37+
- A new argument (uint8_t ucIPType) to specify IP type to support both IPv4 and IPv6
38+
39+
Change 4:
40+
41+
- Existing API: pxFillInterfaceDescriptor
42+
- It is there for backward compatibility. The function FreeRTOS_IPInit() will call it to initialise the interface and end-point objects
43+
- New API: prefix_pxFillInterfaceDescriptor
44+
- where prefix = Network Interface Name
45+
- E.g pxWinPcap_FillInterfaceDescriptor
46+
- New function with the same functionality
47+
48+
Change 5:
49+
50+
- Existing API: vApplicationIPNetworkEventHook
51+
- New API: vApplicationIPNetworkEventHook_Multi
52+
- New argument “struct xNetworkInterface * pxNetworkInterface” added.
53+
54+
Change 6:
55+
56+
- Existing API: xApplicationDHCPHook
57+
- New API: xApplicationDHCPHook_Multi
58+
- New argument "struct xNetworkEndPoint * pxEndPoint" added.
59+
60+
Change 7:
61+
62+
- Existing API: xApplicationDNSQueryHook
63+
- New API: xApplicationDNSQueryHook_Multi
64+
- New argument "struct xNetworkEndPoint * pxEndPoint" added.
65+
66+
**NOTE** : We are NOT considering the APIs changes in FreeRTOS_IP_Private.h for backward compatibility as those are not part of published interface.
67+
68+
Running Demos:
69+
-------------
70+
The demos can be found at: https://github.com/FreeRTOS/FreeRTOS/tree/devIPv6/FreeRTOS-Plus/Demo
71+
72+
In all the demos, there is a backward compatibility mode which can be enabled by setting the flag “ipconfigIPv4_BACKWARD_COMPATIBLE” to 1 in the header file “FreeRTOSIPConfigDefaults.h”.
73+
This flag is by default set to zero.
74+
75+
New IPv6 WinSim Demo: https://github.com/FreeRTOS/FreeRTOS/tree/devIPv6/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo

History.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
Changes between dev/ipv6_integration branch 4.0.0-RC3 and 4.0.0-RC2 releases:
2+
+ Added memory safety proofs for IPv6 using[ CBMC automated reasoning tool ] ( https:/*www.cprover.org/cbmc/)
3+
+ Introduced build separation feature to achieve low memory footprint. Supported build combinations:
4+
1. IPv4 + UDP
5+
2. IPv4 + UDP + TCP
6+
3. IPv6 + UDP
7+
4. IPv6 + UDP + TCP
8+
5. IPv4 + IPv6 + UDP
9+
6. IPv4 + IPv6 + UDP + TCP
10+
11+
Changes between dev/ipv6_integration branch 4.0.0-RC2 and 4.0.0-RC1 releases:
12+
+ Added changes to fix IPv6 issues observed by Maxwell protocol tester.
13+
14+
Changes between dev/ipv6_integration branch RC1 and main branch V3.0.0 releases:
15+
+ Unified code for IPv4 and IPv6
16+
+ Multiple Interface/Endpoint support
17+
((Reference: https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/freertostcp-multiple-interfaces.html).
18+
+ New WinSim demo to support both IPv4 and IPv6.
19+
**Note**- This release does not support ESP32/ M487/ mw300_rd ports yet. This will be released soon.
20+
121
Changes between V3.0.0 and V3.1.0 releases:
222
+ Fixed a bug in the Connect function where multiple SYN and RST packet combinations can
323
lead to orphaned sockets.

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
## NOTE - Work In Progress
2+
3+
This branch contains unified IPv4 and IPv6 functionalities.
4+
Refer to the Getting started Guide (found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/dev/IPv6_integration/GettingStarted_4.0.0-rc3.md)) for more details.
5+
16
## FreeRTOS-Plus-TCP Library
27
FreeRTOS-Plus-TCP is a lightweight TCP/IP stack for FreeRTOS. It provides a familiar Berkeley sockets interface, making it as simple to use and learn as possible. FreeRTOS-Plus-TCP's features and RAM footprint are fully scalable, making FreeRTOS-Plus-TCP equally applicable to smaller lower throughput microcontrollers as well as larger higher throughput microprocessors.
38

4-
This library has undergone static code analysis and checks for compliance with the [MISRA coding standard](https://www.misra.org.uk/). Any deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md). The library is validated for memory safety and data structure invariance through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/) for the functions that parse data originating from the network.
9+
This library has undergone static code analysis and checks for compliance with the [MISRA coding standard](https://www.misra.org.uk/). Any deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md). The library is validated for memory safety and data structure invariance through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/) for the functions that parse data originating from the network. The library is also protocol tested using Maxwell protocol tester for both IPv4 and IPv6.
510

611
## Getting started
7-
The easiest way to use FreeRTOS-Plus-TCP is to start with the pre-configured demo application project (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/master/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)). That way you will have the correct FreeRTOS source files included, and the correct include paths configured. Once a demo application is building and executing you can remove the demo application files, and start to add in your own application source files. See the [FreeRTOS Kernel Quick Start Guide](https://www.freertos.org/FreeRTOS-quick-start-guide.html) for detailed instructions and other useful links.
12+
The easiest way to use the 4.0.0-rc3 version of FreeRTOS-Plus-TCP is to refer to to the Getting started Guide (found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/dev/IPv6_integration/GettingStarted_4.0.0-rc3.md))
13+
Another way is to start with the pre-configured demo application project (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/devIPv6/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)). That way you will have the correct FreeRTOS source files included, and the correct include paths configured. Once a demo application is building and executing you can remove the demo application files, and start to add in your own application source files. See the [FreeRTOS Kernel Quick Start Guide](https://www.freertos.org/FreeRTOS-quick-start-guide.html) for detailed instructions and other useful links.
814

915
Additionally, for FreeRTOS-Plus-TCP source code organization refer to the [Documentation](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html), and [API Reference](https://freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html).
1016

@@ -15,6 +21,8 @@ If you have any questions or need assistance troubleshooting your FreeRTOS proje
1521

1622
Also see the [Submitting a bugs/feature request](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/.github/CONTRIBUTING.md#submitting-a-bugsfeature-request) section of CONTRIBUTING.md for more details.
1723

24+
**Note:** All the remaining sections are generic and applies to all the versions from V3.0.0 onwards.
25+
1826
## Upgrading to V3.0.0 and above
1927
In version 3.0.0 or higher, the folder structure of FreeRTOS-Plus-TCP has changed and the files have been broken down into smaller logically separated modules. This change makes the code more modular and conducive to unit-tests. FreeRTOS-Plus-TCP V3.0.0 improves the robustness, security, and modularity of the library. Version 3.0.0 adds comprehensive unit test coverage for all lines and branches of code and has undergone protocol testing, and penetration testing by AWS Security to reduce the exposure to security vulnerabilities. Additionally, the source files have been moved to a `source` directory. This change requires modification of any existing project(s) to include the modified source files and directories. There are examples on how to use the new files and directory structure. For a windows simulator based example, refer to this [demo](https://github.com/FreeRTOS/FreeRTOS/tree/TCPRefactorDemo/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator). For an example based on the Xilinx Zynq-7000, use the code in this [branch](https://github.com/aws/amazon-freertos/tree/TCPRefactorDemo) and follow these [instructions](https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_xilinx.html) to build and run the demo.
2028

docs/doxygen/config.doxyfile

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ PROJECT_NAME = FreeRTOS-Plus-TCP
4848
# could be handy for archiving the generated documentation or if some version
4949
# control system is used.
5050

51-
PROJECT_NUMBER = V3.0.0
51+
PROJECT_NUMBER = V4.0.0-rc3
5252

5353
# Using the PROJECT_BRIEF tag one can provide an optional one line description
5454
# for a project that appears at the top of each page and should give viewer a
@@ -909,20 +909,48 @@ WARN_LOGFILE =
909909
# Note: If this tag is empty the current directory is searched.
910910

911911
INPUT = ./ \
912-
./source/FreeRTOS_DNS.c \
913-
./source/FreeRTOS_DNS_Cache.c \
914-
./source/FreeRTOS_DNS_Callback.c \
915-
./source/FreeRTOS_DNS_Networking.c \
916-
./source/FreeRTOS_DNS_Parser.c \
917-
./source/FreeRTOS_Stream_Buffer.c \
918-
./source/FreeRTOS_UDP_IP.c \
919-
./source/FreeRTOS_ARP.c \
920-
./source/FreeRTOS_IP.c \
921-
./source/FreeRTOS_TCP_IP.c \
922-
./source/FreeRTOS_DHCP.c \
923-
./source/FreeRTOS_Sockets.c \
924-
./source/FreeRTOS_TCP_WIN.c \
925-
./source/FreeRTOS_Tiny_TCP.c
912+
./source/FreeRTOS_ARP.c \
913+
./source/FreeRTOS_BitConfig.c \
914+
./source/FreeRTOS_DHCP.c \
915+
./source/FreeRTOS_DHCPv6.c \
916+
./source/FreeRTOS_DNS.c \
917+
./source/FreeRTOS_DNS_Cache.c \
918+
./source/FreeRTOS_DNS_Callback.c \
919+
./source/FreeRTOS_DNS_Networking.c \
920+
./source/FreeRTOS_DNS_Parser.c \
921+
./source/FreeRTOS_ICMP.c \
922+
./source/FreeRTOS_IP.c \
923+
./source/FreeRTOS_IP_Timers.c \
924+
./source/FreeRTOS_IP_Utils.c \
925+
./source/FreeRTOS_IPv4.c \
926+
./source/FreeRTOS_IPv4_Sockets.c \
927+
./source/FreeRTOS_IPv4_Utils.c \
928+
./source/FreeRTOS_IPv6.c \
929+
./source/FreeRTOS_IPv6_Sockets.c \
930+
./source/FreeRTOS_IPv6_Utils.c \
931+
./source/FreeRTOS_ND.c \
932+
./source/FreeRTOS_RA.c \
933+
./source/FreeRTOS_Routing.c \
934+
./source/FreeRTOS_Sockets.c \
935+
./source/FreeRTOS_Stream_Buffer.c \
936+
./source/FreeRTOS_TCP_IP.c \
937+
./source/FreeRTOS_TCP_IP_IPV4.c \
938+
./source/FreeRTOS_TCP_IP_IPV6.c \
939+
./source/FreeRTOS_TCP_Reception.c \
940+
./source/FreeRTOS_TCP_State_Handling.c \
941+
./source/FreeRTOS_TCP_State_Handling_IPV4.c \
942+
./source/FreeRTOS_TCP_State_Handling_IPV6.c \
943+
./source/FreeRTOS_TCP_Transmission.c \
944+
./source/FreeRTOS_TCP_Transmission_IPV4.c \
945+
./source/FreeRTOS_TCP_Transmission_IPV6.c \
946+
./source/FreeRTOS_TCP_Utils.c \
947+
./source/FreeRTOS_TCP_Utils_IPV4.c \
948+
./source/FreeRTOS_TCP_Utils_IPV6.c \
949+
./source/FreeRTOS_TCP_WIN.c \
950+
./source/FreeRTOS_Tiny_TCP.c \
951+
./source/FreeRTOS_UDP_IP.c \
952+
./source/FreeRTOS_UDP_IPv4.c \
953+
./source/FreeRTOS_UDP_IPv6.c \
926954

927955
# This tag can be used to specify the character encoding of the source files
928956
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -2338,7 +2366,17 @@ PREDEFINED = DOXYGEN=1 \
23382366
ipconfigDNS_USE_CALLBACKS=1 \
23392367
ipconfigSUPPORT_SELECT_FUNCTION=1 \
23402368
ipconfigUSE_TCP=1 \
2341-
ipconfigUSE_TCP_WIN=1
2369+
ipconfigUSE_TCP_WIN=1 \
2370+
ipconfigUSE_IPv4=1 \
2371+
ipconfigUSE_IPv6=1 \
2372+
ipconfigUSE_DHCPv6=1 \
2373+
ipconfigUSE_DNS_CACHE=1 \
2374+
ipconfigREPLY_TO_INCOMING_PINGS=1 \
2375+
ipconfigSUPPORT_OUTGOING_PINGS=1 \
2376+
ipconfigUSE_RA=1
2377+
2378+
2379+
23422380

23432381
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
23442382
# tag can be used to specify a list of macro names that should be expanded. The

manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name : "FreeRTOS-Plus-TCP"
2-
version: "V3.1.0"
2+
version: "V4.0.0-rc3"
33
description: "Thread safe FreeRTOS TCP/IP stack working on top of the FreeRTOS-Kernel to implement the TCP/IP protocol. Suitable for microcontrollers."
44
license: "MIT"
55
dependencies:

0 commit comments

Comments
 (0)