1
0
mirror of https://github.com/FreeRTOS/FreeRTOS-Plus-TCP synced 2025-10-23 01:18:54 +08:00
Commit Graph

217 Commits

Author SHA1 Message Date
kar-rahul-aws
41222595cd Add UT for FreeRTOS_DNS_Cache (#884)
* Add Ufor FreeRTOS_DNS_Cache

* Add UT for FreeRTOS_DNS_Cache

* Fix build error

* Fix coverage :100%
2023-05-31 17:33:38 +05:30
ActoryOu
ded3f24ff9 Add unit test cases for TCP_UTils_IPv6 (#876) 2023-05-26 17:06:18 +08:00
ActoryOu
a494eeacd1 [IPv6] Add Unit Test for FreeRTOS_TCP_State_Handling_IPV6 (#875)
* TCP_State_Handling_IPV6 basic UT framework

* Add input check in function.

* Add unit test for TCP_State_Handling_IPV6

* Update Monika's comment
2023-05-26 16:44:53 +08:00
ActoryOu
fc11e8c4cd [IPv6] Add Unit Test for FreeRTOS_TCP_State_Handling & FreeRTOS_TCP_State_Handling_IPV4 (#872)
* Add FreeRTOS_TCP_State_Handling_IPV4 UT framework

* Add test case description & file format

* prvHandleListen_IPV4

* prvHandleListen

* Fix UT description

* prvHandleListen_IPV4 full coverage

* prvHandleSynReceived

* full coverage

* Remove redundant include

* Code beautify

* Spelling

* File formatting

* Remove unnecessary buffer.
2023-05-26 10:13:19 +08:00
ActoryOu
7adc5c3955 [IPv6] Add Unit Test for FreeRTOS_Sockets & FreeRTOS_IPv4_Sockets. (#870)
* FreeRTOS_IPv4_Sockets UT framework

* Move test cases to IPv4_Sockets

* Fix failing test cases

* File format

* Add IPv6 test cases

* Fix generic API UT build warning

* Fix privates  API UT build warning

* Fix TCP API UT build warning

* Fix UDP API UT build warning

* more coverage

* Move IPv46 data structure to FreeRTOS_IP_Common.h

* FreeRTOS_recv

* Change pxTCPSocketLookup input structure

* pxTCPSocketLookup

* Full coverage

* Code beautify

* Remove redundant include

* Fix CI

* Fix comments

* Move static variable to global view

* Sockets: Move stub functions to _stubs.c

* Sockets_DiffConfig formatting

* Sockets_DiffConfig1 formatting

* Sockets_DiffConfig2 formatting

* IPv4_Sockets: formatting

* IPv4_Sockets: Formatting

* Fix coverity
2023-05-26 09:47:43 +08:00
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
Monika Singh
66f687c46e Add Unit Test Coverage for FreeRTOS_TCP_Transmission and FreeRTOS_TCP_Transmission_IPv4 (#874)
* Add coverage for TCP_Transmission

* 100% coverage Transmission.c

* Add coverage Transmission_IPV4

* Fix warnings

* Update comment

* Add more comments

* Fix uncrustify

* Spell checker fix

* Update format
2023-05-25 20:34:59 +05:30
ActoryOu
bc613e4585 [IPv6] Add Unit Test for FreeRTOS_IP_Utils/FreeRTOS_IPv4_Utils. (#868)
* pxDuplicateNetworkBufferWithDescriptor

* pxUDPPayloadBuffer_to_NetworkBuffer NULL

* Add IPv4 Utils

* Add description for unit test and separate IP_Utils/IPv4_Utils

* usGenerateProtocolChecksum

* prvChecksumProtocolCalculate

* Add description of test cases

* pxUDPPayloadBuffer_to_NetworkBuffer & prvProcessNetworkDownEvent & usGenerateProtocolChecksum

* usGenerateProtocolChecksum

* Full coverage

* Remove dedundant include

* Code beautify

* IPv4_Utils full coverage

* Remove redundant include in IPv4_Utils unit test

* Fix IPv4 UT building

* Fix spelling.

* Add macro for minimum TCP offset.

* Fix doxygen

* Fix again

* Move Stub functions to _stubs.c and fix compile warning

* Update diffconfig UT
2023-05-23 16:55:59 +08:00
ActoryOu
36173b61c3 [IPv6] Add Unit Test for FreeRTOS_UDP_IPv6. (#869)
* UDPv6 UT basic framework

* xProcessReceivedUDPPacket_IPv6: NULL socket

* xProcessReceivedUDPPacket_IPv6

* vProcessGeneratedUDPPacket_IPv6

* Code beautify

* Spelling
2023-05-23 09:40:10 +08:00
Monika Singh
3cec37a264 Add Unit Test for FreeRTOS_ND (#859)
* Initial changes

* First UT

* Run uncrustify

* Coverage

* Add more coverage

* Update

* Uncrustify: triggered by comment.

* Update spell check

---------

Co-authored-by: GitHub Action <action@github.com>
2023-05-21 21:11:24 +05:30
Monika Singh
61e929fe6d Add Unit Test for FreeRTOS_Bitconfig (#865)
* Initial Change

* Add UTs

* Remove macro file as it is not needed

* Initialise local vars

* Update comment
2023-05-18 15:02:13 +05:30
ActoryOu
fc86ef4183 [IPv6] Add Unit Test for FreeRTOS_Routing. (#845)
* Remove configUSE_CO_ROUTINES.

* Add unit test cases for FreeRTOS_Routing.

* Fix spelling.

* Remove useless test cases.

* Fix spelling again.

* Rename Routing UT folder

* Remove redundant test files.

* Toggle full coverage

* Code beautify

* Fix UT failing
2023-05-18 17:02:53 +08:00
Monika Singh
cb9410b571 Add Unit Test for FreeRTOS_RA (#830)
* Initial changes

* UT for vNDSendRouterSolicitation

* Remove unused/unreachable code

* Add UT for coverage

* 100% line coverage

* Enable test for RA

* Initialise values

* Update vDHCP_RATimerReload_Ignore to vDHCP_RATimerReload_ExpectAnyArgs

* Fix spell checker
2023-05-17 19:39:53 +05:30
ActoryOu
221d8b932d [IPv6] Add Unit Test for FreeRTOS_IP_Timers. (#863)
* Use endpoint's DHCP timer.

* Add test case description

* Remove useless check in MACRO

* Add test cases for xNetworkTimer and xCalculateSleepTime

* vCheckNetworkTimers

* Remove redundant header files

* full coverage

* Code beautify

* Fix spelling
2023-05-17 17:45:22 +08:00
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
ActoryOu
8c86e2be02 [IPv6] Add Unit Test for FreeRTOS_DHCPv6. (#857)
* Basic DHCPv6 UT framework.

* Add test cases for eGetDHCPv6State

* Add reset test case

* Add test cases for solicit happy path.

* Refine test flow

* Add test cases for advertise.

* Add final timeout & test case on waiting reply.

* Add DHCP address lease unit test case

* Add test case for socket creation failed.

* Disable debug print

* Fix coverage scan

* Add test cases for wrong msg type & transaction ID.

* Add more error handling case.

* Add test cases for prvIsOptionLengthValid

* Rename test case

* Add test case for prvDHCPv6_handleStatusCode

* Add test cases for vDHCPv6ProcessEndPoint_HandleReply

* Add test case for xDHCPv6ProcessEndPoint_HandleAdvertise

* Add test case for xDHCPv6ProcessEndPoint_HandleState

* Refine again.

* Refine again.

* Remove fall back function, not implemented for IPv6.

* Remove unnecessary check

* Add expect state mismatch test.

* Add test cases for create/close sockets.

* Add error handling and UT

* Ignore unknown sub-option.

* Add coverage for prvStateName

* Fix corner case for sub-option.

* Fix spelling & build

* Code beautify and remove unnecessary define

* Remove list_macros.h in DHCPv6 unit test.
2023-05-17 14:33:58 +08:00
ActoryOu
a9c6f266d7 [IPv6] Add Unit Test for FreeRTOS_IPv6. (#860)
* Add FreeRTOS_IPv6 unit test framework

* Add test cases for prvAllowIPPacketIPv6

* Add test cases for eHandleIPv6ExtensionHeaders

* Add test cases for IPv6 for first configuration

* AddIPv6 different configuration framework

* Add test cases for xCheckIPv6SizeFields
2023-05-16 12:31:13 +08:00
Tony Josi
ccd19885e9 Add unit tests for IPv6 Sockets and Code coverage (#861)
* FreeRTOS_Sockets_IPv6_utest setup and initial tests

* wip

* more tests till prv_ntop6_write_zeros

* adding more comments

* more unit tests

* covering all functions

* 100% UT coverage for IPv6_Sockets

* updating cmake file to includeew unit test and coverage

* fix formatting

* fix spell check

* fix review feedbacks

* fix review feedbacks
2023-05-16 09:17:53 +05:30
Tony Josi
1f98752059 Adding IPv4/v6 build level separation: integration branch (#855)
* use matching endpoint instead of first endpoint

* update with @htibosch  latest changes

* fix formatting

* fix misra and spellings

* code clean up

* wip separation IP

* separation IP

* separation IP

* wip buils separation

* fixing unit tests

* fix unit tests

* fix formatting

* wip , next prvProcessNetworkDownEvent

* adding build separation to ip utils

* fix unit tests

* fix formatting

* update xCheckRequiresARPResolution

* update vARPAgeCache

* update vARPAgeCache

* misra checks

* fix formatting

* fix misra

* wip s/w: FreeRTOS_recvfrom

* wip sockets till prvSocketBindAdd

* adding  build separation to FreeRTOS_Sockets.c

* add build config support to FreeRTOS_inet_pton FreeRTOS_inet_ntop FreeRTOS_GetIPType

* adding build config support

* fix build  issues

* check misra

* minor fix

* fix unit tests

* fix unit tests build

* Uncrustify: triggered by comment

* fix formatting

* build separate FreeRTOS_TCP_IP.c

* build separate FreeRTOS_TCP_Reception.c

* misra fix

* build separate FreeRTOS_TCP_State_Handling.c

* build separate FreeRTOS_TCP_Transmission.c

* build separate FreeRTOS_TCP_Transmission.c fix build

* adding build separation for FreeRTOS_TCP_Utils.c and FreeRTOS_TCP_Transmission.c

* fix formatting

* UDP: Build Separation Changes

Changes in UDP files to support IPv4 and IPv6 Build Separation.

* fix IPv4 build issues post build sep merge

* IPv4 only build

* more - fix IPv4 build issues post build sep merge

* fix DHCP v4

* fix v6 build

* add v6 build checks

* separate v4v6 tcp files

* fix rebase conflicts

* fix formatting

* fix build when TCP disabled

* add more build checks

* adding more ipv4 flags to v4 specific files

* fix udp unit tests

* add build config build tests to CI

* fix formatting

* fix build checks yml

* DNS: Build Separation Changes

Changes for supporting IPv4 and IPv6 build separation in DNS.

* Routing: Build Separtion Changes

Changes for supporting IPv4 and IPv6 build separation in Routing.

* DNS build fix and rebase to latest changes

* fix formatting

* fix unit tests

* fix formatting

* fix MISRA

* updaating ARP functions to be available on all configs

* plus_tcp_demo_cli build config changes

* fix formatting, guard FreeRTOS_FillEndPoint inside ipconfigUSE_IPv4 check

* more build sepration changes to routing

* build separation plus_tcp_demo_cli.c

* fixing issues with routing, fix formatting

* adding pxFindEndpoint of plus_tcp_demo_cli inside ipconfigUSE_IPv6 != 0 check

* minor build fix

* moving usDNSType of endpoint struct out of ipconfigUSE_IPv6 check

* update code to use IP family while using socket APIs

* moving vSetMultiCastIPv4MacAddress to FreeRTOS_IPv4_Utils.c

* fix routing

* build DNS only if IPv4 is enabled

* fix review feedback

* fix build

* fix build

* fix formatting

* fix comment

* fix wrt reeview feedback

* fix unit tests

* cleanup FreeRTOS_MatchingEndpoint

* fix FreeRTOS_MatchingEndpoint to handle cusstom frames

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: shubnil <103672514+shubnil@users.noreply.github.com>
2023-05-09 19:48:59 +05:30
Tony Josi
8fa0d6b86d Update IPv6 UDP endpoint selection (#853)
* use matching endpoint instead of first endpoint

* update with @htibosch  latest changes

* fix formatting

* fix misra and spellings

* code clean up
2023-05-02 09:38:00 +05:30
Hein Tibosch
af710fafbd dev/int: pass correct networkbuffer to vNDSendNeighbourSolicitation (#854) 2023-04-28 15:55:34 +05:30
ActoryOu
34e80ef043 Use endpoint's address as source. (#847) 2023-04-26 16:31:50 +08:00
Tony Josi
0ffcad5f62 supress coverity single use warning (#843) 2023-04-25 15:57:09 +05:30
Monika Singh
50d0ab3b21 Fix Coverity error (#841) 2023-04-21 10:54:51 -07:00
ActoryOu
082da9c33d [IPv6] added client DUID check back. (#838)
* Add client DUID check back.
2023-04-19 16:02:14 +08:00
Monika Singh
e219a77b40 Fix build error of unused parameters 2023-04-18 16:11:53 +00:00
Monika Singh
3cffc74ed7 Merge branch 'dev/IPv6_integration' into newdev 2023-04-18 21:34:18 +05:30
Hein Tibosch
afd6ffc425 dev/IPv6: DNS NBNS repaired and tested (#817)
* DNS NBNS repaired and tested

* Worked on spelling and called crustify

* Changed parameter to xApplicationDNSQueryHook()

* unit test didn't like the new asserts

* Replaced another assert

* Unit test DNS_Parser.c

* And uncrustify

* One more change to unit-testing

* Spelling

* Added a cast to when calling xApplicationDNSQueryHook()

---------

Co-authored-by: ActoryOu <jay2002824@gmail.com>
2023-04-18 21:30:30 +05:30
ActoryOu
b893d9c00e [IPv6] Check option length in DHCPv6. (#832)
* Add option length check.

* Check buffer boundary in option status code

* Reduce array size in prvDHCPv6_handleStatusCode.

* Cast structure type for xApplicationDHCPHook_Multi.

* Use IP_Address_t in DHCPMessage_IPv6_t and fix coverity.

---------

Co-authored-by: Monika Singh <108652024+moninom1@users.noreply.github.com>
2023-04-18 21:59:42 +08:00
Monika Singh
28d8431465 Merge branch 'dev/IPv6_integration' into dhcpv6CheckClientDUIDFinal 2023-04-18 17:34:34 +05:30
Tony Josi
d18fe9c2a2 Add NetworkDown notification to NetworkInterface.c [PR: #671] (#812)
* Add NetworkDown notification to EMAC task

* Add NetworkDown notification to NetworkInterface.c

* Uncrustify: triggered by comment.

* Introduce ipconfigSUPPORT_NETWORK_DOWN_EVENT compile flag

* Fix formatting

* Uncrustify: triggered by comment.

---------

Co-authored-by: Filip Oleszek <filip.oleszek@o2.pl>
Co-authored-by: zipperowiec <35423392+zipperowiec@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-04-18 11:00:00 +00:00
Monika Singh
a492abb0a8 Fix Additional Clang warnings
Corrects several warnings from Clang flags
for Clang 13.
2023-04-18 11:00:00 +00:00
Kody Stribrny
f15537303c Fix Clang warnings (#809)
Corrects several warnings from Clang flags
for Clang 13.

Inspired by @phelter's bug report
https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/issues/558
2023-04-18 11:00:00 +00:00
Monika Singh
7ac0b651f1 Fix build error 2023-04-18 11:00:00 +00:00
Kody Stribrny
ded3d27f62 Correct GCC warnings (#798)
* Correct GCC warnings

Corrects warnings with current GCC flags
for GCC 7.5.0. The only suppressed warning pertains
to function to object pointer conversion which is
required and common for socket callbacks.

* PR feedback

---------

Co-authored-by: Ubuntu <ubuntu@ip-10-0-137-67.ec2.internal>
Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
2023-04-18 11:00:00 +00:00
Paul Bartell
63fe99f9c6 FreeRTOS_IP.h: Fix build error introduced by 55658e1 in FreeRTOS-Kernel 2023-04-17 19:11:58 +00:00
ActoryOu
67b642623d Merge branch 'dev/IPv6_integration' into fixND 2023-04-14 19:31:55 +08:00
ActoryOu
df91d3281d Fix spelling 2023-04-14 11:19:59 +00:00
ActoryOu
f25b154e28 Fix build check. 2023-04-14 11:11:59 +00:00
ActoryOu
746feda908 Check DHCPv6 option length. 2023-04-14 11:02:46 +00:00
Hein Tibosch
c09528fd57 dev/IPv6: DHCPv6 repaired and tested (#826)
* DHCPv6 repaired and tested

* More changes

* Added entries to lexicon.txt

* Ran uncrustify on tools/tcp_utilities

* Formatting STM32Fxx

* Uncrusitfy tcp_mem_stats.c

* Remove trailing space

* I didn't mean to update the tcp_utilities directory yet

* Changes after Actory's review

* Replaced tabs with spaces

* Fix spelling.

* Changed the application hook for IPv6 and set the correct IPv6 defaults when failed

* Add a macro as maximum send buffer size.
* Fix formatting & build test.

* Replace xApplicationDHCPHook with xApplicationDHCPHook_Multi.

* Fix comments for xDNSServers & uxDNSCount.

* Fix ApplicationDHCPHook_Multi parameters.

---------

Co-authored-by: ActoryOu <jay2002824@gmail.com>
Co-authored-by: ActoryOu <ousc@amazon.com>
2023-04-14 18:24:54 +08:00
Nikhil Kamath
e71473740d Merge branch 'dev/IPv6_integration' into fixND 2023-04-12 15:54:00 +05:30
Tony Josi
3769b5839a fix warnings (#828)
Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
2023-04-12 15:53:10 +05:30
ActoryOu
c3f55cfc3d Merge branch 'dev/IPv6_integration' into fixND 2023-04-10 17:23:12 +08:00
ActoryOu
68561aae09 Reduce stack memory usage. 2023-04-10 09:15:37 +00:00
Tony Josi
9bb016e72e Fix warnings on IAR (#823)
* fix warnings when compiling on IAR

* Uncrustify: triggered by comment

* fix unit tests

---------

Co-authored-by: GitHub Action <action@github.com>
2023-04-10 13:47:22 +05:30
ActoryOu
8e7a3fe5a1 Check packet length for IPv6. (#811)
* Check IPv6 packet length.

* Fix unused compile warnings.

* Move xCheckSizeFields to static function and fix unit test cases.

* Add minimum length check for IPv6 transport layer.
2023-04-06 17:09:24 +08:00
ActoryOu
5e858325e5 [IPv6] Fix IPv4 TCP. (#813)
* Compare endpoint IP address in TCP.

* Replace ipLOCAL_IP_ADDRESS_POINTER with endpoint.

* Set ipLOCAL_IP_ADDRESS_POINTER in DHCP/network down events.

* Check endpoint in DNS_TreatNBNS.

* Fix MISRA.

* Remove DNS_Parser part.
2023-04-06 16:15:50 +08:00
ActoryOu
acb8e2eea1 [IPv6] Check unspecified/loopback/multicast reserved/matching addresses in prvAllowIPPacketIPv6. (#805)
* Check IPv6 multicast address and loopback address.

* Check FF02::1 more specific in xCompareIPv6_Address.

* Fix multicast checking for predefined multicast address.

* Check FF02::1 more specific in xCompareIPv6_Address.

* Handle unspecified IPv6 address.

* Fix coverity scan

* Fix doxygen

* Fix comments.

* Fix build.
2023-04-06 16:02:46 +08:00
kar-rahul-aws
8caca5f1ad WIP : Adding Update_MACAddr function to support Network Interface (#779)
* Adding Update_MACAddr function to support Network Interface

* Changing the backward compatible flag
2023-04-03 12:21:21 +05:30