X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fnanomsg%2Fsrc%2Frmr.c;fp=src%2Fnanomsg%2Fsrc%2Frmr.c;h=392feb732d3e1271b2e6d0d62b0ced10e61419ca;hb=2f37eac699d6727b6f32bd7de6838d948812ccde;hp=e67402f5c8ebe46d1f42cfa4eda8120069144088;hpb=e2ae89934d683b2148531630331dd8a39c7d3591;p=ric-plt%2Flib%2Frmr.git diff --git a/src/nanomsg/src/rmr.c b/src/nanomsg/src/rmr.c index e67402f..392feb7 100644 --- a/src/nanomsg/src/rmr.c +++ b/src/nanomsg/src/rmr.c @@ -634,6 +634,26 @@ static void* init( char* uproto_port, int max_msg_size, int flags ) { return (void *) ctx; } +/* + This sets the default trace length which will be added to any message buffers + allocated. It can be set at any time, and if rmr_set_trace() is given a + trace len that is different than the default allcoated in a message, the message + will be resized. + + Returns 0 on failure and 1 on success. If failure, then errno will be set. +*/ +extern int rmr_init_trace( void* vctx, int tr_len ) { + uta_ctx_t* ctx; + + errno = 0; + if( (ctx = (uta_ctx_t *) vctx) == NULL ) { + errno = EINVAL; + return 0; + } + + ctx->trace_data_len = tr_len; + return 1; +} /* Publicly facing initialisation function. Wrapper for the init() funcion above