aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-06-16 10:09:47 +0000
committerChristian Grothoff <christian@grothoff.org>2011-06-16 10:09:47 +0000
commit007b8443b0cb0d67bf8b176a1a175ad4bc37f1f3 (patch)
treeb42d56110ae349eb2977673690c072dcf75b32a4 /src/include
parent94c41ff98d293d8c041c4bbbe8d19dbf8ccd6f3f (diff)
downloadgnunet-007b8443b0cb0d67bf8b176a1a175ad4bc37f1f3.tar.gz
gnunet-007b8443b0cb0d67bf8b176a1a175ad4bc37f1f3.zip
resolver API change
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_connection_lib.h4
-rw-r--r--src/include/gnunet_resolver_service.h31
2 files changed, 23 insertions, 12 deletions
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h
index 8d2dbb611..700fef3db 100644
--- a/src/include/gnunet_connection_lib.h
+++ b/src/include/gnunet_connection_lib.h
@@ -81,8 +81,8 @@ struct GNUNET_CONNECTION_Credentials
81 */ 81 */
82typedef int (*GNUNET_CONNECTION_AccessCheck) (void *cls, 82typedef int (*GNUNET_CONNECTION_AccessCheck) (void *cls,
83 const struct GNUNET_CONNECTION_Credentials *ucred, 83 const struct GNUNET_CONNECTION_Credentials *ucred,
84 const struct sockaddr * addr, 84 const struct sockaddr * addr,
85 socklen_t addrlen); 85 socklen_t addrlen);
86 86
87 87
88/** 88/**
diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h
index 6ffcc9455..86269d9dd 100644
--- a/src/include/gnunet_resolver_service.h
+++ b/src/include/gnunet_resolver_service.h
@@ -58,11 +58,25 @@ typedef void (*GNUNET_RESOLVER_AddressCallback) (void *cls,
58 */ 58 */
59struct GNUNET_RESOLVER_RequestHandle; 59struct GNUNET_RESOLVER_RequestHandle;
60 60
61/**
62 * Create the connection to the resolver service.
63 *
64 * @param cfg configuration to use
65 */
66void
67GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c);
68
69
70/**
71 * Destroy the connection to the resolver service.
72 */
73void
74GNUNET_RESOLVER_disconnect (void);
75
61 76
62/** 77/**
63 * Convert a string to one or more IP addresses. 78 * Convert a string to one or more IP addresses.
64 * 79 *
65 * @param cfg configuration to use
66 * @param hostname the hostname to resolve 80 * @param hostname the hostname to resolve
67 * @param domain AF_INET or AF_INET6; use AF_UNSPEC for "any" 81 * @param domain AF_INET or AF_INET6; use AF_UNSPEC for "any"
68 * @param callback function to call with addresses 82 * @param callback function to call with addresses
@@ -71,8 +85,7 @@ struct GNUNET_RESOLVER_RequestHandle;
71 * @return handle that can be used to cancel the request, NULL on error 85 * @return handle that can be used to cancel the request, NULL on error
72 */ 86 */
73struct GNUNET_RESOLVER_RequestHandle * 87struct GNUNET_RESOLVER_RequestHandle *
74GNUNET_RESOLVER_ip_get (const struct GNUNET_CONFIGURATION_Handle *cfg, 88GNUNET_RESOLVER_ip_get (const char *hostname,
75 const char *hostname,
76 int domain, 89 int domain,
77 struct GNUNET_TIME_Relative timeout, 90 struct GNUNET_TIME_Relative timeout,
78 GNUNET_RESOLVER_AddressCallback callback, 91 GNUNET_RESOLVER_AddressCallback callback,
@@ -90,8 +103,7 @@ GNUNET_RESOLVER_ip_get (const struct GNUNET_CONFIGURATION_Handle *cfg,
90 * @return handle that can be used to cancel the request, NULL on error 103 * @return handle that can be used to cancel the request, NULL on error
91 */ 104 */
92struct GNUNET_RESOLVER_RequestHandle * 105struct GNUNET_RESOLVER_RequestHandle *
93GNUNET_RESOLVER_hostname_resolve (const struct GNUNET_CONFIGURATION_Handle *cfg, 106GNUNET_RESOLVER_hostname_resolve (int domain,
94 int domain,
95 struct GNUNET_TIME_Relative timeout, 107 struct GNUNET_TIME_Relative timeout,
96 GNUNET_RESOLVER_AddressCallback callback, 108 GNUNET_RESOLVER_AddressCallback callback,
97 void *cls); 109 void *cls);
@@ -113,7 +125,7 @@ typedef void (*GNUNET_RESOLVER_HostnameCallback) (void *cls,
113 * @return local hostname, caller must free 125 * @return local hostname, caller must free
114 */ 126 */
115char * 127char *
116GNUNET_RESOLVER_local_fqdn_get ( void ); 128GNUNET_RESOLVER_local_fqdn_get (void);
117 129
118 130
119/** 131/**
@@ -129,8 +141,7 @@ GNUNET_RESOLVER_local_fqdn_get ( void );
129 * @return handle that can be used to cancel the request, NULL on error 141 * @return handle that can be used to cancel the request, NULL on error
130 */ 142 */
131struct GNUNET_RESOLVER_RequestHandle * 143struct GNUNET_RESOLVER_RequestHandle *
132GNUNET_RESOLVER_hostname_get (const struct GNUNET_CONFIGURATION_Handle *cfg, 144GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa,
133 const struct sockaddr *sa,
134 socklen_t salen, 145 socklen_t salen,
135 int do_resolve, 146 int do_resolve,
136 struct GNUNET_TIME_Relative timeout, 147 struct GNUNET_TIME_Relative timeout,
@@ -144,10 +155,10 @@ GNUNET_RESOLVER_hostname_get (const struct GNUNET_CONFIGURATION_Handle *cfg,
144 * been completed (i.e, the callback has been called to 155 * been completed (i.e, the callback has been called to
145 * signal timeout or the final result). 156 * signal timeout or the final result).
146 * 157 *
147 * @param h handle of request to cancel 158 * @param rh handle of request to cancel
148 */ 159 */
149void 160void
150GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *h); 161GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh);
151 162
152 163
153#if 0 /* keep Emacsens' auto-indent happy */ 164#if 0 /* keep Emacsens' auto-indent happy */