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