Commit Graph

3092 Commits (63aec3607d3daaada0a33989dea59c994b7a566f)
 

Author SHA1 Message Date
Oscar Michael Abrina f23752164b
Map errors from FreeRTOS+TCP to mbedTLS and make read non-blocking when requesting start of frame (#452)
From the FreeRTOS documentation, pdFREERTOS_ERRNO_ENOSPC means that timeout occurred before any data could be sent or received.
- In the plaintext transport-interface implementation, we would directly return `-pdFREERTOS_ERRNO_ENOSPC`. However, an error like this can occur when the TCP buffer is full, so this ought to be retriable. Libraries that consume the transport interface interpret a return value of 0 to mean that send/recv can be invoked again to get the data. As such, we should appropriately set the return value as 0 when the status is `-pdFREERTOS_ERRNO_ENOSPC`.
- In the mbedTLS port, we would directly return whatever `FreeRTOS_send` or `FreeRTOS_recv` returns. However, sometimes, the return value can be an error. In such cases, we ought to map an error from FreeRTOS+TCP to an equivalent error in mbedTLS. In the case of `-pdFREERTOS_ERRNO_ENOSPC`, we map that to `MBEDTLS_ERR_SSL_TIMEOUT`. When the mbedTLS transport-interface send/recv wrapper sees that value, it appropriately returns 0, so that the library can retry the send/recv. I've verified that when the mbedTLS port returns an error, that same error is returned by `mbedtls_ssl_write` & `mbedtls_ssl_read`.
- The TCP socket may have a receive block time.  If bytesToRecv is greater than 1 then a frame is likely already part way through reception and blocking to wait for the desired number of bytes to be available is the
most efficient thing to do.  If bytesToRecv is 1 then this may be a speculative call to read to find the start of a new frame, in which case blocking is not desirable as it could block an entire protocol agent task for the duration of the read block time and therefore negatively impact performance.  So if bytesToRecv is 1 then don't call recv unless it is known that bytes are already available.

Co-authored-by: abhidixi11 <44424462+abhidixi11@users.noreply.github.com>
Co-authored-by: RichardBarry <3073890+RichardBarry@users.noreply.github.com>
4 years ago
Sukhmani Minhas ebd1cdf702
Add comment about handling S3 request limits to S3 download demos (#462)
- Adding a comment to the top of S3 download and multi-threaded download demo source code files, to explain how to handle S3 request limits. This is done to prevent users from treating this case as a bug.
- Increasing ipconfigTCP_RX_BUFFER_LENGTH to 5000, as was done recently for other demos.
4 years ago
Oscar Michael Abrina 1c2c671e7a
Update comments about NetworkContext definition (#461)
Small change that simply specifies why the NetworkContext must be defined by each compilation unit along with details on how to include it to your project.

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
4 years ago
Pascal d264c1f153
Moved definition of ucBufferStorage out of if macro. (#459)
* Moved definition of ucBufferStorage out of if macro. If ucBufferStorage is only defined when configSUPPORT_STATIC_ALLOCATION ist set to 1, compilation will fail in cases where it is set to 0 or not defined (because it defaults to 0, as described in the documenation).
4 years ago
Archit Aggarwal d93a3d63a0
Update demos to use version macro from coreMQTT (#460)
Update demos to use the MQTT_LIBRARY_VERSION macro for the coreMQTT version they report in their metrics
4 years ago
Archit Aggarwal c0d4c7c67c
Update MQTT config for Keep Alive demo that uses dummy timer (#457)
The MQTT library has been updated with the MQTT_RECV_POLLING_TIMEOUT_MS and MQTT_SEND_RETRY_TIMEOUT_MS configurations which should be set to zero when using a dummy timer function to avoid possibility of infinite loop when retrying failed transport send/receive calls. As the MQTT Keep Alive demo uses a dummy timer function, this PR updates the demo configuration to set these timeouts to zero.
4 years ago
Ming Yue 9d937aa0ab
Remove duplicate WinBase.h and Windows.h. (#458) 4 years ago
Cobus van Eeden c6f4284b76
Update kernel submodule pointer to version 47338393f (#456)
* Update kernel submodule pointer to version 47338393f

* Fix patches.

Co-authored-by: Carl Lundin <lundinc@amazon.com>
4 years ago
Carl Lundin 492ac6edb2
Move corePKCS11 forward and update to latest core_pkcs11.h (#441)
* Move corePKCS11 forward.
* Update licenses.
* strip NULL terminator.
* Add threading_alt.h
* Use github link.

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
4 years ago
Archit Gupta 353d2ef35b
Fix FreeRTOS+TCP submodule pointer (#453)
The FreeRTOS+TCP submodule pointer was set to a commit not in main,
which also lacked commits in main, which ended up causing build failures
for defender demo.
4 years ago
Sukhmani Minhas 57161da956
Update HTTP demo project files (#451)
* Update project filters

* Address inaccurate retry count
4 years ago
alfred gedeon 0698f83c3b
Update Kernel head (#444) 4 years ago
Sukhmani Minhas 87662ff4d8
Replace GPL with FreeRTOS license in MbedTLS demo config files (#447)
Since we own mbedtls_config.h files, updating the GPL to use the FreeRTOS license instead.
4 years ago
SarenaAWS 4538b99a9b
Change all occurrences of broker to server in coreHTTP demos folder. (#445) 4 years ago
yngki 46acf2863a
Update readme.txt (#446)
* Update readme.txt

* Update readme.txt

* Update readme.txt

* Update check-header.py

Co-authored-by: Joseph Julicher <jjulicher@mac.com>
4 years ago
Sukhmani Minhas d69c9c01e8
Port S3 multi-threaded download demo from C-SDK (#436)
Adding demo to demonstrate the use of pre-signed URLs to connect and download from a S3 bucket. Sends multiple GET requests synchronously to download a file in chunks using range headers. Uses a request and response task in addition to the main HTTP servicing task.
4 years ago
alfred gedeon b7b9ccb099
Qemu mps2 networking (#439)
* Demo: Add Support for netwroking in Qemu for MPS2 AN385
* Add tcp echo client
* Add steps to Readme
4 years ago
Archit Gupta 79e432738b
Adds error messages for AWS demo mqtt helpers + misc fixes (#440)
Switch MQTT helpers to logging error message instead of error code.
Adds time parameter to xProccessLoop so defender demo does not wait extra time.
Fixes some incorrect returns in metrics_collector.c
4 years ago
Oscar Michael Abrina 9c1efa8d02
Update WindowsTargetPlatformVersion to 10.0 (#442)
CI only supports 10.0, so this change is required for CI to build this demo correctly on Visual Studio.
4 years ago
Carl Lundin 934020a5a2
Move WolfSSL to ThirdParty and Submodule code (#433)
* Submodule wolfSSL and move wolfSSL and WolfSSL-FIPS-Ready to ThirdParty folder.

* Update VS studio project.

* Update FIPS project settings.

* Update FIPS demo readme.

* Add md to ignored file extensions.
4 years ago
leegeth 4651c46479
Add retries to demos in case of a failure. (#435) 4 years ago
Sukhmani Minhas d2fcf20caf
Port S3 Upload Demo from C-SDK (#417)
Adding demo to use script-generated pre-signed URLs to establish a TLS connection and upload a small file to an S3 bucket using a single PUT request, and then verify the upload by obtaining the file size from S3 and comparing it to the size of the local file.
4 years ago
Sukhmani Minhas 24def41337
Port S3 Download Demo from C-SDK (#416)
Adding demo to use script-generated pre-signed URLs to establish a TLS connection and synchronously download a file from an S3 bucket, with multiple GET requests.
4 years ago
Aniruddha Kanhere 9a452918d1
Add UDP demo running FreeRTOS+TCP (#425)
* Add FreeRTOS+TCP UDP only demo.

* Update folder name and remove old one

* Update the network interface to be used.

* Update headers

* Update header

* Header update and folder name correction

* Remove WinPCap folder
4 years ago
Archit Aggarwal eec68e8790
Fix TLS handshake failures in demos (#438)
Increase default size of FreeRTOS+TCP RX buffers in TLS demos to avoid TLS handshake failures
4 years ago
David Chalco 1db51e9996
Header Checker: Misc Enhancements (#437)
* +regex ignores, tentative complete lists for configs

* Use header checks from user repo
4 years ago
Oscar Michael Abrina 05dc34b27b
Clean up server setup instructions for MQTT and HTTP demos (#429)
- Removes a broken link to configure Windows Firewall
- Removes references to Mosquitto in the httpbin server setup instructions
4 years ago
Oscar Michael Abrina 73b0d1b259
Support multiple transports in the same compilation unit (#434)
By removing the definition of the NetworkContext struct in the header file, we allow the application to define it. This allows an application writer to use multiple transports in the same compilation unit. That way, multiple .c files do not have to be created for each transport.
4 years ago
Carl Lundin a9fd30af94
Add code of conduct. (#430)
* Add code of conduct.
* Move into .github folder.
4 years ago
Archit Gupta a7825dc973
Update FreeRTOS+TCP submodule pointer (#427)
Updates the FreeRTOS+TCP submodule pointer.
This brings in a fix that needs changes in defender demo.
4 years ago
Archit Aggarwal 682447445b
Bump backoffAlgorithm submodule for API change and update demos (#426)
The API of FreeRTOS/backoffAlgorithm library has changed to remove dependency on random number generator; instead require the caller to generate the random number and pass it to the BackoffAlgorithm_GetNextBackoff API for backoff period calculation. This PR updates the submodule pointer commit, and updates the demos and tests to use the simplied library API
4 years ago
Carl Lundin 220dd5cc1c
corePKCS11 submodule and file path update (#424)
* Move PKCS #11 submodule forward.

* Update file path for folder update in corePKCS11.

* Update mbedtls file filter.
4 years ago
Archit Gupta 5f72c0031d
Have metrics collector return amount written (#428) 4 years ago
Archit Aggarwal 152b7db2c1
Add "Demo completed successfully" log in Jobs demo (#421) 4 years ago
Oscar Michael Abrina e2652a8711
Add HTTP plaintext demo (#423)
Adds the HTTP plaintext demo from C SDK. No functionality is changed, but naming is updated appropriately. It is using freertos_plus_tcp plaintext transport implementation to send HTTP requests and then logs the response from the server.
4 years ago
Sukhmani Minhas ac1a10428b
Porting HTTP Mutual Auth Demo from C-SDK (#414)
Add demo to establish a mutually-authenticated network connection with the server before sending and verifying a simple POST request.
* Add demo files
* Move all "Http_Demo_Helpers" files into Common
* Update project files and add vendor config files
* Update http_demo_utils.c after backoff updates
4 years ago
Archit Aggarwal 036ec83b65
Replace exponential_backoff with submodule to FreeRTOS/backoffAlgorithm (#419)
A new repository, FreeRTOS/backoffAlgorithm, has been created for hosting the library for backoff calculation. This repo replaces the FreeRTOS-Plus/Source/Utilities/exponential_backoff with the submodule to the new repository, and updates all the demos that use retry logic to use the backoffAlgorithm API
4 years ago
Archit Gupta 5ba1e4cf95
Clean up defender demo (#422) 4 years ago
Archit Gupta ced1845508
Fix missing includes in defender demo (#418)
report_builder.c was missing FreeRTOS includes.
Additionally fixes root CA comments in AWS demos.
4 years ago
Archit Aggarwal aad429ba09
Fix issues in CI check for header files with directories and .gitmodules (#420) 4 years ago
Archit Gupta 98b8fcd89d
Remove certs from AWS demos + misc fixes (#415)
Removes the AWS IoT cert that is included in the demo_config.h files of the Shadow and Jobs demos.
Additionally fixes some typos.
4 years ago
Archit Gupta 2b4f8d4094
Port Defender demo from C-SDK (#407) 4 years ago
Sukhmani Minhas 56a86428fe
Preparation for coreHTTP demos (#413)
Adding common utilities that will be used by 4 coreHTTP demos:
- Adding coreHTTP submodule pointer to FreeRTOS-Plus/Source/Application-Protocols/coreHTTP
- Adding folder FreeRTOS-Plus/Demo/coreHTTP_Windows_Simulator/Http_Demo_Helpers with functions common to demos.
4 years ago
Carl Lundin e313e286df
Bump corePKCS11 submodule (#412)
* Move PKCS submodule forward.

* Use common mbed code.
4 years ago
David Chalco 0d0a88883a
FR Header Checks: Update expected file header. Support ignores. (#410)
* Remove '1 tab == 4 spaces remarks' from check

* Add initial ignore mechanism. Ignore selfcheck
4 years ago
SarenaAWS d59a4e4f3a
Add helpful asterisk comments to the shadow demo. (#409)
* Add helpful asterisk comments to the shadow demo.

* Update FreeRTOS-Plus/Demo/AWS/Device_Shadow_Windows_Simulator/Device_Shadow_Demo/DemoTasks/ShadowDemoMainExample.c

* Add stuff to the license header for GHA checks.
4 years ago
David Chalco fdc9d736b3
File Header Check/Diff Reporter + Companion Git Action (#408)
* Add checker for file headers

* file header check + git action
4 years ago
Archit Gupta 3dc4516ea1
Add device defender library submodule (#406) 4 years ago
Oscar Michael Abrina ae1226b1bb
Match WindowsTargetPlatformVersion across all MQTT VS Projects (#405)
Simply updates the Visual Studio projects so that WindowsTargetPlatformVersion is set to 10.0 for all MQTT demos.
4 years ago
Archit Aggarwal c415143077
Add demo for AWS IoT Jobs library (#404) 4 years ago