Skip to content

Commit cd5d7a6

Browse files
author
Holden
committed
enforce ipconfig macro bounds
1 parent 9a241ef commit cd5d7a6

File tree

5 files changed

+34
-54
lines changed

5 files changed

+34
-54
lines changed

source/include/FreeRTOSIPDeprecatedDefinitions.h

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,99 +38,103 @@
3838
#endif
3939

4040
#ifdef dnsMAX_REQUEST_ATTEMPTS
41-
#error Now called: ipconfigDNS_REQUEST_ATTEMPTS
41+
#error dnsMAX_REQUEST_ATTEMPTS is now called ipconfigDNS_REQUEST_ATTEMPTS
4242
#endif
4343

4444
#ifdef FreeRTOS_lprintf
45-
#error Now called: FreeRTOS_debug_printf
45+
#error FreeRTOS_lprintf is now called FreeRTOS_debug_printf/FreeRTOS_printf
4646
#endif
4747

4848
#ifdef HAS_TX_CRC_OFFLOADING
49-
#error Now called: ipconfigHAS_TX_CRC_OFFLOADING
49+
#error HAS_TX_CRC_OFFLOADING is deprecated
5050
#endif
5151

5252
#ifdef HAS_RX_CRC_OFFLOADING
53-
#error Now called: ipconfigHAS_RX_CRC_OFFLOADING, Not used
53+
#error HAS_RX_CRC_OFFLOADING is deprecated
5454
#endif
5555

5656
#ifdef ipconfigBUFFER_ALLOC_FIXED_SIZE
57-
#error ipconfigBUFFER_ALLOC_FIXED_SIZE was dropped and replaced by a const value, declared in BufferAllocation[12].c
57+
#error ipconfigBUFFER_ALLOC_FIXED_SIZE is deprecated
5858
#endif
5959

6060
#ifdef ipconfigDHCP_USES_USER_HOOK
6161
#error ipconfigDHCP_USES_USER_HOOK has been replaced by ipconfigUSE_DHCP_HOOK
6262
#endif
6363

6464
#ifdef ipconfigDRIVER_INCLUDED_RX_IP_FILTERING
65-
#error Now called: ipconfigETHERNET_DRIVER_FILTERS_PACKETS
65+
#error ipconfigDRIVER_INCLUDED_RX_IP_FILTERING is now called ipconfigETHERNET_DRIVER_FILTERS_PACKETS
6666
#endif
6767

6868
#ifdef ipconfigHAS_INLINE_FUNCTIONS
69-
#error ipconfigHAS_INLINE_FUNCTIONS is not used
69+
#error ipconfigHAS_INLINE_FUNCTIONS is deprecated
70+
#endif
71+
72+
#ifdef ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS
73+
#error ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS is deprecated
7074
#endif
7175

7276
#ifdef ipconfigINCLUDE_FULL_INET_ADDR
73-
#error ipconfigINCLUDE_FULL_INET_ADDR is not used
77+
#error ipconfigINCLUDE_FULL_INET_ADDR is deprecated
7478
#endif
7579

7680
#ifdef ipconfigMAX_SEND_BLOCK_TIME_TICKS
77-
#error Now called: ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS
81+
#error ipconfigMAX_SEND_BLOCK_TIME_TICKS is now called ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS
7882
#endif
7983

8084
#ifdef ipconfigNIC_SEND_PASSES_DMA
81-
#error Now called: ipconfigZERO_COPY_TX_DRIVER
85+
#error ipconfigNIC_SEND_PASSES_DMA is now called ipconfigZERO_COPY_TX_DRIVER
8286
#endif
8387

8488
#ifdef ipconfigNUM_NETWORK_BUFFERS
85-
#error Now called: ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS
89+
#error ipconfigNUM_NETWORK_BUFFERS is now now called ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS
8690
#endif
8791

8892
#ifdef ipconfigRAND32
8993
#error ipconfigRAND32 has been replaced by xApplicationGetRandomNumber( uint32_t *pulValue )
9094
#endif
9195

9296
#ifdef ipconfigTCP_HANG_PROT
93-
#error Now called: ipconfigTCP_HANG_PROTECTION
97+
#error ipconfigTCP_HANG_PROT is now called ipconfigTCP_HANG_PROTECTION
9498
#endif
9599

