1 /*
2  * FreeRTOS+TCP V3.1.0
3  * Copyright (C) 2022 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
5  * SPDX-License-Identifier: MIT
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy of
8  * this software and associated documentation files (the "Software"), to deal in
9  * the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11  * the Software, and to permit persons to whom the Software is furnished to do so,
12  * subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all
15  * copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * http://aws.amazon.com/freertos
25  * http://www.FreeRTOS.org
26  */
27 
28 /* This file provides default (empty) implementations for any IP trace macros
29  * that are not defined by the user.  See
30  * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Trace.html */
31 
32 #ifndef UDP_TRACE_MACRO_DEFAULTS_H
33 #define UDP_TRACE_MACRO_DEFAULTS_H
34 
35 #ifndef iptraceNETWORK_DOWN
36     #define iptraceNETWORK_DOWN()
37 #endif
38 
39 #ifndef iptraceNETWORK_BUFFER_RELEASED
40     #define iptraceNETWORK_BUFFER_RELEASED( pxBufferAddress )
41 #endif
42 
43 #ifndef iptraceNETWORK_BUFFER_OBTAINED
44     #define iptraceNETWORK_BUFFER_OBTAINED( pxBufferAddress )
45 #endif
46 
47 #ifndef iptraceNETWORK_BUFFER_OBTAINED_FROM_ISR
48     #define iptraceNETWORK_BUFFER_OBTAINED_FROM_ISR( pxBufferAddress )
49 #endif
50 
51 #ifndef iptraceNETWORK_INTERFACE_INPUT
52     /* An Ethernet packet has been received. */
53     #define iptraceNETWORK_INTERFACE_INPUT( uxDataLength, pucEthernetBuffer )
54 #endif
55 
56 #ifndef iptraceNETWORK_INTERFACE_OUTPUT
57     /* An Ethernet packet will be sent. */
58     #define iptraceNETWORK_INTERFACE_OUTPUT( uxDataLength, pucEthernetBuffer )
59 #endif
60 
61 #ifndef iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER
62     #define iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER()
63 #endif
64 
65 #ifndef iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER_FROM_ISR
66     #define iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER_FROM_ISR()
67 #endif
68 
69 #ifndef iptraceDROPPED_INVALID_ARP_PACKET
70     #define iptraceDROPPED_INVALID_ARP_PACKET( pxARPHeader )
71 #endif
72 
73 #ifndef iptraceCREATING_ARP_REQUEST
74     #define iptraceCREATING_ARP_REQUEST( ulIPAddress )
75 #endif
76 
77 /* A packet came in from an unknown IPv4 address.
78  * An ARP request has been sent and the network
79  * buffer is stored for processing later.*/
80 #ifndef iptraceDELAYED_ARP_REQUEST_STARTED
81     #define iptraceDELAYED_ARP_REQUEST_STARTED()
82 #endif
83 
84 /* A packet has come in from an unknown IPv4 address.
85  * An ARP request has been sent, but the queue is
86  * still filled with a different packet. */
87 #ifndef iptraceDELAYED_ARP_BUFFER_FULL
88     #define iptraceDELAYED_ARP_BUFFER_FULL()
89 #endif
90 
91 /* An ARP request has been sent, and a matching
92  * reply is received. Now the original
93  * packet will be processed by the IP-task. */
94 #ifndef iptrace_DELAYED_ARP_REQUEST_REPLIED
95     #define iptrace_DELAYED_ARP_REQUEST_REPLIED()
96 #endif
97 
98 /* A packet was stored for delayed processing, but
99  * there is no ARP reply. The network buffer will
100  * be released without being processed. */
101 #ifndef iptraceDELAYED_ARP_TIMER_EXPIRED
102     #define iptraceDELAYED_ARP_TIMER_EXPIRED()
103 #endif
104 
105 #ifndef iptraceARP_TABLE_ENTRY_WILL_EXPIRE
106     #define iptraceARP_TABLE_ENTRY_WILL_EXPIRE( ulIPAddress )
107 #endif
108 
109 #ifndef iptraceARP_TABLE_ENTRY_EXPIRED
110     #define iptraceARP_TABLE_ENTRY_EXPIRED( ulIPAddress )
111 #endif
112 
113 #ifndef iptraceARP_TABLE_ENTRY_CREATED
114     #define iptraceARP_TABLE_ENTRY_CREATED( ulIPAddress, ucMACAddress )
115 #endif
116 
117 #ifndef iptraceSENDING_UDP_PACKET
118     #define iptraceSENDING_UDP_PACKET( ulIPAddress )
119 #endif
120 
121 #ifndef iptracePACKET_DROPPED_TO_GENERATE_ARP
122     #define iptracePACKET_DROPPED_TO_GENERATE_ARP( ulIPAddress )
123 #endif
124 
125 #ifndef iptraceICMP_PACKET_RECEIVED
126     #define iptraceICMP_PACKET_RECEIVED()
127 #endif
128 
129 #ifndef iptraceSENDING_PING_REPLY
130     #define iptraceSENDING_PING_REPLY( ulIPAddress )
131 #endif
132 
133 #ifndef traceARP_PACKET_RECEIVED
134     #define traceARP_PACKET_RECEIVED()
135 #endif
136 
137 #ifndef iptracePROCESSING_RECEIVED_ARP_REPLY
138     #define iptracePROCESSING_RECEIVED_ARP_REPLY( ulIPAddress )
139 #endif
140 
141 #ifndef iptraceSENDING_ARP_REPLY
142     #define iptraceSENDING_ARP_REPLY( ulIPAddress )
143 #endif
144 
145 #ifndef iptraceFAILED_TO_CREATE_SOCKET
146     #define iptraceFAILED_TO_CREATE_SOCKET()
147 #endif
148 
149 #ifndef iptraceFAILED_TO_CREATE_EVENT_GROUP
150     #define iptraceFAILED_TO_CREATE_EVENT_GROUP()
151 #endif
152 
153 #ifndef iptraceRECVFROM_DISCARDING_BYTES
154     #define iptraceRECVFROM_DISCARDING_BYTES( xNumberOfBytesDiscarded )
155 #endif
156 
157 #ifndef iptraceETHERNET_RX_EVENT_LOST
158     #define iptraceETHERNET_RX_EVENT_LOST()
159 #endif
160 
161 #ifndef iptraceSTACK_TX_EVENT_LOST
162     #define iptraceSTACK_TX_EVENT_LOST( xEvent )
163 #endif
164 
165 #ifndef iptraceNETWORK_EVENT_RECEIVED
166     #define iptraceNETWORK_EVENT_RECEIVED( eEvent )
167 #endif
168 
169 #ifndef iptraceBIND_FAILED
170     #define iptraceBIND_FAILED( xSocket, usPort )
171 #endif
172 
173 #ifndef iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS
174     #define iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS( ulIPAddress )
175 #endif
176 
177 #ifndef iptraceSENDING_DHCP_DISCOVER
178     #define iptraceSENDING_DHCP_DISCOVER()
179 #endif
180 
181 #ifndef iptraceSENDING_DHCP_REQUEST
182     #define iptraceSENDING_DHCP_REQUEST()
183 #endif
184 
185 #ifndef iptraceDHCP_SUCCEDEED
186     #define iptraceDHCP_SUCCEDEED( address )
187 #endif
188 
189 #ifndef iptraceNETWORK_INTERFACE_TRANSMIT
190     #define iptraceNETWORK_INTERFACE_TRANSMIT()
191 #endif
192 
193 #ifndef iptraceNETWORK_INTERFACE_RECEIVE
194     #define iptraceNETWORK_INTERFACE_RECEIVE()
195 #endif
196 
197 #ifndef iptraceSENDING_DNS_REQUEST
198     #define iptraceSENDING_DNS_REQUEST()
199 #endif
200 
201 #ifndef iptraceWAITING_FOR_TX_DMA_DESCRIPTOR
202     #define iptraceWAITING_FOR_TX_DMA_DESCRIPTOR()
203 #endif
204 
205 #ifndef ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS
206     #define ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS    0
207 #endif
208 
209 #ifndef iptraceFAILED_TO_NOTIFY_SELECT_GROUP
210     #define iptraceFAILED_TO_NOTIFY_SELECT_GROUP( xSocket )
211 #endif
212 
213 #ifndef pvPortMallocSocket
214     #define pvPortMallocSocket( xSize )    pvPortMalloc( ( xSize ) )
215 #endif
216 
217 #ifndef iptraceRECVFROM_TIMEOUT
218     #define iptraceRECVFROM_TIMEOUT()
219 #endif
220 
221 #ifndef iptraceRECVFROM_INTERRUPTED
222     #define iptraceRECVFROM_INTERRUPTED()
223 #endif
224 
225 #ifndef iptraceNO_BUFFER_FOR_SENDTO
226     #define iptraceNO_BUFFER_FOR_SENDTO()
227 #endif
228 
229 #ifndef iptraceSENDTO_SOCKET_NOT_BOUND
230     #define iptraceSENDTO_SOCKET_NOT_BOUND()
231 #endif
232 
233 #ifndef iptraceSENDTO_DATA_TOO_LONG
234     #define iptraceSENDTO_DATA_TOO_LONG()
235 #endif
236 
237 #ifndef ipconfigUSE_TCP_MEM_STATS
238     #define ipconfigUSE_TCP_MEM_STATS    0
239 #endif
240 
241 #if ( ipconfigUSE_TCP_MEM_STATS == 0 )
242 
243 /* See tools/tcp_mem_stat.c */
244 
245     #ifndef iptraceMEM_STATS_CREATE
246         #define iptraceMEM_STATS_CREATE( xMemType, pxObject, uxSize )
247     #endif
248 
249     #ifndef iptraceMEM_STATS_DELETE
250         #define iptraceMEM_STATS_DELETE( pxObject )
251     #endif
252 
253     #ifndef iptraceMEM_STATS_CLOSE
254         #define iptraceMEM_STATS_CLOSE()
255     #endif
256 
257 #endif /* ( ipconfigUSE_TCP_MEM_STATS != 0 ) */
258 
259 #ifndef ipconfigUSE_DUMP_PACKETS
260     #define ipconfigUSE_DUMP_PACKETS    0
261 #endif
262 
263 #if ( ipconfigUSE_DUMP_PACKETS == 0 )
264 
265 /* See tools/tcp_dump_packets.c */
266 
267     #ifndef iptraceDUMP_INIT
268         #define iptraceDUMP_INIT( pcFileName, pxEntries )
269     #endif
270 
271     #ifndef iptraceDUMP_PACKET
272         #define iptraceDUMP_PACKET( pucBuffer, uxLength, xIncoming )
273     #endif
274 
275 #endif /* ( ipconfigUSE_DUMP_PACKETS != 0 ) */
276 
277 #endif /* UDP_TRACE_MACRO_DEFAULTS_H */
278