mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-18 09:08:33 -04:00
Update trace recorder code.
Add TCP Echo server to the FreeR_Plus_TCP_Minimal_Window_Simulator project.
This commit is contained in:
parent
f7fc215247
commit
d525d5092d
35 changed files with 4431 additions and 2436 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* FreeRTOS+TCP V2.0.1
|
||||
* FreeRTOS+TCP V2.0.3
|
||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
|
@ -19,10 +19,8 @@
|
|||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://aws.amazon.com/freertos
|
||||
*
|
||||
* 1 tab == 4 spaces!
|
||||
* http://www.FreeRTOS.org
|
||||
*/
|
||||
|
||||
/* Standard includes. */
|
||||
|
@ -597,15 +595,19 @@ static void prvInitialiseDHCP( void )
|
|||
xDHCPData.ulTransactionId++;
|
||||
}
|
||||
|
||||
xDHCPData.xUseBroadcast = 0;
|
||||
xDHCPData.ulOfferedIPAddress = 0UL;
|
||||
xDHCPData.ulDHCPServerAddress = 0UL;
|
||||
xDHCPData.xDHCPTxPeriod = dhcpINITIAL_DHCP_TX_PERIOD;
|
||||
/* Check for random number generator API failure. */
|
||||
if( 0 != xDHCPData.ulTransactionId )
|
||||
{
|
||||
xDHCPData.xUseBroadcast = 0;
|
||||
xDHCPData.ulOfferedIPAddress = 0UL;
|
||||
xDHCPData.ulDHCPServerAddress = 0UL;
|
||||
xDHCPData.xDHCPTxPeriod = dhcpINITIAL_DHCP_TX_PERIOD;
|
||||
|
||||
/* Create the DHCP socket if it has not already been created. */
|
||||
prvCreateDHCPSocket();
|
||||
FreeRTOS_debug_printf( ( "prvInitialiseDHCP: start after %lu ticks\n", dhcpINITIAL_TIMER_PERIOD ) );
|
||||
vIPReloadDHCPTimer( dhcpINITIAL_TIMER_PERIOD );
|
||||
/* Create the DHCP socket if it has not already been created. */
|
||||
prvCreateDHCPSocket();
|
||||
FreeRTOS_debug_printf( ( "prvInitialiseDHCP: start after %lu ticks\n", dhcpINITIAL_TIMER_PERIOD ) );
|
||||
vIPReloadDHCPTimer( dhcpINITIAL_TIMER_PERIOD );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -675,18 +677,17 @@ const uint32_t ulMandatoryOptions = 2ul; /* DHCP server address, and the correct
|
|||
state machine is expecting. */
|
||||
ulProcessed++;
|
||||
}
|
||||
else if( *pucByte == ( uint8_t ) dhcpMESSAGE_TYPE_NACK )
|
||||
{
|
||||
if( xExpectedMessageType == ( BaseType_t ) dhcpMESSAGE_TYPE_ACK )
|
||||
{
|
||||
/* Start again. */
|
||||
xDHCPData.eDHCPState = eWaitingSendFirstDiscover;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( *pucByte == ( uint8_t ) dhcpMESSAGE_TYPE_NACK )
|
||||
{
|
||||
if( xExpectedMessageType == ( BaseType_t ) dhcpMESSAGE_TYPE_ACK )
|
||||
{
|
||||
/* Start again. */
|
||||
xDHCPData.eDHCPState = eWaitingSendFirstDiscover;
|
||||
}
|
||||
}
|
||||
/* Stop processing further options. */
|
||||
ucLength = 0;
|
||||
/* Don't process other message types. */
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -292,7 +292,7 @@ void vListInsertGeneric( List_t * const pxList, ListItem_t * const pxNewListItem
|
|||
pxWhere->pxPrevious = pxNewListItem;
|
||||
|
||||
/* Remember which list the item is in. */
|
||||
pxNewListItem->pvContainer = ( void * ) pxList;
|
||||
pxNewListItem->pxContainer = pxList;
|
||||
|
||||
( pxList->uxNumberOfItems )++;
|
||||
}
|
||||
|
@ -788,12 +788,12 @@ const int32_t l500ms = 500;
|
|||
{
|
||||
ulSavedSequenceNumber = ulCurrentSequenceNumber;
|
||||
|
||||
/* Clean up all sequence received between ulSequenceNumber
|
||||
/* Clean up all sequence received between ulSequenceNumber
|
||||
and ulSequenceNumber + ulLength since they are duplicated.
|
||||
If the server is forced to retransmit packets several time
|
||||
in a row it might send a batch of concatenated packet for
|
||||
speed. So we cannot rely on the packets between
|
||||
ulSequenceNumber and ulSequenceNumber + ulLength to be
|
||||
If the server is forced to retransmit packets several time
|
||||
in a row it might send a batch of concatenated packet for
|
||||
speed. So we cannot rely on the packets between
|
||||
ulSequenceNumber and ulSequenceNumber + ulLength to be
|
||||
sequential and it is better to just clean them out. */
|
||||
do
|
||||
{
|
||||
|
|
|
@ -510,7 +510,7 @@ from the FreeRTOSIPConfig.h configuration header file. */
|
|||
#endif
|
||||
|
||||
#ifndef ipconfigTCP_KEEP_ALIVE
|
||||
#define ipconfigTCP_KEEP_ALIVE 0
|
||||
#define ipconfigTCP_KEEP_ALIVE 1
|
||||
#endif
|
||||
|
||||
#ifndef ipconfigDNS_USE_CALLBACKS
|
||||
|
@ -526,7 +526,7 @@ from the FreeRTOSIPConfig.h configuration header file. */
|
|||
#endif
|
||||
|
||||
#ifndef ipconfigTCP_HANG_PROTECTION
|
||||
#define ipconfigTCP_HANG_PROTECTION 0
|
||||
#define ipconfigTCP_HANG_PROTECTION 1
|
||||
#endif
|
||||
|
||||
#ifndef ipconfigTCP_IP_SANITY
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue