X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fcommon%2Finclude%2Frmr.h;h=a83ed90ab3a7f33c332a1b70067fdb87299dcf8c;hb=398a04fedca806ed800ba6909c715ef3e952e0b0;hp=a824a2a26de167f95d917252d956e7a66b8035ec;hpb=a7610c690a3976e296ca768977e38ceb9aafa5ff;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/common/include/rmr.h b/src/rmr/common/include/rmr.h index a824a2a..a83ed90 100644 --- a/src/rmr/common/include/rmr.h +++ b/src/rmr/common/include/rmr.h @@ -78,6 +78,14 @@ extern "C" { (All fields are exposed such that if a wrapper needs to dup the storage as it passes into or out of their environment they dup it all, not just what we choose to expose.) + + NOTE: + State is the RMR state of processing on the message. The transport state (tp_state) + will be set to mirror the value of errno for wrappers unable to access errno directly, + but will only be set if state is not RMR_OK. Even then, the value may be suspect as + the underlying transport mechanism may not set errno. It is strongly recommended that + user applications use tp_state only for dianostic purposes to convey additional information + in a log message. */ typedef struct { int state; // state of processing @@ -86,6 +94,7 @@ typedef struct { unsigned char* payload; // transported data unsigned char* xaction; // pointer to fixed length transaction id bytes int sub_id; // subscription id + int tp_state; // transport state (errno) valid only if state != RMR_OK, and even then may not be valid // these things are off limits to the user application void* tp_buf; // underlying transport allocated pointer (e.g. nng message) @@ -133,7 +142,9 @@ extern void rmr_free_msg( rmr_mbuf_t* mbuf ); extern unsigned char* rmr_get_meid( rmr_mbuf_t* mbuf, unsigned char* dest ); extern unsigned char* rmr_get_src( rmr_mbuf_t* mbuf, unsigned char* dest ); extern unsigned char* rmr_get_srcip( rmr_mbuf_t* msg, unsigned char* dest ); +extern unsigned char* rmr_get_xact( rmr_mbuf_t* mbuf, unsigned char* dest ); extern rmr_mbuf_t* rmr_realloc_msg( rmr_mbuf_t* mbuf, int new_tr_size ); +extern rmr_mbuf_t* rmr_realloc_payload( rmr_mbuf_t* old_msg, int new_len, int copy, int clone ); extern int rmr_str2meid( rmr_mbuf_t* mbuf, unsigned char const* str ); extern void rmr_str2payload( rmr_mbuf_t* mbuf, unsigned char const* str ); extern void rmr_str2payload( rmr_mbuf_t* mbuf, unsigned char const* str );