Updated INFO.yaml file
[ric-app/kpimon.git] / src / E2SM / e2sm_helpers.hpp
1 \r
2 \r
3 #ifndef E2SM_HELPER_\r
4 #define E2SM_HELPER_\r
5 \r
6 #include <errno.h>\r
7 #include <iostream>\r
8 #include <vector>\r
9 #include <sstream>\r
10 \r
11  /* information holder for E2SM indication header */\r
12 typedef struct e2sm_header_helper e2sm_header_helper;\r
13 struct e2sm_header_helper {\r
14   int egNB_id_type;\r
15   \r
16   std::string egNB_id;\r
17   std::string plmn_id;\r
18   \r
19   long int interface_direction;\r
20   unsigned char* timestamp;\r
21 };\r
22 \r
23 /* information holder for E2SM indication message */\r
24 typedef struct e2sm_message_helper e2sm_message_helper;\r
25 struct e2sm_message_helper {\r
26   unsigned char * x2ap_pdu;\r
27   size_t x2ap_pdu_size;\r
28 };\r
29 \r
30   \r
31 /* information holder for E2SM Action Trigger Definition */\r
32 struct Item\r
33 {\r
34   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
35   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
36     \r
37   long int interface_id;\r
38   long int test;\r
39   long int  val_type;\r
40   long int value_n;\r
41   std::string value_s;\r
42     \r
43 };\r
44   \r
45 typedef struct e2sm_event_trigger_helper e2sm_event_trigger_helper;\r
46 struct e2sm_event_trigger_helper {\r
47     \r
48   int egNB_id_type;\r
49   std::string egNB_id;\r
50   std::string plmn_id;\r
51     \r
52   long int interface_direction;\r
53   long int procedure_code;\r
54     \r
55   long int message_type;\r
56 \r
57     \r
58   std::vector<struct Item> * get_list(void){ return &protocol_ie_list; };\r
59   void add_protocol_ie_item(long int id, long int test , unsigned int val_type, long int value ){\r
60     // into list \r
61     protocol_ie_list.emplace_back(id, test, val_type, value);\r
62   };\r
63   \r
64   void add_protocol_ie_item(long int id, long int  test, unsigned  int val_type, std::string  value){\r
65     //  into list \r
66     protocol_ie_list.emplace_back(id, test, val_type, value);    \r
67   };\r
68    \r
69   void clear(void){\r
70     protocol_ie_list.clear();\r
71   }\r
72 \r
73   std::string get_string(void) const {\r
74     std::stringstream ss;\r
75     ss << "egNB_ID_type = " << egNB_id_type << std::endl;\r
76     ss << "PLMN Id = " << plmn_id << std::endl;\r
77     ss << "Procedure Code = " << procedure_code << std::endl;\r
78     ss << "Message Type = " << message_type << std::endl;\r
79 \r
80     std::string info;\r
81     info = ss.str();\r
82     return info;\r
83   }\r
84   \r
85     \r
86     \r
87 private:\r
88     \r
89   std::vector<struct Item> protocol_ie_list;\r
90     \r
91 };\r
92 \r
93   \r
94 \r
95 \r
96 #endif\r