Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Default Macros #782

Merged
merged 53 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
fe5946a
Delete duplicate default defines
Mar 11, 2023
d7112d7
Remove errno definitions that exist in projdefs.h
Mar 11, 2023
f319ae0
Clean & Organize FreeRTOSIPConfigDefaults.h
Mar 12, 2023
e47efb8
Move deprecated definitions to their own file
Mar 12, 2023
e303287
Definitions Documentation Improvements
Mar 12, 2023
f461fdb
Tracing default definitions improvements
Mar 12, 2023
c0dbc91
Organize and add to deprecated definitions
Mar 12, 2023
d55279c
Remove FreeRTOS_errno_TCP.h
Mar 12, 2023
2498683
Fixes for definitions updates
Mar 12, 2023
fa2d942
Address review comments
Mar 22, 2023
20dcff5
Start enforcing macro value limits and make some doc more succinct
Apr 2, 2023
11fb47c
enforce ipconfig macro bounds
Apr 4, 2023
f2a989f
repair config default and reduce unnecessary changes
Jun 19, 2023
b8e1ba3
Add more descriptions of ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM (#947)
ActoryOu Jul 18, 2023
cf34ac7
Merge branch 'dev/IPv6_integration' into dev-defines
HTRamsey Jul 19, 2023
1a9a63b
Fixes mDNS over IPv6. (#949)
evpopov Jul 20, 2023
54cb85e
Merge branch 'dev/IPv6_integration' into dev-defines
HTRamsey Jul 22, 2023
124b7db
remove enabled checks
Jul 22, 2023
becf89b
Merge branch 'dev-defines' of https://github.com/holden-zenith/FreeRT…
Jul 22, 2023
590fe5e
Remove enable checks from trace macros
Jul 22, 2023
2602d33
Update cmake sources
Jul 22, 2023
d3fc48d
add missing defines
Jul 22, 2023
9311489
revert unnecessary changes
Jul 22, 2023
92962d3
formatting
Jul 22, 2023
dc11880
fix lexicon
Jul 22, 2023
eb344df
fix build issue and remove deprecated macro usage from tests
Jul 24, 2023
f200fb6
fix build issues and formatting
Jul 24, 2023
a04db96
disable pdFREERTOS_ERRNO_EAFNOSUPPORT check
Jul 24, 2023
5744a18
update kernel submodule for tests
Jul 25, 2023
c1ae80e
Merge remote-tracking branch 'origin/main' into dev-defines
Jul 25, 2023
4149ec7
Merge branch 'main' into dev-defines
ActoryOu Jul 26, 2023
107cd1f
macro definition fixes
Jul 26, 2023
ac4fd46
Merge branch 'main' into dev-defines
HTRamsey Jul 30, 2023
d37662c
fix some test build issues
Jul 30, 2023
dc98bb9
Merge branch 'dev-defines' of https://github.com/holden-zenith/FreeRT…
Jul 30, 2023
408cb3a
Temporary passing state
Jul 30, 2023
413f47a
Fix unittest
ActoryOu Aug 8, 2023
f2e4c8e
Fix CBMC
ActoryOu Aug 8, 2023
9489ce7
Merge dev-defines to holden-zenith-dev-defines
ActoryOu Aug 8, 2023
4097d6f
Merge branch 'holden-zenith-dev-defines' into dev-defines
ActoryOu Aug 8, 2023
5e14d95
Update CBMC proof
ActoryOu Aug 8, 2023
e5b360c
Merge branch 'main' into dev-defines
moninom1 Aug 24, 2023
5620e17
Update Macro comments
moninom1 Sep 6, 2023
8f0dc95
revert changes
Sep 19, 2023
0e670ee
Merge branch 'main' into dev-defines
Oct 2, 2023
9a7e32b
Fix MISRA 4.4
moninom1 Oct 12, 2023
a9a1935
Fix MISRA 20.7 violation
moninom1 Oct 12, 2023
874d330
Fix spell checker
moninom1 Oct 12, 2023
b9ff400
Merge branch 'main' into dev-defines
ActoryOu Oct 25, 2023
8c0ebcf
Merge branch 'main' into dev-defines
ActoryOu Oct 25, 2023
024bb5f
Merge branch 'holden-zenith-dev-defines' into main
moninom1 Oct 26, 2023
98d2e06
Update Hein's comment
moninom1 Oct 26, 2023
f7c4c00
Merge to main
moninom1 Oct 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ DEAS
DEBR
DEBUGEN
DEBUGF
DECASECONDS
DEFFERRALCHECK
DEFR
Deglitchers
Expand Down
2 changes: 1 addition & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set_property(TARGET freertos_plus_tcp PROPERTY C_STANDARD 90)
target_sources( freertos_plus_tcp
PRIVATE
include/FreeRTOSIPConfigDefaults.h
include/FreeRTOSIPDeprecatedDefinitions.h
include/FreeRTOS_ARP.h
include/FreeRTOS_BitConfig.h
include/FreeRTOS_DHCP.h
Expand Down Expand Up @@ -40,7 +41,6 @@ target_sources( freertos_plus_tcp
include/FreeRTOS_TCP_Utils.h
include/FreeRTOS_TCP_WIN.h
include/FreeRTOS_UDP_IP.h
include/FreeRTOS_errno_TCP.h
include/IPTraceMacroDefaults.h
include/NetworkBufferManagement.h
include/NetworkInterface.h
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_IP_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ uint16_t usGenerateChecksum( uint16_t usSum,

/**
* @brief Utility function: Convert error number to a human readable
* string. Declaration in FreeRTOS_errno_TCP.h.
* string.
*
* @param[in] xErrnum The error number.
* @param[in] pcBuffer Buffer big enough to be filled with the human readable message.
Expand Down
12 changes: 5 additions & 7 deletions source/FreeRTOS_Sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,9 @@ static BaseType_t prvDetermineSocketSize( BaseType_t xDomain,
{
uint16_t usDifference = ipSIZE_OF_IPv6_HEADER - ipSIZE_OF_IPv4_HEADER;

if( pxSocket->u.xTCP.usMSS > usDifference )
{
pxSocket->u.xTCP.usMSS = ( uint16_t ) ( pxSocket->u.xTCP.usMSS - usDifference );
}
/* Because ipconfigTCP_MSS is guaranteed not less than tcpMINIMUM_SEGMENT_LENGTH by FreeRTOSIPConfigDefaults.h,
* it's unnecessary to check if xSocket->u.xTCP.usMSS is greater than difference. */
pxSocket->u.xTCP.usMSS = ( uint16_t ) ( pxSocket->u.xTCP.usMSS - usDifference );
}
#endif /* ipconfigUSE_IPv6 != 0 */

Expand Down Expand Up @@ -1259,8 +1258,7 @@ static int32_t prvRecvFrom_CopyPacket( uint8_t * pucEthernetBuffer,
* (24-bytes) for compatibility.
*
* @return The number of bytes received. Or else, an error code is returned. When it
* returns a negative value, the cause can be looked-up in
* 'FreeRTOS_errno_TCP.h'.
* returns a negative value, the cause can be looked-up in 'FreeRTOS-Kernel/projdefs.h'.
*/
int32_t FreeRTOS_recvfrom( const ConstSocket_t xSocket,
void * pvBuffer,
Expand Down Expand Up @@ -1570,7 +1568,7 @@ static int32_t prvSendTo_ActualSend( const FreeRTOS_Socket_t * pxSocket,
* Berkeley sockets standard. Else, it is not used.
*
* @return When positive: the total number of bytes sent, when negative an error
* has occurred: it can be looked-up in 'FreeRTOS_errno_TCP.h'.
* has occurred: it can be looked-up in 'FreeRTOS-Kernel/projdefs.h'.
*/
int32_t FreeRTOS_sendto( Socket_t xSocket,
const void * pvBuffer,
Expand Down
8 changes: 5 additions & 3 deletions source/FreeRTOS_TCP_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,11 @@
{
/* A socket was in the connecting phase but something
* went wrong and it should be closed. */
FreeRTOS_debug_printf( ( "Move from %s to %s\n",
FreeRTOS_GetTCPStateName( ( UBaseType_t ) xPreviousState ),
FreeRTOS_GetTCPStateName( eTCPState ) ) );
#if ( ipconfigHAS_DEBUG_PRINTF != 0 )
FreeRTOS_debug_printf( ( "Move from %s to %s\n",
FreeRTOS_GetTCPStateName( ( UBaseType_t ) xPreviousState ),
FreeRTOS_GetTCPStateName( eTCPState ) ) );
#endif

/* Set the flag to show that it was connected before and that the
* status has changed now. This will cause the control flow to go
Expand Down
14 changes: 3 additions & 11 deletions source/FreeRTOS_TCP_Utils_IPv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,10 @@ void prvSocketSetMSS_IPV6( FreeRTOS_Socket_t * pxSocket )
/* Compared to IPv4, an IPv6 header is 20 bytes longer.
* It must be subtracted from the MSS. */
size_t uxDifference = ipSIZE_OF_IPv6_HEADER - ipSIZE_OF_IPv4_HEADER;
/* Do not allow MSS smaller than tcpMINIMUM_SEGMENT_LENGTH. */
Copy link
Member

@ActoryOu ActoryOu Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's checked in FreeRTOSIPConfigDefault.h. It's not necessary to check it again here.

#if ( ipconfigTCP_MSS >= tcpMINIMUM_SEGMENT_LENGTH )
{
ulMSS = ipconfigTCP_MSS;
}
#else
{
ulMSS = tcpMINIMUM_SEGMENT_LENGTH;
}
#endif

ulMSS = ( uint32_t ) ( ulMSS - uxDifference );
/* Because ipconfigTCP_MSS is guaranteed not less than tcpMINIMUM_SEGMENT_LENGTH by FreeRTOSIPConfigDefaults.h,
* it's unnecessary to check if xSocket->u.xTCP.usMSS is greater than difference. */
ulMSS = ( uint32_t ) ( ipconfigTCP_MSS - uxDifference );
IPv6_Type_t eType = xIPv6_GetIPType( &( pxSocket->u.xTCP.xRemoteIP.xIP_IPv6 ) );

if( eType == eIPv6_Global )
Expand Down
Loading