*
* We get protocol info from the contract
**/
-int frsh_contract_get_protocol_info(frsh_contract_t contract,
+int frsh_contract_get_protocol_info(frsh_contract_t *contract,
frsh_protocol_info_t *protocol_info);
+/**
+ * frsh_contract_marshal
+ *
+ * Convert a contract to a sequence of bytes of minimum size so it can
+ * be sent through the network with the minimum amount of bytes.
+ *
+ **/
+
+int frsh_contract_marshal(const frsh_contract_t *contract,
+ unsigned char *buffer,
+ const size_t buffer_size,
+ size_t *size);
+
+/**
+ * frsh_contract_unmarshal
+ *
+ * Convert a sequence of bytes generated by frsh_contract_marshal to a contract
+ *
+ **/
+
+int frsh_contract_unmarshal(frsh_contract_t *contract,
+ const unsigned char *marshal_bytes,
+ const size_t size);
+
/*@}*/
//////////////////////////////////////////////////////////////////////
**/
int frsh_receive_sync
(const frsh_receive_endpoint_t endpoint,
- void *buffer,
+ void *buffer,
size_t buffer_size,
- size_t *message_size,
- frsh_network_address_t *from);
+ size_t *message_size,
+ frsh_network_address_t *from);
/**
* frsh_receive_async()
**/
int frsh_receive_async
(const frsh_receive_endpoint_t endpoint,
- void *buffer,
+ void *buffer,
size_t buffer_size,
- size_t *message_size,
- frsh_network_address_t *from);
+ size_t *message_size,
+ frsh_network_address_t *from);
/**