From: sangorrin Date: Thu, 9 Aug 2007 12:00:47 +0000 (+0000) Subject: endpoint is passed by value now, created frsh_distributed_init X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/frsh-include.git/commitdiff_plain/a8af3fbd385c5d5217b44f7dc8f966d72d26b416 endpoint is passed by value now, created frsh_distributed_init git-svn-id: http://www.frescor.org/private/svn/frescor/frsh/trunk/include@657 35b4ef3e-fd22-0410-ab77-dab3279adceb --- diff --git a/frsh_distributed.h b/frsh_distributed.h index c23fd7e..9796c8c 100644 --- a/frsh_distributed.h +++ b/frsh_distributed.h @@ -71,7 +71,6 @@ #ifndef _FRSH_DISTRIBUTED_H_ #define _FRSH_DISTRIBUTED_H_ - /** * @file frsh_distributed.h **/ @@ -86,7 +85,7 @@ * This module defines the functions and typedefs for use in * distributed applications. * - * Each network is identified by its network_id and FRSH hides its + * Each network is identified by its resource_id and FRSH hides its * characteristics completely. The type of network is implied with * its ID via a configuration table defined at compile time. * @@ -105,7 +104,7 @@ * * 1. Map (internally in FRSH implementation) * - node--> network_addresses - * - network --> network_id's + * - network --> resource_id's * - unidirectional communication channel --> stream_id * - other config --> protocol_info. * @@ -122,7 +121,7 @@ * - Other protocol dependent function in protocol_contract_info. * 2.2. Create a send_endpoint per any unidirectional stream that will * be used in sending - * network_id --> the network through which the stream will + * resource_id --> the network through which the stream will * flow (this is extra info needed for coherency * with the bind). * destinator --> network_address of the destination. @@ -143,8 +142,18 @@ * and the network contract will be canceled. **/ - -#define FRSH_DISTRIBUTED_MODULE_SUPPORTED 1 +/** + * frsh_distributed_init(void) + * + * This operation initializes all the installed networks and the structures + * that are necessary for the distributed module. Currently it is called by + * frsh_init so it is not necessary that the user calls it again. + * + * 0: No error \n + * FRSH_ERR_INTERNAL_ERROR: protocol dependent internal errors \n + * + **/ +int frsh_distributed_init(void); ////////////////////////////////////////////////////////////////////// // CONTRACT ASPECTS @@ -335,7 +344,7 @@ int frsh_contract_get_protocol_info(frsh_contract_t contract, * through which, after the corresponding binding, it is possible to * send data to a unicast or multicast destination. * - * @param[in] network_id Identifier of the network referred in the + * @param[in] resource_id Identifier of the network referred in the * network contract as a resource_id. * @param[in] destination FRSH abstraction of the protocol address for the * destinator node. @@ -349,11 +358,11 @@ int frsh_contract_get_protocol_info(frsh_contract_t contract, * @param[out] endpoint Placeholder for the endpoint object. **/ int frsh_send_endpoint_create - (frsh_resource_id_t network_id, - frsh_network_address_t destination, - frsh_stream_id_t stream_id, - frsh_send_endpoint_protocol_info_t protocol_info, - frsh_send_endpoint_t *endpoint); + (frsh_resource_id_t resource_id, + frsh_network_address_t destination, + frsh_stream_id_t stream_id, + frsh_send_endpoint_protocol_info_t protocol_info, + frsh_send_endpoint_t *endpoint); /** * frsh_send_endpoint_get_params() @@ -362,8 +371,8 @@ int frsh_send_endpoint_create * endpoint at creation time. **/ int frsh_send_endpoint_get_params - (const frsh_send_endpoint_t *endpoint, - frsh_resource_id_t *network_id, + (const frsh_send_endpoint_t endpoint, + frsh_resource_id_t *resource_id, frsh_network_address_t *destination, frsh_stream_id_t *stream, frsh_send_endpoint_protocol_info_t *protocol_info); @@ -377,7 +386,7 @@ int frsh_send_endpoint_get_params * code. **/ int frsh_send_endpoint_destroy - (frsh_send_endpoint_t *endpoint); + (frsh_send_endpoint_t endpoint); /** @@ -392,7 +401,7 @@ int frsh_send_endpoint_destroy * unbound from it and bound to the specified one. However if a vres * is already bound to another endpoint an error is returned. * - * A consistency check is done in which the network_id specified at + * A consistency check is done in which the resource_id specified at * endpoint creation must correspond to the resource_id of the vres * contract. * @@ -406,7 +415,7 @@ int frsh_send_endpoint_destroy **/ int frsh_send_endpoint_bind (frsh_vres_id_t vres, - frsh_send_endpoint_t *endpoint); + frsh_send_endpoint_t endpoint); /** * frsh_send_endpoint_unbind() @@ -419,7 +428,7 @@ int frsh_send_endpoint_bind * FRSH_ERR_NOT_BOUND if the endpoint was not bound \n **/ int frsh_send_endpoint_unbind - (frsh_send_endpoint_t *endpoint); + (frsh_send_endpoint_t endpoint); /** * frsh_send_endpoint_get_vres_id() @@ -433,7 +442,7 @@ int frsh_send_endpoint_unbind * is NULL \n **/ int frsh_send_endpoint_get_vres_id - (const frsh_send_endpoint_t *endpoint, + (const frsh_send_endpoint_t endpoint, frsh_vres_id_t *vres); /** @@ -457,9 +466,9 @@ int frsh_send_endpoint_get_vres_id * have the policy FRSH_QP_OLDEST \n **/ int frsh_send_async - (const frsh_send_endpoint_t *endpoint, - void *msg, - size_t size); + (const frsh_send_endpoint_t endpoint, + const void *msg, + const size_t size); /** * frsh_send_sync() @@ -468,7 +477,7 @@ int frsh_send_async * until the message is processed. **/ int frsh_send_sync - (const frsh_send_endpoint_t *endpoint, + (const frsh_send_endpoint_t endpoint, void *msg, size_t size); @@ -479,10 +488,11 @@ int frsh_send_sync * endpoint queue, whether the network is up or down with some * optional information which is protocol_dependent. **/ -int frsh_send_endpoint_get_status(const frsh_send_endpoint_t *endpoint, - int *number_pending_msg, - frsh_endpoint_network_status *network_status, - frsh_protocol_status_t *protocol_status); +int frsh_send_endpoint_get_status + (const frsh_send_endpoint_t endpoint, + int *number_pending_msg, + frsh_endpoint_network_status_t *network_status, + frsh_protocol_status_t *protocol_status); /** * frsh_receive_endpoint_create() @@ -494,11 +504,11 @@ int frsh_send_endpoint_get_status(const frsh_send_endpoint_t *endpoint, * 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. + * it can be determined internally by FRSH based on the resource_id. * * Note also that messages may come from diferent originators. * - * @param[in] network_id Id of the network from which we listen. + * @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). @@ -511,7 +521,7 @@ int frsh_send_endpoint_get_status(const frsh_send_endpoint_t *endpoint, * valid \n **/ int frsh_receive_endpoint_create - (frsh_resource_id_t network_id, + (frsh_resource_id_t resource_id, frsh_stream_id_t stream_id, frsh_endpoint_queueing_info_t queueing_info, frsh_receive_endpoint_protocol_info_t protocol_info, @@ -524,8 +534,8 @@ int frsh_receive_endpoint_create * endpoint at creation time. **/ int frsh_receive_endpoint_get_params - (const frsh_receive_endpoint_t *endpoint, - frsh_resource_id_t *network_id, + (const frsh_receive_endpoint_t endpoint, + frsh_resource_id_t *resource_id, frsh_stream_id_t *stream, frsh_endpoint_queueing_info_t *queueing_info, frsh_receive_endpoint_protocol_info_t *protocol_info); @@ -539,7 +549,7 @@ int frsh_receive_endpoint_get_params * code. **/ int frsh_receive_endpoint_destroy - (frsh_receive_endpoint_t *endpoint); + (frsh_receive_endpoint_t endpoint); /** @@ -571,7 +581,7 @@ int frsh_receive_endpoint_destroy * provided buffer \n **/ int frsh_receive_sync - (const frsh_receive_endpoint_t *endpoint, + (const frsh_receive_endpoint_t endpoint, void *buffer, size_t buffer_size, size_t *message_size, @@ -592,7 +602,7 @@ int frsh_receive_sync * provided buffer \n **/ int frsh_receive_async - (const frsh_receive_endpoint_t *endpoint, + (const frsh_receive_endpoint_t endpoint, void *buffer, size_t buffer_size, size_t *message_size, @@ -606,14 +616,12 @@ int frsh_receive_async * endpoint queue, whether the network is up or down and some optional * information which is protocol dependent. **/ -int frsh_receive_endpoint_get_status(const frsh_receive_endpoint_t *endpoint, - int *number_pending_messages, - frsh_endpoint_network_status *network_status, - frsh_protocol_status_t *protocol_status); - - +int frsh_receive_endpoint_get_status + (const frsh_receive_endpoint_t endpoint, + int *number_pending_messages, + frsh_endpoint_network_status_t *network_status, + frsh_protocol_status_t *protocol_status); /*@}*/ - #endif // _FRSH_DISTRIBUTED_H_