96100
#ifdef ipconfigTCP_HANG_PROT_TIME
97-
#error Now called: ipconfigTCP_HANG_PROTECTION_TIME
101+
#error ipconfigTCP_HANG_PROT_TIME is now called ipconfigTCP_HANG_PROTECTION_TIME
98102
#endif
99103

100104
#ifdef ipconfigTCP_RX_BUF_LEN
101-
#error ipconfigTCP_RX_BUF_LEN is Now called ipconfigTCP_RX_BUFFER_LENGTH
105+
#error ipconfigTCP_RX_BUF_LEN is now called ipconfigTCP_RX_BUFFER_LENGTH
102106
#endif
103107

104108
#ifdef ipconfigTCP_TX_BUF_LEN
105-
#error ipconfigTCP_TX_BUF_LEN is Now called ipconfigTCP_TX_BUFFER_LENGTH
109+
#error ipconfigTCP_TX_BUF_LEN is now called ipconfigTCP_TX_BUFFER_LENGTH
106110
#endif
107111

108112
#ifdef ipconfigUDP_TASK_PRIORITY
109-
#error Now called: ipconfigIP_TASK_PRIORITY
113+
#error ipconfigUDP_TASK_PRIORITY is now called ipconfigIP_TASK_PRIORITY
110114
#endif
111115

112116
#ifdef ipconfigUDP_TASK_STACK_SIZE_WORDS
113-
#error Now called: ipconfigIP_TASK_STACK_SIZE_WORDS
117+
#error ipconfigUDP_TASK_STACK_SIZE_WORDS is now called ipconfigIP_TASK_STACK_SIZE_WORDS
114118
#endif
115119

116120
#ifdef ipconfigUSE_RECEIVE_CONNECT_CALLBACKS
117-
#error Now called: ipconfigUSE_CALLBACKS
121+
#error ipconfigUSE_RECEIVE_CONNECT_CALLBACKS is now called ipconfigUSE_CALLBACKS
118122
#endif
119123

120124
#ifdef ipconfigUSE_TCP_TIMESTAMPS
121-
#error ipconfigUSE_TCP_TIMESTAMPS is not used
125+
#error ipconfigUSE_TCP_TIMESTAMPS is deprecated
122126
#endif
123127

124128
#ifdef ipFILLER_SIZE
125-
#error Now called: ipconfigPACKET_FILLER_SIZE
129+
#error ipFILLER_SIZE is now called ipconfigPACKET_FILLER_SIZE
126130
#endif
127131

128132
#ifdef tcpconfigIP_TIME_TO_LIVE
129-
#error Now called: ipconfigTCP_TIME_TO_LIVE
133+
#error tcpconfigIP_TIME_TO_LIVE is now called ipconfigTCP_TIME_TO_LIVE
130134
#endif
131135

132136
#ifdef updconfigIP_TIME_TO_LIVE
133-
#error Now called: ipconfigUDP_TIME_TO_LIVE
137+
#error updconfigIP_TIME_TO_LIVE is now called ipconfigUDP_TIME_TO_LIVE
134138
#endif
135139

136140
#endif /* FREERTOS_IP_DEPRECATED_DEFINITIONS_H */

source/include/IPTraceMacroDefaults.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@
699699

700700
/*---------------------------------------------------------------------------*/
701701

702-
#if ( ipconfigREPLY_TO_INCOMING_PINGS != 0 ) || ( ipconfigSUPPORT_OUTGOING_PINGS != 0 )
702+
#if ( ipconfigIS_ENABLED( ipconfigREPLY_TO_INCOMING_PINGS ) || ipconfigIS_ENABLED( ipconfigSUPPORT_OUTGOING_PINGS ) )
703703

704704
/*-----------------------------------------------------------------------*/
705705

@@ -714,11 +714,11 @@
714714

715715
/*-----------------------------------------------------------------------*/
716716

717-
#endif /* if ( ipconfigREPLY_TO_INCOMING_PINGS != 0 ) || ( ipconfigSUPPORT_OUTGOING_PINGS != 0 ) */
717+
#endif /* if ( ipconfigIS_ENABLED( ipconfigREPLY_TO_INCOMING_PINGS ) || ipconfigIS_ENABLED( ipconfigSUPPORT_OUTGOING_PINGS ) ) */
718718

719719
/*---------------------------------------------------------------------------*/
720720

721-
#if ( ipconfigREPLY_TO_INCOMING_PINGS != 0 )
721+
#if ( ipconfigIS_ENABLED( ipconfigREPLY_TO_INCOMING_PINGS ) )
722722

