diff options
author | Gabor X Toth <*@tg-x.net> | 2016-01-26 20:37:11 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-01-26 20:37:11 +0000 |
commit | 23f117ce9756b2fb898bba5cb3a1f638333c23d9 (patch) | |
tree | e15291bd36f696802fca5c379ad09e3ea3920d76 /src/include | |
parent | 0841876fb932574a6c9ebaf2adbb64f1ffc06899 (diff) | |
download | gnunet-23f117ce9756b2fb898bba5cb3a1f638333c23d9.tar.gz gnunet-23f117ce9756b2fb898bba5cb3a1f638333c23d9.zip |
social: relay msgs; psyc: slicer api; multicast: reset fragment_offset
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_protocols.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_psyc_message.h | 9 | ||||
-rw-r--r-- | src/include/gnunet_psyc_service.h | 27 | ||||
-rw-r--r-- | src/include/gnunet_psyc_slicer.h | 41 |
4 files changed, 41 insertions, 38 deletions
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index b3d03c0a7..a492e4dd7 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -2650,7 +2650,7 @@ extern "C" | |||
2650 | #define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET 860 | 2650 | #define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET 860 |
2651 | 2651 | ||
2652 | /** C->S: clear message processing flags */ | 2652 | /** C->S: clear message processing flags */ |
2653 | #define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_CLEAR 860 | 2653 | #define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_CLEAR 861 |
2654 | 2654 | ||
2655 | /******************************************************************************* | 2655 | /******************************************************************************* |
2656 | * X-VINE DHT messages | 2656 | * X-VINE DHT messages |
diff --git a/src/include/gnunet_psyc_message.h b/src/include/gnunet_psyc_message.h index 3748832ba..e85f40052 100644 --- a/src/include/gnunet_psyc_message.h +++ b/src/include/gnunet_psyc_message.h | |||
@@ -60,6 +60,8 @@ extern "C" | |||
60 | * | 60 | * |
61 | * @return Message header with size information, | 61 | * @return Message header with size information, |
62 | * followed by the message parts. | 62 | * followed by the message parts. |
63 | * | ||
64 | * FIXME: arg order | ||
63 | */ | 65 | */ |
64 | struct GNUNET_PSYC_Message * | 66 | struct GNUNET_PSYC_Message * |
65 | GNUNET_PSYC_message_create (const char *method_name, | 67 | GNUNET_PSYC_message_create (const char *method_name, |
@@ -83,6 +85,8 @@ GNUNET_PSYC_message_create (const char *method_name, | |||
83 | * | 85 | * |
84 | * @return #GNUNET_OK on success, | 86 | * @return #GNUNET_OK on success, |
85 | * #GNUNET_SYSERR on parse error. | 87 | * #GNUNET_SYSERR on parse error. |
88 | * | ||
89 | * FIXME: arg order | ||
86 | */ | 90 | */ |
87 | int | 91 | int |
88 | GNUNET_PSYC_message_parse (const struct GNUNET_PSYC_MessageHeader *msg, | 92 | GNUNET_PSYC_message_parse (const struct GNUNET_PSYC_MessageHeader *msg, |
@@ -97,11 +101,6 @@ GNUNET_PSYC_log_message (enum GNUNET_ErrorType kind, | |||
97 | const struct GNUNET_MessageHeader *msg); | 101 | const struct GNUNET_MessageHeader *msg); |
98 | 102 | ||
99 | 103 | ||
100 | int | ||
101 | GNUNET_PSYC_check_message_parts (uint16_t data_size, const char *data, | ||
102 | uint16_t *first_ptype, uint16_t *last_ptype); | ||
103 | |||
104 | |||
105 | struct GNUNET_PSYC_TransmitHandle; | 104 | struct GNUNET_PSYC_TransmitHandle; |
106 | 105 | ||
107 | /** | 106 | /** |
diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h index 16be33b15..d31f9c50a 100644 --- a/src/include/gnunet_psyc_service.h +++ b/src/include/gnunet_psyc_service.h | |||
@@ -311,7 +311,7 @@ struct GNUNET_PSYC_MessageModifier | |||
311 | uint16_t name_size GNUNET_PACKED; | 311 | uint16_t name_size GNUNET_PACKED; |
312 | 312 | ||
313 | /** | 313 | /** |
314 | * enum GNUNET_ENV_Operator | 314 | * enum GNUNET_PSYC_Operator |
315 | */ | 315 | */ |
316 | uint8_t oper; | 316 | uint8_t oper; |
317 | 317 | ||
@@ -533,8 +533,6 @@ struct GNUNET_PSYC_JoinHandle; | |||
533 | */ | 533 | */ |
534 | typedef void | 534 | typedef void |
535 | (*GNUNET_PSYC_MessageCallback) (void *cls, | 535 | (*GNUNET_PSYC_MessageCallback) (void *cls, |
536 | uint64_t message_id, | ||
537 | uint32_t flags, | ||
538 | const struct GNUNET_PSYC_MessageHeader *msg); | 536 | const struct GNUNET_PSYC_MessageHeader *msg); |
539 | 537 | ||
540 | 538 | ||
@@ -562,11 +560,8 @@ typedef void | |||
562 | */ | 560 | */ |
563 | typedef void | 561 | typedef void |
564 | (*GNUNET_PSYC_MessagePartCallback) (void *cls, | 562 | (*GNUNET_PSYC_MessagePartCallback) (void *cls, |
565 | const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, | 563 | const struct GNUNET_PSYC_MessageHeader *msg, |
566 | uint64_t message_id, | 564 | const struct GNUNET_MessageHeader *pmsg); |
567 | uint32_t flags, | ||
568 | uint64_t fragment_offset, | ||
569 | const struct GNUNET_MessageHeader *msg); | ||
570 | 565 | ||
571 | 566 | ||
572 | /** | 567 | /** |
@@ -829,6 +824,22 @@ GNUNET_PSYC_master_transmit_cancel (struct GNUNET_PSYC_MasterTransmitHandle *th) | |||
829 | 824 | ||
830 | 825 | ||
831 | /** | 826 | /** |
827 | * Relay a message | ||
828 | * | ||
829 | * @param master Handle to the PSYC channel. | ||
830 | * @param method_name Which method should be invoked. | ||
831 | * @param notify_mod Function to call to obtain modifiers. | ||
832 | * @param notify_data Function to call to obtain fragments of the data. | ||
833 | * @param notify_cls Closure for @a notify_mod and @a notify_data. | ||
834 | * @param flags Flags for the message being transmitted. | ||
835 | * @return Transmission handle, NULL on error (i.e. more than one request queued). | ||
836 | */ | ||
837 | struct GNUNET_PSYC_MasterTransmitHandle * | ||
838 | GNUNET_PSYC_master_relay (struct GNUNET_PSYC_Master *master, | ||
839 | uint64_t message_id); | ||
840 | |||
841 | |||
842 | /** | ||
832 | * Stop a PSYC master channel. | 843 | * Stop a PSYC master channel. |
833 | * | 844 | * |
834 | * @param master | 845 | * @param master |
diff --git a/src/include/gnunet_psyc_slicer.h b/src/include/gnunet_psyc_slicer.h index f6b6547f3..56a7fb636 100644 --- a/src/include/gnunet_psyc_slicer.h +++ b/src/include/gnunet_psyc_slicer.h | |||
@@ -79,12 +79,9 @@ struct GNUNET_PSYC_Slicer; | |||
79 | */ | 79 | */ |
80 | typedef void | 80 | typedef void |
81 | (*GNUNET_PSYC_MethodCallback) (void *cls, | 81 | (*GNUNET_PSYC_MethodCallback) (void *cls, |
82 | const struct GNUNET_PSYC_MessageMethod *msg, | 82 | const struct GNUNET_PSYC_MessageHeader *msg, |
83 | const struct GNUNET_PSYC_MessageMethod *meth, | ||
83 | uint64_t message_id, | 84 | uint64_t message_id, |
84 | uint32_t flags, | ||
85 | uint64_t fragment_offset, | ||
86 | uint32_t tmit_flags, | ||
87 | const struct GNUNET_CRYPTO_EcdsaPublicKey *nym_pub_key, | ||
88 | const char *method_name); | 85 | const char *method_name); |
89 | 86 | ||
90 | 87 | ||
@@ -114,10 +111,9 @@ typedef void | |||
114 | */ | 111 | */ |
115 | typedef void | 112 | typedef void |
116 | (*GNUNET_PSYC_ModifierCallback) (void *cls, | 113 | (*GNUNET_PSYC_ModifierCallback) (void *cls, |
117 | const struct GNUNET_MessageHeader *msg, | 114 | const struct GNUNET_PSYC_MessageHeader *msg, |
115 | const struct GNUNET_MessageHeader *pmsg, | ||
118 | uint64_t message_id, | 116 | uint64_t message_id, |
119 | uint32_t flags, | ||
120 | uint64_t fragment_offset, | ||
121 | enum GNUNET_PSYC_Operator oper, | 117 | enum GNUNET_PSYC_Operator oper, |
122 | const char *name, | 118 | const char *name, |
123 | const void *value, | 119 | const void *value, |
@@ -150,10 +146,9 @@ typedef void | |||
150 | */ | 146 | */ |
151 | typedef void | 147 | typedef void |
152 | (*GNUNET_PSYC_DataCallback) (void *cls, | 148 | (*GNUNET_PSYC_DataCallback) (void *cls, |
153 | const struct GNUNET_MessageHeader *msg, | 149 | const struct GNUNET_PSYC_MessageHeader *msg, |
150 | const struct GNUNET_MessageHeader *pmsg, | ||
154 | uint64_t message_id, | 151 | uint64_t message_id, |
155 | uint32_t flags, | ||
156 | uint64_t fragment_offset, | ||
157 | const void *data, | 152 | const void *data, |
158 | uint16_t data_size); | 153 | uint16_t data_size); |
159 | 154 | ||
@@ -177,11 +172,10 @@ typedef void | |||
177 | */ | 172 | */ |
178 | typedef void | 173 | typedef void |
179 | (*GNUNET_PSYC_EndOfMessageCallback) (void *cls, | 174 | (*GNUNET_PSYC_EndOfMessageCallback) (void *cls, |
180 | const struct GNUNET_MessageHeader *msg, | 175 | const struct GNUNET_PSYC_MessageHeader *msg, |
176 | const struct GNUNET_MessageHeader *pmsg, | ||
181 | uint64_t message_id, | 177 | uint64_t message_id, |
182 | uint32_t flags, | 178 | uint8_t is_cancelled); |
183 | uint64_t fragment_offset, | ||
184 | uint8_t cancelled); | ||
185 | 179 | ||
186 | 180 | ||
187 | /** | 181 | /** |
@@ -220,6 +214,7 @@ GNUNET_PSYC_slicer_create (void); | |||
220 | void | 214 | void |
221 | GNUNET_PSYC_slicer_method_add (struct GNUNET_PSYC_Slicer *slicer, | 215 | GNUNET_PSYC_slicer_method_add (struct GNUNET_PSYC_Slicer *slicer, |
222 | const char *method_name, | 216 | const char *method_name, |
217 | GNUNET_PSYC_MessageCallback msg_cb, | ||
223 | GNUNET_PSYC_MethodCallback method_cb, | 218 | GNUNET_PSYC_MethodCallback method_cb, |
224 | GNUNET_PSYC_ModifierCallback modifier_cb, | 219 | GNUNET_PSYC_ModifierCallback modifier_cb, |
225 | GNUNET_PSYC_DataCallback data_cb, | 220 | GNUNET_PSYC_DataCallback data_cb, |
@@ -237,13 +232,13 @@ GNUNET_PSYC_slicer_method_add (struct GNUNET_PSYC_Slicer *slicer, | |||
237 | * @param method_name | 232 | * @param method_name |
238 | * Name of the method to remove. | 233 | * Name of the method to remove. |
239 | * @param method_cb | 234 | * @param method_cb |
240 | * Method handler. | 235 | * Only remove matching method handler, or NULL. |
241 | * @param modifier_cb | 236 | * @param modifier_cb |
242 | * Modifier handler. | 237 | * Only remove matching modifier handler, or NULL. |
243 | * @param data_cb | 238 | * @param data_cb |
244 | * Data handler. | 239 | * Only remove matching data handler, or NULL. |
245 | * @param eom_cb | 240 | * @param eom_cb |
246 | * End of message handler. | 241 | * Only remove matching End of Message handler, or NULL. |
247 | * | 242 | * |
248 | * @return #GNUNET_OK if a method handler was removed, | 243 | * @return #GNUNET_OK if a method handler was removed, |
249 | * #GNUNET_NO if no handler matched the given method name and callbacks. | 244 | * #GNUNET_NO if no handler matched the given method name and callbacks. |
@@ -251,6 +246,7 @@ GNUNET_PSYC_slicer_method_add (struct GNUNET_PSYC_Slicer *slicer, | |||
251 | int | 246 | int |
252 | GNUNET_PSYC_slicer_method_remove (struct GNUNET_PSYC_Slicer *slicer, | 247 | GNUNET_PSYC_slicer_method_remove (struct GNUNET_PSYC_Slicer *slicer, |
253 | const char *method_name, | 248 | const char *method_name, |
249 | GNUNET_PSYC_MessageCallback msg_cb, | ||
254 | GNUNET_PSYC_MethodCallback method_cb, | 250 | GNUNET_PSYC_MethodCallback method_cb, |
255 | GNUNET_PSYC_ModifierCallback modifier_cb, | 251 | GNUNET_PSYC_ModifierCallback modifier_cb, |
256 | GNUNET_PSYC_DataCallback data_cb, | 252 | GNUNET_PSYC_DataCallback data_cb, |
@@ -325,11 +321,8 @@ GNUNET_PSYC_slicer_message (struct GNUNET_PSYC_Slicer *slicer, | |||
325 | */ | 321 | */ |
326 | void | 322 | void |
327 | GNUNET_PSYC_slicer_message_part (struct GNUNET_PSYC_Slicer *slicer, | 323 | GNUNET_PSYC_slicer_message_part (struct GNUNET_PSYC_Slicer *slicer, |
328 | const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, | 324 | const struct GNUNET_PSYC_MessageHeader *msg, |
329 | uint64_t message_id, | 325 | const struct GNUNET_MessageHeader *pmsg); |
330 | uint32_t flags, | ||
331 | uint64_t fragment_offset, | ||
332 | const struct GNUNET_MessageHeader *msg); | ||
333 | 326 | ||
334 | 327 | ||
335 | /** | 328 | /** |