sresolv 1.12.11devel
Loading...
Searching...
No Matches
sres_sip.h
Go to the documentation of this file.
1/*
2 * This file is part of the Sofia-SIP package
3 *
4 * Copyright (C) 2009 Nokia Corporation.
5 *
6 * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef SOFIA_SIP_SRES_SIP_H
27#define SOFIA_SIP_SRES_SIP_H
28
35#ifndef SU_TYPES_H
36#include <sofia-sip/su_types.h>
37#endif
38
39#ifndef SU_ADDRINFO_H
41#endif
42
43#ifndef URL_H
44#include <sofia-sip/url.h>
45#endif
46
47#ifndef SOFIA_RESOLV_SRES_H
48#include <sofia-resolv/sres.h>
49#endif
50
51SOFIA_BEGIN_DECLS
52
53typedef struct sres_sip_s sres_sip_t;
54
55#ifndef SRES_SIP_MAGIC_T
60#define SRES_SIP_MAGIC_T struct sres_sip_magic_s
61#endif
62
65
66typedef void sres_sip_notify_f(sres_sip_magic_t *context,
67 sres_sip_t *resolver,
68 int error);
69
70SOFIAPUBFUN sres_sip_t *sres_sip_new(
71 sres_resolver_t *sres,
72 url_string_t const *url,
73 su_addrinfo_t const *hints,
74 int naptr, int srv,
75 sres_sip_notify_f *callback,
76 sres_sip_magic_t *magic);
77
78SOFIAPUBFUN sres_sip_t *sres_sip_ref(sres_sip_t *);
79SOFIAPUBFUN void sres_sip_unref(sres_sip_t *);
80
81SOFIAPUBFUN su_addrinfo_t const *sres_sip_results(sres_sip_t *);
82
83SOFIAPUBFUN su_addrinfo_t const *sres_sip_next(sres_sip_t *);
84
85SOFIAPUBFUN int sres_sip_next_step(sres_sip_t *nr);
86
87SOFIAPUBFUN int sres_sip_error(sres_sip_t *nr);
88
89/* Errors */
90enum {
91 SRES_SIP_ERR_FAULT = -1, /* Invalid pointers */
92 SRES_SIP_ERR_BAD_URI = -2, /* Invalid URI */
93 SRES_SIP_ERR_BAD_HINTS = -3, /* Invalid hints */
94 SRES_SIP_ERR_NO_NAME = -4, /* No domain found */
95 SRES_SIP_ERR_NO_DATA = -5, /* No matching records */
96 SRES_SIP_ERR_NO_TPORT = -6, /* Unknown transport */
97 SRES_SIP_ERR_FAIL = -7, /* Permanent resolving error */
98 SRES_SIP_ERR_AGAIN = -8, /* Temporary resolving error */
99 SRES_SIP_ERR_INTERNAL = -9, /* Internal error */
100 _SRES_SIP_ERR_LAST
101};
102
103/* Well-known transport numbers */
104enum {
105 TPPROTO_TCP = 6,
106 TPPROTO_UDP = 17,
107 TPPROTO_SCTP = 132,
108 TPPROTO_SECURE = 256,
109 TPPROTO_TLS = TPPROTO_SECURE | TPPROTO_TCP,
110 TPPROTO_NONE = 0
111};
112
113#define TPPROTO_TCP TPPROTO_TCP
114#define TPPROTO_UDP TPPROTO_UDP
115#define TPPROTO_SCTP TPPROTO_SCTP
116#define TPPROTO_TLS TPPROTO_TLS
117#define TPPROTO_NONE TPPROTO_NONE
118
119SOFIA_END_DECLS
120
121#endif /* SOFIA_SIP_SRES_SIP_H */
Sofia DNS Resolver.
struct sres_resolver_s sres_resolver_t
Opaque type of DNS resolver object.
Definition sres.h:95
SRES_SIP_MAGIC_T sres_sip_magic_t
Application context for NTA resolver.
Definition sres_sip.h:64
sres_sip_t * sres_sip_new(sres_resolver_t *sres, url_string_t const *url, su_addrinfo_t const *hints, int naptr, int srv, sres_sip_notify_f *callback, sres_sip_magic_t *magic)
Resolve a SIP uri.
Definition sres_sip.c:251
#define SRES_SIP_MAGIC_T
Default type of application context for NTA resolver.
Definition sres_sip.h:60
int sres_sip_next_step(sres_sip_t *nr)
Take next step in resolving process.
Definition sres_sip.c:611
struct addrinfo su_addrinfo_t
#define SOFIAPUBFUN

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.