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