as gethostbyname() may be called from different threads */\r
TickType_t xIdentifier = ( TickType_t )usIdentifier++;\r
\r
+ /* If the supplied hostname is IP address, convert it to uint32_t\r
+ and return. */\r
+ #if( ipconfigINCLUDE_FULL_INET_ADDR == 1 )\r
+ {\r
+ ulIPAddress = FreeRTOS_inet_addr( pcHostName );\r
+ }\r
+ #endif /* ipconfigINCLUDE_FULL_INET_ADDR == 1 */\r
+\r
/* If a DNS cache is used then check the cache before issuing another DNS\r
request. */\r
#if( ipconfigUSE_DNS_CACHE == 1 )\r
{\r
- ulIPAddress = FreeRTOS_dnslookup( pcHostName );\r
- if( ulIPAddress != 0 )\r
- {\r
- FreeRTOS_debug_printf( ( "FreeRTOS_gethostbyname: found '%s' in cache: %lxip\n", pcHostName, ulIPAddress ) );\r
- }\r
- else\r
+ if( ulIPAddress == 0UL )\r
{\r
- /* prvGetHostByName will be called to start a DNS lookup. */\r
+ ulIPAddress = FreeRTOS_dnslookup( pcHostName );\r
+ if( ulIPAddress != 0 )\r
+ {\r
+ FreeRTOS_debug_printf( ( "FreeRTOS_gethostbyname: found '%s' in cache: %lxip\n", pcHostName, ulIPAddress ) );\r
+ }\r
+ else\r
+ {\r
+ /* prvGetHostByName will be called to start a DNS lookup */\r
+ }\r
}\r
}\r
#endif /* ipconfigUSE_DNS_CACHE == 1 */\r
{\r
xNetworkBufferSemaphore = xSemaphoreCreateCounting( ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS, ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS );\r
configASSERT( xNetworkBufferSemaphore );\r
- #if ( configQUEUE_REGISTRY_SIZE > 0 )\r
- {\r
- vQueueAddToRegistry( xNetworkBufferSemaphore, "NetBufSem" );\r
- }\r
- #endif /* configQUEUE_REGISTRY_SIZE */\r
-\r
- /* If the trace recorder code is included name the semaphore for viewing\r
- in FreeRTOS+Trace. */\r
- #if( ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 )\r
- {\r
- extern QueueHandle_t xNetworkEventQueue;\r
- vTraceSetQueueName( xNetworkEventQueue, "IPStackEvent" );\r
- vTraceSetQueueName( xNetworkBufferSemaphore, "NetworkBufferCount" );\r
- }\r
- #endif /* ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 */\r
\r
if( xNetworkBufferSemaphore != NULL )\r
{\r
+ #if ( configQUEUE_REGISTRY_SIZE > 0 )\r
+ {\r
+ vQueueAddToRegistry( xNetworkBufferSemaphore, "NetBufSem" );\r
+ }\r
+ #endif /* configQUEUE_REGISTRY_SIZE */\r
+\r
+ /* If the trace recorder code is included name the semaphore for viewing\r
+ in FreeRTOS+Trace. */\r
+ #if( ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 )\r
+ {\r
+ extern QueueHandle_t xNetworkEventQueue;\r
+ vTraceSetQueueName( xNetworkEventQueue, "IPStackEvent" );\r
+ vTraceSetQueueName( xNetworkBufferSemaphore, "NetworkBufferCount" );\r
+ }\r
+ #endif /* ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 */\r
+\r
vListInitialise( &xFreeBuffersList );\r
\r
/* Initialise all the network buffers. No storage is allocated to\r
vReleaseNetworkBuffer( pxNetworkBuffer->pucEthernetBuffer );\r
pxNetworkBuffer->pucEthernetBuffer = pucBuffer;\r
}\r
- \r
+\r
return pxNetworkBuffer;\r
}\r
\r