2 * FreeRTOS+TCP Labs Build 160919 (C) 2016 Real Time Engineers ltd.
\r
3 * Authors include Hein Tibosch and Richard Barry
\r
5 *******************************************************************************
\r
6 ***** NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ***
\r
9 *** FREERTOS+TCP IS STILL IN THE LAB (mainly because the FTP and HTTP ***
\r
10 *** demos have a dependency on FreeRTOS+FAT, which is only in the Labs ***
\r
13 *** FreeRTOS+TCP is functional and has been used in commercial products ***
\r
14 *** for some time. Be aware however that we are still refining its ***
\r
15 *** design, the source code does not yet quite conform to the strict ***
\r
16 *** coding and style standards mandated by Real Time Engineers ltd., and ***
\r
17 *** the documentation and testing is not necessarily complete. ***
\r
19 *** PLEASE REPORT EXPERIENCES USING THE SUPPORT RESOURCES FOUND ON THE ***
\r
20 *** URL: http://www.FreeRTOS.org/contact Active early adopters may, at ***
\r
21 *** the sole discretion of Real Time Engineers Ltd., be offered versions ***
\r
22 *** under a license other than that described below. ***
\r
25 ***** NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ***
\r
26 *******************************************************************************
\r
28 * FreeRTOS+TCP can be used under two different free open source licenses. The
\r
29 * license that applies is dependent on the processor on which FreeRTOS+TCP is
\r
30 * executed, as follows:
\r
32 * If FreeRTOS+TCP is executed on one of the processors listed under the Special
\r
33 * License Arrangements heading of the FreeRTOS+TCP license information web
\r
34 * page, then it can be used under the terms of the FreeRTOS Open Source
\r
35 * License. If FreeRTOS+TCP is used on any other processor, then it can be used
\r
36 * under the terms of the GNU General Public License V2. Links to the relevant
\r
39 * The FreeRTOS+TCP License Information Page: http://www.FreeRTOS.org/tcp_license
\r
40 * The FreeRTOS Open Source License: http://www.FreeRTOS.org/license
\r
41 * The GNU General Public License Version 2: http://www.FreeRTOS.org/gpl-2.0.txt
\r
43 * FreeRTOS+TCP is distributed in the hope that it will be useful. You cannot
\r
44 * use FreeRTOS+TCP unless you agree that you use the software 'as is'.
\r
45 * FreeRTOS+TCP is provided WITHOUT ANY WARRANTY; without even the implied
\r
46 * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
47 * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they
\r
48 * implied, expressed, or statutory.
\r
50 * 1 tab == 4 spaces!
\r
52 * http://www.FreeRTOS.org
\r
53 * http://www.FreeRTOS.org/plus
\r
54 * http://www.FreeRTOS.org/labs
\r
58 #ifndef FREERTOS_DNS_H
\r
59 #define FREERTOS_DNS_H
\r
65 /* Application level configuration options. */
\r
66 #include "FreeRTOSIPConfig.h"
\r
67 #include "IPTraceMacroDefaults.h"
\r
70 /* The Link-local Multicast Name Resolution (LLMNR)
\r
72 * Note that a special MAC address is required in addition to the NIC's actual
\r
73 * MAC address: 01:00:5E:00:00:FC
\r
75 * The target IP address will be 224.0.0.252
\r
77 #if( ipconfigBYTE_ORDER == pdFREERTOS_BIG_ENDIAN )
\r
78 #define ipLLMNR_IP_ADDR 0xE00000FC
\r
80 #define ipLLMNR_IP_ADDR 0xFC0000E0
\r
81 #endif /* ipconfigBYTE_ORDER == pdFREERTOS_BIG_ENDIAN */
\r
83 #define ipLLMNR_PORT 5355 /* Standard LLMNR port. */
\r
84 #define ipDNS_PORT 53 /* Standard DNS port. */
\r
85 #define ipDHCP_CLIENT 67
\r
86 #define ipDHCP_SERVER 68
\r
87 #define ipNBNS_PORT 137 /* NetBIOS Name Service. */
\r
88 #define ipNBDGM_PORT 138 /* Datagram Service, not included. */
\r
91 * The following function should be provided by the user and return true if it
\r
92 * matches the domain name.
\r
94 extern BaseType_t xApplicationDNSQueryHook( const char *pcName );
\r
97 * LLMNR is very similar to DNS, so is handled by the DNS routines.
\r
99 uint32_t ulDNSHandlePacket( NetworkBufferDescriptor_t *pxNetworkBuffer );
\r
101 #if( ipconfigUSE_LLMNR == 1 )
\r
102 extern const MACAddress_t xLLMNR_MacAdress;
\r
103 #endif /* ipconfigUSE_LLMNR */
\r
105 #if( ipconfigUSE_NBNS != 0 )
\r
108 * Inspect a NetBIOS Names-Service message. If the name matches with ours
\r
109 * (xApplicationDNSQueryHook returns true) an answer will be sent back.
\r
110 * Note that LLMNR is a better protocol for name services on a LAN as it is
\r
113 uint32_t ulNBNSHandlePacket (NetworkBufferDescriptor_t *pxNetworkBuffer );
\r
115 #endif /* ipconfigUSE_NBNS */
\r
117 #if( ipconfigUSE_DNS_CACHE != 0 )
\r
119 uint32_t FreeRTOS_dnslookup( const char *pcHostName );
\r
121 #endif /* ipconfigUSE_DNS_CACHE != 0 */
\r
123 #if( ipconfigDNS_USE_CALLBACKS != 0 )
\r
126 * Users may define this type of function as a callback.
\r
127 * It will be called when a DNS reply is received or when a timeout has been reached.
\r
129 typedef void (* FOnDNSEvent ) ( const char * /* pcName */, void * /* pvSearchID */, uint32_t /* ulIPAddress */ );
\r
132 * Asynchronous version of gethostbyname()
\r
133 * xTimeout is in units of ms.
\r
135 uint32_t FreeRTOS_gethostbyname_a( const char *pcHostName, FOnDNSEvent pCallback, void *pvSearchID, TickType_t xTimeout );
\r
136 void FreeRTOS_gethostbyname_cancel( void *pvSearchID );
\r
141 * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE
\r
142 * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:
\r
145 uint32_t FreeRTOS_gethostbyname( const char *pcHostName );
\r
152 #endif /* FREERTOS_DNS_H */
\r