1
0
mirror of https://github.com/FreeRTOS/FreeRTOS-Plus-TCP synced 2025-10-21 15:10:39 +08:00
Commit Graph

25 Commits

Author SHA1 Message Date
Monika Singh
c8d98d443b Fix MISRA issue (#1049)
Fix following MISRA issues :

MISRA Rule 8_5 : Symbol "FreeRTOS_inet_ntop6" is declared more than once.
MISRA Rule 8_9 : Symbol "FreeRTOS_in6addr_loopback" should be defined at block scope.
MISRA Rule 8_8 : missing static storage modifier for "prvCloseDHCPSocket" which has internal linkage.
MISRA Rule 9_1 : Using uninitialized value "xRemoteIP.xIs_IPv6" when calling "pxTCPSocketLookup".
MISRA Rule 9_1 : Using uninitialized value "pxAddress->sin_family" when calling "prvSocketBindAdd".
MISRA Rule 11_3 : A cast shall not be performed between two pointer of different object type.
MISRA Rule 12_1 : Missing parentheses on sub-expression of the operator.
MISRA Rule 14.4 : The condition expression 0 does not have an essentially boolean type
MISRA Rule 15_6 : The body of the "then" branch of the "if" statement is not a compound statement.
MISRA Rule 17_7 : The return value of a non-void function "memset" is unused.
MISRA Rule 20_5 : Using "#undef".
MISRA Rule 20_10 : Use of "#" or "##" preprocessor operator.
MISRA Rule 21_1 : Defining or undefining a reserved name "_static", which is an identifier or macro name beginning with an underscore.
MISRA Rule 21_15 : Calling function "memcmp" with incompatible types "void " and "uint8_t const ()[6]".
2023-12-08 10:37:49 +05:30
Hein Tibosch
160fa292b8 Check minimum size of ICMPv6 packets (#994)
* Not all ICMPv6 packets have the same minimum length

* More precise length checking

* Repaired unit tests / coverage

* Running uncrustify

---------

Co-authored-by: Tony Josi <tonyjosi@amazon.com>
Co-authored-by: ActoryOu <jay2002824@gmail.com>
Co-authored-by: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com>
Co-authored-by: Monika Singh <moninom@amazon.com>
2023-10-06 16:36:10 +05:30
Hein Tibosch
16a74c3ae9 Preparing library to use loopback device (#1020)
* Preparing library to use loopback device

* Repaired FreeRTOS_AddEndPoint() as well

* Minor changes for Doxygen

* Uncrustify: triggered by comment.

* Added IPv6.h and removed call to xIsIPv6Loopback

* Conditional compilation of xIPv6_GetIPType()

* Do not call xBadIPv4Loopback() when IPv4 is not enabled

* Repaired unit tests

* In FreeRTOS_AddEndPoint(), set next to NULL

* One more change in FreeRTOS_AddNetworkInterface()

* FreeRTOS_FillEndPoint: save pxNext before clearing entire endpoint struct

* Uncrustify: triggered by comment.

* Changes after review by Shub

* Changes after review by Shub, part 2

* Uncrustify: triggered by comment.

* Replace pxUDPPacket with pxIPacket in function prvAllowIPPacketIPv4()

* utest: replace xIPv6UnspecifiedAddress with FreeRTOS_in6addr_any

* Checked unit-tests and coverage

* ut: Repaired GetIPType loopback test

* Update test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOS_IPv6_ConfigDriverCheckChecksum_stubs.c

Co-authored-by: ActoryOu <jay2002824@gmail.com>

* Update test/unit-test/FreeRTOS_IPv6/ut.cmake

Co-authored-by: ActoryOu <jay2002824@gmail.com>

* Remove test for 'ipIPv4_FRAME_TYPE'

* Repairing tu again

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Monika Singh <moninom@amazon.com>
Co-authored-by: Tony Josi <tonyjosi@amazon.com>
Co-authored-by: ActoryOu <jay2002824@gmail.com>
2023-10-06 16:27:45 +05:30
Soren Ptak
eed294c0ec CI-CD Updates (#1014)
* Use new version of CI-CD Actions,  checkout@v3 instead of checkout@v2 on all jobs
* Use cSpell spell check, and use ubuntu-20.04 for formatting check
* Add in bot formatting action
2023-09-05 14:31:24 -07:00
Monika Singh
b23fa86ac4 Add and fix -Wconversion errors (#980)
* Fix Wconverstion

* Enable Wconversion warning

* Add fix

* Fix MISRA

* Fix coverity

* Add comments
2023-07-27 15:56:36 +05:30
ActoryOu
dd9a203249 [IPv6] Fix checksum calculation of IPv6 with extension headers. (#952)
* Fix IPv6 checksum calculation

* Use HW support option to see if we need to calculate TX checksum on NS/NA/RS packets.
2023-07-11 10:52:03 +08:00
ActoryOu
63651d05b1 Revert length check in IPv6 RX packets (#941) 2023-06-28 18:10:29 +08:00
ActoryOu
a04227d385 [IPv6] Allow buffer length to be greater than IP packet in IPv6. (#927)
* Allow buffer data^Cength to be more than IP packets

* Fix UT

* Use MACRO instead to represent payload length

---------

Co-authored-by: Tony Josi <tonyjosi@amazon.com>
2023-06-22 17:49:41 +05:30
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
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
Monika Singh
3cffc74ed7 Merge branch 'dev/IPv6_integration' into newdev 2023-04-18 21:34:18 +05:30
Monika Singh
a492abb0a8 Fix Additional Clang warnings
Corrects several warnings from Clang flags
for Clang 13.
2023-04-18 11:00:00 +00:00
ActoryOu
68561aae09 Reduce stack memory usage. 2023-04-10 09:15:37 +00:00
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
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
Tony Josi
366ff19d7f [IPv6] Verify options order in IPv6 Extension Headers (#802)
* Fix test 1 and 2 of the IPv6 destination opts protocol tests

* fixing spelling

* uncrustify yml fix (#815)

* fix uncrustify run command

* fix formatting
2023-03-31 10:08:50 +05:30
Tony Josi
89269454b9 CMake changes from main branch [PR: #557, PR: #742] (#803)
* 556 Initial Cmake Module definition. #557

* renaming variables that have conflicting names with MSC and *nix headers

* fix build issue for posix port

* Fix warning: -Waddress-of-packed-member when calculating checksum directly from network packets

* fix warnings with prvInitialiseTCPFields declaration

* removing macros that hides the structure fields

* Updating build check enable all config to enable all config macros

* CMake: Fix GIT_REPOSITORY and GIT_TAG (#742)

* moving ipTRUE_BOOL and ipFALSE_BOOL out of #ifndef pdTRUE_SIGNED check as they are not defined in kernel

* minor fix to the cmake files and main file

* Uncrustify: triggered by comment.

* adding doxygen comments to new functions

* Uncrustify: triggered by comment

* Add more warnings check and fix warnings

* Uncrustify: triggered by comment

* fix review feedback and more debug printf warnings fix

* more warnings fix

* fix misra issues

* Uncrustify: triggered by comment

* replace sin_addr with sin_address.ulIP_IPv4 in +TCP demos

* replace sin_addr6 with sin_address.xIP_IPv6 in +TCP demos

* replace freertos_sockaddr6 with freertos_sockaddr in +TCP demos

* review feedback changes

* removing duplicate def for prvStreamBufferAdd from winpcap

* fix more warnings from MSVC

* Uncrustify: triggered by comment

* review feedback changes

* Uncrustify: triggered by comment

---------

Co-authored-by: phelter <paulheltera@gmail.com>
Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2023-03-27 10:52:02 +05:30
Monika Singh
9a955f27ac Add changes for Coverity fix (#729)
* Fix Coverity issues

* Fix Misra 4.4 violation:The comment resembles a code snippet

* Misra: Rule 10.4 violations

* Misra: Rule 11.8 violations

* Misra: Rule 12.1 violations

* Misra: Rule 8.2, 8.4, 8.5, and 8.9 violations

* Misra: Rule 5.3, 5.8, 21.1 and 21.2  violations

* Misra: Rule 5.7 violations

* Misra: Rule 8.3 violations

* Misra: Rule Reverse NULL violations

* Misra: Rule 10.3, 10.8 and 8.13 violations

* Fix 11.3 and suppress 11.4

* Misra: Rule 14.3, 15.7, 17.2 and 17.7 violations

* Misra: Rule 2.2 and 2.7 violation

* Misra: Rule 21.6, 8.5 and 8.13 violation

* Fix UT compilation

* Update comments

* Fix Spell checker

* Update snprintf
2023-02-28 12:55:20 +05:30
Tony Josi
0e9628796c Fixing doxygen comments (#728)
* updating doxygen config

* fixing doxygen comments

* adding IPv6 files and fixing comments

* fix doxygen cfg and file names in comments

* wip doxygen v6 docs

* adding doxygen comments

* include RA src file to doxgendocs generation

* fix spell check issues

* Uncrustify: triggered by comment.

* fix minor build issue

* fix spell check issues

* Uncrustify: triggered by comment

* fix trailing white space

* Dev integration hein.v8 (#738)

* Updating tcp utilities

* Some more change in dev_integration_hein.v8

* In FreeRTOS_DNS_Parser.c : use 'ipUDP_PAYLOAD_OFFSET_IPv4' in stead of 'ipIP_PAYLOAD_OFFSET'

* And a few more corrections

* Changes to WinPCap network interface, removed debugging code

* After applying uncrustify

* Oops, I forgot the push changes in include files.

* Now removing it, hopefully

---------

Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
Co-authored-by: Monika Singh <108652024+moninom1@users.noreply.github.com>

* Fix CBMC proofs for DNS (#718)

* Use CBMC XML output to enable VSCode debugger (#673)

Prior to this commit, CBMC would emit logging information in plain text
format, which does not contain information required for the CBMC VSCode
debugger. This commit makes CBMC use XML instead of plain text.

Co-authored-by: Mark Tuttle <tuttle@acm.org>

* wip

* wip DNSgetHostByName

* wip DNSgetHostByName

* fixed cbmc proof for DNS_ReadNameField

* wip DNSgetHostByName_a_harness

* Fix CBMC prooff for DNSgetHostByName

* wip fix DNSgetHostByName_a CBMC proof

* fixed cbmc target func not called issue in DNSclear

* fixed cbmc target func not called issue in DNSlookup

* fix DNSgetHostByName_a CBMC proof

* update comments

* more asserts

* fixing formatting

* updating as per review comments

* fix dns after review comments

* adding more asserts

* adds more asserts

* minor fix

* fixing comments

* fixing comments

* fixing minor issue

* fixing DNS_ReadReply() signature

* making code more consistant

* adding more  asserts

* making code more consistent

---------

Co-authored-by: Kareem Khazem <karkhaz@amazon.com>
Co-authored-by: Mark Tuttle <tuttle@acm.org>

* Uncrustify: triggered by comment

* fixing formatting

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Hein Tibosch <hein_tibosch@yahoo.es>
Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
Co-authored-by: Monika Singh <108652024+moninom1@users.noreply.github.com>
Co-authored-by: Kareem Khazem <karkhaz@amazon.com>
Co-authored-by: Mark Tuttle <tuttle@acm.org>
2023-02-24 13:58:53 +05:30
Hein Tibosch
ff11a1484a Dev integration hein.v8 (#738)
* Updating tcp utilities

* Some more change in dev_integration_hein.v8

* In FreeRTOS_DNS_Parser.c : use 'ipUDP_PAYLOAD_OFFSET_IPv4' in stead of 'ipIP_PAYLOAD_OFFSET'

* And a few more corrections

* Changes to WinPCap network interface, removed debugging code

* After applying uncrustify

* Oops, I forgot the push changes in include files.

* Now removing it, hopefully

---------

Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
Co-authored-by: Monika Singh <108652024+moninom1@users.noreply.github.com>
2023-02-23 14:50:27 +05:30
Hein Tibosch
f88dea60ca Reparations and recommendations for the dev/IPv6_integration branch (#664)
* Reparations and recommendations for the dev/IPv6_integration branch
* Applied uncrustify
* More changes after testing ARP, ICMP4, ICMP6, UDPv4 and UDPv6, DNSv6
* A few changes to DNS after testing it
2023-01-25 18:33:44 +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
Monika Singh
1d3f1a4e88 Add endpoint changes to DHCP files (#593)
* DHCP.c changes and compilation fix
* Update end point changes
* Run uncrustify
2022-12-08 11:30:24 +05:30
Monika Singh
96643cedf1 Add IPv6 data path and endpoint changes to FreeRTOS_IP.c (#591)
* Add IPv6 data path and endpoint changes to FreeRTOS_IP.c
* Add FreeRTOS_IPv4.h and FreeRTOS_IPv6.h files.
* Fix compilation issues and run Uncrustify
2022-12-06 11:59:32 +05:30