diff --git a/source/include/FreeRTOS_ARP.h b/source/include/FreeRTOS_ARP.h index 7be3f2f7d..5385beca0 100644 --- a/source/include/FreeRTOS_ARP.h +++ b/source/include/FreeRTOS_ARP.h @@ -28,17 +28,16 @@ #ifndef FREERTOS_ARP_H #define FREERTOS_ARP_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /* Application level configuration options. */ #include "FreeRTOSIPConfig.h" #include "FreeRTOSIPConfigDefaults.h" #include "IPTraceMacroDefaults.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ /*-----------------------------------------------------------*/ /* Miscellaneous structure and definitions. */ /*-----------------------------------------------------------*/ diff --git a/source/include/FreeRTOS_DHCP.h b/source/include/FreeRTOS_DHCP.h index 2dc1ff97a..7742fbd8c 100644 --- a/source/include/FreeRTOS_DHCP.h +++ b/source/include/FreeRTOS_DHCP.h @@ -28,11 +28,6 @@ #ifndef FREERTOS_DHCP_H #define FREERTOS_DHCP_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif - #include "FreeRTOS_Sockets.h" #include "FreeRTOS_Routing.h" @@ -40,6 +35,11 @@ #include "FreeRTOSIPConfig.h" #include "IPTraceMacroDefaults.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif + #if ( ipconfigUSE_DHCP != 0 ) && ( ipconfigNETWORK_MTU < 586U ) /* DHCP must be able to receive an options field of 312 bytes, the fixed diff --git a/source/include/FreeRTOS_DHCPv6.h b/source/include/FreeRTOS_DHCPv6.h index 801007c02..bd620c5df 100644 --- a/source/include/FreeRTOS_DHCPv6.h +++ b/source/include/FreeRTOS_DHCPv6.h @@ -26,15 +26,15 @@ #ifndef FREERTOS_DHCPV6_H #define FREERTOS_DHCPV6_H - #ifdef __cplusplus - extern "C" { - #endif - /* Application level configuration options. */ #include "FreeRTOS_DHCP.h" #include "FreeRTOSIPConfig.h" #include "IPTraceMacroDefaults.h" + #ifdef __cplusplus + extern "C" { + #endif + /* IPv6 option numbers. */ /** @brief IPv6 DHCP option number - Solicit */ #define DHCPv6_message_Type_Solicit 1U diff --git a/source/include/FreeRTOS_DNS.h b/source/include/FreeRTOS_DNS.h index 6fd10f3d9..c33a0c3a0 100644 --- a/source/include/FreeRTOS_DNS.h +++ b/source/include/FreeRTOS_DNS.h @@ -28,17 +28,17 @@ #ifndef FREERTOS_DNS_H #define FREERTOS_DNS_H +/* Application level configuration options. */ +#include "FreeRTOS_DNS_Globals.h" +#include "FreeRTOS_DNS_Callback.h" +#include "FreeRTOS_DNS_Cache.h" + /* *INDENT-OFF* */ #ifdef __cplusplus extern "C" { #endif /* *INDENT-ON* */ -/* Application level configuration options. */ -#include "FreeRTOS_DNS_Globals.h" -#include "FreeRTOS_DNS_Callback.h" -#include "FreeRTOS_DNS_Cache.h" - /* * LLMNR is very similar to DNS, so is handled by the DNS routines. */ diff --git a/source/include/FreeRTOS_DNS_Callback.h b/source/include/FreeRTOS_DNS_Callback.h index c7b0cfc00..5a0094f12 100644 --- a/source/include/FreeRTOS_DNS_Callback.h +++ b/source/include/FreeRTOS_DNS_Callback.h @@ -29,12 +29,6 @@ #ifndef FREERTOS_DNS_CALLBACK_H #define FREERTOS_DNS_CALLBACK_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /* FreeRTOS includes. */ #include "FreeRTOS.h" @@ -45,6 +39,13 @@ /* Standard includes. */ #include + +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* Application level configuration options. */ #if ( ( ipconfigDNS_USE_CALLBACKS == 1 ) && ( ipconfigUSE_DNS != 0 ) ) diff --git a/source/include/FreeRTOS_ICMP.h b/source/include/FreeRTOS_ICMP.h index 4cc9cd4cf..fa7cd8bb1 100644 --- a/source/include/FreeRTOS_ICMP.h +++ b/source/include/FreeRTOS_ICMP.h @@ -33,12 +33,6 @@ #ifndef FREERTOS_ICMP_H #define FREERTOS_ICMP_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /* Standard includes. */ #include #include @@ -61,6 +55,12 @@ #include "NetworkBufferManagement.h" #include "FreeRTOS_DNS.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* ICMP protocol definitions. */ #define ipICMP_ECHO_REQUEST ( ( uint8_t ) 8 ) /**< ICMP echo request. */ #define ipICMP_ECHO_REPLY ( ( uint8_t ) 0 ) /**< ICMP echo reply. */ diff --git a/source/include/FreeRTOS_IP.h b/source/include/FreeRTOS_IP.h index 8500c5fc4..98f123761 100644 --- a/source/include/FreeRTOS_IP.h +++ b/source/include/FreeRTOS_IP.h @@ -28,12 +28,6 @@ #ifndef FREERTOS_IP_H #define FREERTOS_IP_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - #include "FreeRTOS.h" #include "task.h" @@ -43,6 +37,12 @@ #include "FreeRTOS_IP_Common.h" #include "IPTraceMacroDefaults.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* Constants defining the current version of the FreeRTOS+TCP * network stack. */ #define ipFR_TCP_VERSION_NUMBER "V4.0.999" diff --git a/source/include/FreeRTOS_IP_Private.h b/source/include/FreeRTOS_IP_Private.h index 51463f1ce..329812e76 100644 --- a/source/include/FreeRTOS_IP_Private.h +++ b/source/include/FreeRTOS_IP_Private.h @@ -27,11 +27,6 @@ #ifndef FREERTOS_IP_PRIVATE_H #define FREERTOS_IP_PRIVATE_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ /* Application level configuration options. */ #include "FreeRTOSIPConfig.h" @@ -50,6 +45,12 @@ #include "event_groups.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + #ifdef TEST int ipFOREVER( void ); #else diff --git a/source/include/FreeRTOS_IP_Timers.h b/source/include/FreeRTOS_IP_Timers.h index 73688e329..8d7a84e26 100644 --- a/source/include/FreeRTOS_IP_Timers.h +++ b/source/include/FreeRTOS_IP_Timers.h @@ -33,12 +33,6 @@ #ifndef FREERTOS_IP_TIMERS_H #define FREERTOS_IP_TIMERS_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /* Standard includes. */ #include #include @@ -61,6 +55,12 @@ #include "NetworkBufferManagement.h" #include "FreeRTOS_DNS.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* * Checks the ARP, DHCP and TCP timers to see if any periodic or timeout * processing is required. diff --git a/source/include/FreeRTOS_IP_Utils.h b/source/include/FreeRTOS_IP_Utils.h index eaa436681..89b6e58aa 100644 --- a/source/include/FreeRTOS_IP_Utils.h +++ b/source/include/FreeRTOS_IP_Utils.h @@ -25,20 +25,14 @@ * http://www.FreeRTOS.org */ -#ifndef FREERTOS_IP_UTILS_H -#define FREERTOS_IP_UTILS_H - -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /** * @file FreeRTOS_IP_Utils.h * @brief Implements the utility functions for FreeRTOS_IP.c */ +#ifndef FREERTOS_IP_UTILS_H +#define FREERTOS_IP_UTILS_H + /* Standard includes. */ #include #include @@ -65,6 +59,12 @@ #include "FreeRTOS_IPv4_Utils.h" #include "FreeRTOS_IPv6_Utils.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + #if ( ipconfigUSE_DHCP != 0 ) /** diff --git a/source/include/FreeRTOS_IPv4.h b/source/include/FreeRTOS_IPv4.h index 3dfad00d2..bdbb1bc2e 100644 --- a/source/include/FreeRTOS_IPv4.h +++ b/source/include/FreeRTOS_IPv4.h @@ -28,12 +28,6 @@ #ifndef FREERTOS_IPV4_H #define FREERTOS_IPV4_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - #include "FreeRTOS.h" #include "task.h" #include "FreeRTOS_IP.h" @@ -43,6 +37,12 @@ #include "FreeRTOSIPConfigDefaults.h" #include "IPTraceMacroDefaults.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + #define ipSIZE_OF_IPv4_HEADER 20U #define ipSIZE_OF_IPv4_ADDRESS 4U #define ipSIZE_OF_ICMPv4_HEADER 8U diff --git a/source/include/FreeRTOS_IPv4_Private.h b/source/include/FreeRTOS_IPv4_Private.h index eb83b5a47..620d53004 100644 --- a/source/include/FreeRTOS_IPv4_Private.h +++ b/source/include/FreeRTOS_IPv4_Private.h @@ -27,14 +27,15 @@ #ifndef FREERTOS_IPV4_PRIVATE_H #define FREERTOS_IPV4_PRIVATE_H + +#include "FreeRTOS_IP_Private.h" + /* *INDENT-OFF* */ #ifdef __cplusplus extern "C" { #endif /* *INDENT-ON* */ -#include "FreeRTOS_IP_Private.h" - /* The maximum UDP payload length. */ #define ipMAX_UDP_PAYLOAD_LENGTH ( ( ipconfigNETWORK_MTU - ipSIZE_OF_IPv4_HEADER ) - ipSIZE_OF_UDP_HEADER ) diff --git a/source/include/FreeRTOS_IPv4_Sockets.h b/source/include/FreeRTOS_IPv4_Sockets.h index 3d1e3fced..8cb2859c5 100644 --- a/source/include/FreeRTOS_IPv4_Sockets.h +++ b/source/include/FreeRTOS_IPv4_Sockets.h @@ -28,16 +28,16 @@ #ifndef FREERTOS_IPV4_SOCKETS_H #define FREERTOS_IPV4_SOCKETS_H - #ifdef __cplusplus - extern "C" { - #endif - /* Standard includes. */ #include /* FreeRTOS includes. */ #include "FreeRTOS.h" + #ifdef __cplusplus + extern "C" { + #endif + /* Translate from 192.168.1.1 to a 32-bit number. */ BaseType_t FreeRTOS_inet_pton4( const char * pcSource, diff --git a/source/include/FreeRTOS_IPv4_Utils.h b/source/include/FreeRTOS_IPv4_Utils.h index dac3161f8..402497af7 100644 --- a/source/include/FreeRTOS_IPv4_Utils.h +++ b/source/include/FreeRTOS_IPv4_Utils.h @@ -28,12 +28,6 @@ #ifndef FREERTOS_IPV4_UTILS_H #define FREERTOS_IPV4_UTILS_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /** * @file FreeRTOS_IPv4_Utils.h * @brief Implements the utility functions for FreeRTOS_IP.c @@ -49,6 +43,12 @@ /* FreeRTOS+TCP includes. */ #include "FreeRTOS_IP.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* Set the MAC-address that belongs to a given IPv4 multi-cast address. */ void vSetMultiCastIPv4MacAddress( uint32_t ulIPAddress, MACAddress_t * pxMACAddress ); diff --git a/source/include/FreeRTOS_IPv6.h b/source/include/FreeRTOS_IPv6.h index 37a5f3ff3..393ef2816 100644 --- a/source/include/FreeRTOS_IPv6.h +++ b/source/include/FreeRTOS_IPv6.h @@ -26,18 +26,18 @@ #ifndef FREERTOS_IPV6_H #define FREERTOS_IPV6_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - #include "FreeRTOS.h" #include "task.h" #include "FreeRTOS_IP.h" #include "FreeRTOS_IP_Common.h" #include "FreeRTOS_IPv6_Private.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* Some constants defining the sizes of several parts of a packet. * These defines come before including the configuration header files. */ #define ipSIZE_OF_IPv6_HEADER 40U diff --git a/source/include/FreeRTOS_IPv6_Private.h b/source/include/FreeRTOS_IPv6_Private.h index 6851fe8a4..49e4c058e 100644 --- a/source/include/FreeRTOS_IPv6_Private.h +++ b/source/include/FreeRTOS_IPv6_Private.h @@ -27,11 +27,6 @@ #ifndef FREERTOS_IPV6_PRIVATE_H #define FREERTOS_IPV6_PRIVATE_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ /* Application level configuration options. */ #include "FreeRTOSIPConfig.h" @@ -49,6 +44,12 @@ #include "event_groups.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* MISRA Ref 20.5.1 [Use of undef] */ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-2051 */ /* coverity[misra_c_2012_rule_20_5_violation] */ diff --git a/source/include/FreeRTOS_IPv6_Sockets.h b/source/include/FreeRTOS_IPv6_Sockets.h index 378da5ccb..903e0617f 100644 --- a/source/include/FreeRTOS_IPv6_Sockets.h +++ b/source/include/FreeRTOS_IPv6_Sockets.h @@ -28,10 +28,6 @@ #ifndef FREERTOS_IPV6_SOCKETS_H #define FREERTOS_IPV6_SOCKETS_H - #ifdef __cplusplus - extern "C" { - #endif - /* Standard includes. */ #include @@ -39,6 +35,10 @@ #include "FreeRTOS.h" #include "FreeRTOS_IP_Common.h" + #ifdef __cplusplus + extern "C" { + #endif + /** @brief When ucASCIIToHex() can not convert a character, * the value 255 will be returned. */ diff --git a/source/include/FreeRTOS_IPv6_Utils.h b/source/include/FreeRTOS_IPv6_Utils.h index d686bd0e5..ffa742e78 100644 --- a/source/include/FreeRTOS_IPv6_Utils.h +++ b/source/include/FreeRTOS_IPv6_Utils.h @@ -28,12 +28,6 @@ #ifndef FREERTOS_IPV6_UTILS_H #define FREERTOS_IPV6_UTILS_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /** * @file FreeRTOS_IPv6_Utils.h * @brief Implements the utility functions for FreeRTOS_IP.c @@ -49,6 +43,13 @@ /* FreeRTOS+TCP includes. */ #include "FreeRTOS_IP.h" + +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* Set the MAC-address that belongs to a given IPv6 multi-cast address. */ void vSetMultiCastIPv6MacAddress( const IPv6_Address_t * pxAddress, MACAddress_t * pxMACAddress ); diff --git a/source/include/FreeRTOS_ND.h b/source/include/FreeRTOS_ND.h index a514cbb90..08c14c8e1 100644 --- a/source/include/FreeRTOS_ND.h +++ b/source/include/FreeRTOS_ND.h @@ -26,12 +26,6 @@ #ifndef FREERTOS_ND_H #define FREERTOS_ND_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /* Application level configuration options. */ #include "FreeRTOSIPConfig.h" #include "FreeRTOSIPConfigDefaults.h" @@ -39,6 +33,12 @@ #include "FreeRTOS_ARP.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + #if ( ipconfigUSE_IPv6 != 0 ) /*-----------------------------------------------------------*/ /* Miscellaneous structure and definitions. */ diff --git a/source/include/FreeRTOS_Routing.h b/source/include/FreeRTOS_Routing.h index e57d7d572..c2d2a9fc5 100644 --- a/source/include/FreeRTOS_Routing.h +++ b/source/include/FreeRTOS_Routing.h @@ -26,10 +26,6 @@ #ifndef FREERTOS_ROUTING_H #define FREERTOS_ROUTING_H - #ifdef __cplusplus - extern "C" { - #endif - #if ( ipconfigUSE_DHCP != 0 ) #include "FreeRTOS_DHCP.h" #endif @@ -38,6 +34,10 @@ #include "FreeRTOS_DHCPv6.h" #endif + #ifdef __cplusplus + extern "C" { + #endif + /* Every NetworkInterface needs a set of access functions: */ /* Forward declaration of 'struct xNetworkInterface'. */ diff --git a/source/include/FreeRTOS_Sockets.h b/source/include/FreeRTOS_Sockets.h index 5c56b6198..a4b108c57 100644 --- a/source/include/FreeRTOS_Sockets.h +++ b/source/include/FreeRTOS_Sockets.h @@ -28,10 +28,6 @@ #ifndef FREERTOS_SOCKETS_H #define FREERTOS_SOCKETS_H - #ifdef __cplusplus - extern "C" { - #endif - /* Standard includes. */ #include @@ -52,6 +48,10 @@ /* Event bit definitions are required by the select functions. */ #include "event_groups.h" + #ifdef __cplusplus + extern "C" { + #endif + #ifndef INC_FREERTOS_H #error FreeRTOS.h must be included before FreeRTOS_Sockets.h. #endif diff --git a/source/include/FreeRTOS_UDP_IP.h b/source/include/FreeRTOS_UDP_IP.h index d3bbe8bd6..adf9412f8 100644 --- a/source/include/FreeRTOS_UDP_IP.h +++ b/source/include/FreeRTOS_UDP_IP.h @@ -28,18 +28,18 @@ #ifndef FREERTOS_UDP_IP_H #define FREERTOS_UDP_IP_H -/* *INDENT-OFF* */ -#ifdef __cplusplus - extern "C" { -#endif -/* *INDENT-ON* */ - /* Application level configuration options. */ #include "FreeRTOSIPConfig.h" #include "FreeRTOSIPConfigDefaults.h" #include "IPTraceMacroDefaults.h" #include "FreeRTOS_IP.h" +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /* * Called when the application has generated a UDP packet to send. */ diff --git a/source/portable/NetworkInterface/STM32Hxx/stm32hxx_hal_eth.h b/source/portable/NetworkInterface/STM32Hxx/stm32hxx_hal_eth.h index 9454d1ca8..b762885f8 100644 --- a/source/portable/NetworkInterface/STM32Hxx/stm32hxx_hal_eth.h +++ b/source/portable/NetworkInterface/STM32Hxx/stm32hxx_hal_eth.h @@ -23,14 +23,13 @@ #define STM32H7xx_HAL_ETH_H +/* Includes ------------------------------------------------------------------*/ + #include "stm32h7xx_hal_def.h" + #ifdef __cplusplus extern "C" { #endif - -/* Includes ------------------------------------------------------------------*/ - #include "stm32h7xx_hal_def.h" - #if defined( ETH ) /** @addtogroup STM32H7xx_HAL_Driver diff --git a/source/portable/NetworkInterface/Zynq/x_emacpsif.h b/source/portable/NetworkInterface/Zynq/x_emacpsif.h index 787efd0df..82fc9df1d 100644 --- a/source/portable/NetworkInterface/Zynq/x_emacpsif.h +++ b/source/portable/NetworkInterface/Zynq/x_emacpsif.h @@ -19,10 +19,6 @@ #ifndef __NETIF_XEMACPSIF_H__ #define __NETIF_XEMACPSIF_H__ - #ifdef __cplusplus - extern "C" { - #endif - #include #include "xstatus.h" @@ -38,6 +34,10 @@ #include "xscugic.h" #include "xemacps.h" /* defines XEmacPs API */ + #ifdef __cplusplus + extern "C" { + #endif + #define XPAR_PS7_ETHERNET_1_DEVICE_ID 1 #define XPAR_PS7_ETHERNET_1_BASEADDR 0xE000C000 diff --git a/source/portable/NetworkInterface/xilinx_ultrascale/x_emacpsif.h b/source/portable/NetworkInterface/xilinx_ultrascale/x_emacpsif.h index e5273627a..39b48d7d2 100644 --- a/source/portable/NetworkInterface/xilinx_ultrascale/x_emacpsif.h +++ b/source/portable/NetworkInterface/xilinx_ultrascale/x_emacpsif.h @@ -19,10 +19,6 @@ #ifndef __NETIF_XEMACPSIF_H__ #define __NETIF_XEMACPSIF_H__ - #ifdef __cplusplus - extern "C" { - #endif - #include #include "xstatus.h" @@ -39,8 +35,9 @@ #include "xscugic.h" #include "xemacps.h" /* defines XEmacPs API */ -/*#include "netif/xpqueue.h" */ -/*#include "xlwipconfig.h" */ + #ifdef __cplusplus + extern "C" { + #endif void xemacpsif_setmac( uint32_t index, uint8_t * addr ); diff --git a/test/unit-test/ConfigFiles/portmacro.h b/test/unit-test/ConfigFiles/portmacro.h index 7ea2523c6..a766fe152 100644 --- a/test/unit-test/ConfigFiles/portmacro.h +++ b/test/unit-test/ConfigFiles/portmacro.h @@ -28,12 +28,12 @@ #ifndef PORTMACRO_H #define PORTMACRO_H + #include + #ifdef __cplusplus extern "C" { #endif - #include - /*----------------------------------------------------------- * Port specific definitions. * diff --git a/tools/tcp_utilities/include/date_and_time.h b/tools/tcp_utilities/include/date_and_time.h index 6026a4b16..56cb04f54 100644 --- a/tools/tcp_utilities/include/date_and_time.h +++ b/tools/tcp_utilities/include/date_and_time.h @@ -28,12 +28,12 @@ #ifndef DATE_AND_TIME_H #define DATE_AND_TIME_H + #include + #ifdef __cplusplus extern "C" { #endif - #include - extern uint32_t ulSeconds, ulMsec; extern int iTimeZone;