ISSUE ID:- (RICAPP-176).
[ric-app/bouncer.git] / Bouncer / src / xapp-asn / e2sm / e2sm_helpers.hpp
1 /*
2 # ==================================================================================
3 # Copyright (c) 2020 HCL Technologies Limited.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ==================================================================================
17 */
18
19
20 /* Classes to handle E2 service model based on e2sm-Bouncer-v001.asn */
21 #ifndef E2SM_HELPER_
22 #define E2SM_HELPER_
23
24 #include <errno.h>
25 #include <iostream>
26 #include <vector>
27 #include <sstream>
28 #include <memory>
29
30 typedef struct ranparam_helper ranparam_helper;
31 struct ranparam_helper {
32           long int _param_id;
33           unsigned char* _param_name;
34           size_t _param_name_len;
35           int _param_test;
36           unsigned char* _param_value;
37           size_t _param_value_len;
38
39 };
40 class RANParam_Helper{
41 private:
42         ranparam_helper _ranparam_helper;
43
44 public:
45
46         RANParam_Helper(int id, unsigned char *param_name, size_t param_name_len, int param_test, unsigned char* param_value, size_t param_value_len){
47                 _ranparam_helper._param_id = id;
48                 _ranparam_helper._param_name = param_name;
49                 _ranparam_helper._param_name_len = param_name_len;
50                 _ranparam_helper._param_test = param_test;
51                 _ranparam_helper._param_value = param_value;
52                 _ranparam_helper._param_value_len = param_value_len;
53           }
54
55         const ranparam_helper & getran_helper() const {
56                 return _ranparam_helper;
57         }
58         void print_ranparam_info(void){
59             std::cout <<"Param ID = " << _ranparam_helper._param_id << std::endl;
60             std::cout << "Parame Name =" << _ranparam_helper._param_name << std::endl;
61             std::cout <<"Param Test = " << _ranparam_helper._param_test << std::endl;
62             std::cout <<"Param Value = " << _ranparam_helper._param_value << std::endl;
63         }
64 };
65
66
67 using ranparam_helper_t = std::vector<RANParam_Helper>;
68
69 typedef struct e2sm_subscription_helper e2sm_subscription_helper;
70 struct e2sm_subscription_helper {
71 public:
72
73
74   int triger_nature;
75   ranparam_helper_t param;
76   void add_param(int id, unsigned char *param_name, size_t param_name_len, int param_test, unsigned char* param_value, size_t param_value_len){
77           RANParam_Helper rparam(id,param_name,param_name_len,param_test,param_value,param_value_len);
78       param.push_back(rparam);
79     };
80   ranparam_helper_t get_paramlist() const {return param;};
81
82
83
84 };
85
86
87 typedef struct e2sm_indication_helper e2sm_indication_helper;
88
89
90 struct e2sm_indication_helper {
91         long int header;
92         unsigned char* message;
93         size_t message_len;
94 };
95
96 typedef struct e2sm_control_helper e2sm_control_helper;
97
98 struct e2sm_control_helper {
99         long int header;
100         unsigned char* message;
101         size_t message_len;
102 };
103
104 #endif