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

35 Commits

Author SHA1 Message Date
Monika Singh
574b646147 Fix Clang warnings (#984)
* CMAKe update

* Fix Wdocumentation errors

* Fix Wconditional-uninitialized

* Fix [-Wformat-pedantic

* Fix Wcompound-token-split-by-space and Wgnu-statement-expression

* Add suppression

* Uncrustify: triggered by comment.

* Fix coverity

---------

Co-authored-by: GitHub Action <action@github.com>
2023-07-28 10:25:24 +05:30
Hein Tibosch
929a658fbd IPv4/single: some minor comments after the MISRA changes (#531)
* IPv4/single: some minor comments after the MISRA changes

* Added the "V" in the version macro

* Corrected the call to memset()

* Update source/FreeRTOS_DNS_Networking.c

Aniruddha suggestion to clear uxPayloadXXX when recv() failed

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

* Undo the change to the macro ipFR_TCP_VERSION_NUMBER

* Remove redundant variablein DNS_Networking.c.

---------

Co-authored-by: Hein Tibosch <hein@htibosch.net>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
Co-authored-by: ActoryOu <jay2002824@gmail.com>
Co-authored-by: ActoryOu <ousc@amazon.com>
2023-07-20 17:31:16 +08:00
Tony Josi
ae4b272275 Add CBMC proof for DNS (#924)
* Adding CBMC proof for TreatNBNS

* add prrofs for prepareReplyDNSMessage

* add proofs for prepareReplyDNSMessage

* prove ulNBNSHandlePacket

* add prrof for ulNBNSHandlePacket

* fix formatting

* fix formatting

* fix formatting

* fix copyright

* reverting last commits

* add more comments

* add proof for NBNSHandlePacket

* add proof for NBNSHandlePacket, fix formatting

* add cbmc proof for prepareReplyDNSMessage

* add cbmc proof for prepareReplyDNSMessage

* fix spell check

* revert back unwanted changes

* add CBMC proof for CreateDNSMessage

* fix formatting

* fix spell check

* fix review comments

* fix review comments

* adding review comment changes

* upddate as per review comments

* update copyright
2023-06-22 17:19:23 +05:30
ActoryOu
35fdbe1cdc [IPv6] Add Unit Test for FreeRTOS_DNS. (#886)
* FreeRTOS_getaddrinfo_a

* pxNew_AddrInfo

* FreeRTOS_freeaddrinfo

* prvPrepareLookup

* prvGetHostByNameOp

* coverage

* prvFillSockAddress

* prvDNSReply

* prvGetHostByNameOp

* ulDNSHandlePacket

* test case re-order

* Code beautify

* Fix CBMC

* Add NULL pointer check back

* Add no callback test for DNS.c

* Fix DNS_Callback UT failure

* Fix DNS_Cache UT failure

---------

Co-authored-by: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com>
2023-06-01 10:53:37 +08:00
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
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
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
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
5c9a511629 MISRA: Fix 8.9 and 10.4 violation (#752) 2023-03-02 18:36:10 +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
36172f9b66 Fix unit tests wrt. latest dev/IPv6_Integration changes (#740)
* fix ip timers unit tests

* fix FreeRTOS_IP_Utils_DiffConfig_utest tests

* fixed FreeRTOS_IP_Utils_utest

* fix dns cache unit test

* wip arp utests

* fixing arp unit tests

* fix dhcp errors

* clearing structs before usage

* fix dns parser seg fault

* fix dns parser seg fault in unit test

* fix arp uunit tests

* fix arp unit tests

* fixing dns unit test and updating the CBMC proofs

* fixing udp unit tests

* fixing TCP IP unit tests

* fixing TCP IP diffconfig unit tests

* adding additional header file for ARP for declaring missing stub headers

* minor fix

* Uncrustify: triggered by comment

* fixing comments

---------

Co-authored-by: GitHub Action <action@github.com>
2023-02-24 14:41:13 +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
Tony Josi
e9bb5773ff 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>
2023-02-23 17:19:09 +05:30
holden-zenith
91b68555fd lexicon fixes (#727)
Co-authored-by: Tony Josi <tonyjosi@amazon.com>
2023-02-17 12:23:25 +05:30
Hein Tibosch
66d4455921 A few minor changes after testing Xueli's branch, mostly in TCP_Transmission (#702) 2023-02-08 18:04:57 +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
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
f3b54f9150 Fix failing test cases for DNS unit tests (#663)
* WIP dns test cases

* WIP DNS unit tests, fix failing tests

* Fix failing tests for DNS cache unit tests

* WIP dns unt test cases fix

* WIP dns unt test cases fix

* WIP failing test cases for DNS unit test

* WIP fix failing test cases for DNS callback

* WIP fix dns networking unit tests

* WIP fix failing unit test cases for DNS parser

* WIP fix failing test cases for the DNS parser unit tests

* Fixed failing test cases for the DNS networking unit tests

* WIP fix failing unit test cases for DNS

* Fixed failing test cases for DNS unit tests

* Fixed failing test cases for the DNS unit tests

* Fix failing test cases for the DNS callback unit tests

* Fixed failing test cases for DNS parser and updted the TreatNBNS function

* xDNS_IP_Preference kept xPreferenceIPv4 by default
2023-01-09 08:54:23 +05:30
Monika Singh
4624fb0e00 Remove use of ipconfigCOMPATIBLE_WITH_SINGLE (#646)
As ipconfigCOMPATIBLE_WITH_SINGLE is never enabled and used partially, removing the rest of the instances of the same.
Ran uncrustify.
2022-12-21 20:09:40 +05:30
Monika Singh
66ca9c2011 Update DNS file to add end point changes (#607)
* Add endpoint changes to DNS files.
* SocketAddress changes
* Update DNS_Parser
* Provide stub for NetworkInterface functions
* Run uncrustify
2022-12-16 16:18:47 +05:30
Monika Singh
5e56f7739f Add IPv6 data path changes to FreeRTOS_Socket.c (#583)
* Add EndPoint changes to FreeRTOS_Socket.c

* Split Socket.c to IPv4 and IPv6 files

* Combine freertos_sockaddr for IPv4 and IPv6

* Update sendto and recv function to handle IPv4 and IPv6 case

* Run uncrustify
2022-12-05 13:48:17 +05:30
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
alfred gedeon
80876f5301 Consolidate all misra inline violation justifications into a single file (#521)
* Consolidate all misra inline violation justification into a single file

* Style: fix formatting error

* Style: fix formatting error

* Fix build error

* fix merge errors

* fix merge conflicts

* Style: improve misra exception file

* Updated the justification for MISRA rule 2.2 violation

* Fix comments and justification for MISRA rule 8.9

* Update justification for MISRA rule 11.3

* Updated wording of violation of rule 11.4 ref 5

* Updated the justification of rule 11.4 ref 29

* Fixed comment and justification for ref 31

* Update rule 11.6

* Fix some violations

* Update justifications of various violations

* Fix formatting

* Remove the previous verison of violation table

* Update formatting to separate reference numbers from the text

* Update ref for rule 2.2 and 8.9

* Update rule 11.3 references

* Added rule 11.4

* Added rule 11.6

* Added rule 11.8

* Update refs in MISRA.md

* Add rule 14.3

* Fix 21.6, 17.2 and 20.10

* Fix spell check

* Fix mis-spelled words and address review comments

* Add link to 8.9

* Add 11.3 link

* Add link for 11.4

* Add links for 14.3

* Add remaining links

* Updated some justifications and simplified code to remove deviation

* Fixed spelling errors

* Fix justification for rule 11.3 violation

* Update the link to be a hyperlink

* Update comments for misaligned access

* Add link to project wide suppression file

* Updated wording in MISRA config

* Fix grammar and reorder file

* Address comments

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
2022-07-26 11:30:42 -07:00
alfred gedeon
7aada8e2e6 Misra: fix rule 20.10, and some random fixes (#509)
* Misra: fix rule 20.10, and some random fixes

* Change variable prefix

Co-authored-by: Paul Bartell <paul.bartell@gmail.com>
2022-07-13 15:35:56 -07:00
xuelix
ab519329f4 Misra rule 11.3, 11.4 suppression and 4.6 fix (#512)
* Misra rule 11.3 inline suppression

* Added several MISRA deviations

* MISRA Rule 11.4 inline suppression

* Misra violation fix 4.6

* Misra rule 1.2 suppression
2022-07-12 14:20:52 -07:00
alfred gedeon
94ab067dd3 MISRA: fix rule 14.4 (#508)
* MISRA: fix rule 14.4

* Retrigger CI
2022-07-08 16:35:32 -07:00
alfred gedeon
6b84c44e07 Misra: Fix Rule 8.13 violations (#507)
* MISRA: fix rule 8.13 violations

* Fix more 8.3 rules violation

* Misra rule 8.13 fixes

* Fix Unit Test
2022-07-08 10:06:10 -07:00
alfred gedeon
3df8a759fe Misra: rule 2.2 fix and suppression (#504)
Co-authored-by: Paul Bartell <paul.bartell@gmail.com>
2022-07-06 15:15:51 -07:00
Aniruddha Kanhere
f44d36d5ce Update version number of TCP to development (#516)
* 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
2022-07-06 10:29:48 -07:00
alfred gedeon
aeac4fa9ed Misra: Rule 10.4 violations (#495)
* Misra: Rule 10.4 violations

* Style: Fix formatting
2022-07-01 13:28:37 -07:00
alfred gedeon
590bc27fb9 Mirsa Rule 10.3 violations (#492)
* MISRA: fix Rule 10.3 vilations

* MISRA: Fix more Rule 10.3 vilations

* Style: fix format errors

* Spell: fix variable name

* Fix PR comments

* Fix: variable names

* Style: fix format

* Fix PR comments

* Fix variable check in cache

* Remove non needed check

* Coverage: fix coverage

* test commit

* Test commit

* Remove print statements

* Initialize some memeory

* Testing workflow

* Testing on workflow

* Fix: ut coverage

* Revert workflow changes

* Style: fix format error
2022-06-25 05:26:42 -07:00
alfred gedeon
2b6a33f987 Misra: Rule 2.7 unsused parameter (#489)
* Misra: Rule 2.7

* Style: fix formatting
2022-06-23 10:02:15 -07:00
Aniruddha Kanhere
ceb8e1aa95 Add coverage check and default build combo test (#477)
* Add coverage checker

* Add build check with default configuration

* Fix build combination and DNS error

* uncrustified and fixed cmakelists
2022-06-02 11:15:30 -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