diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-12-03 13:58:54 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-12-03 13:58:54 +0000 |
commit | 91443f0b2069987845c458ab70eee8f0600f5939 (patch) | |
tree | 2ad1d5cb676f2146cccc009bf2a9209c56012ef2 /src/include/gnunet_testbed_service.h | |
parent | 020a5d9860368e63c997fb5dd82b2498b85f0584 (diff) | |
download | gnunet-91443f0b2069987845c458ab70eee8f0600f5939.tar.gz gnunet-91443f0b2069987845c458ab70eee8f0600f5939.zip |
making GNUNET_TESTBED_is_host_compatible() asynchronous
Diffstat (limited to 'src/include/gnunet_testbed_service.h')
-rw-r--r-- | src/include/gnunet_testbed_service.h | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 91fb424c4..55e503232 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -133,19 +133,53 @@ GNUNET_TESTBED_host_destroy (struct GNUNET_TESTBED_Host *host); | |||
133 | 133 | ||
134 | 134 | ||
135 | /** | 135 | /** |
136 | * The handle for whether a host is habitable or not | ||
137 | */ | ||
138 | struct GNUNET_TESTBED_HostHabitableCheckHandle; | ||
139 | |||
140 | |||
141 | /** | ||
142 | * Callbacks of this type are called by GNUNET_TESTBED_is_host_habitable to | ||
143 | * inform whether the given host is habitable or not. The Handle returned by | ||
144 | * GNUNET_TESTBED_is_host_habitable() is invalid after this callback is called | ||
145 | * | ||
146 | * @param cls the closure given to GNUNET_TESTBED_is_host_habitable() | ||
147 | * @param status GNUNET_YES if it is habitable; GNUNET_NO if not | ||
148 | */ | ||
149 | typedef void (*GNUNET_TESTBED_HostHabitableCallback) (void *cls, | ||
150 | int status); | ||
151 | |||
152 | |||
153 | /** | ||
136 | * Checks whether a host can be used to start testbed service | 154 | * Checks whether a host can be used to start testbed service |
137 | * | 155 | * |
138 | * @param host the host to check | 156 | * @param host the host to check |
139 | * @param config the configuration handle to lookup the path of the testbed helper | 157 | * @param config the configuration handle to lookup the path of the testbed |
140 | * @return GNUNET_YES if testbed service can be started on the given host | 158 | * helper |
141 | * remotely; GNUNET_NO if not | 159 | * @param cb the callback to call to inform about habitability of the given host |
142 | */ | 160 | * @param cb_cls the closure for the callback |
143 | int | 161 | * @return NULL upon any error or a handle which can be passed to |
162 | * GNUNET_TESTBED_is_host_habitable_cancel() | ||
163 | */ | ||
164 | struct GNUNET_TESTBED_HostHabitableCheckHandle * | ||
144 | GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, | 165 | GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, |
145 | const struct GNUNET_CONFIGURATION_Handle *config); | 166 | const struct GNUNET_CONFIGURATION_Handle |
167 | *config, | ||
168 | GNUNET_TESTBED_HostHabitableCallback cb, | ||
169 | void *cb_cls); | ||
146 | 170 | ||
147 | 171 | ||
148 | /** | 172 | /** |
173 | * Function to cancel a request started using GNUNET_TESTBED_is_host_habitable() | ||
174 | * | ||
175 | * @param struct handle the habitability check handle | ||
176 | */ | ||
177 | void | ||
178 | GNUNET_TESTBED_is_host_habitable_cancel (struct | ||
179 | GNUNET_TESTBED_HostHabitableCheckHandle | ||
180 | *handle); | ||
181 | |||
182 | /** | ||
149 | * Obtain the host's hostname. | 183 | * Obtain the host's hostname. |
150 | * | 184 | * |
151 | * @param host handle to the host, NULL means 'localhost' | 185 | * @param host handle to the host, NULL means 'localhost' |