1
0
mirror of https://github.com/FreeRTOS/FreeRTOS-Plus-TCP synced 2025-10-24 03:32:36 +08:00
Commit Graph

25 Commits

Author SHA1 Message Date
Monika Singh
1496d573ab Add Unit Test for FreeRTOS_TCP_Transmission_IPV6 (#871)
* Initial changes

* In between changes

* Add UTs

* Add UTs

* Fix spell check and uncrustify
2023-05-25 21:28:29 +05:30
ActoryOu
31c7a360a9 [IPv6] Add Unit Test for FreeRTOS_IP/FreeRTOS_IPv4. (#862)
* Add network down test in prvIPTask

* Align IP test configurations

* Remove redundant define check

* Fix unit test cases

* Fix stubs in some UT

* Add test cases for DHCPv6 and backward compatible

* Add test cases for FreeRTOS_GetUDPPayloadBuffer_Multi IPv6

* Test case for FreeRTOS_IPInit_Multi

* FreeRTOS_ReleaseUDPPayloadBuffer

* FreeRTOS_GetEndPointConfiguration

* FreeRTOS_GetAddressConfiguration

* FreeRTOS_GetEndPointConfiguration

* FreeRTOS_SetEndPointConfiguration

* FreeRTOS_GetAddressConfiguration

* Fix UT

* eConsiderFrameForProcessing

* prvProcessIPPacket

* vReturnEthernetFrame

* FreeRTOS_GetIPAddress

* Move IPv4 test under IPv4.

* Move IPv4 unit test cases from IP folders to IPv4 folders.

* prvProcessIPPacket

* vReturnEthernetFrame

* FreeRTOS_GetIPAddress

* FreeRTOS_IsNetworkUp

* FreeRTOS_AllEndPointsUp

* uxIPHeaderSizeSocket

* IP coverage

* FreeRTOS_SetIPAddress

* FreeRTOS_GetGatewayAddress

* FreeRTOS_GetDNSServerAddress

* FreeRTOS_GetNetmask

* FreeRTOS_UpdateMACAddress

* FreeRTOS_GetMACAddress

* FreeRTOS_SetNetmask

* FreeRTOS_SetGatewayAddress

* FreeRTOS_GetUDPPayloadBuffer_Multi

* IP coverage

* Code beautify

* prvAllowIPPacketIPv4

* prvCheckIP4HeaderOptions

* Remove legacy ipLOCAL_IP_ADDRESS_POINTER

* Add descriptions for IP test cases

* Remove redundant includes in test files.

* Add test description for IPv4 unit test

* Remove unnecessary config change

* Code beautify.

* Spelling

* Fix UT
2023-05-17 15:02:55 +08:00
Tony Josi
d8fc3200a2 Add backward compatibility with main branch with ipconfigIPv4_BACKWARD_COMPATIBLE (#756)
* add FreeRTOS_GetAddressConfiguration and FreeRTOS_SetAddressConfiguration

* renaming FreeRTOS_GetUDPPayloadBuffer_ByIPType to FreeRTOS_GetUDPPayloadBuffer_Multi

* adding ipconfigIPv4_BACKWARD_COMPATIBLE to all main branch APIs that got changed except hooks

* rename vApplicationIPNetworkEventHook to vApplicationIPNetworkEventHook_Multi when ipconfigIPv4_BACKWARD_COMPATIBLE is disabled

* renaming xApplicationDNSQueryHook to xApplicationDNSQueryHook_Multi when ipconfigIPv4_BACKWARD_COMPATIBLE is disabled

* Uncrustify: triggered by comment

* fix DNS_ParseDNSReply complexity issue

* Uncrustify: triggered by comment

* replacing with ipconfigIPv4_BACKWARD_COMPATIBLE flag

* minor unit test fix

---------

Co-authored-by: GitHub Action <action@github.com>
2023-03-07 20:55:27 +05:30
kar-rahul-aws
ab881bfeac Portable layer changes (#701)
* Update NetworkInterface.c

* Update NetworkInterface.c

* Update NetworkInterface.c

* Update x_emacpsif_dma.c

* Update NetworkInterface.c

* Update NetworkInterface_eth.c

* Update NetworkInterface.c

* Uncrustify: triggered by comment.

* Update FreeRTOS_DNS_Cache.c

* Update NetworkInterface.c

* Update NetworkInterface.c

* Update NetworkInterface.c

* Update FreeRTOS_DNS_Parser.c

* Update FreeRTOS_DNS_Parser.c

* Update NetworkInterface.c

* Update uncached_memory.c

* Update x_emacpsif.h

* Update x_emacpsif_dma.c

* Update x_emacpsif_hw.c

* Update x_emacpsif_physpeed.c

* Update x_topology.h

---------

Co-authored-by: GitHub Action <action@github.com>
2023-02-10 19:14:23 +05:30
Tony Josi
0639fd45a0 Fix unit test build issues and test failures for IP Utils (#699)
* Fix seg fault

* Remove ipconfigUSE_IPV6

* Add change for FreeRTOS_IP_Utils unit test case

* Fix  comments

* Uncrustify: triggered by comment.

* Fixed build issue with IP utils unit test build.

* Removed calculation of checksum being done twice for debug printf

---------

Co-authored-by: Monika Singh <moninom@amazon.com>
Co-authored-by: Monika Singh <108652024+moninom1@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-02-07 10:19:09 +05:30
Monika Singh
0490d89319 Add Protocol Testing fixes (#694)
* Fix compilation and add Protocol testing fixes

* Update debug function with correct config flag
2023-01-31 21:56:54 +05:30
Tony Josi
937ac3b50a Fix unit test build issues and test failures for ARP, TCP, UDP (#682)
* WIP

* Fixed ARP, with 2 test cases pending which requires src changes which are not priority. Fixed TCP and UDP test cases.

* return value of xProcessReceivedUDPPacket initialized to pdFAIL
2023-01-30 09:43:30 +05:30
Tony Josi
ac1fdae585 Fixed failing test cases for TCP transmission unit tests (#672)
* Fixed minor issue with build

* Fix minor compilation error with latest unit test changes

* WIP

* Fixed failing tcp transmission unit tests

* Undo commenting few test cases that were commented by mistake

* Fix PR review comments
2023-01-24 16:11:15 +05:30
Monika Singh
7315e4b3ba Fix FreeRTOS_IP test cases (#666)
* Fix FreeRTOS_IP and FreeRTOS_IP_DiffConfig test cases
* Remove test_prvProcessIPEventsAndTimers_eNetworkDownEvent test Case
 - eNetworkDownEvent no longer support xNetworkUp variable, the network status
is kept in pxEndPoint->bits.bEndPointUp.
* Run Uncrustify.

Co-authored-by: GitHub Action <action@github.com>
2023-01-16 21:07:57 +05:30
Tony Josi
e8bec09103 Fix tcp transmission test cases (#657)
* WIP fix tcp transmission utests

* WIP fixing failing test cases for TCP transmission unittests

* Fix issue with tcp test case arguments getting changed when passed to functions

* Fixed failing unit tests for TCP transmission unit tests
2023-01-06 12:35:29 +05:30
kar-rahul-aws
306445517e Update Portable Folder for End Point changes (#602)
Added changes in WinpCap Port for IPV4 Endpoint changes
* Update NetworkInterface.c/NetworkInterface.h with End point changes.
* Run uncrustify

Co-authored-by: GitHub Action <action@github.com>
2022-12-16 12:17:38 +05:30
xuelix
f29870920d Fixing MISRA violation for FreeRTOS_IP*, FreeRTOS_DHCP* (#604)
* Fixing MISRA violation for FreeRTOS_IP*, FreeRTOS_DHCP*
* remove temp change
2022-12-14 09:19:08 +05:30
Tony Josi
4841b83def Build fix for unit tests for sockets - ipv4 (#600)
* Fix basic build issue
* Fixed builds issues with the sockets unit tests

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
2022-12-09 11:16:59 +05:30
Paul Bartell
5c845eae4d Remove references to 1200 byte MTU
Setting an MTU below 1500 bytes is very likely to cause interoperability
issues with devices that have a different MTU in the same broadcast domain.
2022-09-13 10:16:33 -07:00
Aniruddha Kanhere
1ab6eb8885 Update version numbers and licensing info (#541)
* Update source location for coverity

* Add coverage checker

* Add build check with default configuration

* Fix build combination and DNS error

* uncrustified and fixed cmakelists

* This commit updates version number in all files to Development-Branch

* Update version number macros

* This commit fixes a typo in version number macro

* Added a 'critical section' to prevent a race condition in stream buffers

* Uncrustify: triggered by comment.

* Fixed unit-tests by adding mocked functions

* Initial commit of file README.md

* Update README.md

* Fix the title of README file in coverity

* Addressed issue comments

* Update command

* Add details about remaining exception

* Move file to original location

* Remove use of sudo in commands

* Fix links; added coverity version note

* Update README.md

* Remove CMake installation instructions

* Update manifest/history and copyright year

* Update kernel version to 10.4.5

* Update remaining copyright year instances

* Update the version number macros

* Update license header titles

* Remove kernel license header and add TCP header

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2022-08-12 16:21:44 -07:00
Aniruddha Kanhere
a4124602cc Merge changes to main.
This commit brings in the refactoring and restructuring changes
from IntegrationTesting1 branch to the main branch.
It also includes additional unit tests for 100% coverage.
The rationale behind not creating a PR is that the conflicts were too
huge to be resolved correctly. Thus, a force push to the main branch is
being done.
2022-05-26 12:42:45 -07:00
Aniruddha Kanhere
de36c605a8 Update version number, history, and kernel submodule pointer (#328)
* Update the history.txt

* Update version numbers

* Update copyright year

* Add one more fix for copyright

* Update Kernel pointer
2021-09-14 14:04:55 -07:00
Aniruddha Kanhere
89df2bb4f8 Add UDP_IP unit-tests (#234)
* 100% coverage

* Fix broken build

* Add default file back

* Remove default file

* Fix some checks

* Update after review comments

* Update v2 and added comments for tests.

* Fixed checks

* Update: added asserts
2021-05-07 12:15:57 -07:00
Aniruddha Kanhere
d0349790cb DHCP unit test (#211)
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
2021-03-26 15:49:30 -07:00
Aniruddha Kanhere
d6ed4473d3 Add unit-tests for FreeRTOS_ARP.c (#209)
* Fix compiler warnings when the TCP Window is not used (#124)

* Fix warnings when TCP window is not used

* Uncrustify

* Move local variables to inner loop in prvNetworkInterfaceInput() (#144)

Co-authored-by: Hein Tibosch <hein@htibosch.net>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Update litani submodule (#147)

Co-authored-by: Mark R. Tuttle <mrtuttle@amazon.com>

* Fix doxygen check (#149)

* Update doxygen version

* update the config file

* TCP_WIN: fix compile warning on x86_64 (#148)

* TCP_WIN: fix compile warning on x86_64

Fix the following warning when building for 64 bit:

warning: conversion from ‘long unsigned int’ to ‘uint32_t’ {aka ‘unsigned int’} changes value from ‘18446744073709551615’ to ‘4294967295’ [-Woverflow]
             uint32_t ulReturn = ~0UL;
                                 ^

* Update FreeRTOS_TCP_WIN.c

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

Co-authored-by: Thomas Pedersen <thomas@adapt-ip.com>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* fix deprecated volatile compound assignment (#152)

* fixed deprecated volatile compound assignment

C++20 deprecates some undefined or unclear use cases of 'volatile' like
compound assignments and compliant compilers warn about those deprecated
operations.

In vStreamBufferMoveMid the deprecated compound assignment and other
direct accesses to volatile 'StreamBuffer_t->uxMid' is replaced using a
local variable stored back when done.

* Uncrustify

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
Co-authored-by: Aniruddha Kanhere <kanherea@amazon.com>

* FreeRTOS_ARP.c : store local addresses only (#120)

* FreeRTOS_ARP.c : store local addresses only

* Added the function xARPWaitResolution()

* Added an entry to lexicon.txt.

* Ran Uncrustify

* Update unit test file

* Update

* Declared xARPWaitResolution() in FreeRTOS_IP.h

* Compare the result of xIsCallingFromIPTask() with pdFALSE in stead of 0

Co-authored-by: Hein Tibosch <hein@htibosch.net>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
Co-authored-by: Aniruddha Kanhere <kanherea@amazon.com>

* Remove unnecessary #ifndef (#186)

* Add entropy

* remove warning

* Remove unnecessary ifndef

* Remove unwanted changes

* Don't Fragment Flags patch. (#179)

* Moves all IP flag defines in FreeRTOS_IP_Private.h so that they are accessible to all protocols
Adds definitions for the IP fragmentation flags
Modifies the fragmentation check for incoming frames to drop both the first and later fragments.
Sets the "don't fragment" flag for all outgoing IP frames ( ICMP, DNS, UDP, TCP )
Removes ipGET_UDP_PAYLOAD_OFFSET_FOR_FRAGMENT as it appears obsolete. The stack never outputs fragments.

* Uncrustified

* Uncrustify

* Fixes the fragment offset and fragmentation flags masks ( 0x0FFF and 0xF000 -> 0x1FFF and 0xE000 )
Adds a configuration define ( ipconfigADVERTISE_DONT_FRAGMENT_FLAG ) as suggested by htibosch with a default value of zero for backwards compatibility
Updates the comment that explains the discarding of incoming fragments as discussed with Aniruddha Kanhere

* Adds the 'U' qualifier as requested by hs2gh
fixes a typo in FreeRTOSIPConfigDefaults.h

* Shortens the comment in FreeRTOSIPConfigDefaults as per htibosch's suggestion.

* Renames ipconfigADVERTISE_DONT_FRAGMENT to ipconfigFORCE_IP_DONT_FRAGMENT

* same as last commit, simply forgot to save this before pushing.

Co-authored-by: Emil Popov <epopov@cardinalkinetic.com>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* fix IP buffer padding check on 64bit (#146)

* fix IP buffer padding check on 64bit

On 64 bit systems, FreeRTOS_IPInit() would assert
ipconfigBUFFER_PADDING was equal to 14 to "make sure there
is enough space in pucEthernetBuffer to store a pointer."

This prevents the driver from requesting additional
padding, so make the assert greater than or equal to 14.

Also use the final ipBUFFER_PADDING value instead of
ipconfigBUFFER_PADDING, which is probably what was
intended?

* Update after comments

Co-authored-by: Thomas Pedersen <thomas@adapt-ip.com>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Update readme.md (#189)

Just fixing the "table of 3 types of STH32H7" so that it renders in github webpage.  I had a tough time reading that table until I looked at the md source.
You could also just put code fences around it:
~~~
/**
 * RAM area	H747	H743	H742	Location
 * ------------------------------------------------
 * DTCM		128k	128k	128k	0x20000000
 * AXI-SRAM	511k	511k	384k	0x24000000
 *
 * SRAM1	128k	128k	32k		0x30000000
 * SRAM2	128k	128k	16k		0x30020000
 * SRAM3	32k		32k	 	-		0x30040000
 * SRAM4	64k		64k		64k		0x38000000
 * Backup   SRAM	4k		4k	4k	0x38800000
 */
~~~

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Update files referencing aws_application_version.h to use iot_application_version.h (#188)

* Update files referencing aws_application_version.h to use iot_application_version.h

* Remove pic32 ethernet _Command_Version function to remove dependency on iot_application_version.h from amazon-freertos repository.

* Remove function defs from header files (#190)

* Add entropy

* remove warning

* Remove function defs from headers

* Some corrections

* More fixes and uncrustify

* Remove the BaseType min function

* Doxygen

* Fix one CBMC proof

* More cbmc proof fixes

* More cbmc fixes

* Some doxygen additions

* Update last CBMC proof

* Doxygen comments

* Doxygen updates

* Doxygen and spell check

* Spell check and unit-test

* Unit test fix

* Update after comments

* Update 2 after comments

* Move function around

* Uncrustify

* Update after comments

Co-authored-by: Gary Wicker <14828980+gkwicker@users.noreply.github.com>

* Do not release a network buffer if it equals to NULL (#191)

Co-authored-by: Hein Tibosch <hein@htibosch.net>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Circumvent Qemu MPS2 networking bug (#142)

* Add support for MPS2 networking with lan9118/lan9220

* Fix uncrustify errors

* Enable network interrupt handling

* Add network interrupt support to Qemu MPS2 AN385

* Fix function comment

* Fix Uncrustify errors

* Fix Uncrustify errors

* Fix Uncrustify Errors

* Fix typo

* Cirumvent Qemu MPS2 network bug

* Remove commented code, add doxygen comment

* Add a project for static analysis (#195)

* Add entropy

* remove warning

* Remove unwanted changes

* Update tcp_mem_stats.c

* Add Coverity

* Remove unused files

* Add some features

* clean up

* More clean up

* Unwanted additions removal

* Clean up

* Add 32-bit compile option

* Update after comments

* Uncrustify

* Create uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Update uncrustify.yml

* Add header in the socket file

* Remove unwanted file

* remove unwanted changes

* First commit

* Cleanup

* Update: working version

* Coverage of eARPGetCacheEntry

* Update

* Unit-test and clenaup

* 100% line and function coverage

* Uncrustify and update

* 100% all coverage

* Move files to correct location

* Fix tests

* uncrustified

* Update ci.yml

* Update

* uncrustify and update after Hein's comments

* Empty commit

* Clenaup after @yanjos-dev's review

* Update CI

* Cleanup - pass 1

* Remove gdb

* Uncrustify

* Remove litani changes

* Clean up

* Uncrustify

Co-authored-by: Hein Tibosch <hein_tibosch@yahoo.es>
Co-authored-by: Hein Tibosch <hein@htibosch.net>
Co-authored-by: Mark Tuttle <tuttle@acm.org>
Co-authored-by: Mark R. Tuttle <mrtuttle@amazon.com>
Co-authored-by: Thomas Pedersen <thomas@ibsgaard.io>
Co-authored-by: Thomas Pedersen <thomas@adapt-ip.com>
Co-authored-by: Hartmut Schaefer <hs2gh@users.noreply.github.com>
Co-authored-by: evpopov <evpopov@gmail.com>
Co-authored-by: Emil Popov <epopov@cardinalkinetic.com>
Co-authored-by: shrewmouse1 <34042878+shrewmouse1@users.noreply.github.com>
Co-authored-by: Paul Bartell <paul.bartell@gmail.com>
Co-authored-by: Gary Wicker <14828980+gkwicker@users.noreply.github.com>
Co-authored-by: alfred gedeon <28123637+alfred2g@users.noreply.github.com>
2021-03-23 10:55:44 -07:00
Aniruddha Kanhere
9d15770091 Uncrustify (#44)
* Create manifest.yml

* Remove trailing whitespace

* Update manifest.yml

* Corrected a typo

* Uncrustify C files

* Uncrustify header files

* Update ci.yml

* Update ci.yml

* Uncrustify with version 0.67

* Spelling corrections
2020-10-23 22:01:24 -07:00
AniruddhaKanhere
7f893fe198 Uncrustify v1 2020-10-01 08:32:11 -07:00
Aniruddha Kanhere
93a7c39a0c Update the copyright notice 2020-09-30 14:42:34 -04:00
AniruddhaKanhere
cf2b8ccc07 CMake working setup 2020-09-14 16:57:45 -07:00
AniruddhaKanhere
820b8d7921 add cmake and submodule kernel 2020-09-14 11:53:10 -07:00