Embedded TCP/IP stack: fnet_dns.h Source File

FNET

fnet_dns.h
1 /**************************************************************************
2 *
3 * Copyright 2011-2017 by Andrey Butok. FNET Community.
4 *
5 ***************************************************************************
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ***************************************************************************
20 *
21 * DNS Resolver API.
22 *
23 ***************************************************************************/
24 
25 #ifndef _FNET_DNS_H_
26 
27 #define _FNET_DNS_H_
28 
29 #if FNET_CFG_DNS || defined(__DOXYGEN__)
30 
72 /**************************************************************************/
77 {
79  fnet_uint32_t resolved_addr_ttl;
81 };
82 
83 /**************************************************************************/
87 typedef void *fnet_dns_desc_t;
88 
89 /**************************************************************************/
103 typedef void(*fnet_dns_callback_resolved_t)(const struct fnet_dns_resolved_addr *addr_list, fnet_size_t addr_list_size, void *cookie);
104 
105 /**************************************************************************/
109 {
110  struct fnet_sockaddr dns_server_addr;
117  void *cookie;
120 };
121 
122 #if defined(__cplusplus)
123 extern "C" {
124 #endif
125 
126 /***************************************************************************/
154 
155 /***************************************************************************/
173 
174 /***************************************************************************/
190 
191 #if defined(__cplusplus)
192 }
193 #endif
194 
197 #endif /* FNET_CFG_DNS */
198 
199 #endif /* _FNET_DNS_H_ */
fnet_bool_t fnet_dns_is_enabled(fnet_dns_desc_t desc)
Detects if the DNS client service is enabled or disabled.
fnet_uint32_t resolved_addr_ttl
Specifies the time interval (in seconds) that the resolved address may be cached before it should be ...
Definition: fnet_dns.h:79
const fnet_char_t * host_name
Host name to resolve (null-terminated string).
Definition: fnet_dns.h:112
fnet_dns_desc_t fnet_dns_init(struct fnet_dns_params *params)
Initializes the DNS client service and starts the host name resolving.
Initialization parameters for the fnet_dns_init() function.
Definition: fnet_dns.h:108
Resolved address structure provided by fnet_dns_callback_resolved_t callback function.
Definition: fnet_dns.h:76
unsigned long fnet_size_t
Unsigned integer type representing the size in bytes.
Definition: fnet_stdlib.h:56
void fnet_dns_release(fnet_dns_desc_t desc)
Aborts the resolving and releases the DNS-client service.
void * fnet_dns_desc_t
DNS client descriptor.
Definition: fnet_dns.h:87
void(* fnet_dns_callback_resolved_t)(const struct fnet_dns_resolved_addr *addr_list, fnet_size_t addr_list_size, void *cookie)
Prototype of the DNS-client callback function that is called when the DNS client has completed the re...
Definition: fnet_dns.h:103
fnet_address_family_t addr_family
Family of the IP Address which is queried.
Definition: fnet_dns.h:113
fnet_bool_t
Boolean type.
Definition: fnet_stdlib.h:81
fnet_dns_callback_resolved_t callback
Pointer to the callback function defined by fnet_dns_callback_resolved_t. It is called when the DNS-c...
Definition: fnet_dns.h:114
struct fnet_sockaddr resolved_addr
Socket address of the resolved host name.
Definition: fnet_dns.h:78
char fnet_char_t
Type representing the charecter.
Definition: fnet_stdlib.h:76
fnet_uint16_t fnet_address_family_t
Address family type.
Definition: fnet_socket.h:139
Socket address structure.
Definition: fnet_socket.h:270
void * cookie
Optional application-specific parameter. It's passed to the callback function as input parameter...
Definition: fnet_dns.h:117

© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net