sresolv  1.12.11devel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
26 
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
40 #include <sofia-sip/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 
51 SOFIA_BEGIN_DECLS
52 
53 typedef struct sres_sip_s sres_sip_t;
54 
55 #ifndef SRES_SIP_MAGIC_T
56 
60 #define SRES_SIP_MAGIC_T struct sres_sip_magic_s
61 #endif
62 
65 
66 typedef void sres_sip_notify_f(sres_sip_magic_t *context,
67  sres_sip_t *resolver,
68  int error);
69 
70 SOFIAPUBFUN 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 
78 SOFIAPUBFUN sres_sip_t *sres_sip_ref(sres_sip_t *);
79 SOFIAPUBFUN void sres_sip_unref(sres_sip_t *);
80 
81 SOFIAPUBFUN su_addrinfo_t const *sres_sip_results(sres_sip_t *);
82 
83 SOFIAPUBFUN su_addrinfo_t const *sres_sip_next(sres_sip_t *);
84 
85 SOFIAPUBFUN int sres_sip_next_step(sres_sip_t *nr);
86 
87 SOFIAPUBFUN int sres_sip_error(sres_sip_t *nr);
88 
89 /* Errors */
90 enum {
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 */
104 enum {
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 
119 SOFIA_END_DECLS
120 
121 #endif /* SOFIA_SIP_SRES_SIP_H */

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