Correct inability to extend payload for rts msg
[ric-plt/lib/rmr.git] / src / rmr / common / include / rmr_agnostic.h
index 465f60a..a20e2e7 100644 (file)
@@ -53,6 +53,8 @@ typedef struct uta_ctx  uta_ctx_t;
 #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 +65,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 +86,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 +146,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
@@ -245,6 +256,7 @@ typedef struct chute {
 //---- tools ----------------------------------
 static int has_myip( char const* buf, if_addrs_t* list, char sep, int max );
 static int uta_tokenise( char* buf, char** tokens, int max, char sep );
+static int uta_rmip_tokenise( char* buf, if_addrs_t* iplist, char** toks, int max, char sep );
 static char* uta_h2ip( char const* hname );
 static int uta_lookup_rtg( uta_ctx_t* ctx );
 static int uta_has_str( char const* buf, char const* str, char sep, int max );