diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-04-04 12:02:43 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-04-04 12:02:43 +0000 |
commit | 425e9cdea733ca7be9a901abff7a070c460fa84d (patch) | |
tree | c4e2919e2f4183a324801c061fb2d57a3b232ddc /src/include/gnunet_peerinfo_service.h | |
parent | 6713f0ce7d70cdb5cb0172157e647b8dfb6852ff (diff) | |
download | gnunet-425e9cdea733ca7be9a901abff7a070c460fa84d.tar.gz gnunet-425e9cdea733ca7be9a901abff7a070c460fa84d.zip |
peerinfo API change + changes in code using api
Diffstat (limited to 'src/include/gnunet_peerinfo_service.h')
-rw-r--r-- | src/include/gnunet_peerinfo_service.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 49ba91600..6aadba964 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h | |||
@@ -145,28 +145,28 @@ struct GNUNET_PEERINFO_IteratorContext; | |||
145 | 145 | ||
146 | 146 | ||
147 | /** | 147 | /** |
148 | * Call a method for each known matching host to get its HELLO. | 148 | * Call a method for each known matching host. The callback method |
149 | * The callback method will be invoked once for each matching | 149 | * will be invoked once for each matching host and then finally once |
150 | * host and then finally once with a NULL pointer. After that final | 150 | * with a NULL pointer. After that final invocation, the iterator |
151 | * invocation, the iterator context must no longer be used. | 151 | * context must no longer be used. |
152 | * | 152 | * |
153 | * Instead of calling this function with 'peer == NULL' | 153 | * Instead of calling this function with 'peer == NULL' it is often |
154 | * it is often better to use 'GNUNET_PEERINFO_notify'. | 154 | * better to use 'GNUNET_PEERINFO_notify'. |
155 | * | 155 | * |
156 | * @param h handle to the peerinfo service | 156 | * @param h handle to the peerinfo service |
157 | * @param include_friend_only include HELLO messages for friends only | ||
157 | * @param peer restrict iteration to this peer only (can be NULL) | 158 | * @param peer restrict iteration to this peer only (can be NULL) |
158 | * @param timeout how long to wait until timing out | 159 | * @param timeout how long to wait until timing out |
159 | * @param callback the method to call for each peer | 160 | * @param callback the method to call for each peer |
160 | * @param callback_cls closure for callback | 161 | * @param callback_cls closure for callback |
161 | * @return NULL on error (in this case, 'callback' is never called!), | 162 | * @return iterator context |
162 | * otherwise an iterator context | ||
163 | */ | 163 | */ |
164 | struct GNUNET_PEERINFO_IteratorContext * | 164 | struct GNUNET_PEERINFO_IteratorContext * |
165 | GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, | 165 | GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, |
166 | int include_friend_only, | ||
166 | const struct GNUNET_PeerIdentity *peer, | 167 | const struct GNUNET_PeerIdentity *peer, |
167 | struct GNUNET_TIME_Relative timeout, | 168 | struct GNUNET_TIME_Relative timeout, |
168 | GNUNET_PEERINFO_Processor callback, | 169 | GNUNET_PEERINFO_Processor callback, void *callback_cls); |
169 | void *callback_cls); | ||
170 | 170 | ||
171 | 171 | ||
172 | 172 | ||
@@ -189,17 +189,21 @@ struct GNUNET_PEERINFO_NotifyContext; | |||
189 | /** | 189 | /** |
190 | * Call a method whenever our known information about peers | 190 | * Call a method whenever our known information about peers |
191 | * changes. Initially calls the given function for all known | 191 | * changes. Initially calls the given function for all known |
192 | * peers and then only signals changes. Note that it is | 192 | * peers and then only signals changes. |
193 | * possible (i.e. on disconnects) that the callback is called | 193 | * |
194 | * twice with the same peer information. | 194 | * If include_friend_only is set to GNUNET_YES peerinfo will include HELLO |
195 | * messages which are intended for friend to friend mode and which do not | ||
196 | * have to be gossiped. Otherwise these messages are skipped. | ||
195 | * | 197 | * |
196 | * @param cfg configuration to use | 198 | * @param cfg configuration to use |
199 | * @param include_friend_only include HELLO messages for friends only | ||
197 | * @param callback the method to call for each peer | 200 | * @param callback the method to call for each peer |
198 | * @param callback_cls closure for callback | 201 | * @param callback_cls closure for callback |
199 | * @return NULL on error | 202 | * @return NULL on error |
200 | */ | 203 | */ |
201 | struct GNUNET_PEERINFO_NotifyContext * | 204 | struct GNUNET_PEERINFO_NotifyContext * |
202 | GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, | 205 | GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, |
206 | int include_friend_only, | ||
203 | GNUNET_PEERINFO_Processor callback, void *callback_cls); | 207 | GNUNET_PEERINFO_Processor callback, void *callback_cls); |
204 | 208 | ||
205 | 209 | ||