diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-03 11:27:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-03 11:27:14 +0000 |
commit | 31fa7ff21510bad20198b2e6d2b93d62d7624394 (patch) | |
tree | 13f4cbacee4a266b6908a5fef47fa2382785b56c /src/include/gnunet_peerinfo_service.h | |
parent | 214038fae7d60dc443e823009c1fc942d0560aa4 (diff) | |
download | gnunet-31fa7ff21510bad20198b2e6d2b93d62d7624394.tar.gz gnunet-31fa7ff21510bad20198b2e6d2b93d62d7624394.zip |
-enable lm building
Diffstat (limited to 'src/include/gnunet_peerinfo_service.h')
-rw-r--r-- | src/include/gnunet_peerinfo_service.h | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 12264fb1f..49ba91600 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h | |||
@@ -58,7 +58,6 @@ struct GNUNET_PEERINFO_Handle * | |||
58 | GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 58 | GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
59 | 59 | ||
60 | 60 | ||
61 | |||
62 | /** | 61 | /** |
63 | * Disconnect from the peerinfo service. Note that all iterators must | 62 | * Disconnect from the peerinfo service. Note that all iterators must |
64 | * have completed or have been cancelled by the time this function is | 63 | * have completed or have been cancelled by the time this function is |
@@ -73,6 +72,22 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | |||
73 | 72 | ||
74 | 73 | ||
75 | /** | 74 | /** |
75 | * Continuation called with a status result. | ||
76 | * | ||
77 | * @param cls closure | ||
78 | * @param emsg error message, NULL on success | ||
79 | */ | ||
80 | typedef void (*GNUNET_PEERINFO_Continuation)(void *cls, | ||
81 | const char *emsg); | ||
82 | |||
83 | |||
84 | /** | ||
85 | * Opaque handle to cancel 'add' operation. | ||
86 | */ | ||
87 | struct GNUNET_PEERINFO_AddContext; | ||
88 | |||
89 | |||
90 | /** | ||
76 | * Add a host to the persistent list. This method operates in | 91 | * Add a host to the persistent list. This method operates in |
77 | * semi-reliable mode: if the transmission is not completed by | 92 | * semi-reliable mode: if the transmission is not completed by |
78 | * the time 'GNUNET_PEERINFO_disconnect' is called, it will be | 93 | * the time 'GNUNET_PEERINFO_disconnect' is called, it will be |
@@ -82,10 +97,29 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | |||
82 | * | 97 | * |
83 | * @param h handle to the peerinfo service | 98 | * @param h handle to the peerinfo service |
84 | * @param hello the verified (!) HELLO message | 99 | * @param hello the verified (!) HELLO message |
100 | * @param cont continuation to call when done, NULL is allowed | ||
101 | * @param cont_cls closure for 'cont' | ||
102 | * @return handle to cancel add operation; all pending | ||
103 | * 'add' operations will be cancelled automatically | ||
104 | * on disconnect, so it is not necessary to keep this | ||
105 | * handle (unless 'cont' is NULL and at some point | ||
106 | * calling 'cont' must be prevented) | ||
85 | */ | 107 | */ |
86 | void | 108 | struct GNUNET_PEERINFO_AddContext * |
87 | GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, | 109 | GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, |
88 | const struct GNUNET_HELLO_Message *hello); | 110 | const struct GNUNET_HELLO_Message *hello, |
111 | GNUNET_PEERINFO_Continuation cont, | ||
112 | void *cont_cls); | ||
113 | |||
114 | |||
115 | /** | ||
116 | * Cancel pending 'add' operation. Must only be called before | ||
117 | * either 'cont' or 'GNUNET_PEERINFO_disconnect' are invoked. | ||
118 | * | ||
119 | * @param ac handle for the add operation to cancel | ||
120 | */ | ||
121 | void | ||
122 | GNUNET_PEERINFO_add_peer_cancel (struct GNUNET_PEERINFO_AddContext *ac); | ||
89 | 123 | ||
90 | 124 | ||
91 | /** | 125 | /** |