sresolv.h 2.58 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7
/*
 * This file is part of the Sofia-SIP package
 *
 * Copyright (C) 2005 Nokia Corporation.
 *
 * Contact: Pekka Pessi <pekka.pessi@nokia.com>
 *
8
 * This library is free software; you can redistribute it and/or
Pekka Pessi's avatar
Pekka Pessi committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

Pekka Pessi's avatar
Pekka Pessi committed
25
#ifndef SRESOLV_H 
26
/** Defined when <sofia-sip/sresolv.h> has been included. */
Pekka Pessi's avatar
Pekka Pessi committed
27
#define SRESOLV_H
28

Pekka Pessi's avatar
Pekka Pessi committed
29
/**
Pekka Pessi's avatar
Pekka Pessi committed
30
 * @file sofia-sip/sresolv.h Easy API for Sofia DNS Resolver.
Pekka Pessi's avatar
Pekka Pessi committed
31 32 33 34 35 36 37
 *
 * @author Pekka Pessi <Pekka.Pessi@nokia.com>,
 * @author Teemu Jalava <Teemu.Jalava@nokia.com>,
 * @author Mikko Haataja <ext-Mikko.A.Haataja@nokia.com>.
 *
 */

38
#include <sofia-sip/su.h>
39 40
#include <sofia-sip/su_wait.h>
#include <sofia-sip/su_tag.h>
Pekka Pessi's avatar
Pekka Pessi committed
41

42
#include <sofia-resolv/sres.h>
43
#include <sofia-resolv/sres_record.h>
44
#include <sofia-resolv/sres_async.h>
Pekka Pessi's avatar
Pekka Pessi committed
45

46
SOFIA_BEGIN_DECLS
Pekka Pessi's avatar
Pekka Pessi committed
47 48 49

/* Sofia-specific reactor interface for asynchronous operation */

50 51
/** Filter tag matching any sresolv tag. */
#define SRESOLVTAG_ANY()         srestag_any, ((tag_value_t)0)
Pekka Pessi's avatar
Pekka Pessi committed
52
SOFIAPUBVAR tag_typedef_t srestag_any;
53

Pekka Pessi's avatar
Pekka Pessi committed
54 55
SOFIAPUBVAR tag_typedef_t srestag_resolv_conf;
/** Path of resolv.conf file. */
Pekka Pessi's avatar
Pekka Pessi committed
56
#define SRESTAG_RESOLV_CONF(x) srestag_resolv_conf, tag_str_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
57
SOFIAPUBVAR tag_typedef_t srestag_resolv_conf_ref;
Pekka Pessi's avatar
Pekka Pessi committed
58 59
#define SRESTAG_RESOLV_CONF_REF(x) srestag_resolv_conf_ref, tag_str_vr(&(x))

Pekka Pessi's avatar
Pekka Pessi committed
60 61
SOFIAPUBVAR tag_typedef_t srestag_cache;
/** Pointer to existing #sres_cache_t object. */
62
#define SRESTAG_CACHE(x) srestag_cache, tag_ptr_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
63
SOFIAPUBVAR tag_typedef_t srestag_cache_ref;
64 65
#define SRESTAG_CACHE_REF(x) srestag_cache_ref, tag_ptr_vr(&(x), (x))

Pekka Pessi's avatar
Pekka Pessi committed
66
/** Create a resolver object using @a root reactor. */
Pekka Pessi's avatar
Pekka Pessi committed
67 68 69 70
SOFIAPUBFUN sres_resolver_t *sres_resolver_create(su_root_t *root, 
						  char const *resolv_conf,
				                  tag_type_t, tag_value_t,
						  ...);
Pekka Pessi's avatar
Pekka Pessi committed
71
/** Destroy a resolver object. */
Pekka Pessi's avatar
Pekka Pessi committed
72
SOFIAPUBFUN int sres_resolver_destroy(sres_resolver_t *res);
Pekka Pessi's avatar
Pekka Pessi committed
73

74
/* Return socket used by root. @deprecated */
75
SOFIAPUBFUN su_socket_t sres_resolver_root_socket(sres_resolver_t *res);
Pekka Pessi's avatar
Pekka Pessi committed
76

77 78
SOFIA_END_DECLS

79
#endif