1 /* 2 * FreeRTOS+TCP <DEVELOPMENT BRANCH> 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 iptraceND_TABLE_ENTRY_WILL_EXPIRE 118 #define iptraceND_TABLE_ENTRY_WILL_EXPIRE( pxIPAddress ) 119 #endif 120 121 #ifndef iptraceND_TABLE_ENTRY_EXPIRED 122 #define iptraceND_TABLE_ENTRY_EXPIRED( pxIPAddress ) 123 #endif 124 125 #ifndef iptraceSENDING_UDP_PACKET 126 #define iptraceSENDING_UDP_PACKET( ulIPAddress ) 127 #endif 128 129 #ifndef iptracePACKET_DROPPED_TO_GENERATE_ARP 130 #define iptracePACKET_DROPPED_TO_GENERATE_ARP( ulIPAddress ) 131 #endif 132 133 #ifndef iptraceICMP_PACKET_RECEIVED 134 #define iptraceICMP_PACKET_RECEIVED() 135 #endif 136 137 #ifndef iptraceSENDING_PING_REPLY 138 #define iptraceSENDING_PING_REPLY( ulIPAddress ) 139 #endif 140 141 #ifndef traceARP_PACKET_RECEIVED 142 #define traceARP_PACKET_RECEIVED() 143 #endif 144 145 #ifndef iptracePROCESSING_RECEIVED_ARP_REPLY 146 #define iptracePROCESSING_RECEIVED_ARP_REPLY( ulIPAddress ) 147 #endif 148 149 #ifndef iptraceSENDING_ARP_REPLY 150 #define iptraceSENDING_ARP_REPLY( ulIPAddress ) 151 #endif 152 153 #ifndef iptraceFAILED_TO_CREATE_SOCKET 154 #define iptraceFAILED_TO_CREATE_SOCKET() 155 #endif 156 157 #ifndef iptraceFAILED_TO_CREATE_EVENT_GROUP 158 #define iptraceFAILED_TO_CREATE_EVENT_GROUP() 159 #endif 160 161 #ifndef iptraceRECVFROM_DISCARDING_BYTES 162 #define iptraceRECVFROM_DISCARDING_BYTES( xNumberOfBytesDiscarded ) 163 #endif 164 165 #ifndef iptraceETHERNET_RX_EVENT_LOST 166 #define iptraceETHERNET_RX_EVENT_LOST() 167 #endif 168 169 #ifndef iptraceSTACK_TX_EVENT_LOST 170 #define iptraceSTACK_TX_EVENT_LOST( xEvent ) 171 #endif 172 173 #ifndef iptraceNETWORK_EVENT_RECEIVED 174 #define iptraceNETWORK_EVENT_RECEIVED( eEvent ) 175 #endif 176 177 #ifndef iptraceBIND_FAILED 178 #define iptraceBIND_FAILED( xSocket, usPort ) 179 #endif 180 181 #ifndef iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS 182 #define iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS( ulIPAddress ) 183 #endif 184 185 #ifndef iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IPv6_ADDRESS 186 #define iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IPv6_ADDRESS( xIPAddress ) 187 #endif 188 189 #ifndef iptraceSENDING_DHCP_DISCOVER 190 #define iptraceSENDING_DHCP_DISCOVER() 191 #endif 192 193 #ifndef iptraceSENDING_DHCP_REQUEST 194 #define iptraceSENDING_DHCP_REQUEST() 195 #endif 196 197 #ifndef iptraceDHCP_SUCCEDEED 198 #define iptraceDHCP_SUCCEDEED( address ) 199 #endif 200 201 #ifndef iptraceRA_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS 202 #define iptraceRA_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS( ipv6_address ) 203 #endif 204 205 #ifndef iptraceRA_SUCCEDEED 206 #define iptraceRA_SUCCEDEED( ipv6_address ) 207 #endif 208 209 #ifndef iptraceNETWORK_INTERFACE_TRANSMIT 210 #define iptraceNETWORK_INTERFACE_TRANSMIT() 211 #endif 212 213 #ifndef iptraceNETWORK_INTERFACE_RECEIVE 214 #define iptraceNETWORK_INTERFACE_RECEIVE() 215 #endif 216 217 #ifndef iptraceSENDING_DNS_REQUEST 218 #define iptraceSENDING_DNS_REQUEST() 219 #endif 220 221 #ifndef iptraceWAITING_FOR_TX_DMA_DESCRIPTOR 222 #define iptraceWAITING_FOR_TX_DMA_DESCRIPTOR() 223 #endif 224 225 #ifndef ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS 226 #define ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS 0 227 #endif 228 229 #ifndef iptraceFAILED_TO_NOTIFY_SELECT_GROUP 230 #define iptraceFAILED_TO_NOTIFY_SELECT_GROUP( xSocket ) 231 #endif 232 233 #ifndef pvPortMallocSocket 234 #define pvPortMallocSocket( xSize ) pvPortMalloc( ( xSize ) ) 235 #endif 236 237 #ifndef iptraceRECVFROM_TIMEOUT 238 #define iptraceRECVFROM_TIMEOUT() 239 #endif 240 241 #ifndef iptraceRECVFROM_INTERRUPTED 242 #define iptraceRECVFROM_INTERRUPTED() 243 #endif 244 245 #ifndef iptraceNO_BUFFER_FOR_SENDTO 246 #define iptraceNO_BUFFER_FOR_SENDTO() 247 #endif 248 249 #ifndef iptraceSENDTO_SOCKET_NOT_BOUND 250 #define iptraceSENDTO_SOCKET_NOT_BOUND() 251 #endif 252 253 #ifndef iptraceSENDTO_DATA_TOO_LONG 254 #define iptraceSENDTO_DATA_TOO_LONG() 255 #endif 256 257 #ifndef ipconfigUSE_TCP_MEM_STATS 258 #define ipconfigUSE_TCP_MEM_STATS 0 259 #endif 260 261 #if ( ipconfigUSE_TCP_MEM_STATS == 0 ) 262 263 /* See tools/tcp_mem_stat.c */ 264 265 #ifndef iptraceMEM_STATS_CREATE 266 #define iptraceMEM_STATS_CREATE( xMemType, pxObject, uxSize ) 267 #endif 268 269 #ifndef iptraceMEM_STATS_DELETE 270 #define iptraceMEM_STATS_DELETE( pxObject ) 271 #endif 272 273 #ifndef iptraceMEM_STATS_CLOSE 274 #define iptraceMEM_STATS_CLOSE() 275 #endif 276 277 #endif /* ( ipconfigUSE_TCP_MEM_STATS != 0 ) */ 278 279 #ifndef ipconfigUSE_DUMP_PACKETS 280 #define ipconfigUSE_DUMP_PACKETS 0 281 #endif 282 283 #if ( ipconfigUSE_DUMP_PACKETS == 0 ) 284 285 /* See tools/tcp_dump_packets.c */ 286 287 #ifndef iptraceDUMP_INIT 288 #define iptraceDUMP_INIT( pcFileName, pxEntries ) 289 #endif 290 291 #ifndef iptraceDUMP_PACKET 292 #define iptraceDUMP_PACKET( pucBuffer, uxLength, xIncoming ) 293 #endif 294 295 #endif /* ( ipconfigUSE_DUMP_PACKETS != 0 ) */ 296 297 #endif /* UDP_TRACE_MACRO_DEFAULTS_H */ 298