X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fnng%2Finclude%2Frmr_nng_private.h;h=6bca91f83bfcab37670ab9b15abf5c958edfcc62;hb=f7d44570f8de6e15f768e8e2d9b6061cd0bff11f;hp=83db50091e6c3a71ebc8d702e46274913e9e8d45;hpb=fd9cc7a5b3355146388ebdf4d558cb284c66c5f1;p=ric-plt%2Flib%2Frmr.git diff --git a/src/nng/include/rmr_nng_private.h b/src/nng/include/rmr_nng_private.h index 83db500..6bca91f 100644 --- a/src/nng/include/rmr_nng_private.h +++ b/src/nng/include/rmr_nng_private.h @@ -1,14 +1,14 @@ // : vi ts=4 sw=4 noet : /* ================================================================================== - Copyright (c) 2019 Nokia + Copyright (c) 2019 Nokia Copyright (c) 2018-2019 AT&T Intellectual Property. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -49,14 +49,14 @@ struct endpoint { Epoll information needed for the rmr_torcv_msg() funciton */ typedef struct epoll_stuff { - struct epoll_event events[1]; // wait on 10 possible events - struct epoll_event epe; // event definition for event to listen to + struct epoll_event events[1]; // wait on 10 possible events + struct epoll_event epe; // event definition for event to listen to int ep_fd; // file des from nng int nng_fd; // fd from nng } epoll_stuff_t; /* - Context describing our world. Should be returned to user programme on + Context describing our world. Should be returned to user programme on call to initialise, and passed as first parm on all calls to other visible functions. @@ -70,16 +70,19 @@ struct uta_ctx { int flags; // CTXFL_ constants int nrtele; // number of elements in the routing table int send_retries; // number of retries send_msg() should attempt if eagain/timeout indicated by nng + int trace_data_len; // number of bytes to allocate in header for trace data + int d1_len; // extra header data 1 length (future) + int d2_len; // extra header data 2 length (future) nng_socket nn_sock; // our general listen socket route_table_t* rtable; // the active route table route_table_t* old_rtable; // the previously used rt, sits here to allow for draining route_table_t* new_rtable; // route table under construction if_addrs_t* ip_list; // list manager of the IP addresses that are on our known interfaces void* mring; // ring where msgs are queued while waiting for a call response msg - + char* rtg_addr; // addr/port of the route table generation publisher int rtg_port; // the port that the rtg listens on - + wh_mgt_t* wormholes; // management of user opened wormholes epoll_stuff_t* eps; // epoll information needed for the rcv with timeout call @@ -89,7 +92,7 @@ struct uta_ctx { /* - Static prototypes for functions located here. All common protos are in the + Static prototypes for functions located here. All common protos are in the agnostic header file. */ @@ -101,17 +104,18 @@ static void free_ctx( uta_ctx_t* ctx ); static int uta_link2( char* target, nng_socket* nn_sock, nng_dialer* dialer ); static int rt_link2_ep( endpoint_t* ep ); static int uta_epsock_byname( route_table_t* rt, char* ep_name, nng_socket* nn_sock ); -static int uta_epsock_rr( route_table_t *rt, int mtype, int group, int* more, nng_socket* nn_sock ); +static int uta_epsock_rr( route_table_t *rt, uint64_t key, int group, int* more, nng_socket* nn_sock ); static inline int xlate_nng_state( int state, int def_state ); // --- msg --------------------------------------- -static rmr_mbuf_t* alloc_zcmsg( uta_ctx_t* ctx, rmr_mbuf_t* msg, int size, int state ); +static rmr_mbuf_t* alloc_zcmsg( uta_ctx_t* ctx, rmr_mbuf_t* msg, int size, int state, int trlo ); static rmr_mbuf_t* alloc_mbuf( uta_ctx_t* ctx, int state ); static void ref_tpbuf( rmr_mbuf_t* msg, size_t alen ) ; static inline rmr_mbuf_t* clone_msg( rmr_mbuf_t* old_msg ); static rmr_mbuf_t* rcv_msg( uta_ctx_t* ctx, rmr_mbuf_t* old_msg ); static void* rcv_payload( uta_ctx_t* ctx, rmr_mbuf_t* old_msg ); +static inline rmr_mbuf_t* realloc_msg( rmr_mbuf_t* old_msg, int tr_len ); static rmr_mbuf_t* send_msg( uta_ctx_t* ctx, rmr_mbuf_t* msg, nng_socket nn_sock, int retries ); static rmr_mbuf_t* send2ep( uta_ctx_t* ctx, endpoint_t* ep, rmr_mbuf_t* msg );