* @author Michal Sojka <sojkam1@fel.cvut.cz>
* @date Thu Aug 28 10:36:23 2008
*
- * @brief FORB transport protocol module
+ * @brief FORB transport protocol declarations
*
*
*/
*
* @param peer Peer to destroy
*
- * @return Zero on success, negatove error code on error.
+ * @note The memory allocated by @a deserialize_addr (if any)
+ * is deallocated by FORB and should not be deallocated here.
*/
- int (*peer_destroy)(forb_peer_t *peer);
+ void (*peer_destroy)(forb_peer_t *peer);
/**
* Receives data through a port
*
size_t (*broadcast)(forb_port_t *port, const void *buf, size_t len);
/** Serializes the protocol specific address */
- CORBA_boolean (*serialize_addr)(CDR_Codec *codec, const void *addr);
+ CORBA_boolean (*serialize_addr)(FORB_CDR_Codec *codec, const void *addr);
+
+ /** Deserializes the protocol specific address. The memory for
+ * storing the address should be allocated by forb_malloc(). */
+ CORBA_boolean (*deserialize_addr)(FORB_CDR_Codec *codec, void **addr);
- /** Deserializes the protocol specific address */
- CORBA_boolean (*deserialize_addr)(CDR_Codec *codec, void **addr);
+ /** Converts protocol specific address to string */
+ size_t (*addr2str)(char *dest, size_t maxlen, const void *addr);
+
+ /**
+ * Callback caled when the port is registered to FORB just
+ * before reception and discovery threads are started.
+ */
+ void (*register_cb)(forb_port_t *port);
};
-size_t forb_proto_send(forb_peer_t *peer, CDR_Codec *codec);
+size_t forb_proto_send(forb_peer_t *peer, FORB_CDR_Codec *codec);
forb_peer_t *
forb_get_next_hop(forb_t *forb, forb_server_id *server, fosa_abs_time_t *timeout);