X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fsi%2Finclude%2Frmr_si_private.h;h=6c6f74a98737678c94f4f573c9d494cc601470cf;hb=c113b0836f3ebd58911c30de1636a707174efe55;hp=132873c61b38cb4befe33a007b657de852c7329c;hpb=ec88d3c0563eeb6ae5f73427edb0b3c4d7acf299;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/si/include/rmr_si_private.h b/src/rmr/si/include/rmr_si_private.h index 132873c..6c6f74a 100644 --- a/src/rmr/si/include/rmr_si_private.h +++ b/src/rmr/si/include/rmr_si_private.h @@ -34,8 +34,8 @@ #define _uta_private_h // if pmode is off we don't compile in some checks in hopes of speeding things up -#ifndef PARINOID_CHECKS -# define PARINOID_CHECKS 0 +#ifndef PARANOID_CHECKS +# define PARANOID_CHECKS 0 #endif @@ -48,6 +48,13 @@ #define RS_GOOD 1 // flow is in progress #define RS_RESET 2 // flow was interrupted; reset on next receive +#define RF_NOTIFIED 0x01 // notification made about river issue +#define RF_DROP 0x02 // this message is large and being dropped + +#define TP_SZFIELD_LEN ((sizeof(uint32_t)*2)+1) // number of bytes needed for msg size in transport header +#define TP_SZ_MARKER '$' // marker indicating net byte order used + + #define SI_MAX_ADDR_LEN 512 /* @@ -58,9 +65,8 @@ typedef struct { char* accum; // bytes being accumulated int nbytes; // allocated size of accumulator int ipt; // insertion point in accumulator - //int max; // size of accum - //int expected; // expected for a complete message int msg_size; // size of the message being accumulated + int flags; // RF_* constants } river_t; @@ -138,12 +144,18 @@ struct uta_ctx { pthread_t rtc_th; // thread info for the rtc listener pthread_t mtc_th; // thread info for the multi-thread call receive process + // added for route manager request/states + rmr_whid_t rtg_whid; // wormhole id to the route manager for acks/requests + char* table_id; // table ID of the route table load in progress + // added for SI95 support si_ctx_t* si_ctx; // the socket context int nrivers; // allocated rivers river_t* rivers; // inbound flows (index is the socket fd) int max_ibm; // max size of an inbound message (river accum alloc size) void* zcb_mring; // zero copy buffer mbuf ring + void* fd2ep; // the symtab mapping file des to endpoints for cleanup on disconnect + pthread_mutex_t *fd2ep_gate; // we must gate add/deletes to the fd2 symtab }; typedef uta_ctx_t uta_ctx; @@ -160,14 +172,16 @@ static void free_ctx( uta_ctx_t* ctx ); // --- rt table things --------------------------- static void uta_ep_failed( endpoint_t* ep ); -static int uta_link2( si_ctx_t* si_ctx, endpoint_t* ep ); +static int uta_link2( uta_ctx_t *ctx, endpoint_t* ep ); + static int rt_link2_ep( void* vctx, endpoint_t* ep ); static rtable_ent_t* uta_get_rte( route_table_t *rt, int sid, int mtype, int try_alt ); static inline int xlate_si_state( int state, int def_state ); // --- these have changes for si -static int uta_epsock_byname( route_table_t* rt, char* ep_name, int* nn_sock, endpoint_t** uepp, si_ctx_t* si_ctx ); -static int uta_epsock_rr( rtable_ent_t *rte, int group, int* more, int* nn_sock, endpoint_t** uepp, si_ctx_t* si_ctx ); +static int uta_epsock_byname( uta_ctx_t* ctx, char* ep_name, int* nn_sock, endpoint_t** uepp ); +//static int uta_epsock_rr( rtable_ent_t *rte, int group, int* more, int* nn_sock, endpoint_t** uepp, si_ctx_t* si_ctx ); +static int uta_epsock_rr( uta_ctx_t* ctx, rtable_ent_t *rte, int group, int* more, int* nn_sock, endpoint_t** uepp ); // --- msg --------------------------------------- @@ -176,11 +190,15 @@ static rmr_mbuf_t* alloc_mbuf( uta_ctx_t* ctx, int state ); static void ref_tpbuf( rmr_mbuf_t* msg, size_t alen ) ; static inline rmr_mbuf_t* clone_msg( rmr_mbuf_t* old_msg ); static rmr_mbuf_t* rcv_msg( uta_ctx_t* ctx, rmr_mbuf_t* old_msg ); -static void* rcv_payload( uta_ctx_t* ctx, rmr_mbuf_t* old_msg ); static inline rmr_mbuf_t* realloc_msg( rmr_mbuf_t* old_msg, int tr_len ); static rmr_mbuf_t* send2ep( uta_ctx_t* ctx, endpoint_t* ep, rmr_mbuf_t* msg ); static rmr_mbuf_t* send_msg( uta_ctx_t* ctx, rmr_mbuf_t* msg, int nn_sock, int retries ); +// ---- fd to endpoint translation ------------------------------ +static endpoint_t* fd2ep_del( uta_ctx_t* ctx, int fd ); +static endpoint_t* fd2ep_get( uta_ctx_t* ctx, int fd ); +static void fd2ep_init( uta_ctx_t* ctx ); +static void fd2ep_add( uta_ctx_t* ctx, int fd, endpoint_t* ep ); #endif