mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-06-28 12:57:52 +08:00
Remove dependency of CBMC on Patches (#181)
* Changes to DHCP * CBMC DNS changes * Changes for TCP_IP * Changes to TCP_WIN * Define away static to nothing * Remove patches * Changes after Mark's comments v1 * Update MakefileCommon.json * Correction!
This commit is contained in:

committed by
GitHub

parent
a7fec906a4
commit
08af68ef90
@ -39,6 +39,8 @@
|
||||
#include "FreeRTOS_DHCP.h"
|
||||
#include "FreeRTOS_ARP.h"
|
||||
|
||||
#include "FreeRTOSIPConfigDefaults.h"
|
||||
|
||||
/* Exclude the entire file if DHCP is not enabled. */
|
||||
#if( ipconfigUSE_DHCP != 0 )
|
||||
|
||||
@ -153,7 +155,7 @@ struct xDHCPMessage_IPv4
|
||||
typedef struct xDHCPMessage_IPv4 DHCPMessage_IPv4_t;
|
||||
|
||||
/* The UDP socket used for all incoming and outgoing DHCP traffic. */
|
||||
static Socket_t xDHCPSocket;
|
||||
_static Socket_t xDHCPSocket;
|
||||
|
||||
#if( ipconfigDHCP_FALL_BACK_AUTO_IP != 0 )
|
||||
/* Define the Link Layer IP address: 169.254.x.x */
|
||||
@ -176,7 +178,7 @@ static void prvSendDHCPDiscover( void );
|
||||
/*
|
||||
* Interpret message received on the DHCP socket.
|
||||
*/
|
||||
static BaseType_t prvProcessDHCPReplies( BaseType_t xExpectedMessageType );
|
||||
_static BaseType_t prvProcessDHCPReplies( BaseType_t xExpectedMessageType );
|
||||
|
||||
/*
|
||||
* Generate a DHCP request packet, and send it on the DHCP socket.
|
||||
@ -201,7 +203,7 @@ static uint8_t *prvCreatePartDHCPMessage( struct freertos_sockaddr *pxAddress,
|
||||
/*
|
||||
* Create the DHCP socket, if it has not been created already.
|
||||
*/
|
||||
static void prvCreateDHCPSocket( void );
|
||||
_static void prvCreateDHCPSocket( void );
|
||||
|
||||
/*
|
||||
* Close the DHCP socket.
|
||||
@ -220,7 +222,7 @@ static void prvCloseDHCPSocket( void );
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Hold information in between steps in the DHCP state machine. */
|
||||
static DHCPData_t xDHCPData;
|
||||
_static DHCPData_t xDHCPData;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@ -620,7 +622,7 @@ static void prvInitialiseDHCP( void )
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static BaseType_t prvProcessDHCPReplies( BaseType_t xExpectedMessageType )
|
||||
_static BaseType_t prvProcessDHCPReplies( BaseType_t xExpectedMessageType )
|
||||
{
|
||||
uint8_t *pucUDPPayload;
|
||||
int32_t lBytes;
|
||||
|
@ -42,6 +42,8 @@
|
||||
#include "NetworkBufferManagement.h"
|
||||
#include "NetworkInterface.h"
|
||||
|
||||
#include "FreeRTOSIPConfigDefaults.h"
|
||||
|
||||
/* Exclude the entire file if DNS is not enabled. */
|
||||
#if( ipconfigUSE_DNS != 0 )
|
||||
|
||||
@ -124,7 +126,7 @@ static Socket_t prvCreateDNSSocket( void );
|
||||
/*
|
||||
* Create the DNS message in the zero copy buffer passed in the first parameter.
|
||||
*/
|
||||
static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer,
|
||||
_static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer,
|
||||
const char *pcHostName,
|
||||
TickType_t uxIdentifier );
|
||||
|
||||
@ -132,7 +134,7 @@ static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer,
|
||||
* Simple routine that jumps over the NAME field of a resource record.
|
||||
* It returns the number of bytes read.
|
||||
*/
|
||||
static size_t prvSkipNameField( const uint8_t *pucByte,
|
||||
_static size_t prvSkipNameField( const uint8_t *pucByte,
|
||||
size_t uxLength );
|
||||
|
||||
/*
|
||||
@ -140,7 +142,7 @@ static size_t prvSkipNameField( const uint8_t *pucByte,
|
||||
* The parameter 'xExpected' indicates whether the identifier in the reply
|
||||
* was expected, and thus if the DNS cache may be updated with the reply.
|
||||
*/
|
||||
static uint32_t prvParseDNSReply( uint8_t *pucUDPPayloadBuffer,
|
||||
_static uint32_t prvParseDNSReply( uint8_t *pucUDPPayloadBuffer,
|
||||
size_t uxBufferLength,
|
||||
BaseType_t xExpected );
|
||||
|
||||
@ -194,7 +196,7 @@ static uint32_t prvGetHostByName( const char *pcHostName,
|
||||
|
||||
|
||||
#if( ipconfigUSE_DNS_CACHE == 1 ) || ( ipconfigDNS_USE_CALLBACKS == 1 )
|
||||
static size_t prvReadNameField( const uint8_t *pucByte,
|
||||
_static size_t prvReadNameField( const uint8_t *pucByte,
|
||||
size_t uxRemainingBytes,
|
||||
char *pcName,
|
||||
size_t uxDestLen );
|
||||
@ -790,7 +792,7 @@ TickType_t uxWriteTimeOut_ticks = ipconfigDNS_SEND_BLOCK_TIME_TICKS;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer,
|
||||
_static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer,
|
||||
const char *pcHostName,
|
||||
TickType_t uxIdentifier )
|
||||
{
|
||||
@ -871,7 +873,7 @@ static const DNSMessage_t xDefaultPartDNSHeader =
|
||||
|
||||
#if( ipconfigUSE_DNS_CACHE == 1 ) || ( ipconfigDNS_USE_CALLBACKS == 1 )
|
||||
|
||||
static size_t prvReadNameField( const uint8_t *pucByte,
|
||||
_static size_t prvReadNameField( const uint8_t *pucByte,
|
||||
size_t uxRemainingBytes,
|
||||
char *pcName,
|
||||
size_t uxDestLen )
|
||||
@ -966,7 +968,7 @@ static const DNSMessage_t xDefaultPartDNSHeader =
|
||||
#endif /* ipconfigUSE_DNS_CACHE || ipconfigDNS_USE_CALLBACKS */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static size_t prvSkipNameField( const uint8_t *pucByte,
|
||||
_static size_t prvSkipNameField( const uint8_t *pucByte,
|
||||
size_t uxLength )
|
||||
{
|
||||
size_t uxChunkLength;
|
||||
@ -1081,7 +1083,7 @@ size_t uxPayloadSize;
|
||||
#endif /* ipconfigUSE_NBNS */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static uint32_t prvParseDNSReply( uint8_t *pucUDPPayloadBuffer,
|
||||
_static uint32_t prvParseDNSReply( uint8_t *pucUDPPayloadBuffer,
|
||||
size_t uxBufferLength,
|
||||
BaseType_t xExpected )
|
||||
{
|
||||
|
@ -54,6 +54,9 @@
|
||||
#include "FreeRTOS_ARP.h"
|
||||
|
||||
|
||||
#include "FreeRTOSIPConfigDefaults.h"
|
||||
|
||||
|
||||
/* Just make sure the contents doesn't get compiled if TCP is not enabled. */
|
||||
#if ipconfigUSE_TCP == 1
|
||||
|
||||
@ -198,14 +201,14 @@ static BaseType_t prvTCPPrepareConnect( FreeRTOS_Socket_t *pxSocket );
|
||||
/*
|
||||
* Parse the TCP option(s) received, if present.
|
||||
*/
|
||||
static void prvCheckOptions( FreeRTOS_Socket_t *pxSocket, const NetworkBufferDescriptor_t *pxNetworkBuffer );
|
||||
_static void prvCheckOptions( FreeRTOS_Socket_t *pxSocket, const NetworkBufferDescriptor_t *pxNetworkBuffer );
|
||||
|
||||
/*
|
||||
* Identify and deal with a single TCP header option, advancing the pointer to
|
||||
* the header. This function returns pdTRUE or pdFALSE depending on whether the
|
||||
* caller should continue to parse more header options or break the loop.
|
||||
*/
|
||||
static size_t prvSingleStepTCPHeaderOptions( const uint8_t * const pucPtr,
|
||||
_static size_t prvSingleStepTCPHeaderOptions( const uint8_t * const pucPtr,
|
||||
size_t uxTotalLength,
|
||||
FreeRTOS_Socket_t * const pxSocket,
|
||||
BaseType_t xHasSYNFlag );
|
||||
@ -215,7 +218,7 @@ static size_t prvSingleStepTCPHeaderOptions( const uint8_t * const pucPtr,
|
||||
* Skip past TCP header options when doing Selective ACK, until there are no
|
||||
* more options left.
|
||||
*/
|
||||
static void prvReadSackOption( const uint8_t * const pucPtr,
|
||||
_static void prvReadSackOption( const uint8_t * const pucPtr,
|
||||
size_t uxIndex,
|
||||
FreeRTOS_Socket_t * const pxSocket );
|
||||
#endif/* ( ipconfigUSE_TCP_WIN == 1 ) */
|
||||
@ -1139,7 +1142,7 @@ uint32_t ulInitialSequenceNumber = 0;
|
||||
* that: ((pxTCPHeader->ucTCPOffset & 0xf0) > 0x50), meaning that the TP header
|
||||
* is longer than the usual 20 (5 x 4) bytes.
|
||||
*/
|
||||
static void prvCheckOptions( FreeRTOS_Socket_t *pxSocket, const NetworkBufferDescriptor_t *pxNetworkBuffer )
|
||||
_static void prvCheckOptions( FreeRTOS_Socket_t *pxSocket, const NetworkBufferDescriptor_t *pxNetworkBuffer )
|
||||
{
|
||||
size_t uxTCPHeaderOffset = ipSIZE_OF_ETH_HEADER + xIPHeaderSize( pxNetworkBuffer );
|
||||
const ProtocolHeaders_t *pxProtocolHeaders = ipPOINTER_CAST( ProtocolHeaders_t *,
|
||||
@ -1205,7 +1208,7 @@ uint8_t ucLength;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static size_t prvSingleStepTCPHeaderOptions( const uint8_t * const pucPtr,
|
||||
_static size_t prvSingleStepTCPHeaderOptions( const uint8_t * const pucPtr,
|
||||
size_t uxTotalLength,
|
||||
FreeRTOS_Socket_t * const pxSocket,
|
||||
BaseType_t xHasSYNFlag )
|
||||
@ -1355,7 +1358,7 @@ BaseType_t xReturn = pdFALSE;
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( ipconfigUSE_TCP_WIN == 1 )
|
||||
static void prvReadSackOption( const uint8_t * const pucPtr,
|
||||
_static void prvReadSackOption( const uint8_t * const pucPtr,
|
||||
size_t uxIndex,
|
||||
FreeRTOS_Socket_t * const pxSocket )
|
||||
{
|
||||
|
@ -46,6 +46,8 @@
|
||||
#include "FreeRTOS_Sockets.h"
|
||||
#include "FreeRTOS_IP_Private.h"
|
||||
|
||||
#include "FreeRTOSIPConfigDefaults.h"
|
||||
|
||||
/* Constants used for Smoothed Round Trip Time (SRTT). */
|
||||
#define winSRTT_INCREMENT_NEW 2
|
||||
#define winSRTT_INCREMENT_CURRENT 6
|
||||
@ -192,7 +194,7 @@ static void vListInsertGeneric( List_t * const pxList, ListItem_t * const pxNewL
|
||||
|
||||
/* List of free TCP segments. */
|
||||
#if( ipconfigUSE_TCP_WIN == 1 )
|
||||
static List_t xSegmentList;
|
||||
_static List_t xSegmentList;
|
||||
#endif
|
||||
|
||||
/* Logging verbosity level. */
|
||||
|
@ -36,6 +36,10 @@ will be removed. */
|
||||
/* This file provides default values for configuration options that are missing
|
||||
from the FreeRTOSIPConfig.h configuration header file. */
|
||||
|
||||
/* These macros are used to define away static keyword for CBMC proofs */
|
||||
#ifndef _static
|
||||
#define _static static
|
||||
#endif
|
||||
|
||||
/* Ensure defined configuration constants are using the most up to date naming. */
|
||||
#ifdef tcpconfigIP_TIME_TO_LIVE
|
||||
|
Reference in New Issue
Block a user