]> jfr.im git - solanum.git/blame - authd/res.h
authd: import stripped down charybdis resolver
[solanum.git] / authd / res.h
CommitLineData
ed62c46b
AC
1/*
2 * res.h for referencing functions in res.c, reslib.c
3 *
4 * $Id: res.h 2023 2006-09-02 23:47:27Z jilles $
5 */
6
7#ifndef _CHARYBDIS_RES_H
8#define _CHARYBDIS_RES_H
9
10/* Maximum number of nameservers in /etc/resolv.conf we care about
11 * In hybrid, this was 2 -- but in Charybdis, we want to track
12 * a few more than that ;) --nenolod
13 */
14#define IRCD_MAXNS 10
15#define RESOLVER_HOSTLEN 255
16
17struct DNSReply
18{
19 char *h_name;
20 struct rb_sockaddr_storage addr;
21};
22
23struct DNSQuery
24{
25 void *ptr; /* pointer used by callback to identify request */
26 void (*callback)(void* vptr, struct DNSReply *reply); /* callback to call */
27};
28
29extern struct rb_sockaddr_storage irc_nsaddr_list[];
30extern int irc_nscount;
31
32extern void init_resolver(void);
33extern void restart_resolver(void);
34extern void gethost_byname_type(const char *, struct DNSQuery *, int);
35extern void gethost_byaddr(const struct rb_sockaddr_storage *, struct DNSQuery *);
36
37#endif