X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fcommon%2Finclude%2Frmr_agnostic.h;h=86f46608b4198f7512093cb5738eea8929b00d6b;hb=ec88d3c0563eeb6ae5f73427edb0b3c4d7acf299;hp=9000c291b3419a9f38eea527b0d2f211e725b996;hpb=3925774e739509bb51df2c81addb3ab742c1801f;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/common/include/rmr_agnostic.h b/src/rmr/common/include/rmr_agnostic.h index 9000c29..86f4660 100644 --- a/src/rmr/common/include/rmr_agnostic.h +++ b/src/rmr/common/include/rmr_agnostic.h @@ -44,15 +44,24 @@ typedef struct uta_ctx uta_ctx_t; #define QUOTE_DEF(a) QUOTE(a) // allow a #define value to be quoted (e.g. QUOTE(MAJOR_VERSION) ) +#define RT_SIZE 10009 // primary entries in route table (prime) meids hash through this so larger than expected # meids + // space deginations in the hash table +#define RT_MT_SPACE 0 // (integer) message type as the key +#define RT_NAME_SPACE 1 // enpoint name/address is the key +#define RT_ME_SPACE 2 // message id is the key + #define RMR_MSG_VER 3 // message version this code was designed to handle // environment variable names we'll suss out #define ENV_BIND_IF "RMR_BIND_IF" // the interface to bind to for both normal comma and RTG (0.0.0.0 if missing) #define ENV_RTG_PORT "RMR_RTG_SVC" // the port we'll listen on for rtg connections #define ENV_SEED_RT "RMR_SEED_RT" // where we expect to find the name of the seed route table +#define ENV_SEED_MEMAP "RMR_SEED_MEMAP" // where we expect to find the name of the seed route table #define ENV_RTG_RAW "RMR_RTG_ISRAW" // if > 0 we expect route table gen messages as raw (not sent from an RMr application) #define ENV_VERBOSE_FILE "RMR_VCTL_FILE" // file where vlevel may be managed for some (non-time critical) functions #define ENV_NAME_ONLY "RMR_SRC_NAMEONLY" // src in message is name only +#define ENV_WARNINGS "RMR_WARNINGS" // if == 1 then we write some, non-performance impacting, warnings +#define ENV_SRC_ID "RMR_SRC_ID" // forces this string (adding :port, max 63 ch) into the source field; host name used if not set #define NO_FLAGS 0 // no flags to pass to a function @@ -63,6 +72,9 @@ typedef struct uta_ctx uta_ctx_t; #define CFL_MTC_ENABLED 0x01 // multi-threaded call is enabled + // context flags +#define CTXFL_WARN 0x01 // ok to warn on stderr for some things that shouldn't happen + // msg buffer flags #define MFL_ZEROCOPY 0x01 // the message is an allocated zero copy message and can be sent. #define MFL_NOALLOC 0x02 // send should NOT allocate a new buffer before returning @@ -81,6 +93,12 @@ typedef struct uta_ctx uta_ctx_t; #define UNSET_SUBID (-1) // initial value on msg allocation indicating not set #define UNSET_MSGTYPE (-1) + // index values into the send counters for an enpoint +#define EPSC_GOOD 0 // successful send +#define EPSC_FAIL 1 // hard failurs +#define EPSC_TRANS 2 // transient/soft faiures +#define EPSC_SIZE 3 // number of counters + // -- header length/offset macros must ensure network conversion ---- #define RMR_HDR_LEN(h) (ntohl(((uta_mhdr_t *)h)->len0)+htonl(((uta_mhdr_t *)h)->len1)+htonl(((uta_mhdr_t *)h)->len2)+htonl(((uta_mhdr_t *)h)->len3)) // ALL things, not just formal struct #define RMR_TR_LEN(h) (ntohl(((uta_mhdr_t *)h)->len1)) @@ -135,7 +153,7 @@ typedef struct uta_ctx uta_ctx_t; */ typedef struct { int32_t mtype; // message type ("long" network integer) - int32_t plen; // payload length + int32_t plen; // payload length (sender data length in payload) int32_t rmr_ver; // our internal message version number unsigned char xid[RMR_MAX_XID]; // space for user transaction id or somesuch unsigned char sid[RMR_MAX_SID]; // sender ID for return to sender needs @@ -186,7 +204,7 @@ typedef struct { uint64_t key; // key used to reinsert this entry into a new symtab int refs; // number of symtabs which reference the entry int mtype; // the message type for this list - int nrrgroups; // number of rr groups to send to + int nrrgroups; // number of rr groups to send to (if 0, the meid in a message determines endpoint) rrgroup_t** rrgroups; // one or more set of endpoints to round robin messages to } rtable_ent_t; @@ -196,6 +214,7 @@ typedef struct { typedef struct { void* hash; // hash table. int updates; // counter of update records received + int mupdates; // counter of meid update records received } route_table_t; /* @@ -224,6 +243,7 @@ typedef struct ring { uint16_t tail; // index of the tail (extract point) uint16_t nelements; // number of elements in the ring void** data; // the ring data (pointers to blobs of stuff) + int pfd; // event fd for the ring for epoll } ring_t;