2 ==================================================================================
4 Copyright (c) 2018-2019 AT&T Intellectual Property.
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
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
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 ==================================================================================
20 /* Classes to handle E2 service model based on e2sm-gNB-X2-release-1-v040.asn */
27 #include <mdclog/mdclog.h>
28 #include <E2N_E2SM-gNB-X2-indicationHeader.h>
29 #include <E2N_E2SM-gNB-X2-indicationMessage.h>
30 #include <E2N_E2SM-gNB-X2-controlHeader.h>
31 #include <E2N_E2SM-gNB-X2-controlMessage.h>
32 #include <E2N_E2SM-gNB-X2-eventTriggerDefinition.h>
34 #include <E2N_GlobalGNB-ID.h>
35 #include <E2N_TypeOfMessage.h>
36 #include <E2N_InterfaceProtocolIE-Item.h>
38 #include<E2N_InterfaceProtocolIE-ID.h>
39 #include<E2N_InterfaceProtocolIE-Value.h>
40 #include<E2N_InterfaceProtocolIE-Test.h>
41 #include "../../xapp-formats/e2sm/e2sm_helpers.hpp"
43 #define INITIAL_LIST_SIZE 4
48 /* builder class for E2SM event trigger definition */
50 class e2sm_event_trigger {
52 e2sm_event_trigger(void);
53 ~e2sm_event_trigger(void);
55 bool set_fields(E2N_E2SM_gNB_X2_eventTriggerDefinition_t *, e2sm_event_trigger_helper &);
56 bool get_fields(E2N_E2SM_gNB_X2_eventTriggerDefinition_t *, e2sm_event_trigger_helper &);
57 bool encode_event_trigger(unsigned char *, size_t *, e2sm_event_trigger_helper &);
59 std::string get_error (void) const {return error_string ;};
63 E2N_E2SM_gNB_X2_eventTriggerDefinition_t * event_trigger; // used for encoding
64 E2N_GlobalGNB_ID_t gNodeB_ID;
65 struct E2N_InterfaceProtocolIE_Item * ie_list;
66 unsigned int ie_list_size;
68 //std::vector<struct InterfaceProtocolIE_Item> ie_list;
69 E2N_E2SM_gNB_X2_eventTriggerDefinition::E2N_E2SM_gNB_X2_eventTriggerDefinition__interfaceProtocolIE_List *condition_list;
73 std::string error_string;
77 /* builder class for E2SM indication using ASN1c */
79 class e2sm_indication {
82 e2sm_indication(void);
83 ~e2sm_indication(void);
85 E2N_E2SM_gNB_X2_indicationHeader_t * get_header(void);
86 E2N_E2SM_gNB_X2_indicationMessage_t * get_message(void);
88 bool set_header_fields(E2N_E2SM_gNB_X2_indicationHeader_t *, e2sm_header_helper &);
89 bool get_header_fields(E2N_E2SM_gNB_X2_indicationHeader_t *, e2sm_header_helper &);
91 bool set_message_fields(E2N_E2SM_gNB_X2_indicationMessage_t *, e2sm_message_helper &);
92 bool get_message_fields(E2N_E2SM_gNB_X2_indicationMessage_t *, e2sm_message_helper &);
94 bool encode_indication_header(unsigned char * , size_t * , e2sm_header_helper &);
95 bool encode_indication_message(unsigned char *, size_t *, e2sm_message_helper &);
96 std::string get_error (void) const {return error_string ; };
100 E2N_E2SM_gNB_X2_indicationHeader_t *header; // used for encoding
101 E2N_E2SM_gNB_X2_indicationMessage_t *message; // used for encoding
105 E2N_GlobalGNB_ID_t gNodeB_ID;
106 std::string error_string;
111 /* builder class for E2SM control using ASN1c */
119 E2N_E2SM_gNB_X2_controlHeader_t * get_header(void);
120 E2N_E2SM_gNB_X2_controlMessage_t * get_message(void);
122 bool set_header_fields(E2N_E2SM_gNB_X2_controlHeader_t *, e2sm_header_helper &);
123 bool get_header_fields(E2N_E2SM_gNB_X2_controlHeader_t *, e2sm_header_helper &);
125 bool set_message_fields(E2N_E2SM_gNB_X2_controlMessage_t *, e2sm_message_helper &);
126 bool get_message_fields(E2N_E2SM_gNB_X2_controlMessage_t *, e2sm_message_helper &);
128 bool encode_control_header(unsigned char * , size_t * , e2sm_header_helper &);
129 bool encode_control_message(unsigned char *, size_t *, e2sm_message_helper &);
130 std::string get_error (void) const {return error_string ; };
134 E2N_E2SM_gNB_X2_controlHeader_t *header; // used for encoding
135 E2N_E2SM_gNB_X2_controlMessage_t *message; // used for encoding
139 E2N_GlobalGNB_ID_t gNodeB_ID;
140 std::string error_string;