[Issue-Id: RICAPP-150]: Introduced Anomaly ACK for AD xApp use case 06/5106/1
authorDeepanshu Karnwal <deepanshu.k@hcl.com>
Wed, 18 Nov 2020 07:05:12 +0000 (12:35 +0530)
committerDeepanshu Karnwal <deepanshu.k@hcl.com>
Wed, 18 Nov 2020 07:16:08 +0000 (12:46 +0530)
Signed-off-by: Deepanshu Karnwal <deepanshu.k@hcl.com>
Change-Id: Iacee85c65700525df131bea2244d6bc50f1b0feb

Dockerfile
assets/bootstrap.rt
routes.txt
src/ts_xapp/ts_xapp.cpp
xapp-descriptor/config.json

index 9571fe6..3259306 100644 (file)
@@ -31,7 +31,7 @@
 
 # the builder has: git, wget, cmake, gcc/g++, make, python2/3. v7 dropped nng support
 #
-FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:8-u18.04 as buildenv
+FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:9-u18.04 as buildenv
 
 # spaces to save things in the build image to copy to final image
 RUN mkdir -p /playpen/assets /playpen/src /playpen/bin
@@ -42,7 +42,7 @@ WORKDIR /playpen
 # versions we snarf from package cloud
 ARG RMR_VER=4.0.5
 ARG SDL_VER=1.0.4
-ARG XFCPP_VER=1.0.0
+ARG XFCPP_VER=1.2.0
 
 # package cloud urls for wget
 ARG PC_REL_URL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch
index 38084cb..6b0f249 100644 (file)
@@ -3,4 +3,5 @@
 newrt | start
 mse | 20011 | -1 | service-ricplt-a1mediator-rmr.ricplt:4562
 mse | 30000 | -1 | service-ricxapp-qpdriver-rmr.ricxapp.svc.cluster.local:4560
+mse | 30004 | -1 | service-ricxapp-ad-rmr:4560
 newrt | end
index 5837eb1..15e2edf 100755 (executable)
@@ -1,4 +1,5 @@
 newrt|start
 rte|20011|service-ricplt-a1mediator-rmr:10000
 rte|30000|service-ricxapp-qpdriver.ricxapp.svc.cluster.local:4562
+rte|30004|service-ricxapp-ad-rmr:4560
 newrt|end
index 1ef8a56..8194b15 100644 (file)
@@ -532,7 +532,13 @@ void run_loop() {
   }
 }
 
-
+/* This function works with Anomaly Detection(AD) xApp. It is invoked when anomalous UEs are send by AD xApp.
+ * It just print the payload received from AD xApp and send an ACK with same UEID as payload to AD xApp.
+ */
+void ad_callback( Message& mbuf, int mtype, int subid, int len, Msg_component payload,  void* data ) {
+  cout << "payload is " << payload.get() << "\n";
+  mbuf.Send_response(30004, -1, strlen((char *) payload.get()), (unsigned char *) payload.get());
+}
 
 extern int main( int argc, char** argv ) {
 
@@ -551,6 +557,7 @@ extern int main( int argc, char** argv ) {
   
   xfw->Add_msg_cb( 20010, policy_callback, NULL );
   xfw->Add_msg_cb( 30002, prediction_callback, NULL );
+  xfw->Add_msg_cb( 30003, ad_callback, NULL ); /*Register a callback function for msg type 30003*/
   
   std::thread loop_thread;
 
index c703bf9..7d1ce13 100644 (file)
                     "port": 4560,\r
                     "rxMessages": [ \r
                        "TS_QOE_PREDICTION",\r
-                       "A1_POLICY_REQ"\r
-\r
+                       "A1_POLICY_REQ",\r
+                       "TS_ANOMALY_UPDATE"\r
                     ],\r
-                    "txMessages": [ "TS_UE_LIST" ],\r
+                    "txMessages": [ "TS_UE_LIST", "TS_ANOMALY_ACK" ],\r
                     "policies": [20008],\r
                     "description": "rmr receive data port for mcxapp"\r
                 },\r
             "maxSize": 2072,\r
             "numWorkers": 1,\r
             "txMessages": [\r
-                "TS_UE_LIST"\r
+                "TS_UE_LIST",\r
+               "TS_ANOMALY_ACK"\r
             ],\r
             "rxMessages": [\r
                 "TS_QOE_PREDICTION",\r
-                "A1_POLICY_REQ"                \r
+                "A1_POLICY_REQ",\r
+               "TS_ANOMALY_UPDATE"             \r
             ],\r
             "policies": [20008]\r
         }\r