From 60d2f2e9864eb18397a533285e7f865007dcbc7b Mon Sep 17 00:00:00 2001 From: sojkam Date: Fri, 24 Oct 2008 08:17:20 +0000 Subject: [PATCH] Added FWP to FNA. FNA ops extended for bind, unbind, send_endpoint_created, endpoint_destroy git-svn-id: http://www.frescor.org/private/svn/frescor/fna/trunk@1349 35b4ef3e-fd22-0410-ab77-dab3279adceb --- Makefile.omk | 7 +++- include/fna.h | 77 ++++++++++++++++++++++++++++++++++++- include/fna_configuration.h | 3 +- src/fna_configuration.c | 18 +++++++-- 4 files changed, 99 insertions(+), 6 deletions(-) diff --git a/Makefile.omk b/Makefile.omk index 59c2607..80006e6 100644 --- a/Makefile.omk +++ b/Makefile.omk @@ -1,6 +1,6 @@ SUBDIRS=include src -default_CONFIG = CONFIG_FNA_RTEP=n CONFIG_FNA_UNIX=n CONFIG_FNA_FRESCAN=n +default_CONFIG = CONFIG_FNA_RTEP=n CONFIG_FNA_UNIX=n CONFIG_FNA_FRESCAN=n CONFIG_FNA_FWP=n lib_LIBRARIES = fna fna_SOURCES = src/fna_configuration.c @@ -19,3 +19,8 @@ ifeq ($(CONFIG_FNA_FRESCAN),y) SUBDIRS+=src_frescan CFLAGS+=-DFRESCAN_FNA_ENABLED endif + +ifeq ($(CONFIG_FNA_FWP),y) +SUBDIRS+=src_fwp +CFLAGS+=-DFWP_FNA_ENABLED +endif diff --git a/include/fna.h b/include/fna.h index cea2b44..475e766 100644 --- a/include/fna.h +++ b/include/fna.h @@ -550,7 +550,7 @@ typedef enum { FRSH_RECEIVE_ENDPOINT_TYPE } frsh_endpoint_type_t; -typedef struct { +typedef struct fna_endpoint_data { frsh_endpoint_type_t endpoint_type; // send_endpoint or receive_endpoint fna_vres_id_t vres; // only for send_endpoints bool is_bound; // only for send_endpoints @@ -724,6 +724,60 @@ typedef int fna_send_endpoint_get_status_t frsh_endpoint_network_status_t *network_status, frsh_protocol_status_t *protocol_status); +/** + * fna_send_endpoint_bind_t() + * + * This operation is a called from frsh_send_endpoint_bind and binds send + * edpoint to vres. + * + * @param[in] endpoint the endpoint object. + * @param[in] vres The internal virtual resource id + * + * @return + * 0 if there are no errors \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 + **/ +typedef +int fna_send_endpoint_bind_t(fna_endpoint_data_t *endpoint, fna_vres_id_t vres); + +/** + * fna_send_endpoint_unbind_t() + * + * This operation is a called from frsh_send_endpoint_bind. + * + * @param[in] endpoint the endpoint object. + * + * @return + * 0 if there are no errors \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 + **/ +typedef +int fna_send_endpoint_unbind_t(fna_endpoint_data_t *endpoint); + +/** + * fna_send_endpoint_create_callback() + * + * This operation is a called from frsh_send_endpoint_create with a + * send_endpoint structure already filled. + * + * @param[in] endpoint the endpoint object. + * + * @return + * 0 if there are no errors \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 + **/ +typedef int fna_send_endpoint_create_callback_t + (fna_endpoint_data_t *endpoint); + /** * fna_receive_endpoint_create_callback() * @@ -745,6 +799,23 @@ typedef int fna_send_endpoint_get_status_t typedef int fna_receive_endpoint_create_callback_t (fna_endpoint_data_t *endpoint); +/** + * fna_endpoint_destroy() + * + * This operation is a called from frsh_send(receive)_endpoint_destroy. + * + * @param[in] endpoint the endpoint object. + * + * @return + * 0 if there are no errors \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 + **/ +typedef int fna_endpoint_destroy_t + (fna_endpoint_data_t *endpoint); + /** * fna_receive_endpoint_get_pending_messages * @@ -922,6 +993,10 @@ typedef struct { fna_receive_sync_t *fna_receive_sync; fna_receive_async_t *fna_receive_async; fna_send_endpoint_get_status_t *fna_send_endpoint_get_status; + fna_send_endpoint_bind_t *fna_send_endpoint_bind; + fna_send_endpoint_unbind_t *fna_send_endpoint_unbind; + fna_endpoint_destroy_t *fna_endpoint_destroy; + fna_send_endpoint_create_callback_t *fna_send_endpoint_created; fna_receive_endpoint_create_callback_t *fna_receive_endpoint_created; fna_receive_endpoint_get_status_t *fna_receive_endpoint_get_status; fna_network_get_max_message_size_t *fna_network_get_max_message_size; diff --git a/include/fna_configuration.h b/include/fna_configuration.h index 7cfce3a..c80c201 100644 --- a/include/fna_configuration.h +++ b/include/fna_configuration.h @@ -68,7 +68,8 @@ #include "fna.h" -#define FRESCAN_FNA_ENABLED +// These are defined in Make configuration file +// #define FRESCAN_FNA_ENABLED // #define RTEP_FNA_ENABLED // #define UNIX_FNA_ENABLED diff --git a/src/fna_configuration.c b/src/fna_configuration.c index ecfc6b9..3965553 100644 --- a/src/fna_configuration.c +++ b/src/fna_configuration.c @@ -83,17 +83,29 @@ #include "../src_frescan/frescan_bwres_fna.h" // for frescan_fna_operations #endif +#ifdef FWP_FNA_ENABLED + #include "fwp_fna.h" // for fwp_fna_operations +#endif + fna_operations_t *fna_operations[FNA_MAX_NETWORKS] = { #ifdef FRESCAN_FNA_ENABLED &frescan_fna_operations, +#else + NULL, #endif #ifdef RTEP_FNA_ENABLED &rtep_fna_operations, +#else + NULL, #endif #ifdef UNIX_FNA_ENABLED &unix_fna_operations, +#else + NULL, +#endif +#ifdef FWP_FNA_ENABLED + &fwp_fna_operations +#else + NULL #endif - NULL, // resource_id 1 - NULL, // resource_id 2 - NULL // resource_id 3 }; -- 2.39.2