Blame


1 46ec0f24 2002-05-27 alex /*
2 46ec0f24 2002-05-27 alex * ngIRCd -- The Next Generation IRC Daemon
3 b79b315d 2003-12-27 alex * Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
4 46ec0f24 2002-05-27 alex *
5 c7f07523 2002-12-12 alex * This program is free software; you can redistribute it and/or modify
6 c7f07523 2002-12-12 alex * it under the terms of the GNU General Public License as published by
7 c7f07523 2002-12-12 alex * the Free Software Foundation; either version 2 of the License, or
8 c7f07523 2002-12-12 alex * (at your option) any later version.
9 c7f07523 2002-12-12 alex * Please read the file COPYING, README and AUTHORS for more information.
10 46ec0f24 2002-05-27 alex *
11 feb31e42 2008-02-26 fw * $Id: resolve.h,v 1.14 2008/02/26 22:04:17 fw Exp $
12 46ec0f24 2002-05-27 alex *
13 c7f07523 2002-12-12 alex * Asynchronous resolver (header)
14 46ec0f24 2002-05-27 alex */
15 46ec0f24 2002-05-27 alex
16 46ec0f24 2002-05-27 alex
17 46ec0f24 2002-05-27 alex #ifndef __resolve_h__
18 46ec0f24 2002-05-27 alex #define __resolve_h__
19 46ec0f24 2002-05-27 alex
20 46a191ca 2005-07-28 fw #include "array.h"
21 feb31e42 2008-02-26 fw #include "tool.h"
22 feb31e42 2008-02-26 fw #include "ng_ipaddr.h"
23 46ec0f24 2002-05-27 alex
24 5b2364b2 2005-09-12 fw /* This struct must not be accessed directly */
25 5b2364b2 2005-09-12 fw typedef struct _Res_Stat {
26 dd3a3bc6 2006-05-10 alex pid_t pid; /* PID of resolver process */
27 5b2364b2 2005-09-12 fw int resolver_fd; /* pipe fd for lookup result. */
28 46ec0f24 2002-05-27 alex } RES_STAT;
29 46ec0f24 2002-05-27 alex
30 46ec0f24 2002-05-27 alex
31 5b2364b2 2005-09-12 fw #define Resolve_Getfd(x) ((x)->resolver_fd)
32 5b2364b2 2005-09-12 fw #define Resolve_INPROGRESS(x) ((x)->resolver_fd >= 0)
33 b79b315d 2003-12-27 alex
34 feb31e42 2008-02-26 fw GLOBAL bool Resolve_Addr PARAMS(( RES_STAT *s, const ng_ipaddr_t *Addr, int identsock, void (*cbfunc)(int, short)));
35 5b2364b2 2005-09-12 fw GLOBAL bool Resolve_Name PARAMS(( RES_STAT *s, const char *Host, void (*cbfunc)(int, short) ));
36 5b2364b2 2005-09-12 fw GLOBAL size_t Resolve_Read PARAMS(( RES_STAT *s, void *buf, size_t buflen));
37 5b2364b2 2005-09-12 fw GLOBAL void Resolve_Init PARAMS(( RES_STAT *s));
38 5b2364b2 2005-09-12 fw GLOBAL bool Resolve_Shutdown PARAMS(( RES_STAT *s));
39 46ec0f24 2002-05-27 alex
40 46ec0f24 2002-05-27 alex #endif
41 46ec0f24 2002-05-27 alex /* -eof- */