From 85f507f6823820f42fe2e8b08666fdee80b9801d Mon Sep 17 00:00:00 2001 From: gunjarastogi Date: Wed, 18 Jan 2023 16:27:55 +0530 Subject: [PATCH] RIC-851: Added handling for IS Subscription Delete Required Procedure triggerred from E2 node and forward it to Subscription Manager Signed-off-by: gunjarastogi Change-Id: I17e34465dd9847e333c18fb380a3a09d3d2c3b76 --- RIC-E2-TERMINATION/Dockerfile | 10 +++++----- RIC-E2-TERMINATION/sctpThread.cpp | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/RIC-E2-TERMINATION/Dockerfile b/RIC-E2-TERMINATION/Dockerfile index 36569ef..d9b1342 100644 --- a/RIC-E2-TERMINATION/Dockerfile +++ b/RIC-E2-TERMINATION/Dockerfile @@ -43,10 +43,10 @@ RUN apt-get install -y libboost-all-dev RUN mv /opt/e2/RIC-E2-TERMINATION/CMakeLists.txt /opt/e2/ && cat /opt/e2/RIC-E2-TERMINATION/config/config.conf \ && wget --content-disposition https://github.com/cgreen-devs/cgreen/releases/download/1.2.0/cgreen_1.2.0_amd64.deb \ && dpkg -i cgreen_1.2.0_amd64.deb \ - && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_4.8.5_amd64.deb/download.deb \ - && dpkg -i rmr_4.8.5_amd64.deb \ - && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_4.8.5_amd64.deb/download.deb \ - && dpkg -i rmr-dev_4.8.5_amd64.deb \ + && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_4.9.0_amd64.deb/download.deb \ + && dpkg -i rmr_4.9.0_amd64.deb \ + && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_4.9.0_amd64.deb/download.deb \ + && dpkg -i rmr-dev_4.9.0_amd64.deb \ && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/mdclog_0.1.1-1_amd64.deb/download.deb \ && dpkg -i mdclog_0.1.1-1_amd64.deb \ && wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/mdclog-dev_0.1.1-1_amd64.deb/download.deb \ @@ -97,7 +97,7 @@ COPY --from=ubuntu /opt/e2/RIC-E2-TERMINATION/startup.sh /opt/e2/startup.sh #COPY --from=ubuntu /opt/e2/RIC-E2-TERMINATION/tracelibcpp/build/libtracelibcpp.so.0.0.2 /usr/local/lib/libtracelibcpp.so.0.0.2 -COPY --from=ubuntu /usr/local/lib/librmr_si.so.4.8.5 /usr/local/lib/librmr_si.so.4.8.5 +COPY --from=ubuntu /usr/local/lib/librmr_si.so.4.9.0 /usr/local/lib/librmr_si.so.4.9.0 COPY --from=ubuntu /usr/local/lib/librmr_si.so.4 /usr/local/lib/librmr_si.so.4 COPY --from=ubuntu /usr/local/lib/librmr_si.so /usr/local/lib/librmr_si.so diff --git a/RIC-E2-TERMINATION/sctpThread.cpp b/RIC-E2-TERMINATION/sctpThread.cpp index 89feebb..423d51e 100644 --- a/RIC-E2-TERMINATION/sctpThread.cpp +++ b/RIC-E2-TERMINATION/sctpThread.cpp @@ -1878,6 +1878,10 @@ void buildE2TPrometheusCounters(sctp_params_t &sctpParams) { sctpParams.e2tCounters[OUT_INITI][MSG_COUNTER][ProcedureCode_id_RICserviceQuery] = &sctpParams.prometheusFamily->Add({{"counter", "RICServiceQueryMsgs"}}); sctpParams.e2tCounters[OUT_INITI][BYTES_COUNTER][ProcedureCode_id_RICserviceQuery] = &sctpParams.prometheusFamily->Add({{"counter", "RICServiceQueryBytes"}}); + + sctpParams.e2tCounters[IN_INITI][MSG_COUNTER][ProcedureCode_id_RICsubscriptionDeleteRequired] = &sctpParams.prometheusFamily->Add({{"counter", "RICSubscriptionDeleteRequiredMsgs"}}); + sctpParams.e2tCounters[IN_INITI][BYTES_COUNTER][ProcedureCode_id_RICsubscriptionDeleteRequired] = &sctpParams.prometheusFamily->Add({{"counter", "RICSubscriptionDeleteRequiredBytes"}}); + } void buildPrometheusList(ConnectedCU_t *peerInfo, Family *prometheusFamily) { @@ -1960,6 +1964,11 @@ void buildPrometheusList(ConnectedCU_t *peerInfo, Family *prometheusFam peerInfo->counters[OUT_UN_SUCC][MSG_COUNTER][(ProcedureCode_id_RICserviceUpdate)] = &prometheusFamily->Add({{peerInfo->enodbName, "OUT"}, {"RICserviceUpdateFailure", "Messages"}}); peerInfo->counters[OUT_UN_SUCC][BYTES_COUNTER][(ProcedureCode_id_RICserviceUpdate)] = &prometheusFamily->Add({{peerInfo->enodbName, "OUT"}, {"RICserviceUpdateFailure", "Bytes"}}); + + + peerInfo->counters[IN_INITI][MSG_COUNTER][(ProcedureCode_id_RICsubscriptionDeleteRequired)] = &prometheusFamily->Add({{peerInfo->enodbName, "IN"}, {"RICsubscriptionDeleteRequired", "Messages"}}); + peerInfo->counters[IN_INITI][BYTES_COUNTER][(ProcedureCode_id_RICsubscriptionDeleteRequired)] = &prometheusFamily->Add({{peerInfo->enodbName, "IN"}, {"RICsubscriptionDeleteRequired", "Bytes"}}); + } /** @@ -2263,6 +2272,24 @@ case ProcedureCode_id_E2nodeConfigurationUpdate: { } break; } + case ProcedureCode_id_RICsubscriptionDeleteRequired: { + if (logLevel >= MDCLOG_DEBUG) { + mdclog_write(MDCLOG_DEBUG, "Got RICsubscriptionDeleteRequired %s", message.message.enodbName); + } + #if !(defined(UNIT_TEST) || defined(MODULE_TEST)) + message.peerInfo->counters[IN_INITI][MSG_COUNTER][ProcedureCode_id_RICsubscriptionDeleteRequired]->Increment(); + message.peerInfo->counters[IN_INITI][BYTES_COUNTER][ProcedureCode_id_RICsubscriptionDeleteRequired]->Increment((double)message.message.asnLength); + + // Update E2T instance level metrics + message.peerInfo->sctpParams->e2tCounters[IN_INITI][MSG_COUNTER][ProcedureCode_id_RICsubscriptionDeleteRequired]->Increment(); + message.peerInfo->sctpParams->e2tCounters[IN_INITI][BYTES_COUNTER][ProcedureCode_id_RICsubscriptionDeleteRequired]->Increment((double)message.message.asnLength); + #endif + if (sendRequestToXapp(message, RIC_SUB_DEL_REQUIRED, rmrMessageBuffer) != 0) { + mdclog_write(MDCLOG_ERR, "Subscription Delete Required message failed to send to xAPP"); + } + break; + } + default: { mdclog_write(MDCLOG_ERR, "Undefined or not supported message = %ld", procedureCode); message.message.messageType = 0; // no RMR message type yet -- 2.16.6