57a2e2d8720defb3c5c1c104c29b5ed871e11ef3
[ric-app/hw.git] / src / xapp-formats / e2ap / e2ap_control.hpp
1 /*
2 ==================================================================================
3
4         Copyright (c) 2018-2019 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, 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 ==================================================================================
18 */
19 /*
20  * ric_indication.h
21  *
22  *  Created on: Jul 11, 2019
23  *      Author: sjana, Ashwin Sridharan
24  */
25
26 #ifndef E2AP_RIC_CONTROL_REQUEST_H_
27 #define E2AP_RIC_CONTROL_REQUEST_H_
28
29   
30 #include <iostream>
31 #include <errno.h>
32 #include <mdclog/mdclog.h>
33 #include <sstream>
34 #include <E2N_E2AP-PDU.h>
35 #include <E2N_InitiatingMessage.h>
36 #include <E2N_RICcontrolRequest.h>
37 #include <E2N_ProtocolIE-Field.h>
38 #include "e2ap_control_helper.hpp"
39
40 #define NUM_CONTROL_REQUEST_IES 6
41   
42   
43 class ric_control_request{
44     
45 public:
46   ric_control_request(void);
47   ~ric_control_request(void);
48     
49   bool encode_e2ap_control_request(unsigned char *, size_t *,  ric_control_helper &);
50   E2N_InitiatingMessage_t * get_message (void) ;
51   bool set_fields(E2N_InitiatingMessage_t *, ric_control_helper &);
52   bool get_fields(E2N_InitiatingMessage_t *, ric_control_helper &);
53   std::string get_error(void) const {return error_string ; };
54 private:
55
56   E2N_E2AP_PDU_t * e2ap_pdu_obj;
57   E2N_InitiatingMessage_t *initMsg;
58   E2N_RICcontrolRequest_IEs_t *IE_array;
59   std::string error_string;
60
61   char errbuf[128];
62   size_t errbuf_len = 128;
63 };
64
65
66 #endif /* E2AP_RIC_CONTROL_REQUEST_H_ */