size_t *received_bytes);
/**
- * fna_send_endpoint_get_pending_messages()
+ * fna_send_endpoint_get_status()
*
- * This function tells the number of messages still pending
+ * This function tells the number of messages still pending in the
+ * endpoint queue, whether the network is up or down with some
+ * optional information which is protocol_dependent.
*
* @param[in] endpoint The send endpoint (resource_id is in the endpoint).
* @param[out] number_of_pending_messages The number of pending messages
+ * @param[out] network_status How is the network (up, down..)
+ * @param[out] protocol_status Protocol dependent status info
*
* @return
* FNA_NO_ERROR: in this case it also means contract accepted \n
* FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
*
**/
-int fna_send_endpoint_get_pending_messages
- (const frsh_send_endpoint_t *endpoint,
- int *number_of_pending_messages);
+int fna_send_endpoint_get_status(const frsh_send_endpoint_t *endpoint,
+ int *number_of_pending_messages,
+ frsh_endpoint_network_status *network_status,
+ frsh_protocol_status_t *protocol_status);
+
+/**
+ * fna_receive_endpoint_create()
+ *
+ * This operation creates a receive endpoint associated with a
+ * undirectional stream within a network interface of the node.
+ *
+ * Receiving endpoints are not bound to any network vres, this is
+ * because don't originate any traffic.
+ *
+ * Note that the protocol address is not needed for reception because
+ * it can be determined internally by FRSH based on the network_id.
+ *
+ * Note also that messages may come from diferent originators.
+ *
+ * @param[in] resource_id Id of the network from which we listen.
+ * @param[in] stream_id Id of the stream within the network.
+ * @param[in] queueing_info Buffering information(queue size and
+ * policy).
+ * @param[in] protocol_info Extra protocol info opaque for the
+ * application.
+ * @param[out] endpoint Placeholder for the endpoint object.
+ *
+ * @return
+ * FNA_NO_ERROR: in this case it also means contract accepted \n
+ * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
+ * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
+ * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
+ * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
+ **/
+int fna_receive_endpoint_create
+ (const frsh_resource_id_t resource_id,
+ const frsh_stream_id_t stream_id,
+ const frsh_endpoint_queueing_info_t queueing_info,
+ const frsh_protocol_info_t protocol_info,
+ frsh_receive_endpoint_t *endpoint);
/**
* fna_receive_endpoint_get_pending_messages
*
* This function tells the number of messages still pending in the
- * receive endpoint queue
+ * endpoint queue, whether the network is up or down and some optional
+ * information which is protocol dependent.
*
* @param[in] endpoint The receive endpoint (resource_id is in the endpoint).
* @param[out] number_of_pending_messages The number of pending messages
+ * @param[out] network_status How is the network (up, down..)
+ * @param[out] protocol_status Protocol dependent status info
*
* @return
* FNA_NO_ERROR: in this case it also means contract accepted \n
* FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
*
**/
-int fna_receive_endpoint_get_pending_messages
+int fna_receive_endpoint_get_status
(const frsh_receive_endpoint_t *endpoint,
- int *number_of_pending_messages);
+ int *number_of_pending_messages,
+ frsh_endpoint_network_status *network_status,
+ frsh_protocol_status_t *protocol_status);
/*@}*/
*
**/
int fna_message_get_max_size
- (const frsh_resource_id_t *resource_id,
+ (const frsh_resource_id_t resource_id,
size_t *max_size);
/*@}*/