2 ==================================================================================
\r
4 Copyright (c) 2018-2019 AT&T Intellectual Property.
\r
6 Licensed under the Apache License, Version 2.0 (the "License");
\r
7 you may not use this file except in compliance with the License.
\r
8 You may obtain a copy of the License at
\r
10 http://www.apache.org/licenses/LICENSE-2.0
\r
12 Unless required by applicable law or agreed to in writing, software
\r
13 distributed under the License is distributed on an "AS IS" BASIS,
\r
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
15 See the License for the specific language governing permissions and
\r
16 limitations under the License.
\r
17 ==================================================================================
\r
20 /* Classes to handle E2 service model based on e2sm-gNB-X2-release-1-v040.asn */
\r
27 #include <e2sm_helpers.hpp>
\r
28 #include <mdclog/mdclog.h>
\r
29 #include <E2SM-gNB-X2-indicationHeader.h>
\r
30 #include <E2SM-gNB-X2-indicationMessage.h>
\r
31 #include <E2SM-gNB-X2-controlHeader.h>
\r
32 #include <E2SM-gNB-X2-controlMessage.h>
\r
33 #include <E2SM-gNB-X2-eventTriggerDefinition.h>
\r
35 #include <GlobalGNB-ID.h>
\r
36 #include <TypeOfMessage.h>
\r
37 #include <InterfaceProtocolIE-Item.h>
\r
39 #include<InterfaceProtocolIE-ID.h>
\r
40 #include<InterfaceProtocolIE-Value.h>
\r
41 #include<InterfaceProtocolIE-Test.h>
\r
43 #define INITIAL_LIST_SIZE 4
\r
48 /* builder class for E2SM event trigger definition */
\r
50 class e2sm_event_trigger {
\r
52 e2sm_event_trigger(void);
\r
53 ~e2sm_event_trigger(void);
\r
55 bool set_fields(E2SM_gNB_X2_eventTriggerDefinition_t *, e2sm_event_trigger_helper &);
\r
56 bool get_fields(E2SM_gNB_X2_eventTriggerDefinition_t *, e2sm_event_trigger_helper &);
\r
57 bool encode_event_trigger(unsigned char *, size_t *, e2sm_event_trigger_helper &);
\r
59 std::string get_error (void) const {return error_string ;};
\r
63 E2SM_gNB_X2_eventTriggerDefinition_t * event_trigger; // used for encoding
\r
64 GlobalGNB_ID_t gNodeB_ID;
\r
65 struct InterfaceProtocolIE_Item * ie_list;
\r
66 unsigned int ie_list_size;
\r
68 //std::vector<struct InterfaceProtocolIE_Item> ie_list;
\r
69 E2SM_gNB_X2_eventTriggerDefinition::E2SM_gNB_X2_eventTriggerDefinition__interfaceProtocolIE_List *condition_list;
\r
73 std::string error_string;
\r
77 /* builder class for E2SM indication using ASN1c */
\r
79 class e2sm_indication {
\r
82 e2sm_indication(void);
\r
83 ~e2sm_indication(void);
\r
85 E2SM_gNB_X2_indicationHeader_t * get_header(void);
\r
86 E2SM_gNB_X2_indicationMessage_t * get_message(void);
\r
88 bool set_header_fields(E2SM_gNB_X2_indicationHeader_t *, e2sm_header_helper &);
\r
89 bool get_header_fields(E2SM_gNB_X2_indicationHeader_t *, e2sm_header_helper &);
\r
91 bool set_message_fields(E2SM_gNB_X2_indicationMessage_t *, e2sm_message_helper &);
\r
92 bool get_message_fields(E2SM_gNB_X2_indicationMessage_t *, e2sm_message_helper &);
\r
94 bool encode_indication_header(unsigned char * , size_t * , e2sm_header_helper &);
\r
95 bool encode_indication_message(unsigned char *, size_t *, e2sm_message_helper &);
\r
96 std::string get_error (void) const {return error_string ; };
\r
100 E2SM_gNB_X2_indicationHeader_t *header; // used for encoding
\r
101 E2SM_gNB_X2_indicationMessage_t *message; // used for encoding
\r
105 GlobalGNB_ID_t gNodeB_ID;
\r
106 std::string error_string;
\r
111 /* builder class for E2SM control using ASN1c */
\r
113 class e2sm_control {
\r
116 e2sm_control(void);
\r
117 ~e2sm_control(void);
\r
119 E2SM_gNB_X2_controlHeader_t * get_header(void);
\r
120 E2SM_gNB_X2_controlMessage_t * get_message(void);
\r
122 bool set_header_fields(E2SM_gNB_X2_controlHeader_t *, e2sm_header_helper &);
\r
123 bool get_header_fields(E2SM_gNB_X2_controlHeader_t *, e2sm_header_helper &);
\r
125 bool set_message_fields(E2SM_gNB_X2_controlMessage_t *, e2sm_message_helper &);
\r
126 bool get_message_fields(E2SM_gNB_X2_controlMessage_t *, e2sm_message_helper &);
\r
128 bool encode_control_header(unsigned char * , size_t * , e2sm_header_helper &);
\r
129 bool encode_control_message(unsigned char *, size_t *, e2sm_message_helper &);
\r
130 std::string get_error (void) const {return error_string ; };
\r
134 E2SM_gNB_X2_controlHeader_t *header; // used for encoding
\r
135 E2SM_gNB_X2_controlMessage_t *message; // used for encoding
\r
139 GlobalGNB_ID_t gNodeB_ID;
\r
140 std::string error_string;
\r