Adding initial code jy.oak@samsung.com
[ric-app/kpimon.git] / src / message_processor_class.hpp
diff --git a/src/message_processor_class.hpp b/src/message_processor_class.hpp
new file mode 100755 (executable)
index 0000000..e72cd1c
--- /dev/null
@@ -0,0 +1,65 @@
+/*\r
+==================================================================================\r
+\r
+        Copyright (c) 2018-2019 AT&T Intellectual Property.\r
+\r
+   Licensed under the Apache License, Version 2.0 (the "License");\r
+   you may not use this file except in compliance with the License.\r
+   You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+==================================================================================\r
+*/\r
+\r
+\r
+#pragma once\r
+#include <iostream>\r
+#include <cstring>\r
+#include <rmr/RIC_message_types.h>\r
+#include <rmr/rmr.h>\r
+#include <mdclog/mdclog.h>\r
+#include <e2ap_indication.hpp>\r
+#include <subscription_handler.hpp>\r
+#include <KPIMessageHandler.h>\r
+#include <e2sm.hpp>\r
+\r
+#ifdef __GNUC__\r
+#define likely(x)  __builtin_expect((x), 1)\r
+#define unlikely(x) __builtin_expect((x), 0)\r
+#else\r
+#define likely(x) (x)\r
+#define unlikely(x) (x)\r
+#endif\r
+\r
+#define BUFFER_LENGTH 2048\r
+\r
+class message_processor {\r
+\r
+public:\r
+\r
+  bool operator() (redisContext *, rmr_mbuf_t *);  \r
+  unsigned long const get_messages (void);\r
+  void register_subscription_handler(SubscriptionHandler *);\r
+  \r
+private:\r
+\r
+  E2AP_PDU_t * e2ap_recv_pdu;\r
+  E2SM_gNB_X2_indicationHeader_t *e2sm_header; // used for decoding\r
+\r
+  E2APRicIndication indication_data;\r
+  ric_indication indication_processor;\r
+  \r
+  e2sm_header_helper header_helper;\r
+  e2sm_indication e2sm_indication_processor;\r
+  \r
+  SubscriptionHandler * _ref_sub_handler;\r
+  kpi_msg_handler *_ref_kpi_msg_handler;\r
+  unsigned long _num_messages;\r
+  unsigned long int num_indications, num_err_indications;\r
+};\r