summaryrefslogtreecommitdiffstats
path: root/lib/resolver.h
blob: 5f922dcb579916b480c6c62f5d7f6cbc5a62f9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* C-Ares integration to Quagga mainloop
 * Copyright (c) 2014-2015 Timo Teräs
 *
 * This file is free software: you may copy, redistribute and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 */

#ifndef _FRR_RESOLVER_H
#define _FRR_RESOLVER_H

#include "thread.h"
#include "sockunion.h"

#ifdef __cplusplus
extern "C" {
#endif

struct resolver_query {
	void (*callback)(struct resolver_query *, const char *errstr, int n,
			 union sockunion *);

	/* used to immediate provide the result if IP literal is passed in */
	union sockunion literal_addr;
	struct thread *literal_cb;
};

void resolver_init(struct thread_master *tm);
void resolver_resolve(struct resolver_query *query, int af,
		      const char *hostname, void (*cb)(struct resolver_query *,
						       const char *, int,
						       union sockunion *));

#ifdef __cplusplus
}
#endif

#endif /* _FRR_RESOLVER_H */