diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-06-16 10:09:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-06-16 10:09:47 +0000 |
commit | 007b8443b0cb0d67bf8b176a1a175ad4bc37f1f3 (patch) | |
tree | b42d56110ae349eb2977673690c072dcf75b32a4 /src/include/gnunet_resolver_service.h | |
parent | 94c41ff98d293d8c041c4bbbe8d19dbf8ccd6f3f (diff) | |
download | gnunet-007b8443b0cb0d67bf8b176a1a175ad4bc37f1f3.tar.gz gnunet-007b8443b0cb0d67bf8b176a1a175ad4bc37f1f3.zip |
resolver API change
Diffstat (limited to 'src/include/gnunet_resolver_service.h')
-rw-r--r-- | src/include/gnunet_resolver_service.h | 31 |
1 files changed, 21 insertions, 10 deletions
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 | */ |
59 | struct GNUNET_RESOLVER_RequestHandle; | 59 | struct GNUNET_RESOLVER_RequestHandle; |
60 | 60 | ||
61 | /** | ||
62 | * Create the connection to the resolver service. | ||
63 | * | ||
64 | * @param cfg configuration to use | ||
65 | */ | ||
66 | void | ||
67 | GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c); | ||
68 | |||
69 | |||
70 | /** | ||
71 | * Destroy the connection to the resolver service. | ||
72 | */ | ||
73 | void | ||
74 | GNUNET_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 | */ |
73 | struct GNUNET_RESOLVER_RequestHandle * | 87 | struct GNUNET_RESOLVER_RequestHandle * |
74 | GNUNET_RESOLVER_ip_get (const struct GNUNET_CONFIGURATION_Handle *cfg, | 88 | GNUNET_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 | */ |
92 | struct GNUNET_RESOLVER_RequestHandle * | 105 | struct GNUNET_RESOLVER_RequestHandle * |
93 | GNUNET_RESOLVER_hostname_resolve (const struct GNUNET_CONFIGURATION_Handle *cfg, | 106 | GNUNET_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 | */ |
115 | char * | 127 | char * |
116 | GNUNET_RESOLVER_local_fqdn_get ( void ); | 128 | GNUNET_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 | */ |
131 | struct GNUNET_RESOLVER_RequestHandle * | 143 | struct GNUNET_RESOLVER_RequestHandle * |
132 | GNUNET_RESOLVER_hostname_get (const struct GNUNET_CONFIGURATION_Handle *cfg, | 144 | GNUNET_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 | */ |
149 | void | 160 | void |
150 | GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *h); | 161 | GNUNET_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 */ |