llmnr_client.c
Go to the documentation of this file.
1 /**
2  * @file llmnr_client.c
3  * @brief LLMNR client (Link-Local Multicast Name Resolution)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2022 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.2.0
29  **/
30 
31 //Switch to the appropriate trace level
32 #define TRACE_LEVEL LLMNR_TRACE_LEVEL
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "ipv4/ipv4_misc.h"
37 #include "llmnr/llmnr_client.h"
38 #include "dns/dns_debug.h"
39 #include "debug.h"
40 
41 //Check TCP/IP stack configuration
42 #if (LLMNR_CLIENT_SUPPORT == ENABLED)
43 
44 
45 /**
46  * @brief Resolve a host name using LLMNR
47  * @param[in] interface Underlying network interface
48  * @param[in] name Name of the host to be resolved
49  * @param[in] type Host type (IPv4 or IPv6)
50  * @param[out] ipAddr IP address corresponding to the specified host name
51  **/
52 
55 {
56  error_t error;
57  DnsCacheEntry *entry;
58 
59 #if (NET_RTOS_SUPPORT == ENABLED)
60  systime_t delay;
61 
62  //Debug message
63  TRACE_INFO("Resolving host name %s (LLMNR resolver)...\r\n", name);
64 #endif
65 
66  //Get exclusive access
68 
69  //Search the DNS cache for the specified host name
70  entry = dnsFindEntry(interface, name, type, HOST_NAME_RESOLVER_LLMNR);
71 
72  //Check whether a matching entry has been found
73  if(entry)
74  {
75  //Host name already resolved?
76  if(entry->state == DNS_STATE_RESOLVED ||
77  entry->state == DNS_STATE_PERMANENT)
78  {
79  //Return the corresponding IP address
80  *ipAddr = entry->ipAddr;
81  //Successful host name resolution
82  error = NO_ERROR;
83  }
84  else
85  {
86  //Host name resolution is in progress
87  error = ERROR_IN_PROGRESS;
88  }
89  }
90  else
91  {
92  //If no entry exists, then create a new one
93  entry = dnsCreateEntry();
94 
95  //Record the host name whose IP address is unknown
96  osStrcpy(entry->name, name);
97 
98  //Initialize DNS cache entry
99  entry->type = type;
101  entry->interface = interface;
102 
103  //Get an ephemeral port number
104  entry->port = udpGetDynamicPort();
105 
106  //An identifier is used by the LLMNR client to match replies
107  //with corresponding requests
108  entry->id = (uint16_t) netGenerateRand();
109 
110  //Callback function to be called when a LLMNR response is received
111  error = udpAttachRxCallback(interface, entry->port, llmnrProcessResponse,
112  NULL);
113 
114  //Check status code
115  if(!error)
116  {
117  //Initialize retransmission counter
119  //Send LLMNR query
120  error = llmnrSendQuery(entry);
121 
122  //LLMNR message successfully sent?
123  if(!error)
124  {
125  //Save the time at which the query message was sent
126  entry->timestamp = osGetSystemTime();
127  //Set timeout value
130  //Decrement retransmission counter
131  entry->retransmitCount--;
132 
133  //Switch state
134  entry->state = DNS_STATE_IN_PROGRESS;
135  //Host name resolution is in progress
136  error = ERROR_IN_PROGRESS;
137  }
138  else
139  {
140  //Unregister callback function
141  udpDetachRxCallback(interface, entry->port);
142  }
143  }
144  }
145 
146  //Release exclusive access
148 
149 #if (NET_RTOS_SUPPORT == ENABLED)
150  //Set default polling interval
152 
153  //Wait the host name resolution to complete
154  while(error == ERROR_IN_PROGRESS)
155  {
156  //Wait until the next polling period
157  osDelayTask(delay);
158 
159  //Get exclusive access
161 
162  //Search the DNS cache for the specified host name
163  entry = dnsFindEntry(interface, name, type, HOST_NAME_RESOLVER_LLMNR);
164 
165  //Check whether a matching entry has been found
166  if(entry)
167  {
168  //Host name successfully resolved?
169  if(entry->state == DNS_STATE_RESOLVED)
170  {
171  //Return the corresponding IP address
172  *ipAddr = entry->ipAddr;
173  //Successful host name resolution
174  error = NO_ERROR;
175  }
176  }
177  else
178  {
179  //Host name resolution failed
180  error = ERROR_FAILURE;
181  }
182 
183  //Release exclusive access
185 
186  //Backoff support for less aggressive polling
187  delay = MIN(delay * 2, DNS_CACHE_MAX_POLLING_INTERVAL);
188  }
189 
190  //Check status code
191  if(error)
192  {
193  //Failed to resolve host name
194  TRACE_INFO("Host name resolution failed!\r\n");
195  }
196  else
197  {
198  //Successful host name resolution
199  TRACE_INFO("Host name resolved to %s...\r\n", ipAddrToString(ipAddr, NULL));
200  }
201 #endif
202 
203  //Return status code
204  return error;
205 }
206 
207 
208 /**
209  * @brief Send a LLMNR query message
210  * @param[in] entry Pointer to a valid DNS cache entry
211  * @return Error code
212  **/
213 
215 {
216  error_t error;
217  size_t length;
218  size_t offset;
219  NetBuffer *buffer;
221  DnsQuestion *dnsQuestion;
223  NetTxAncillary ancillary;
224 
225 #if (IPV4_SUPPORT == ENABLED)
226  //An IPv4 address is expected?
227  if(entry->type == HOST_TYPE_IPV4)
228  {
229  //The IPv4 link-scope multicast address to which a sender sends queries
230  //is 224.0.0.252
231  destIpAddr.length = sizeof(Ipv4Addr);
233  }
234  else
235 #endif
236 #if (IPV6_SUPPORT == ENABLED)
237  //An IPv6 address is expected?
238  if(entry->type == HOST_TYPE_IPV6)
239  {
240  //The IPv6 link-scope multicast address to which a sender sends queries
241  //is ff02:0:0:0:0:0:1:3
242  destIpAddr.length = sizeof(Ipv6Addr);
244  }
245  else
246 #endif
247  //Invalid host type?
248  {
249  //Report an error
251  }
252 
253  //Allocate a memory buffer to hold the LLMNR query message
254  buffer = udpAllocBuffer(LLMNR_MESSAGE_MAX_SIZE, &offset);
255  //Failed to allocate buffer?
256  if(buffer == NULL)
257  return ERROR_OUT_OF_MEMORY;
258 
259  //Point to the LLMNR header
260  message = netBufferAt(buffer, offset);
261 
262  //Format LLMNR query message
263  message->id = htons(entry->id);
264  message->qr = 0;
265  message->opcode = DNS_OPCODE_QUERY;
266  message->c = 0;
267  message->tc = 0;
268  message->t = 0;
269  message->z = 0;
270  message->rcode = DNS_RCODE_NO_ERROR;
271 
272  //The LLMNR query contains one question
273  message->qdcount = HTONS(1);
274  message->ancount = 0;
275  message->nscount = 0;
276  message->arcount = 0;
277 
278  //Length of the LLMNR query message
279  length = sizeof(DnsHeader);
280 
281  //Encode the host name using the DNS name notation
282  length += dnsEncodeName(entry->name, message->questions);
283 
284  //Point to the corresponding question structure
285  dnsQuestion = DNS_GET_QUESTION(message, length);
286 
287 #if (IPV4_SUPPORT == ENABLED)
288  //An IPv4 address is expected?
289  if(entry->type == HOST_TYPE_IPV4)
290  {
291  //Fill in question structure
292  dnsQuestion->qtype = HTONS(DNS_RR_TYPE_A);
293  dnsQuestion->qclass = HTONS(DNS_RR_CLASS_IN);
294  }
295 #endif
296 #if (IPV6_SUPPORT == ENABLED)
297  //An IPv6 address is expected?
298  if(entry->type == HOST_TYPE_IPV6)
299  {
300  //Fill in question structure
301  dnsQuestion->qtype = HTONS(DNS_RR_TYPE_AAAA);
302  dnsQuestion->qclass = HTONS(DNS_RR_CLASS_IN);
303  }
304 #endif
305 
306  //Update the length of the LLMNR query message
307  length += sizeof(DnsQuestion);
308 
309  //Adjust the length of the multi-part buffer
310  netBufferSetLength(buffer, offset + length);
311 
312  //Debug message
313  TRACE_INFO("Sending LLMNR message (%" PRIuSIZE " bytes)...\r\n", length);
314  //Dump message
316 
317  //Additional options can be passed to the stack along with the packet
318  ancillary = NET_DEFAULT_TX_ANCILLARY;
319 
320  //For UDP queries, the Hop Limit field in the IPv6 header and the TTL
321  //field in the IPV4 header MAY be set to any value. However, it is
322  //recommended that the value 255 be used for compatibility with early
323  //implementations (refer to RFC 4795, section 2.5)
324  ancillary.ttl = LLMNR_DEFAULT_QUERY_IP_TTL;
325 
326  //LLMNR queries are sent to and received on port 5355
327  error = udpSendBuffer(entry->interface, NULL, entry->port, &destIpAddr,
328  LLMNR_PORT, buffer, offset, &ancillary);
329 
330  //Free previously allocated memory
331  netBufferFree(buffer);
332 
333  //Return status code
334  return error;
335 }
336 
337 
338 /**
339  * @brief Process LLMNR response message
340  * @param[in] interface Underlying network interface
341  * @param[in] pseudoHeader UDP pseudo header
342  * @param[in] udpHeader UDP header
343  * @param[in] buffer Multi-part buffer containing the incoming LLMNR message
344  * @param[in] offset Offset to the first byte of the LLMNR message
345  * @param[in] ancillary Additional options passed to the stack along with
346  * the packet
347  * @param[in] param Callback function parameter (not used)
348  **/
349 
351  const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader,
352  const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary,
353  void *param)
354 {
355  uint_t i;
356  uint_t j;
357  size_t pos;
358  size_t length;
360  DnsQuestion *question;
361  DnsResourceRecord *record;
362  DnsCacheEntry *entry;
363 
364  //Retrieve the length of the LLMNR message
365  length = netBufferGetLength(buffer) - offset;
366 
367  //Ensure the LLMNR message is valid
368  if(length < sizeof(LlmnrHeader))
369  return;
371  return;
372 
373  //Point to the LLMNR message header
374  message = netBufferAt(buffer, offset);
375  //Sanity check
376  if(message == NULL)
377  return;
378 
379  //Debug message
380  TRACE_INFO("LLMNR message received (%" PRIuSIZE " bytes)...\r\n", length);
381  //Dump message
383 
384  //Discard LLMNR queries
385  if(!message->qr)
386  return;
387 
388  //LLMNR messages received with an opcode other than zero must be silently
389  //ignored
390  if(message->opcode != DNS_OPCODE_QUERY)
391  return;
392 
393  //LLMNR messages received with non-zero response codes must be silently
394  //ignored
395  if(message->rcode != DNS_RCODE_NO_ERROR)
396  return;
397 
398  //LLMNR senders must silently discard LLMNR responses with QDCOUNT not
399  //equal to one (refer to RFC 4795, section 2.1.1)
400  if(ntohs(message->qdcount) != 1)
401  return;
402 
403  //Loop through DNS cache entries
404  for(i = 0; i < DNS_CACHE_SIZE; i++)
405  {
406  //Point to the current entry
407  entry = &dnsCache[i];
408 
409  //LLMNR name resolution in progress?
410  if(entry->state == DNS_STATE_IN_PROGRESS &&
412  {
413  //Check destination port number
414  if(entry->port == ntohs(udpHeader->destPort))
415  {
416  //Compare identifier against the expected one
417  if(ntohs(message->id) != entry->id)
418  break;
419 
420  //Point to the first question
421  pos = sizeof(DnsHeader);
422  //Parse domain name
423  pos = dnsParseName((DnsHeader *) message, length, pos, NULL, 0);
424 
425  //Invalid name?
426  if(!pos)
427  break;
428  //Malformed DNS message?
429  if((pos + sizeof(DnsQuestion)) > length)
430  break;
431 
432  //Compare domain name
434  entry->name, 0))
435  {
436  break;
437  }
438 
439  //Point to the corresponding entry
440  question = DNS_GET_QUESTION(message, pos);
441 
442  //Check the class of the query
443  if(ntohs(question->qclass) != DNS_RR_CLASS_IN)
444  break;
445 
446  //Check the type of the query
447  if(entry->type == HOST_TYPE_IPV4 && ntohs(question->qtype) != DNS_RR_TYPE_A)
448  break;
449  if(entry->type == HOST_TYPE_IPV6 && ntohs(question->qtype) != DNS_RR_TYPE_AAAA)
450  break;
451 
452  //Point to the first answer
453  pos += sizeof(DnsQuestion);
454 
455  //Parse answer resource records
456  for(j = 0; j < ntohs(message->ancount); j++)
457  {
458  //Parse domain name
459  pos = dnsParseName((DnsHeader *) message, length, pos, NULL, 0);
460  //Invalid name?
461  if(!pos)
462  break;
463 
464  //Point to the associated resource record
465  record = DNS_GET_RESOURCE_RECORD(message, pos);
466  //Point to the resource data
467  pos += sizeof(DnsResourceRecord);
468 
469  //Make sure the resource record is valid
470  if(pos > length)
471  break;
472  if((pos + ntohs(record->rdlength)) > length)
473  break;
474 
475 #if (IPV4_SUPPORT == ENABLED)
476  //IPv4 address expected?
477  if(entry->type == HOST_TYPE_IPV4)
478  {
479  //A resource record found?
480  if(ntohs(record->rtype) == DNS_RR_TYPE_A &&
481  ntohs(record->rdlength) == sizeof(Ipv4Addr))
482  {
483  //Copy the IPv4 address
484  entry->ipAddr.length = sizeof(Ipv4Addr);
485  ipv4CopyAddr(&entry->ipAddr.ipv4Addr, record->rdata);
486 
487  //Save current time
488  entry->timestamp = osGetSystemTime();
489  //Save TTL value
490  entry->timeout = ntohl(record->ttl) * 1000;
491  //Limit the lifetime of the NBNS cache entries
492  entry->timeout = MIN(entry->timeout, LLMNR_MAX_LIFETIME);
493 
494  //Unregister UDP callback function
495  udpDetachRxCallback(interface, entry->port);
496  //Host name successfully resolved
497  entry->state = DNS_STATE_RESOLVED;
498  //Exit immediately
499  break;
500  }
501  }
502 #endif
503 #if (IPV6_SUPPORT == ENABLED)
504  //IPv6 address expected?
505  if(entry->type == HOST_TYPE_IPV6)
506  {
507  //AAAA resource record found?
508  if(ntohs(record->rtype) == DNS_RR_TYPE_AAAA &&
509  ntohs(record->rdlength) == sizeof(Ipv6Addr))
510  {
511  //Copy the IPv6 address
512  entry->ipAddr.length = sizeof(Ipv6Addr);
513  ipv6CopyAddr(&entry->ipAddr.ipv6Addr, record->rdata);
514 
515  //Save current time
516  entry->timestamp = osGetSystemTime();
517  //Save TTL value
518  entry->timeout = ntohl(record->ttl) * 1000;
519  //Limit the lifetime of the NBNS cache entries
520  entry->timeout = MIN(entry->timeout, LLMNR_MAX_LIFETIME);
521 
522  //Unregister UDP callback function
523  udpDetachRxCallback(interface, entry->port);
524  //Host name successfully resolved
525  entry->state = DNS_STATE_RESOLVED;
526  //Exit immediately
527  break;
528  }
529  }
530 #endif
531  //Point to the next resource record
532  pos += ntohs(record->rdlength);
533  }
534 
535  //We are done
536  break;
537  }
538  }
539  }
540 }
541 
542 #endif
#define LLMNR_DEFAULT_QUERY_IP_TTL
Definition: llmnr_common.h:55
uint8_t length
Definition: coap_common.h:193
#define htons(value)
Definition: cpu_endian.h:413
HostType
Host types.
Definition: socket.h:174
@ DNS_STATE_PERMANENT
Definition: dns_cache.h:88
HostType type
IPv4 or IPv6 host?
Definition: dns_cache.h:99
__start_packed struct @2 DnsResourceRecord
Resource record format.
#define LLMNR_MAX_LIFETIME
Definition: llmnr_client.h:72
const NetTxAncillary NET_DEFAULT_TX_ANCILLARY
Definition: net_misc.c:71
#define netMutex
Definition: net_legacy.h:266
IP network address.
Definition: ip.h:79
__start_packed struct @0 UdpHeader
UDP header.
@ DNS_OPCODE_QUERY
Definition: dns_common.h:81
#define LLMNR_CLIENT_MAX_TIMEOUT
Definition: llmnr_client.h:65
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
error_t llmnrSendQuery(DnsCacheEntry *entry)
Send a LLMNR query message.
Definition: llmnr_client.c:214
systime_t timeout
Retransmission timeout.
Definition: dns_cache.h:108
@ HOST_NAME_RESOLVER_LLMNR
Definition: socket.h:191
__start_packed struct @0 DnsHeader
DNS message header.
char_t * ipAddrToString(const IpAddr *ipAddr, char_t *str)
Convert a binary IP address to a string representation.
Definition: ip.c:806
size_t dnsParseName(const DnsHeader *message, size_t length, size_t pos, char_t *dest, uint_t level)
Decode a domain name that uses the DNS name encoding.
Definition: dns_common.c:133
@ ERROR_OUT_OF_MEMORY
Definition: error.h:63
HostnameResolver protocol
Name resolution protocol.
Definition: dns_cache.h:100
@ DNS_RR_CLASS_IN
Internet.
Definition: dns_common.h:110
char_t name[]
IpAddr ipAddr
IP address.
Definition: dns_cache.h:106
uint32_t Ipv4Addr
IPv4 network address.
Definition: ipv4.h:261
uint32_t netGenerateRand(void)
Generate a random 32-bit value.
Definition: net_misc.c:874
@ HOST_TYPE_IPV6
Definition: socket.h:177
IP pseudo header.
Definition: ip.h:98
uint16_t id
Identifier used to match queries and responses.
Definition: dns_cache.h:104
@ ERROR_IN_PROGRESS
Definition: error.h:212
Helper functions for IPv4.
uint16_t port
Port number used by the resolver.
Definition: dns_cache.h:103
@ ERROR_INVALID_PARAMETER
Invalid parameter.
Definition: error.h:47
char_t type
error_t
Error codes.
Definition: error.h:43
#define DNS_GET_QUESTION(message, offset)
Definition: dns_common.h:63
char_t name[DNS_MAX_NAME_LEN+1]
Domain name.
Definition: dns_cache.h:105
systime_t timestamp
Time stamp to manage entry lifetime.
Definition: dns_cache.h:107
#define DNS_GET_RESOURCE_RECORD(message, offset)
Definition: dns_common.h:64
#define LLMNR_CLIENT_MAX_RETRIES
Definition: llmnr_client.h:51
void * netBufferAt(const NetBuffer *buffer, size_t offset)
Returns a pointer to the data at the specified position.
Definition: net_mem.c:413
#define LLMNR_IPV4_MULTICAST_ADDR
Definition: llmnr_common.h:60
@ ERROR_FAILURE
Generic error code.
Definition: error.h:45
__start_packed struct @0 LlmnrHeader
LLMNR message header.
#define LLMNR_PORT
Definition: llmnr_common.h:53
error_t udpDetachRxCallback(NetInterface *interface, uint16_t port)
Unregister user callback.
Definition: udp.c:918
#define NetRxAncillary
Definition: net_misc.h:40
#define NetInterface
Definition: net.h:36
error_t udpAttachRxCallback(NetInterface *interface, uint16_t port, UdpRxCallback callback, void *param)
Register user callback.
Definition: udp.c:877
void netBufferFree(NetBuffer *buffer)
Dispose a multi-part buffer.
Definition: net_mem.c:282
DNS cache entry.
Definition: dns_cache.h:97
@ DNS_RR_TYPE_A
Host address.
Definition: dns_common.h:123
error_t udpSendBuffer(NetInterface *interface, const IpAddr *srcIpAddr, uint16_t srcPort, const IpAddr *destIpAddr, uint16_t destPort, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a UDP datagram.
Definition: udp.c:548
DnsCacheEntry * dnsCreateEntry(void)
Create a new entry in the DNS cache.
Definition: dns_cache.c:104
#define NetTxAncillary
Definition: net_misc.h:36
systime_t maxTimeout
Maximum retransmission timeout.
Definition: dns_cache.h:109
error_t llmnrResolve(NetInterface *interface, const char_t *name, HostType type, IpAddr *ipAddr)
Resolve a host name using LLMNR.
Definition: llmnr_client.c:53
#define TRACE_INFO(...)
Definition: debug.h:95
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
void dnsDumpMessage(const DnsHeader *message, size_t length)
Dump DNS message for debugging purpose.
Definition: dns_debug.c:52
#define MIN(a, b)
Definition: os_port.h:62
NetBuffer * udpAllocBuffer(size_t length, size_t *offset)
Allocate a buffer to hold a UDP packet.
Definition: udp.c:808
size_t length
Definition: ip.h:80
@ HOST_TYPE_IPV4
Definition: socket.h:176
uint16_t udpGetDynamicPort(void)
Get an ephemeral port number.
Definition: udp.c:81
size_t dnsEncodeName(const char_t *src, uint8_t *dest)
Encode a domain name using the DNS name notation.
Definition: dns_common.c:59
const Ipv6Addr LLMNR_IPV6_MULTICAST_ADDR
Definition: llmnr_common.c:45
#define DNS_CACHE_INIT_POLLING_INTERVAL
Definition: dns_cache.h:61
#define LLMNR_MESSAGE_MAX_SIZE
Definition: llmnr_common.h:40
uint32_t systime_t
System time.
#define ntohs(value)
Definition: cpu_endian.h:421
char char_t
Definition: compiler_port.h:43
LLMNR client (Link-Local Multicast Name Resolution)
DnsCacheEntry * dnsFindEntry(NetInterface *interface, const char_t *name, HostType type, HostnameResolver protocol)
Search the DNS cache for a given domain name.
Definition: dns_cache.c:187
Ipv4Addr ipv4Addr
Definition: ip.h:84
#define ipv6CopyAddr(destIpAddr, srcIpAddr)
Definition: ipv6.h:117
#define HTONS(value)
Definition: cpu_endian.h:410
@ DNS_STATE_IN_PROGRESS
Definition: dns_cache.h:86
NetInterface * interface
Underlying network interface.
Definition: dns_cache.h:101
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
#define DNS_CACHE_SIZE
Definition: dns_cache.h:47
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
__start_packed struct @1 DnsQuestion
Question format.
@ DNS_STATE_RESOLVED
Definition: dns_cache.h:87
error_t netBufferSetLength(NetBuffer *buffer, size_t length)
Adjust the length of a multi-part buffer.
Definition: net_mem.c:320
uint8_t message[]
Definition: chap.h:152
#define ipv4CopyAddr(destIpAddr, srcIpAddr)
Definition: ipv4.h:142
void osDelayTask(systime_t delay)
Delay routine.
#define LLMNR_CLIENT_INIT_TIMEOUT
Definition: llmnr_client.h:58
DnsCacheEntry dnsCache[DNS_CACHE_SIZE]
Definition: dns_cache.c:52
DnsState state
Entry state.
Definition: dns_cache.h:98
Ipv6Addr ipv6Addr
Definition: ip.h:87
uint_t retransmitCount
Retransmission counter.
Definition: dns_cache.h:110
#define PRIuSIZE
unsigned int uint_t
Definition: compiler_port.h:45
TCP/IP stack core.
@ DNS_RCODE_NO_ERROR
Definition: dns_common.h:95
void llmnrProcessResponse(NetInterface *interface, const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary, void *param)
Process LLMNR response message.
Definition: llmnr_client.c:350
@ DNS_RR_TYPE_AAAA
IPv6 address.
Definition: dns_common.h:133
Data logging functions for debugging purpose (DNS)
int_t dnsCompareName(const DnsHeader *message, size_t length, size_t pos, const char_t *name, uint_t level)
Compare domain names.
Definition: dns_common.c:243
#define osStrcpy(s1, s2)
Definition: os_port.h:197
__start_packed struct @0 Ipv6Addr
IPv6 network address.
#define DNS_CACHE_MAX_POLLING_INTERVAL
Definition: dns_cache.h:68
uint8_t ipAddr[4]
Definition: mib_common.h:187
#define ntohl(value)
Definition: cpu_endian.h:422
@ NO_ERROR
Success.
Definition: error.h:44
Debugging facilities.
systime_t osGetSystemTime(void)
Retrieve system time.
Ipv4Addr destIpAddr
Definition: ipcp.h:78