/**
* Byte offset of this @e fragment of the @e message.
- * FIXME: use data_offset instead
*/
uint64_t fragment_offset GNUNET_PACKED;
* Sequence number of the message.
* @param flags
* OR'ed GNUNET_PSYC_MessageFlags
- * @param data_offset
- * Byte offset of data, only set if @a msg has a type
- * #GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_DATA
+ * @param fragment_offset
+ * Multicast message fragment offset.
* @param msg Message part, one of the following types:
* - #GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_HEADER
* - #GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD
const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key,
uint64_t message_id,
uint32_t flags,
- uint64_t data_offset,
+ uint64_t fragment_offset,
const struct GNUNET_MessageHeader *msg);
* Message part, as it arrived from the network.
* @param message_id
* Message counter, monotonically increasing from 1.
+ * @param flags
+ * OR'ed GNUNET_PSYC_MessageFlags
+ * @param fragment_offset
+ * Multicast message fragment offset.
+ * @param tmit_flags
+ * OR'ed GNUNET_PSYC_MasterTransmitFlags
* @param nym
* The sender of the message.
* Can be NULL if the message is not connected to a pseudonym.
- * @param flags
- * OR'ed GNUNET_PSYC_MessageFlags
* @param method_name
* Original method name from PSYC.
* May be more specific than the registered method name due to
const struct GNUNET_PSYC_MessageMethod *msg,
uint64_t message_id,
uint32_t flags,
+ uint64_t fragment_offset,
+ uint32_t tmit_flags,
const struct GNUNET_CRYPTO_EcdsaPublicKey *nym_pub_key,
const char *method_name);
* Closure.
* @param message_id
* Message ID this data fragment belongs to.
+ * @param flags
+ * OR'ed GNUNET_PSYC_MessageFlags
+ * @param fragment_offset
+ * Multicast message fragment offset.
* @param msg
* Message part, as it arrived from the network.
* @param oper
(*GNUNET_PSYC_ModifierCallback) (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
+ uint32_t flags,
+ uint64_t fragment_offset,
enum GNUNET_PSYC_Operator oper,
const char *name,
const void *value,
*
* @param cls
* Closure.
- * @param message_id
- * Message ID this data fragment belongs to.
* @param msg
* Message part, as it arrived from the network.
- * @param data_offset
- * Byte offset of @a data in the overall data of the method.
- * @param data_size
- * Number of bytes in @a data.
+ * @param message_id
+ * Message ID this data fragment belongs to.
+ * @param flags
+ * OR'ed GNUNET_PSYC_MessageFlags
+ * @param fragment_offset
+ * Multicast message fragment offset.
* @param data
* Data stream given to the method.
+ * @param data_size
+ * Number of bytes in @a data.
* @param end
* End of message?
* #GNUNET_NO if there are further fragments,
(*GNUNET_PSYC_DataCallback) (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
- uint64_t data_offset,
+ uint32_t flags,
+ uint64_t fragment_offset,
const void *data,
uint16_t data_size);
* Message part, as it arrived from the network.
* @param message_id
* Message ID this data fragment belongs to.
+ * @param flags
+ * OR'ed GNUNET_PSYC_MessageFlags
+ * @param fragment_offset
+ * Multicast message fragment offset.
* @param cancelled
* #GNUNET_YES if the message was cancelled,
* #GNUNET_NO if the message is complete.
(*GNUNET_PSYC_EndOfMessageCallback) (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
+ uint32_t flags,
+ uint64_t fragment_offset,
uint8_t cancelled);
if (NULL != recv->message_part_cb)
recv->message_part_cb (recv->cb_cls, &recv->slave_pub_key,
recv->message_id, recv->flags,
- 0, // FIXME: data_offset
+ GNUNET_ntohll (msg->fragment_offset),
pmsg);
switch (ptype)
static void
parse_message_part_cb (void *cls,
const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key,
- uint64_t message_id, uint32_t flags, uint64_t data_offset,
+ uint64_t message_id, uint32_t flags, uint64_t fragment_offset,
const struct GNUNET_MessageHeader *msg)
{
struct ParseMessageClosure *pmc = cls;
*/
uint64_t message_id;
+ /**
+ * Fragment offset of currently being received message.
+ */
+ uint64_t fragment_offset;
+
+ /**
+ * Flags of currently being received message.
+ */
+ uint32_t flags;
+
/**
* Method name of currently being received message.
*/
struct GNUNET_PSYC_MessageMethod *
meth = (struct GNUNET_PSYC_MessageMethod *) msg;
cbs->method_cb (cbs->cls, meth, slicer->message_id,
+ slicer->flags, slicer->fragment_offset,
ntohl (meth->flags),
&slicer->nym_pub_key,
slicer->method_name);
struct GNUNET_PSYC_MessageModifier *
mod = (struct GNUNET_PSYC_MessageModifier *) msg;
cbs->modifier_cb (cbs->cls, &mod->header, slicer->message_id,
+ slicer->flags, slicer->fragment_offset,
mod->oper, (const char *) &mod[1],
(const void *) &mod[1] + ntohs (mod->name_size),
ntohs (mod->header.size) - sizeof (*mod) - ntohs (mod->name_size),
if (NULL == cbs->modifier_cb)
break;
cbs->modifier_cb (cbs->cls, msg, slicer->message_id,
+ slicer->flags, slicer->fragment_offset,
slicer->mod_oper, slicer->mod_name, &msg[1],
ntohs (msg->size) - sizeof (*msg),
slicer->mod_full_value_size);
{
if (NULL == cbs->data_cb)
break;
- uint64_t data_offset = 0; // FIXME
cbs->data_cb (cbs->cls, msg, slicer->message_id,
- data_offset, &msg[1], ntohs (msg->size) - sizeof (*msg));
+ slicer->flags, slicer->fragment_offset,
+ &msg[1], ntohs (msg->size) - sizeof (*msg));
break;
}
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_END:
if (NULL == cbs->eom_cb)
break;
- cbs->eom_cb (cbs->cls, msg, slicer->message_id, GNUNET_NO);
+ cbs->eom_cb (cbs->cls, msg, slicer->message_id,
+ slicer->flags, slicer->fragment_offset, GNUNET_NO);
break;
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_CANCEL:
if (NULL == cbs->eom_cb)
break;
- cbs->eom_cb (cbs->cls, msg, slicer->message_id, GNUNET_YES);
+ cbs->eom_cb (cbs->cls, msg, slicer->message_id,
+ slicer->flags, slicer->fragment_offset, GNUNET_YES);
break;
}
return GNUNET_YES;
struct GNUNET_PSYC_Slicer *slicer = cls;
struct SlicerModifierCallbacks *cbs = value;
- cbs->modifier_cb (cbs->cls, slicer->msg, slicer->message_id, slicer->mod_oper,
- slicer->mod_name, slicer->mod_value,
+ cbs->modifier_cb (cbs->cls, slicer->msg,
+ slicer->message_id, slicer->flags, slicer->fragment_offset,
+ slicer->mod_oper, slicer->mod_name, slicer->mod_value,
slicer->mod_value_size, slicer->mod_full_value_size);
return GNUNET_YES;
}
slicer->method_name = GNUNET_malloc (slicer->method_name_size);
memcpy (slicer->method_name, &meth[1], slicer->method_name_size);
slicer->message_id = message_id;
+ slicer->flags = flags;
+ slicer->fragment_offset = fragment_offset;
}
else
{
const struct GNUNET_PSYC_MessageMethod *meth,
uint64_t message_id,
uint32_t flags,
+ uint64_t fragment_offset,
+ uint32_t tmit_flags,
const struct GNUNET_CRYPTO_EcdsaPublicKey *nym_pub_key,
const char *method_name)
{
struct Host *hst = cls;
struct Place *plc = &hst->plc;
- // FIXME: relay message
+
}
place_recv_relay_modifier (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
+ uint32_t flags,
+ uint64_t fragment_offset,
enum GNUNET_PSYC_Operator oper,
const char *name,
const void *value,
place_recv_relay_eom (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
+ uint32_t flags,
+ uint64_t fragment_offset,
uint8_t cancelled)
{
place_recv_relay_data (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
- uint64_t data_offset,
+ uint32_t flags,
+ uint64_t fragment_offset,
const void *data,
uint16_t data_size)
{
const struct GNUNET_PSYC_MessageMethod *meth,
uint64_t message_id,
uint32_t flags,
+ uint64_t fragment_offset,
+ uint32_t tmit_flags,
const struct GNUNET_CRYPTO_EcdsaPublicKey *nym_pub_key,
const char *method_name)
{
place_recv_save_data (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
- uint64_t data_offset,
+ uint32_t flags,
+ uint64_t fragment_offset,
const void *data,
uint16_t data_size)
{
place_recv_save_eom (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
+ uint32_t flags,
+ uint64_t fragment_offset,
uint8_t cancelled)
{
struct Place *plc = cls;
const struct MsgProcRequest *
-relay_req_parse (const struct GNUNET_MessageHeader *msg,
- uint32_t *flags,
- const char **method_prefix,
- struct GNUNET_HashCode *method_hash)
+msg_proc_parse (const struct GNUNET_MessageHeader *msg,
+ uint32_t *flags,
+ const char **method_prefix,
+ struct GNUNET_HashCode *method_hash)
{
const struct MsgProcRequest *mpreq = (const struct MsgProcRequest *) msg;
uint8_t method_size = ntohs (mpreq->header.size) - sizeof (*mpreq);
uint32_t flags = 0;
struct GNUNET_HashCode method_hash;
const struct MsgProcRequest *
- mpreq = relay_req_parse (msg, &flags, &method_prefix, &method_hash);
+ mpreq = msg_proc_parse (msg, &flags, &method_prefix, &method_hash);
if (NULL == mpreq) {
GNUNET_break (0);
const struct GNUNET_PSYC_MessageMethod *meth,
uint64_t message_id,
uint32_t flags,
+ uint64_t fragment_offset,
+ uint32_t tmit_flags,
const struct GNUNET_CRYPTO_EcdsaPublicKey *nym_pub_key,
const char *method_name)
{
host_recv_notice_place_leave_modifier (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
+ uint32_t flags,
+ uint64_t fragment_offset,
enum GNUNET_PSYC_Operator oper,
const char *name,
const void *value,
host_recv_notice_place_leave_eom (void *cls,
const struct GNUNET_MessageHeader *msg,
uint64_t message_id,
+ uint32_t flags,
+ uint64_t fragment_offset,
uint8_t cancelled)
{
struct GNUNET_SOCIAL_Host *hst = cls;