diff options
author | Gabor X Toth <*@tg-x.net> | 2014-05-06 10:26:24 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2014-05-06 10:26:24 +0000 |
commit | 4e1baae59f18ee5d7cd47afe28ced3daaaa5a5ad (patch) | |
tree | 4e0d4a1bf488d4969f44e3a8db26af6ca22d4db7 /src/include/gnunet_psyc_service.h | |
parent | b2061e704ac6309bb7ee4427a89a1572aa9f339e (diff) | |
download | gnunet-4e1baae59f18ee5d7cd47afe28ced3daaaa5a5ad.tar.gz gnunet-4e1baae59f18ee5d7cd47afe28ced3daaaa5a5ad.zip |
psyc: in-order message delivery
Diffstat (limited to 'src/include/gnunet_psyc_service.h')
-rw-r--r-- | src/include/gnunet_psyc_service.h | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h index 018f012f4..928e05242 100644 --- a/src/include/gnunet_psyc_service.h +++ b/src/include/gnunet_psyc_service.h | |||
@@ -167,7 +167,23 @@ enum GNUNET_PSYC_MessageFlags | |||
167 | /** | 167 | /** |
168 | * Request from slave to master. | 168 | * Request from slave to master. |
169 | */ | 169 | */ |
170 | GNUNET_PSYC_MESSAGE_REQUEST = 1 << 1 | 170 | GNUNET_PSYC_MESSAGE_REQUEST = 1 << 1, |
171 | |||
172 | /** | ||
173 | * Message can be delivered out of order. | ||
174 | */ | ||
175 | GNUNET_PSYC_MESSAGE_ORDER_ANY = 1 << 2 | ||
176 | }; | ||
177 | |||
178 | |||
179 | /** | ||
180 | * Values for the @a state_delta field of GNUNET_PSYC_MessageHeader. | ||
181 | */ | ||
182 | enum GNUNET_PSYC_StateDeltaValues | ||
183 | { | ||
184 | GNUNET_PSYC_STATE_RESET = 0, | ||
185 | |||
186 | GNUNET_PSYC_STATE_NOT_MODIFIED = UINT64_MAX | ||
171 | }; | 187 | }; |
172 | 188 | ||
173 | 189 | ||
@@ -175,6 +191,8 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
175 | 191 | ||
176 | /** | 192 | /** |
177 | * Header of a PSYC message. | 193 | * Header of a PSYC message. |
194 | * | ||
195 | * Only present when receiving a message. | ||
178 | */ | 196 | */ |
179 | struct GNUNET_PSYC_MessageHeader | 197 | struct GNUNET_PSYC_MessageHeader |
180 | { | 198 | { |
@@ -223,6 +241,12 @@ struct GNUNET_PSYC_MessageMethod | |||
223 | */ | 241 | */ |
224 | uint32_t flags GNUNET_PACKED; | 242 | uint32_t flags GNUNET_PACKED; |
225 | 243 | ||
244 | /** | ||
245 | * Number of message IDs since the last message that contained state | ||
246 | * operations. @see enum GNUNET_PSYC_StateDeltaValues | ||
247 | */ | ||
248 | uint64_t state_delta GNUNET_PACKED; | ||
249 | |||
226 | /* Followed by NUL-terminated method name. */ | 250 | /* Followed by NUL-terminated method name. */ |
227 | }; | 251 | }; |
228 | 252 | ||
@@ -479,22 +503,29 @@ typedef int | |||
479 | enum GNUNET_PSYC_MasterTransmitFlags | 503 | enum GNUNET_PSYC_MasterTransmitFlags |
480 | { | 504 | { |
481 | GNUNET_PSYC_MASTER_TRANSMIT_NONE = 0, | 505 | GNUNET_PSYC_MASTER_TRANSMIT_NONE = 0, |
506 | |||
482 | /** | 507 | /** |
483 | * Whether this message should reset the channel state, | 508 | * Whether this message should reset the channel state, |
484 | * i.e. remove all previously stored state variables. | 509 | * i.e. remove all previously stored state variables. |
485 | */ | 510 | */ |
486 | GNUNET_PSYC_MASTER_TRANSMIT_RESET_STATE = 1 << 0, | 511 | |
512 | GNUNET_PSYC_MASTER_TRANSMIT_STATE_RESET = 1 << 0, | ||
487 | 513 | ||
488 | /** | 514 | /** |
489 | * Whether we need to increment the group generation counter after | 515 | * Whether this message contains any state modifiers. |
490 | * transmitting this message. | ||
491 | */ | 516 | */ |
492 | GNUNET_PSYC_MASTER_TRANSMIT_INC_GROUP_GEN = 1 << 1, | 517 | GNUNET_PSYC_MASTER_TRANSMIT_STATE_MODIFY = 1 << 1, |
493 | 518 | ||
494 | /** | 519 | /** |
495 | * Add PSYC header variable with the hash of the current channel state. | 520 | * Add PSYC header variable with the hash of the current channel state. |
496 | */ | 521 | */ |
497 | GNUNET_PSYC_MASTER_TRANSMIT_ADD_STATE_HASH = 1 << 2 | 522 | GNUNET_PSYC_MASTER_TRANSMIT_STATE_HASH = 1 << 2, |
523 | |||
524 | /** | ||
525 | * Whether we need to increment the group generation counter after | ||
526 | * transmitting this message. | ||
527 | */ | ||
528 | GNUNET_PSYC_MASTER_TRANSMIT_INC_GROUP_GEN = 1 << 3 | ||
498 | }; | 529 | }; |
499 | 530 | ||
500 | 531 | ||