Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
dns.h
Go to the documentation of this file.
1#ifndef __DNS_H__
2#define __DNS_H__
3
4#include <netinet/in.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif /* __cplusplus */
9
10
11typedef void (*DnsCallback_t)(int status, Dlist *addr_list, void *data);
12
13void a_Dns_init (void);
14void a_Dns_freeall(void);
15void a_Dns_resolve(const char *hostname, DnsCallback_t cb_func, void *cb_data);
16
17#ifdef ENABLE_IPV6
18# define DILLO_ADDR_MAX sizeof(struct in6_addr)
19#else
20# define DILLO_ADDR_MAX sizeof(struct in_addr)
21#endif
22
23typedef struct {
24 int af;
25 int alen;
26 char data[DILLO_ADDR_MAX];
27} DilloHost;
28
29void a_Dns_dillohost_to_string(DilloHost *host, char *dst, size_t size);
30
31#ifdef __cplusplus
32}
33#endif /* __cplusplus */
34
35#endif /* __DNS_H__ */
void a_Dns_dillohost_to_string(DilloHost *host, char *dst, size_t size)
Writes a string representation of the given DilloHost into dst.
Definition dns.c:502
#define DILLO_ADDR_MAX
Definition dns.h:20
void a_Dns_init(void)
Initializer function.
Definition dns.c:177
void a_Dns_freeall(void)
Dns memory-deallocation.
Definition dns.c:480
void(* DnsCallback_t)(int status, Dlist *addr_list, void *data)
Definition dns.h:11
void a_Dns_resolve(const char *hostname, DnsCallback_t cb_func, void *cb_data)
Return the IP for the given hostname using a callback.
Definition dns.c:361
int alen
Definition dns.h:25
int af
Definition dns.h:24
Definition dlib.h:131