diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-01-21 14:06:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-01-21 14:06:06 +0000 |
commit | 87b254030acd37b6714565c5ac2e803da743d777 (patch) | |
tree | c542002dffca21eeb335b278d377fa22bef33cf7 /src/include | |
parent | c13dfb403b26b07486953500103bccf9132654d6 (diff) | |
download | gnunet-87b254030acd37b6714565c5ac2e803da743d777.tar.gz gnunet-87b254030acd37b6714565c5ac2e803da743d777.zip |
stuff
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_core_service.h | 66 | ||||
-rw-r--r-- | src/include/gnunet_transport_service.h | 6 |
2 files changed, 44 insertions, 28 deletions
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index cffdf0a14..3ba4ef137 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -51,15 +51,30 @@ struct GNUNET_CORE_Handle; | |||
51 | 51 | ||
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Method called whenever a given peer either connects or | 54 | * Method called whenever a given peer either connects. |
55 | * disconnects (or list of connections was requested). | ||
56 | * | 55 | * |
57 | * @param cls closure | 56 | * @param cls closure |
58 | * @param peer peer identity this notification is about | 57 | * @param peer peer identity this notification is about |
58 | * @param latency reported latency of the connection with 'other' | ||
59 | * @param distance reported distance (DV) to 'other' | ||
59 | */ | 60 | */ |
60 | typedef void (*GNUNET_CORE_ClientEventHandler) (void *cls, | 61 | typedef void (*GNUNET_CORE_ConnectEventHandler) (void *cls, |
61 | const struct | 62 | const struct |
62 | GNUNET_PeerIdentity * peer); | 63 | GNUNET_PeerIdentity * peer, |
64 | struct GNUNET_TIME_Relative latency, | ||
65 | uint32_t distance); | ||
66 | |||
67 | |||
68 | |||
69 | /** | ||
70 | * Method called whenever a given peer either disconnects. | ||
71 | * | ||
72 | * @param cls closure | ||
73 | * @param peer peer identity this notification is about | ||
74 | */ | ||
75 | typedef void (*GNUNET_CORE_DisconnectEventHandler) (void *cls, | ||
76 | const struct | ||
77 | GNUNET_PeerIdentity * peer); | ||
63 | 78 | ||
64 | 79 | ||
65 | /** | 80 | /** |
@@ -70,6 +85,8 @@ typedef void (*GNUNET_CORE_ClientEventHandler) (void *cls, | |||
70 | * @param peer the other peer involved (sender or receiver, NULL | 85 | * @param peer the other peer involved (sender or receiver, NULL |
71 | * for loopback messages where we are both sender and receiver) | 86 | * for loopback messages where we are both sender and receiver) |
72 | * @param message the actual message | 87 | * @param message the actual message |
88 | * @param latency reported latency of the connection with 'other' | ||
89 | * @param distance reported distance (DV) to 'other' | ||
73 | * @return GNUNET_OK to keep the connection open, | 90 | * @return GNUNET_OK to keep the connection open, |
74 | * GNUNET_SYSERR to close it (signal serious error) | 91 | * GNUNET_SYSERR to close it (signal serious error) |
75 | */ | 92 | */ |
@@ -77,7 +94,9 @@ typedef int | |||
77 | (*GNUNET_CORE_MessageCallback) (void *cls, | 94 | (*GNUNET_CORE_MessageCallback) (void *cls, |
78 | const struct GNUNET_PeerIdentity * other, | 95 | const struct GNUNET_PeerIdentity * other, |
79 | const struct GNUNET_MessageHeader * | 96 | const struct GNUNET_MessageHeader * |
80 | message); | 97 | message, |
98 | struct GNUNET_TIME_Relative latency, | ||
99 | uint32_t distance); | ||
81 | 100 | ||
82 | 101 | ||
83 | /** | 102 | /** |
@@ -159,9 +178,9 @@ GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched, | |||
159 | struct GNUNET_TIME_Relative timeout, | 178 | struct GNUNET_TIME_Relative timeout, |
160 | void *cls, | 179 | void *cls, |
161 | GNUNET_CORE_StartupCallback init, | 180 | GNUNET_CORE_StartupCallback init, |
162 | GNUNET_CORE_ClientEventHandler pre_connects, | 181 | GNUNET_CORE_ConnectEventHandler pre_connects, |
163 | GNUNET_CORE_ClientEventHandler connects, | 182 | GNUNET_CORE_ConnectEventHandler connects, |
164 | GNUNET_CORE_ClientEventHandler disconnects, | 183 | GNUNET_CORE_DisconnectEventHandler disconnects, |
165 | GNUNET_CORE_MessageCallback inbound_notify, | 184 | GNUNET_CORE_MessageCallback inbound_notify, |
166 | int inbound_hdr_only, | 185 | int inbound_hdr_only, |
167 | GNUNET_CORE_MessageCallback outbound_notify, | 186 | GNUNET_CORE_MessageCallback outbound_notify, |
@@ -270,9 +289,8 @@ typedef void | |||
270 | GNUNET_PeerIdentity * peer, | 289 | GNUNET_PeerIdentity * peer, |
271 | unsigned int bpm_in, | 290 | unsigned int bpm_in, |
272 | unsigned int bpm_out, | 291 | unsigned int bpm_out, |
273 | struct GNUNET_TIME_Relative | 292 | int amount, |
274 | latency, int amount, | 293 | uint64_t preference); |
275 | unsigned long long preference); | ||
276 | 294 | ||
277 | 295 | ||
278 | 296 | ||
@@ -307,15 +325,15 @@ struct GNUNET_CORE_InformationRequestContext; | |||
307 | * @return NULL on error | 325 | * @return NULL on error |
308 | */ | 326 | */ |
309 | struct GNUNET_CORE_InformationRequestContext * | 327 | struct GNUNET_CORE_InformationRequestContext * |
310 | GNUNET_CORE_peer_get_info (struct GNUNET_SCHEDULER_Handle *sched, | 328 | GNUNET_CORE_peer_change_preference (struct GNUNET_SCHEDULER_Handle *sched, |
311 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 329 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
312 | const struct GNUNET_PeerIdentity *peer, | 330 | const struct GNUNET_PeerIdentity *peer, |
313 | struct GNUNET_TIME_Relative timeout, | 331 | struct GNUNET_TIME_Relative timeout, |
314 | uint32_t bpm_out, | 332 | uint32_t bpm_out, |
315 | int32_t amount, | 333 | int32_t amount, |
316 | uint64_t preference, | 334 | uint64_t preference, |
317 | GNUNET_CORE_PeerConfigurationInfoCallback info, | 335 | GNUNET_CORE_PeerConfigurationInfoCallback info, |
318 | void *info_cls); | 336 | void *info_cls); |
319 | 337 | ||
320 | 338 | ||
321 | /** | 339 | /** |
@@ -324,7 +342,7 @@ GNUNET_CORE_peer_get_info (struct GNUNET_SCHEDULER_Handle *sched, | |||
324 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call | 342 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call |
325 | */ | 343 | */ |
326 | void | 344 | void |
327 | GNUNET_CORE_peer_get_info_cancel (struct GNUNET_CORE_InformationRequestContext *irc); | 345 | GNUNET_CORE_peer_change_preference_cancel (struct GNUNET_CORE_InformationRequestContext *irc); |
328 | 346 | ||
329 | 347 | ||
330 | /** | 348 | /** |
@@ -355,9 +373,7 @@ struct GNUNET_CORE_TransmitHandle * | |||
355 | GNUNET_CORE_notify_transmit_ready (struct | 373 | GNUNET_CORE_notify_transmit_ready (struct |
356 | GNUNET_CORE_Handle | 374 | GNUNET_CORE_Handle |
357 | *handle, | 375 | *handle, |
358 | unsigned | 376 | uint32_t priority, |
359 | int | ||
360 | priority, | ||
361 | struct | 377 | struct |
362 | GNUNET_TIME_Relative | 378 | GNUNET_TIME_Relative |
363 | maxdelay, | 379 | maxdelay, |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 0d378cbd3..b86bb1663 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -68,7 +68,7 @@ typedef void (*GNUNET_TRANSPORT_ReceiveCallback) (void *cls, | |||
68 | message, | 68 | message, |
69 | struct GNUNET_TIME_Relative | 69 | struct GNUNET_TIME_Relative |
70 | latency, | 70 | latency, |
71 | unsigned int distance); | 71 | uint32_t distance); |
72 | 72 | ||
73 | 73 | ||
74 | /** | 74 | /** |
@@ -91,7 +91,7 @@ typedef void | |||
91 | (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, | 91 | (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, |
92 | const struct GNUNET_PeerIdentity * peer, | 92 | const struct GNUNET_PeerIdentity * peer, |
93 | struct GNUNET_TIME_Relative latency, | 93 | struct GNUNET_TIME_Relative latency, |
94 | unsigned int distance); | 94 | uint32_t distance); |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * Function called to notify transport users that another | 97 | * Function called to notify transport users that another |
@@ -204,7 +204,7 @@ struct GNUNET_TRANSPORT_TransmitHandle | |||
204 | *handle, | 204 | *handle, |
205 | const struct GNUNET_PeerIdentity | 205 | const struct GNUNET_PeerIdentity |
206 | *target, size_t size, | 206 | *target, size_t size, |
207 | unsigned int priority, | 207 | uint32_t priority, |
208 | struct GNUNET_TIME_Relative | 208 | struct GNUNET_TIME_Relative |
209 | timeout, | 209 | timeout, |
210 | GNUNET_CONNECTION_TransmitReadyNotify | 210 | GNUNET_CONNECTION_TransmitReadyNotify |