1. Transitioned to using latest asn1c compiler
[ric-app/admin.git] / src / X2AP / sgnb_addition_response.hpp
1 /*
2 ==================================================================================
3         Copyright (c) 2018-2019 AT&T Intellectual Property.
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  * ric_indication.h
20  *
21  *  Created on: Aug 14, 2019
22  *      Author: Ashwin Sridharan
23  */
24
25 #ifndef SGNB_ADDITION_RESPONSE_
26 #define SGNB_ADDITION_RESPONSE_
27
28   
29 #include <iostream>
30 #include <errno.h>
31 #include <mdclog/mdclog.h>
32 #include <sstream>
33 #include <X2N_X2AP-PDU.h>
34 #include <X2N_SuccessfulOutcome.h>
35 #include <X2N_UnsuccessfulOutcome.h>
36 #include <X2N_SgNBAdditionRequestAcknowledge.h>
37 #include <X2N_SgNBAdditionRequestReject.h>
38 #include <X2N_ProtocolIE-Field.h>
39 #include <X2N_E-RABs-Admitted-ToBeAdded-SgNBAddReqAck-Item.h>
40 #include <X2N_E-RABs-Admitted-ToBeAdded-SgNBAddReqAck-Item-SgNBPDCPnotpresent.h>
41 #include <X2N_E-RABs-Admitted-ToBeAdded-SgNBAddReqAck-Item-SgNBPDCPpresent.h>
42 #include <X2N_GBR-QosInformation.h>
43 #include <sgnb_addition_helpers.hpp>
44
45 #define NUM_SGNB_ADDITION_RESPONSE_ACKNOWLEDGE_IES 4
46 #define NUM_SGNB_ADDITION_RESPONSE_FAILURE_IES 3
47
48 #define INITIAL_SIZE 4
49
50 class sgnb_addition_response {
51 public:
52   sgnb_addition_response();
53   ~sgnb_addition_response(void);
54
55   bool encode_sgnb_addition_response(unsigned char *, size_t *, sgnb_addition_helper &, bool);
56
57   bool set_fields(X2N_SuccessfulOutcome_t *, sgnb_addition_helper &);
58   bool get_fields(X2N_SuccessfulOutcome_t * ,sgnb_addition_helper &);
59
60   bool set_fields(X2N_UnsuccessfulOutcome_t *, sgnb_addition_helper &);
61   bool get_fields(X2N_UnsuccessfulOutcome_t * ,sgnb_addition_helper &);
62   
63   std::string get_error(void) const {return error_string; };
64   
65 private:
66
67   bool sgnb_response;
68   X2N_X2AP_PDU_t * x2ap_pdu_obj;
69   X2N_SuccessfulOutcome_t * successMsg;
70   X2N_UnsuccessfulOutcome_t * unsuccessMsg;
71   
72   X2N_SgNBAdditionRequestAcknowledge_IEs_t * IE_array;
73   X2N_SgNBAdditionRequestReject_IEs_t * IE_reject_array;
74   
75   X2N_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs_t * erab_admit_array;
76   size_t erab_admit_array_size;
77   
78   X2N_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item_SgNBPDCPpresent_t * erab_sgnb_present_array;
79   X2N_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item_SgNBPDCPnotpresent_t * erab_sgnb_notpresent_array;
80   size_t erab_sgnb_present_array_size ;
81   size_t erab_sgnb_notpresent_array_size;
82   
83   std::string error_string;
84   char errbuf[128];
85   size_t errbuf_len = 128;
86 };
87
88 #endif