diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-01-03 00:43:57 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-01-03 00:43:57 +0000 |
commit | 845316cb543af7e4c77709acce4df79f3e0dc162 (patch) | |
tree | 629739608b0bd0f645d82fd41d90ccb2cb617d09 /src/include/gnunet_consensus_service.h | |
parent | 3def510831309a5a0a5f50a2250911d6b592a87e (diff) | |
download | gnunet-845316cb543af7e4c77709acce4df79f3e0dc162.tar.gz gnunet-845316cb543af7e4c77709acce4df79f3e0dc162.zip |
implemented the modified consensus api, started implementing p2p protocol for consensus
Diffstat (limited to 'src/include/gnunet_consensus_service.h')
-rw-r--r-- | src/include/gnunet_consensus_service.h | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/src/include/gnunet_consensus_service.h b/src/include/gnunet_consensus_service.h index 232033598..951f9a031 100644 --- a/src/include/gnunet_consensus_service.h +++ b/src/include/gnunet_consensus_service.h | |||
@@ -76,8 +76,8 @@ struct GNUNET_CONSENSUS_Element | |||
76 | * @return GNUNET_OK if the valid is well-formed and should be added to the consensus, | 76 | * @return GNUNET_OK if the valid is well-formed and should be added to the consensus, |
77 | * GNUNET_SYSERR if the element should be ignored and not be propagated | 77 | * GNUNET_SYSERR if the element should be ignored and not be propagated |
78 | */ | 78 | */ |
79 | typedef int (*GNUNET_CONSENSUS_NewElementCallback) (void *cls, | 79 | typedef int (*GNUNET_CONSENSUS_ElementCallback) (void *cls, |
80 | struct GNUNET_CONSENSUS_Element *element); | 80 | struct GNUNET_CONSENSUS_Element *element); |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
@@ -105,10 +105,10 @@ struct GNUNET_CONSENSUS_Handle; | |||
105 | */ | 105 | */ |
106 | struct GNUNET_CONSENSUS_Handle * | 106 | struct GNUNET_CONSENSUS_Handle * |
107 | GNUNET_CONSENSUS_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | 107 | GNUNET_CONSENSUS_create (const struct GNUNET_CONFIGURATION_Handle *cfg, |
108 | unsigned int num_peers, | 108 | unsigned int num_peers, |
109 | const struct GNUNET_PeerIdentity *peers, | 109 | const struct GNUNET_PeerIdentity *peers, |
110 | const struct GNUNET_HashCode *session_id, | 110 | const struct GNUNET_HashCode *session_id, |
111 | GNUNET_CONSENSUS_NewElementCallback new_element_cb, | 111 | GNUNET_CONSENSUS_ElementCallback new_element_cb, |
112 | void *new_element_cls); | 112 | void *new_element_cls); |
113 | 113 | ||
114 | 114 | ||
@@ -122,7 +122,7 @@ GNUNET_CONSENSUS_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
122 | * the insertion and thus the consensus failed for good | 122 | * the insertion and thus the consensus failed for good |
123 | */ | 123 | */ |
124 | typedef void (*GNUNET_CONSENSUS_InsertDoneCallback) (void *cls, | 124 | typedef void (*GNUNET_CONSENSUS_InsertDoneCallback) (void *cls, |
125 | int success); | 125 | int success); |
126 | 126 | ||
127 | 127 | ||
128 | /** | 128 | /** |
@@ -138,9 +138,9 @@ typedef void (*GNUNET_CONSENSUS_InsertDoneCallback) (void *cls, | |||
138 | */ | 138 | */ |
139 | void | 139 | void |
140 | GNUNET_CONSENSUS_insert (struct GNUNET_CONSENSUS_Handle *consensus, | 140 | GNUNET_CONSENSUS_insert (struct GNUNET_CONSENSUS_Handle *consensus, |
141 | const struct GNUNET_CONSENSUS_Element *element, | 141 | const struct GNUNET_CONSENSUS_Element *element, |
142 | GNUNET_CONSENSUS_InsertDoneCallback idc, | 142 | GNUNET_CONSENSUS_InsertDoneCallback idc, |
143 | void *idc_cls); | 143 | void *idc_cls); |
144 | 144 | ||
145 | 145 | ||
146 | /** | 146 | /** |
@@ -168,9 +168,9 @@ struct GNUNET_CONSENSUS_DeltaRequest; | |||
168 | */ | 168 | */ |
169 | struct GNUNET_CONSENSUS_DeltaRequest * | 169 | struct GNUNET_CONSENSUS_DeltaRequest * |
170 | GNUNET_CONSENSUS_get_delta (struct GNUNET_CONSENSUS_Handle *consensus, | 170 | GNUNET_CONSENSUS_get_delta (struct GNUNET_CONSENSUS_Handle *consensus, |
171 | uint32_t group_id, | 171 | uint32_t group_id, |
172 | GNUNET_CONSENSUS_NewElementCallback remove_element_cb, | 172 | GNUNET_CONSENSUS_ElementCallback remove_element_cb, |
173 | void *remove_element_cb_cls); | 173 | void *remove_element_cb_cls); |
174 | 174 | ||
175 | 175 | ||
176 | void | 176 | void |
@@ -184,19 +184,7 @@ struct GNUNET_CONSENSUS_Group | |||
184 | uint64_t total_elements_in_group; | 184 | uint64_t total_elements_in_group; |
185 | const struct GNUNET_PeerIdentity **members; | 185 | const struct GNUNET_PeerIdentity **members; |
186 | }; | 186 | }; |
187 | 187 | ||
188 | |||
189 | /** | ||
190 | * Called when a conclusion was successful. | ||
191 | * | ||
192 | * @param cls | ||
193 | * @param num_peers_in_consensus | ||
194 | * @param peers_in_consensus | ||
195 | */ | ||
196 | typedef void (*GNUNET_CONSENSUS_NewConcludeCallback) (void *cls, | ||
197 | unsigned int consensus_group_count, | ||
198 | const struct GNUNET_CONSENSUS_Group *groups); | ||
199 | |||
200 | 188 | ||
201 | /** | 189 | /** |
202 | * Called when a conclusion was successful. | 190 | * Called when a conclusion was successful. |
@@ -206,8 +194,8 @@ typedef void (*GNUNET_CONSENSUS_NewConcludeCallback) (void *cls, | |||
206 | * @param peers_in_consensus | 194 | * @param peers_in_consensus |
207 | */ | 195 | */ |
208 | typedef void (*GNUNET_CONSENSUS_ConcludeCallback) (void *cls, | 196 | typedef void (*GNUNET_CONSENSUS_ConcludeCallback) (void *cls, |
209 | unsigned int num_peers_in_consensus, | 197 | unsigned int consensus_group_count, |
210 | const struct GNUNET_PeerIdentity *peers_in_consensus); | 198 | const struct GNUNET_CONSENSUS_Group *groups); |
211 | 199 | ||
212 | 200 | ||
213 | /** | 201 | /** |
@@ -222,10 +210,10 @@ typedef void (*GNUNET_CONSENSUS_ConcludeCallback) (void *cls, | |||
222 | */ | 210 | */ |
223 | void | 211 | void |
224 | GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus, | 212 | GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus, |
225 | struct GNUNET_TIME_Relative timeout, | 213 | struct GNUNET_TIME_Relative timeout, |
226 | // unsigned int min_group_size_in_consensus, | 214 | unsigned int min_group_size_in_consensus, |
227 | GNUNET_CONSENSUS_ConcludeCallback conclude, | 215 | GNUNET_CONSENSUS_ConcludeCallback conclude, |
228 | void *conclude_cls); | 216 | void *conclude_cls); |
229 | 217 | ||
230 | 218 | ||
231 | /** | 219 | /** |