Adding initial code jy.oak@samsung.com
[ric-app/kpimon.git] / src / E2SM / e2sm_helpers.hpp
diff --git a/src/E2SM/e2sm_helpers.hpp b/src/E2SM/e2sm_helpers.hpp
new file mode 100755 (executable)
index 0000000..a9a8886
--- /dev/null
@@ -0,0 +1,96 @@
+\r
+\r
+#ifndef E2SM_HELPER_\r
+#define E2SM_HELPER_\r
+\r
+#include <errno.h>\r
+#include <iostream>\r
+#include <vector>\r
+#include <sstream>\r
+\r
+ /* information holder for E2SM indication header */\r
+typedef struct e2sm_header_helper e2sm_header_helper;\r
+struct e2sm_header_helper {\r
+  int egNB_id_type;\r
+  \r
+  std::string egNB_id;\r
+  std::string plmn_id;\r
+  \r
+  long int interface_direction;\r
+  unsigned char* timestamp;\r
+};\r
+\r
+/* information holder for E2SM indication message */\r
+typedef struct e2sm_message_helper e2sm_message_helper;\r
+struct e2sm_message_helper {\r
+  unsigned char * x2ap_pdu;\r
+  size_t x2ap_pdu_size;\r
+};\r
+\r
+  \r
+/* information holder for E2SM Action Trigger Definition */\r
+struct Item\r
+{\r
+  Item(long int id, long int test, long int val_type, int value):interface_id(id), test(test), val_type(val_type), value_n(value){};\r
+  Item(long int id, long int test, long int val_type, std::string value):interface_id(id), test(test), val_type(val_type), value_s(value){};\r
+    \r
+  long int interface_id;\r
+  long int test;\r
+  long int  val_type;\r
+  long int value_n;\r
+  std::string value_s;\r
+    \r
+};\r
+  \r
+typedef struct e2sm_event_trigger_helper e2sm_event_trigger_helper;\r
+struct e2sm_event_trigger_helper {\r
+    \r
+  int egNB_id_type;\r
+  std::string egNB_id;\r
+  std::string plmn_id;\r
+    \r
+  long int interface_direction;\r
+  long int procedure_code;\r
+    \r
+  long int message_type;\r
+\r
+    \r
+  std::vector<struct Item> * get_list(void){ return &protocol_ie_list; };\r
+  void add_protocol_ie_item(long int id, long int test , unsigned int val_type, long int value ){\r
+    // into list \r
+    protocol_ie_list.emplace_back(id, test, val_type, value);\r
+  };\r
+  \r
+  void add_protocol_ie_item(long int id, long int  test, unsigned  int val_type, std::string  value){\r
+    //  into list \r
+    protocol_ie_list.emplace_back(id, test, val_type, value);    \r
+  };\r
+   \r
+  void clear(void){\r
+    protocol_ie_list.clear();\r
+  }\r
+\r
+  std::string get_string(void) const {\r
+    std::stringstream ss;\r
+    ss << "egNB_ID_type = " << egNB_id_type << std::endl;\r
+    ss << "PLMN Id = " << plmn_id << std::endl;\r
+    ss << "Procedure Code = " << procedure_code << std::endl;\r
+    ss << "Message Type = " << message_type << std::endl;\r
+\r
+    std::string info;\r
+    info = ss.str();\r
+    return info;\r
+  }\r
+  \r
+    \r
+    \r
+private:\r
+    \r
+  std::vector<struct Item> protocol_ie_list;\r
+    \r
+};\r
+\r
+  \r
+\r
+\r
+#endif\r