X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fcommon%2Fsrc%2Frt_generic_static.c;h=16fddd1c35c100eae7476fc81e36b488bcce8a0e;hb=99584a241c64d29fc20e74a4b4e01427d0f00e73;hp=f098f53471907400481f988f3d44f9d4fdbc8061;hpb=6d112571b27574ae857da7cb8dc8758ffee4ff60;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/common/src/rt_generic_static.c b/src/rmr/common/src/rt_generic_static.c index f098f53..16fddd1 100644 --- a/src/rmr/common/src/rt_generic_static.c +++ b/src/rmr/common/src/rt_generic_static.c @@ -1235,4 +1235,18 @@ static inline uint64_t build_rt_key( int32_t sub_id, int32_t mtype ) { return key; } +/* + Given a route table and meid string, find the owner (if known). Returns a pointer to + the endpoint struct or nil. +*/ +static inline endpoint_t* get_meid_owner( route_table_t *rt, char* meid ) { + endpoint_t* ep; // the ep we found in the hash + + if( rt == NULL || rt->hash == NULL || meid == NULL || *meid == 0 ) { + return NULL; + } + + return (endpoint_t *) rmr_sym_get( rt->hash, meid, RT_ME_SPACE ); +} + #endif