723723
/*-----------------------------------------------------------------------*/
724724

@@ -736,7 +736,7 @@
736736

737737
/*-----------------------------------------------------------------------*/
738738

739-
#endif /* if ( ipconfigREPLY_TO_INCOMING_PINGS != 0 ) */
739+
#endif /* if ( ipconfigIS_ENABLED( ipconfigREPLY_TO_INCOMING_PINGS ) ) */
740740

741741
/*---------------------------------------------------------------------------*/
742742

@@ -813,7 +813,7 @@
813813
/*---------------------------------------------------------------------------*/
814814

815815
/* See tools/tcp_mem_stat.c */
816-
#if ( ipconfigUSE_TCP_MEM_STATS == 0 )
816+
#if ( ipconfigIS_DISABLED( ipconfigUSE_TCP_MEM_STATS ) )
817817

818818
/*-----------------------------------------------------------------------*/
819819

@@ -853,7 +853,7 @@
853853

854854
/*-----------------------------------------------------------------------*/
855855

856-
#endif /* if ( ipconfigUSE_TCP_MEM_STATS == 0 ) */
856+
#endif /* if ( ipconfigIS_DISABLED( ipconfigUSE_TCP_MEM_STATS ) ) */
857857

858858
/*---------------------------------------------------------------------------*/
859859

@@ -870,7 +870,7 @@
870870
/*---------------------------------------------------------------------------*/
871871

872872
/* See tools/tcp_dump_packets.c */
873-
#if ( ipconfigUSE_DUMP_PACKETS == 0 )
873+
#if ( ipconfigIS_DISABLED( ipconfigUSE_DUMP_PACKETS ) )
874874

875875
/*-----------------------------------------------------------------------*/
876876

@@ -892,7 +892,7 @@
892892

893893
/*-----------------------------------------------------------------------*/
894894

895-
#endif /* if ( ipconfigUSE_DUMP_PACKETS == 0 ) */
895+
#endif /* if ( ipconfigIS_DISABLED( ipconfigUSE_DUMP_PACKETS ) ) */
896896

897897
/*---------------------------------------------------------------------------*/
898898

source/portable/BufferManagement/BufferAllocation_2.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,6 @@ BaseType_t xNetworkBuffersInitialise( void )
132132
}
133133
#endif /* configQUEUE_REGISTRY_SIZE */
134134

135-
/* If the trace recorder code is included name the semaphore for viewing
136-
* in FreeRTOS+Trace. */
137-
#if ( ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 )
138-
{
139-
extern QueueHandle_t xNetworkEventQueue;
140-
vTraceSetQueueName( xNetworkEventQueue, "IPStackEvent" );
141-
vTraceSetQueueName( xNetworkBufferSemaphore, "NetworkBufferCount" );
142-
}
143-
#endif /* ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 */
144-
145135
vListInitialise( &xFreeBuffersList );
146136

147137
/* Initialise all the network buffers. No storage is allocated to

source/portable/NetworkInterface/pic32mzef/BufferAllocation_2.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,6 @@ BaseType_t xNetworkBuffersInitialise( void )
274274
}
275275
#endif /* configQUEUE_REGISTRY_SIZE */
276276

277-
/* If the trace recorder code is included name the semaphore for viewing
278-
* in FreeRTOS+Trace. */
279-
#if ( ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 )
280-
{
281-
extern QueueHandle_t xNetworkEventQueue;
282-
vTraceSetQueueName( xNetworkEventQueue, "IPStackEvent" );
283-
vTraceSetQueueName( xNetworkBufferSemaphore, "NetworkBufferCount" );
284-
}
285-
#endif /* ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 */
286-
287277
vListInitialise( &xFreeBuffersList );
288278

289279
/* Initialise all the network buffers. No storage is allocated to

test/unit-test/ConfigFiles/IPTraceMacroDefaults.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@
160160
#define iptraceWAITING_FOR_TX_DMA_DESCRIPTOR()
161161
#endif
162162

163-
#ifndef ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS
164-
#define ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS 0
165-
#endif
166-
167163
#ifndef iptraceFAILED_TO_NOTIFY_SELECT_GROUP
168164
#define iptraceFAILED_TO_NOTIFY_SELECT_GROUP( xSocket )
169165
#endif

0 commit comments

Comments
 (0)