X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fcommon%2Finclude%2Frmr_agnostic.h;h=df4a3169f96d9c2a07142d2442578d8e2d3a2357;hb=0b79fc264eea2591ad6f645d0c90cc378ea5603b;hp=17a51589111080a843b3e64b10d2791f81a057fe;hpb=6511ac74cdc367a94bffeb3743624775acd52c5b;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 17a5158..df4a316 100644 --- a/src/rmr/common/include/rmr_agnostic.h +++ b/src/rmr/common/include/rmr_agnostic.h @@ -44,16 +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 @@ -85,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)) @@ -139,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 @@ -190,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; @@ -200,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; /*