Sync up with Amazon-freertos repo (10th March 2020) (#34)
* Sync up with amazon-freertos * Sync up with amazon-freertos * Sync up with amazon-freertospull/36/head
parent
0acffef047
commit
ecf0f12aa1
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,81 @@
|
||||
This is a FreeeRTOS+TCP driver that works for both STM32F4xx and STM32F7xx parts.
|
||||
|
||||
The code of stm32fxx_hal_eth.c is based on both drivers as provided by ST.
|
||||
|
||||
These modules should be included:
|
||||
|
||||
NetworkInterface.c
|
||||
stm32fxx_hal_eth.c
|
||||
|
||||
It is assumed that one of these words are defined:
|
||||
|
||||
STM32F7xx
|
||||
STM32F407xx
|
||||
STM32F417xx
|
||||
STM32F427xx
|
||||
STM32F437xx
|
||||
STM32F429xx
|
||||
STM32F439xx
|
||||
|
||||
The driver has been tested on both Eval and Discovery boards with both STM32F4 and STM32F7.
|
||||
|
||||
Recommended settings for STM32Fxx Network Interface:
|
||||
|
||||
// Defined in FreeRTOSIPConfig.h
|
||||
|
||||
#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 1
|
||||
#define ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM 1
|
||||
#define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM 1
|
||||
#define ipconfigZERO_COPY_RX_DRIVER 1
|
||||
#define ipconfigZERO_COPY_TX_DRIVER 1
|
||||
#define ipconfigUSE_LINKED_RX_MESSAGES 1
|
||||
|
||||
// Defined in stm32f4xx_hal_conf.h
|
||||
#define ETH_RXBUFNB 3 or 4
|
||||
#define ETH_TXBUFNB 2 or 3
|
||||
#define ETH_RX_BUF_SIZE ( ipconfigNETWORK_MTU + 36 )
|
||||
#define ETH_TX_BUF_SIZE ( ipconfigNETWORK_MTU + 36 )
|
||||
|
||||
The best size for 'ETH_RXBUFNB' and 'ETH_TXBUFNB' depends on the speed of the CPU. These macro's define the number of DMA buffers for reception and for transmission.
|
||||
In general, if the CPU is very fast, you will need less buffers. You can obtain an estimate empirically.
|
||||
|
||||
The optimal value of 'ETH_RX_BUF_SIZE' and 'ETH_TX_BUF_SIZE' depends on the actual value of 'ipconfigNETWORK_MTU'.
|
||||
When MTU is 1500, MTU+36 becomes a well-aligned buffer of 1536 bytes ( 0x600 ).
|
||||
When MTU is 1200, MTU+48 will make 1248 ( 0x4E0 ), which is also well aligned.
|
||||
|
||||
Having well aligned buffers is important for CPU with memory cache. Often the caching system divides memory in blocks of 32 bytes. When two buffers share the same cache buffer, you are bound to see data errors.
|
||||
|
||||
Without memory caching, let the size be at least a multiple of 8 ( for DMA ), and make it at least "ipconfigNETWORK_MTU + 14".
|
||||
|
||||
STM32F7xx only:
|
||||
|
||||
Networkinterface.c will place the 2 DMA tables in a special section called 'first_data'.
|
||||
In case 'BufferAllocation_1.c' is used, the network packets will also be declared in this section 'first_data'.
|
||||
As long as the part has no caching, this section can be placed anywhere in RAM.
|
||||
On an STM32F7 with an L1 data cache, it shall be placed in the first 64KB of RAM, which is always uncached.
|
||||
The linker script must be changed for this, for instance as follows:
|
||||
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sdata = .; // create a global symbol at data start
|
||||
+ *(.first_data) // .first_data sections
|
||||
*(.data) // .data sections
|
||||
*(.data*) // .data* sections
|
||||
|
||||
. = ALIGN(4);
|
||||
_edata = .; // define a global symbol at data end
|
||||
} >RAM AT> FLASH
|
||||
|
||||
|
||||
The driver contains these files:
|
||||
|
||||
stm32fxx_hal_eth.c
|
||||
stm32f2xx_hal_eth.h
|
||||
stm32f4xx_hal_eth.h
|
||||
stm32f7xx_hal_eth.h
|
||||
stm32fxx_hal_eth.h
|
||||
|
||||
These files are copied from ST's HAL library. These work both for STM32F4 and STM32F7.
|
||||
Please remove or rename these files from the HAL distribution that you are using.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* FreeRTOS+TCP V2.2.1
|
||||
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* 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://aws.amazon.com/freertos
|
||||
* http://www.FreeRTOS.org
|
||||
*/
|
||||
|
||||
#ifndef _AWS_FREERTOS_TCP_TEST_ACCESS_DECLARE_H_
|
||||
#define _AWS_FREERTOS_TCP_TEST_ACCESS_DECLARE_H_
|
||||
|
||||
uint32_t TEST_FreeRTOS_TCP_prvParseDNSReply( uint8_t * pucUDPPayloadBuffer,
|
||||
size_t xBufferLength,
|
||||
TickType_t xIdentifier );
|
||||
|
||||
void TEST_FreeRTOS_TCP_prvCheckOptions( FreeRTOS_Socket_t * pxSocket,
|
||||
NetworkBufferDescriptor_t * pxNetworkBuffer );
|
||||
|
||||
void TEST_FreeRTOS_TCP_prvTCPCreateWindow( FreeRTOS_Socket_t * pxSocket );
|
||||
|
||||
#endif /* ifndef _AWS_FREERTOS_TCP_TEST_ACCESS_DECLARE_H_ */
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* FreeRTOS+TCP V2.2.1
|
||||
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* 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://aws.amazon.com/freertos
|
||||
* http://www.FreeRTOS.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file aws_ota_pal_test_access_define.h
|
||||
* @brief Function wrappers that access private methods in aws_ota_pal.c.
|
||||
*
|
||||
* Needed for testing private functions.
|
||||
*/
|
||||
|
||||
#ifndef _AWS_FREERTOS_TCP_TEST_ACCESS_DNS_DEFINE_H_
|
||||
#define _AWS_FREERTOS_TCP_TEST_ACCESS_DNS_DEFINE_H_
|
||||
|
||||
#include "iot_freertos_tcp_test_access_declare.h"
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
uint32_t TEST_FreeRTOS_TCP_prvParseDNSReply( uint8_t * pucUDPPayloadBuffer,
|
||||
size_t xBufferLength,
|
||||
TickType_t xIdentifier )
|
||||
{
|
||||
return prvParseDNSReply( pucUDPPayloadBuffer, xBufferLength, xIdentifier );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#endif /* ifndef _AWS_FREERTOS_TCP_TEST_ACCESS_DNS_DEFINE_H_ */
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* FreeRTOS+TCP V2.2.1
|
||||
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* 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://aws.amazon.com/freertos
|
||||
* http://www.FreeRTOS.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file aws_ota_pal_test_access_define.h
|
||||
* @brief Function wrappers that access private methods in aws_ota_pal.c.
|
||||
*
|
||||
* Needed for testing private functions.
|
||||
*/
|
||||
|
||||
#ifndef _AWS_FREERTOS_TCP_TEST_ACCESS_TCP_DEFINE_H_
|
||||
#define _AWS_FREERTOS_TCP_TEST_ACCESS_TCP_DEFINE_H_
|
||||
|
||||
#include "iot_freertos_tcp_test_access_declare.h"
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void TEST_FreeRTOS_TCP_prvCheckOptions( FreeRTOS_Socket_t * pxSocket,
|
||||
NetworkBufferDescriptor_t * pxNetworkBuffer )
|
||||
{
|
||||
prvCheckOptions( pxSocket, pxNetworkBuffer );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void TEST_FreeRTOS_TCP_prvTCPCreateWindow( FreeRTOS_Socket_t * pxSocket )
|
||||
{
|
||||
prvTCPCreateWindow( pxSocket );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#endif /* ifndef _AWS_FREERTOS_TCP_TEST_ACCESS_TCP_DEFINE_H_ */
|
@ -0,0 +1,362 @@
|
||||
/*
|
||||
* FreeRTOS+TCP V2.2.1
|
||||
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* 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://aws.amazon.com/freertos
|
||||
* http://www.FreeRTOS.org
|
||||
*/
|
||||
|
||||
/* Standard includes. */
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
/* FreeRTOS includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "list.h"
|
||||
#include "FreeRTOS_IP.h"
|
||||
#include "FreeRTOS_IP_Private.h"
|
||||
#include "FreeRTOS_DNS.h"
|
||||
|
||||
/* Test includes. */
|
||||
#include "unity_fixture.h"
|
||||
#include "unity.h"
|
||||
#include "iot_freertos_tcp_test_access_declare.h"
|
||||
|
||||
/**
|
||||
* @brief Configuration for this test group.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @brief Test group definition.
|
||||
*/
|
||||
TEST_GROUP( Full_FREERTOS_TCP );
|
||||
|
||||
TEST_SETUP( Full_FREERTOS_TCP )
|
||||
{
|
||||
}
|
||||
|
||||
TEST_TEAR_DOWN( Full_FREERTOS_TCP )
|
||||
{
|
||||
}
|
||||
|
||||
TEST_GROUP_RUNNER( Full_FREERTOS_TCP )
|
||||
{
|
||||
/* Run a parser test. */
|
||||
RUN_TEST_CASE( Full_FREERTOS_TCP, prvParseDnsResponse );
|
||||
RUN_TEST_CASE( Full_FREERTOS_TCP, ulDNSHandlePacket );
|
||||
|
||||
/* prvCheckOptions test. */
|
||||
RUN_TEST_CASE( Full_FREERTOS_TCP, prvCheckOptions );
|
||||
|
||||
/* xProcessReceivedUDPPacket test. */
|
||||
RUN_TEST_CASE( Full_FREERTOS_TCP, UDPPacketLength );
|
||||
}
|
||||
|
||||
TEST( Full_FREERTOS_TCP, prvParseDnsResponse )
|
||||
{
|
||||
uint8_t ucGoodDnsResponse[] =
|
||||
{
|
||||
0xd7, 0x66, 0x81, 0x80, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x61, 0x33, 0x37,
|
||||
0x62, 0x78, 0x76, 0x31, 0x63, 0x62, 0x64, 0x61, 0x33, 0x6a, 0x67, 0x03, 0x69, 0x6f, 0x74, 0x09,
|
||||
0x75, 0x73, 0x2d, 0x77, 0x65, 0x73, 0x74, 0x2d, 0x32, 0x09, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e,
|
||||
0x61, 0x77, 0x73, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x05,
|
||||
0x00, 0x01, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x1e, 0x0c, 0x69, 0x6f, 0x74, 0x6d, 0x6f, 0x6f, 0x6e,
|
||||
0x72, 0x61, 0x6b, 0x65, 0x72, 0x09, 0x75, 0x73, 0x2d, 0x77, 0x65, 0x73, 0x74, 0x2d, 0x32, 0x04,
|
||||
0x70, 0x72, 0x6f, 0x64, 0xc0, 0x1b, 0xc0, 0x48, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xec,
|
||||
0x00, 0x45, 0x09, 0x64, 0x75, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2a, 0x69, 0x6f, 0x74,
|
||||
0x6d, 0x6f, 0x6f, 0x6e, 0x72, 0x61, 0x6b, 0x65, 0x72, 0x2d, 0x75, 0x2d, 0x65, 0x6c, 0x62, 0x2d,
|
||||
0x31, 0x77, 0x38, 0x71, 0x6e, 0x77, 0x31, 0x33, 0x33, 0x36, 0x7a, 0x71, 0x2d, 0x31, 0x31, 0x38,
|
||||
0x36, 0x33, 0x34, 0x38, 0x30, 0x39, 0x32, 0x09, 0x75, 0x73, 0x2d, 0x77, 0x65, 0x73, 0x74, 0x2d,
|
||||
0x32, 0x03, 0x65, 0x6c, 0x62, 0xc0, 0x29, 0xc0, 0x72, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x04, 0x22, 0xd3, 0x41, 0xdb, 0xc0, 0x72, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x04, 0x22, 0xd3, 0x53, 0xe4, 0xc0, 0x72, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x04, 0x22, 0xd3, 0xb6, 0x17, 0xc0, 0x72, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x04, 0x22, 0xd6, 0xf5, 0xf0, 0xc0, 0x72, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x04, 0x22, 0xd7, 0xe6, 0xa4, 0xc0, 0x72, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x04, 0x36, 0x95, 0x5e, 0x45
|
||||
};
|
||||
const uint32_t ulExpectedAddress = 0xdb41d322;
|
||||
uint8_t ucBadDnsResponseA[] =
|
||||
{
|
||||
0x3b, 0x6a, 0x81, 0x83, 0x01, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x09, 0x69, 0x6e, 0x73,
|
||||
0x70, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x08, 0x75, 0x73, 0x2d, 0x77, 0x65, 0x73, 0x74, 0x32, 0x09,
|
||||
0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x61, 0x77, 0x73, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01,
|
||||
0x00, 0x01, 0xc0, 0x1f, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x33, 0x0e, 0x64,
|
||||
0x6e, 0x73, 0x2d, 0x64, 0x79, 0x6e, 0x2d
|
||||
};
|
||||
uint8_t ucBadDnsResponseB[] =
|
||||
{
|
||||
0xf0, 0x23, 0x81, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
|
||||
0x05, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0,
|
||||
0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x01, 0x7c, 0x00, 0x1b, 0x03, 0x77, 0x77, 0x77, 0x05,
|
||||
0x61, 0x70, 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x07, 0x65, 0x64, 0x67, 0x65, 0x6b, 0x65,
|
||||
0x79, 0x03, 0x6e, 0x65, 0x74, 0x00, 0xc0, 0x2b, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x1a, 0xd5,
|
||||
0x00, 0x2f, 0x03, 0x77, 0x77, 0x77, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d,
|
||||
0x07, 0x65, 0x64, 0x67, 0x65, 0x6b, 0x65, 0x79, 0x03, 0x6e, 0x65, 0x74, 0x0b, 0x67, 0x6c, 0x6f,
|
||||
0x62, 0x61, 0x6c, 0x72, 0x65, 0x64, 0x69, 0x72, 0x06, 0x61, 0x6b, 0x61, 0x64, 0x6e, 0x73, 0xc0,
|
||||
0x41, 0xc0, 0x52, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x08, 0xb3, 0x00, 0x19, 0x05, 0x65, 0x36,
|
||||
0x38, 0x35, 0x38, 0x05, 0x64, 0x73, 0x63, 0x65, 0x39, 0x0a, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x69,
|
||||
0x65, 0x64, 0x67, 0x65, 0xc0, 0x41, 0xc0, 0x8d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a,
|
||||
0x00, 0x04, 0x17, 0x4a, 0x3e, 0x96
|
||||
};
|
||||
uint8_t ucBadDnsResponseC[] =
|
||||
{
|
||||
0x3b, 0xa3, 0x81, 0x80, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
|
||||
0x09, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66
|
||||
};
|
||||
uint8_t ucBadDnsResponseD[] =
|
||||
{
|
||||
0x95, 0x1e, 0x81, 0x80, 0x05, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
|
||||
0x03, 0x63, 0x6e, 0x6e, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, 0x0c, 0x00,
|
||||
0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x1b, 0x0a, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x72,
|
||||
0x2d, 0x74, 0x6c, 0x73, 0x03, 0x6d, 0x61, 0x70, 0x06, 0x66, 0x61, 0x73, 0x74, 0x6c, 0x79, 0x03,
|
||||
0x6e, 0x65, 0x74, 0x00, 0xc0, 0x29, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04,
|
||||
0x97, 0x65, 0x35, 0x43
|
||||
};
|
||||
uint8_t ucBadDnsResponseE[] =
|
||||
{
|
||||
0xa8, 0x6d, 0x81, 0x80, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
|
||||
0x05, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0,
|
||||
0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x03, 0x77, 0x77, 0x77, 0x05,
|
||||
0x61, 0x70, 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x07, 0x65, 0x64, 0x67, 0x65, 0x6b, 0x65,
|
||||
0x79, 0x03, 0x6e, 0x65, 0x74, 0x00, 0xc0, 0x2b, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x1c, 0x2c,
|
||||
0x00, 0x2f, 0x03, 0x77, 0x77, 0x77, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d,
|
||||
0x07, 0x65, 0x64, 0x67, 0x65, 0x6b, 0x65, 0x79, 0x03, 0x6e, 0x65, 0x74, 0x0b, 0x67, 0x6c, 0x6f,
|
||||
0x62, 0x61, 0x6c, 0x72, 0x65, 0x64, 0x69, 0x72, 0x06, 0x61, 0x6b, 0x61, 0x64, 0x6e, 0x73, 0xc0,
|
||||
0x41, 0xc0, 0x52, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x03, 0xd7, 0x00, 0x19, 0x05, 0x65, 0x36,
|
||||
0x38, 0x35, 0x38, 0x05, 0x64, 0x73, 0x63, 0x65, 0x39, 0x0a, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x69,
|
||||
0x65, 0x64, 0x67, 0x65, 0xc0, 0x41, 0xc0, 0x8d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08,
|
||||
0x00, 0x04, 0x17, 0x4b, 0xba, 0x13
|
||||
};
|
||||
uint8_t ucBadDnsResponseF[] =
|
||||
{
|
||||
0x6c, 0x1e, 0x81, 0x80, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
|
||||
0x06, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01,
|
||||
0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x01, 0x57, 0x00, 0x0a, 0x03, 0x77, 0x77, 0x77,
|
||||
0x03, 0x63, 0x64, 0x6e, 0xc0, 0x10, 0x41, 0x41, 0xc0, 0x2c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x17, 0x00, 0x1f, 0x0e, 0x64, 0x33, 0x61, 0x67, 0x34, 0x68, 0x75, 0x6b, 0x6b, 0x68, 0x36,
|
||||
0x32, 0x79, 0x6e, 0x0a, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x03, 0x6e,
|
||||
0x65, 0x74, 0x00, 0xc0, 0x42, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x04, 0x0d,
|
||||
0x20, 0xa7, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x9a, 0x3a, 0x01, 0x5c, 0x31, 0x1f, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00
|
||||
};
|
||||
uint8_t ucBadDnsResponseG[] =
|
||||
{
|
||||
0x73, 0xe1, 0x81, 0x80, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, 0x77, 0x77,
|
||||
0x06, 0x22, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00,
|
||||
0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x04, 0xd8, 0x3a, 0xd8, 0x84, 0x00, 0x34, 0x02, 0x41, 0x01,
|
||||
0x2c, 0xb2, 0x1a, 0x01, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00
|
||||
};
|
||||
uint8_t ucBadDnsResponseH[] = /* Regress crash in prvReadNameField. */
|
||||
{
|
||||
0x10, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x35,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
|
||||
0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
uint8_t ucBadDnsResponseI[] = /* Regress crash in prvSkipNameField. */
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8,
|
||||
0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8,
|
||||
0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0x00, 0x35,
|
||||
0x0a, 0xf8, 0xf8, 0xf8, 0x27, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8,
|
||||
0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0x16, 0x16, 0x21, 0x16,
|
||||
0x16, 0x16, 0x16, 0x16, 0x16, 0x2a, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf8,
|
||||
0x27, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
|
||||
0x00, 0x16, 0x16, 0x16, 0x16, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x16, 0x5a,
|
||||
0x00, 0x16, 0x00, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x21
|
||||
};
|
||||
uint32_t ulAddress = 0;
|
||||
|
||||
/* Parsing a valid packet should succeed. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucGoodDnsResponse,
|
||||
sizeof( ucGoodDnsResponse ),
|
||||
*( uint16_t * ) ucGoodDnsResponse );
|
||||
TEST_ASSERT_EQUAL_UINT32( ulExpectedAddress, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseA,
|
||||
sizeof( ucBadDnsResponseA ),
|
||||
*( uint16_t * ) ucBadDnsResponseA );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseB,
|
||||
sizeof( ucBadDnsResponseB ),
|
||||
*( uint16_t * ) ucBadDnsResponseB );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseC,
|
||||
sizeof( ucBadDnsResponseC ),
|
||||
*( uint16_t * ) ucBadDnsResponseC );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseD,
|
||||
sizeof( ucBadDnsResponseD ),
|
||||
*( uint16_t * ) ucBadDnsResponseD );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseE,
|
||||
sizeof( ucBadDnsResponseE ),
|
||||
*( uint16_t * ) ucBadDnsResponseE );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseF,
|
||||
sizeof( ucBadDnsResponseF ),
|
||||
*( uint16_t * ) ucBadDnsResponseF );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseG,
|
||||
sizeof( ucBadDnsResponseG ),
|
||||
*( uint16_t * ) ucBadDnsResponseG );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseH,
|
||||
sizeof( ucBadDnsResponseH ),
|
||||
*( uint16_t * ) ucBadDnsResponseH );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
|
||||
/* Parsing a bad packet should fail gracefully. */
|
||||
ulAddress = TEST_FreeRTOS_TCP_prvParseDNSReply(
|
||||
ucBadDnsResponseI,
|
||||
sizeof( ucBadDnsResponseI ),
|
||||
*( uint16_t * ) ucBadDnsResponseI );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulAddress );
|
||||
/* End test. */
|
||||
}
|
||||
|
||||
TEST( Full_FREERTOS_TCP, ulDNSHandlePacket )
|
||||
{
|
||||
NetworkBufferDescriptor_t xNetworkBuffer = { 0 };
|
||||
uint8_t ucPartialUdpPacket[ sizeof( ipSIZE_OF_UDP_HEADER ) - 1 ] = { 0xFF };
|
||||
uint32_t ulResult = 0;
|
||||
|
||||
/* Attempting to parse a packet that's shorter than a UDP header should be
|
||||
* a no-op. */
|
||||
xNetworkBuffer.pucEthernetBuffer = ucPartialUdpPacket;
|
||||
xNetworkBuffer.xDataLength = sizeof( ucPartialUdpPacket );
|
||||
ulResult = ulDNSHandlePacket( &xNetworkBuffer );
|
||||
TEST_ASSERT_EQUAL_UINT32( 0, ulResult );
|
||||
}
|
||||
|
||||
TEST( Full_FREERTOS_TCP, prvCheckOptions )
|
||||
{
|
||||
uint8_t ucDivideByZero[] =
|
||||
{
|
||||
0x6f, 0xff, 0xff, 0xff, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x6f, 0x6f, 0x6d,
|
||||
0x6f, 0xff, 0xff, 0xff, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xe5, 0x6f, 0x6f,
|
||||
0x6f, 0x6f, 0x6f, 0x6b, 0xbf, 0x6f, 0x03, 0xff, 0x04, 0x01, 0xb7, 0xff,
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x02, 0x02, 0x02, 0x02,
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02,
|
||||
0x02, 0x02, 0xf8, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x05
|
||||
};
|
||||
|
||||
FreeRTOS_Socket_t xSocket;
|
||||
NetworkBufferDescriptor_t xNetworkBuffer;
|
||||
|
||||
xNetworkBuffer.pucEthernetBuffer = ucDivideByZero;
|
||||
xNetworkBuffer.xDataLength = sizeof( ucDivideByZero );
|
||||
|
||||
TEST_FreeRTOS_TCP_prvTCPCreateWindow( &xSocket );
|
||||
TEST_FreeRTOS_TCP_prvCheckOptions( &xSocket, &xNetworkBuffer );
|
||||
}
|
||||
|
||||
TEST( Full_FREERTOS_TCP, UDPPacketLength )
|
||||
{
|
||||
uint8_t ucBadUdpPacketA[] =
|
||||
{
|
||||
0xff, 0xff
|
||||
};
|
||||
|
||||
uint8_t ucBadUdpPacketB[] =
|
||||
{
|
||||
0x0a, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0x54, 0xbf, 0xbf, 0xbf, 0xff, 0xbf,
|
||||
0x0a, 0xbf, 0xbf, 0xbf, 0x3f, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf,
|
||||
0x88, 0x00, 0xbf, 0xbf, 0xbf, 0x00, 0x32, 0xbf, 0xbf, 0xbf, 0x00, 0x35,
|
||||
0x0a, 0xbf, 0xbf, 0x3a, 0xbf, 0xbf, 0xbf
|
||||
};
|
||||
|
||||
BaseType_t xReturn = pdPASS;
|
||||
uint16_t usPort = 65535;
|
||||
NetworkBufferDescriptor_t xNetworkBuffer;
|
||||
|
||||
xNetworkBuffer.pucEthernetBuffer = NULL;
|
||||
xNetworkBuffer.xDataLength = 0;
|
||||
|
||||
xReturn = xProcessReceivedUDPPacket( &xNetworkBuffer, usPort );
|
||||
TEST_ASSERT_EQUAL_UINT32_MESSAGE( pdFAIL, xReturn, "Failed to parse 0 size packet" );
|
||||
|
||||
xNetworkBuffer.pucEthernetBuffer = ucBadUdpPacketA;
|
||||
xNetworkBuffer.xDataLength = sizeof( ucBadUdpPacketA );
|
||||
xReturn = xProcessReceivedUDPPacket( &xNetworkBuffer, usPort );
|
||||
TEST_ASSERT_EQUAL_UINT32_MESSAGE( pdFAIL, xReturn, "Failed to parse 2 bytes packet" );
|
||||
|
||||
xNetworkBuffer.pucEthernetBuffer = ucBadUdpPacketB;
|
||||
xNetworkBuffer.xDataLength = sizeof( ucBadUdpPacketB );
|
||||
xReturn = xProcessReceivedUDPPacket( &xNetworkBuffer, usPort );
|
||||
TEST_ASSERT_EQUAL_UINT32( pdFAIL, xReturn );
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
# Uncrustify-0.67
|
||||
input_tab_size = 4 # unsigned number
|
||||
output_tab_size = 4 # unsigned number
|
||||
sp_arith = force # ignore/add/remove/force
|
||||
sp_assign = force # ignore/add/remove/force
|
||||
sp_assign_default = force # ignore/add/remove/force
|
||||
sp_before_assign = force # ignore/add/remove/force
|
||||
sp_after_assign = force # ignore/add/remove/force
|
||||
sp_enum_assign = force # ignore/add/remove/force
|
||||
sp_enum_before_assign = force # ignore/add/remove/force
|
||||
sp_enum_after_assign = force # ignore/add/remove/force
|
||||
sp_pp_stringify = add # ignore/add/remove/force
|
||||
sp_bool = force # ignore/add/remove/force
|
||||
sp_compare = force # ignore/add/remove/force
|
||||
sp_inside_paren = force # ignore/add/remove/force
|
||||
sp_paren_paren = force # ignore/add/remove/force
|
||||
sp_paren_brace = force # ignore/add/remove/force
|
||||
sp_before_ptr_star = force # ignore/add/remove/force
|
||||
sp_before_unnamed_ptr_star = force # ignore/add/remove/force
|
||||
sp_between_ptr_star = remove # ignore/add/remove/force
|
||||
sp_after_ptr_star = ignore # ignore/add/remove/force
|
||||
sp_before_byref = force # ignore/add/remove/force
|
||||
sp_after_byref = remove # ignore/add/remove/force
|
||||
sp_after_byref_func = remove # ignore/add/remove/force
|
||||
sp_before_angle = remove # ignore/add/remove/force
|
||||
sp_inside_angle = remove # ignore/add/remove/force
|
||||
sp_after_angle = force # ignore/add/remove/force
|
||||
sp_before_sparen = remove # ignore/add/remove/force
|
||||
sp_inside_sparen = force # ignore/add/remove/force
|
||||
sp_after_sparen = force # ignore/add/remove/force
|
||||
sp_sparen_brace = force # ignore/add/remove/force
|
||||
sp_before_semi_for = remove # ignore/add/remove/force
|
||||
sp_before_semi_for_empty = add # ignore/add/remove/force
|
||||
sp_after_semi_for_empty = force # ignore/add/remove/force
|
||||
sp_before_square = remove # ignore/add/remove/force
|
||||
sp_before_squares = remove # ignore/add/remove/force
|
||||
sp_inside_square = force # ignore/add/remove/force
|
||||
sp_after_comma = force # ignore/add/remove/force
|
||||
sp_after_cast = force # ignore/add/remove/force
|
||||
sp_inside_paren_cast = force # ignore/add/remove/force
|
||||
sp_sizeof_paren = remove # ignore/add/remove/force
|
||||
sp_inside_braces_enum = force # ignore/add/remove/force
|
||||
sp_inside_braces_struct = force # ignore/add/remove/force
|
||||
sp_inside_braces = force # ignore/add/remove/force
|
||||
sp_inside_braces_empty = remove # ignore/add/remove/force
|
||||
sp_type_func = force # ignore/add/remove/force
|
||||
sp_func_proto_paren = remove # ignore/add/remove/force
|
||||
sp_func_def_paren = remove # ignore/add/remove/force
|
||||
sp_inside_fparens = remove # ignore/add/remove/force
|
||||
sp_inside_fparen = force # ignore/add/remove/force
|
||||
sp_fparen_brace = add # ignore/add/remove/force
|
||||
sp_func_call_paren = remove # ignore/add/remove/force
|
||||
sp_func_class_paren = remove # ignore/add/remove/force
|
||||
sp_return_paren = remove # ignore/add/remove/force
|
||||
sp_attribute_paren = remove # ignore/add/remove/force
|
||||
sp_defined_paren = remove # ignore/add/remove/force
|
||||
sp_macro = force # ignore/add/remove/force
|
||||
sp_macro_func = force # ignore/add/remove/force
|
||||
sp_brace_typedef = force # ignore/add/remove/force
|
||||
sp_before_dc = remove # ignore/add/remove/force
|
||||
sp_after_dc = remove # ignore/add/remove/force
|
||||
sp_cond_colon = force # ignore/add/remove/force
|
||||
sp_cond_question = force # ignore/add/remove/force
|
||||
sp_case_label = force # ignore/add/remove/force
|
||||
sp_endif_cmt = force # ignore/add/remove/force
|
||||
sp_before_tr_emb_cmt = force # ignore/add/remove/force
|
||||
sp_num_before_tr_emb_cmt = 1 # unsigned number
|
||||
indent_columns = 4 # unsigned number
|
||||
indent_with_tabs = 2 # unsigned number
|
||||
indent_align_string = true # false/true
|
||||
indent_class = true # false/true
|
||||
indent_class_colon = true # false/true
|
||||
indent_member = 3 # unsigned number
|
||||
indent_switch_case = 4 # unsigned number
|
||||
indent_case_brace = 3 # number
|
||||
indent_var_def_blk = -4 # number
|
||||
nl_assign_leave_one_liners = true # false/true
|
||||
nl_class_leave_one_liners = true # false/true
|
||||
nl_start_of_file = remove # ignore/add/remove/force
|
||||
nl_end_of_file = force # ignore/add/remove/force
|
||||
nl_end_of_file_min = 1 # unsigned number
|
||||
nl_assign_brace = add # ignore/add/remove/force
|
||||
nl_func_var_def_blk = 1 # unsigned number
|
||||
nl_fcall_brace = add # ignore/add/remove/force
|
||||
nl_enum_brace = force # ignore/add/remove/force
|
||||
nl_struct_brace = force # ignore/add/remove/force
|
||||
nl_union_brace = force # ignore/add/remove/force
|
||||
nl_if_brace = add # ignore/add/remove/force
|
||||
nl_brace_else = add # ignore/add/remove/force
|
||||
nl_else_brace = add # ignore/add/remove/force
|
||||
nl_getset_brace = force # ignore/add/remove/force
|
||||
nl_for_brace = add # ignore/add/remove/force
|
||||
nl_while_brace = add # ignore/add/remove/force
|
||||
nl_do_brace = add # ignore/add/remove/force
|
||||
nl_switch_brace = add # ignore/add/remove/force
|
||||
nl_multi_line_define = true # false/true
|
||||
nl_before_case = true # false/true
|
||||
nl_after_case = true # false/true
|
||||
nl_func_type_name = remove # ignore/add/remove/force
|
||||
nl_func_proto_type_name = remove # ignore/add/remove/force
|
||||
nl_func_paren = remove # ignore/add/remove/force
|
||||
nl_func_def_paren = remove # ignore/add/remove/force
|
||||
nl_func_decl_start = remove # ignore/add/remove/force
|
||||
nl_func_def_start = remove # ignore/add/remove/force
|
||||
nl_func_decl_args = add # ignore/add/remove/force
|
||||
nl_func_def_args = add # ignore/add/remove/force
|
||||
nl_func_decl_end = remove # ignore/add/remove/force
|
||||
nl_func_def_end = remove # ignore/add/remove/force
|
||||
nl_fdef_brace = add # ignore/add/remove/force
|
||||
nl_after_semicolon = true # false/true
|
||||
nl_after_brace_open = true # false/true
|
||||
nl_after_brace_close = true # false/true
|
||||
nl_squeeze_ifdef = true # false/true
|
||||
nl_before_if = force # ignore/add/remove/force
|
||||
nl_after_if = force # ignore/add/remove/force
|
||||
nl_before_for = force # ignore/add/remove/force
|
||||
nl_after_for = force # ignore/add/remove/force
|
||||
nl_before_while = force # ignore/add/remove/force
|
||||
nl_after_while = force # ignore/add/remove/force
|
||||
nl_before_switch = force # ignore/add/remove/force
|
||||
nl_after_switch = force # ignore/add/remove/force
|
||||
nl_before_do = force # ignore/add/remove/force
|
||||
nl_after_do = force # ignore/add/remove/force
|
||||
nl_max = 4 # unsigned number
|
||||
nl_after_func_proto_group = 1 # unsigned number
|
||||
nl_after_func_body_class = 2 # unsigned number
|
||||
nl_before_block_comment = 2 # unsigned number
|
||||
eat_blanks_after_open_brace = true # false/true
|
||||
eat_blanks_before_close_brace = true # false/true
|
||||
nl_after_return = true # false/true
|
||||
pos_bool = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
|
||||
align_var_def_amp_style = 1 # unsigned number
|
||||
align_var_def_thresh = 16 # unsigned number
|
||||
align_assign_thresh = 12 # unsigned number
|
||||
align_struct_init_span = 3 # unsigned number
|
||||
align_typedef_gap = 3 # unsigned number
|
||||
align_typedef_span = 5 # unsigned number
|
||||
align_typedef_star_style = 1 # unsigned number
|
||||
align_typedef_amp_style = 1 # unsigned number
|
||||
align_right_cmt_span = 3 # unsigned number
|
||||
align_nl_cont = true # false/true
|
||||
align_pp_define_gap = 4 # unsigned number
|
||||
align_pp_define_span = 3 # unsigned number
|
||||
cmt_cpp_to_c = true # false/true
|
||||
cmt_star_cont = false # false/true
|
||||
cmt_indent_multi = false # false/true
|
||||
mod_full_brace_do = add # ignore/add/remove/force
|
||||
mod_full_brace_for = add # ignore/add/remove/force
|
||||
mod_full_brace_if = add # ignore/add/remove/force
|
||||
mod_full_brace_while = add # ignore/add/remove/force
|
||||
mod_full_paren_if_bool = true # false/true
|
||||
mod_remove_extra_semicolon = true # false/true
|
||||
mod_add_long_ifdef_endif_comment = 10 # unsigned number
|
||||
mod_add_long_ifdef_else_comment = 10 # unsigned number
|
||||
mod_case_brace = remove # ignore/add/remove/force
|
||||
mod_remove_empty_return = true # false/true
|
||||
pp_indent = force # ignore/add/remove/force
|
||||
pp_indent_at_level = true # false/true
|
||||
pp_indent_count = 4 # unsigned number
|
||||
pp_space = remove # ignore/add/remove/force
|
||||
pp_if_indent_code = true # false/true
|
||||
pp_indent_brace = false # false/true
|
||||
align_with_tabs = true # false/true
|
||||
# option(s) with 'not default' value: 162
|
Loading…
Reference in New Issue