2 ==================================================================================
4 Copyright (c) 2019-2020 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 * e2ap_control_ack.hpp
22 * Author: Shraboni Jana
25 /*-- **************************************************************
27 -- RIC CONTROL ACKNOWLEDGE
29 -- **************************************************************
30 RICcontrolAcknowledge ::= SEQUENCE {
31 protocolIEs ProtocolIE-Container {{RICcontrolAcknowledge-IEs}},
35 RICcontrolAcknowledge-IEs E2AP-PROTOCOL-IES ::= {
36 { ID id-RICrequestID CRITICALITY reject TYPE RICrequestID PRESENCE mandatory }|
37 { ID id-RANfunctionID CRITICALITY reject TYPE RANfunctionID PRESENCE mandatory }|
38 { ID id-RICcallProcessID CRITICALITY reject TYPE RICcallProcessID PRESENCE optional }|
39 { ID id-RICcontrolStatus CRITICALITY reject TYPE RICcontrolStatus PRESENCE mandatory } |
40 { ID id-RICcontrolOutcome CRITICALITY reject TYPE RICcontrolOutcome PRESENCE optional },
44 #ifndef SRC_XAPP_ASN_E2AP_E2AP_CONTROL_ACK_HPP_
45 #define SRC_XAPP_ASN_E2AP_E2AP_CONTROL_ACK_HPP_
48 #include <mdclog/mdclog.h>
52 #include <SuccessfulOutcome.h>
53 #include <RICcontrolAcknowledge.h>
54 #include <ProtocolIE-Field.h>
55 #include "e2ap_consts.hpp"
57 class E2APControlAcknowledge{
60 class ControlAcknowledgeIEs{
62 long int ricRequestorID , ricInstanceID, ranFunctionID, ricCallProcessID, ricControlStatus;
64 unsigned char ricCallProcessId[IE_SIZE];
65 size_t ricCallProcessId_size = IE_SIZE;
66 bool is_ricCallProcessId;
67 unsigned char ricControlOutcome[IE_SIZE];
68 size_t ricControlOutcome_size = IE_SIZE;
69 bool is_ricControlOutcome;
72 ControlAcknowledgeIEs(void):ricRequestorID(1), ricInstanceID(1),ranFunctionID(1), ricCallProcessID(0),ricControlStatus(1),is_ricControlOutcome(false),is_ricCallProcessId(false){};
73 void* get_ricCallProcessId(){return this->ricCallProcessId;};
74 size_t get_ricCallProcessId_size(){return this->ricCallProcessId_size;};
76 void* get_ricControlOutcome(){return this->ricControlOutcome;};
77 size_t get_ricControlOutcome_size(){return this->ricControlOutcome_size;};
79 long int get_ricRequestorID(){return this->ricRequestorID;};
80 long int get_ricInstanceID(){return this->ricInstanceID;};
81 long int get_ranFunctionID(){return this->ranFunctionID;};
82 long int get_ricControlStatus(){return this->ricControlStatus;};
84 bool get_is_ricCallProcessId(){return is_ricCallProcessId;};
85 bool get_is_ricControlOutcome(){return is_ricControlOutcome;};
88 ControlAcknowledgeIEs& set_ricCallProcessID(std::string strCallProcID){
89 is_ricCallProcessId = true; ricCallProcessId_size = strlen(strCallProcID.c_str());
90 memcpy((char*)ricCallProcessId, strCallProcID.c_str(), ricCallProcessId_size);
93 ControlAcknowledgeIEs& set_ricCallProcessID(unsigned char* callproc, size_t callproc_size){
94 is_ricCallProcessId = true;
95 memcpy(ricCallProcessId, callproc, callproc_size); ricCallProcessId_size = callproc_size;
100 ControlAcknowledgeIEs& set_ricControlOutcome(std::string strOutcome){
101 is_ricControlOutcome = true; ricControlOutcome_size = strlen(strOutcome.c_str());
102 memcpy((char*)ricControlOutcome, strOutcome.c_str(), ricControlOutcome_size);
105 ControlAcknowledgeIEs& set_ricControlOutcome(unsigned char* callproc, size_t callproc_size){
106 is_ricControlOutcome = true;
107 memcpy(ricControlOutcome, callproc, callproc_size); ricControlOutcome_size = callproc_size;
112 ControlAcknowledgeIEs& set_ricRequestorID(long int reqID){this->ricRequestorID = reqID; return *this;}
113 ControlAcknowledgeIEs& set_ricControlStatus(long int stat){this->ricControlStatus = stat; return *this;}
114 ControlAcknowledgeIEs& set_ricInstanceID(long int reqID){this->ricInstanceID = reqID; return *this;}
115 ControlAcknowledgeIEs& set_ranFunctionID(long int funcID){this->ranFunctionID = funcID; return *this;}
118 E2APControlAcknowledge(ControlAcknowledgeIEs &);
119 E2APControlAcknowledge(unsigned char *, size_t *);
120 ~E2APControlAcknowledge(void);
121 bool encode(unsigned char *, size_t *);
122 bool decode(unsigned char *, size_t *);
123 ControlAcknowledgeIEs& getIEs(){ return *_cntrlIEs.get();};
124 std::string get_error(void) const {return _error_string ; };
127 E2AP_PDU_t * _e2ap_pdu_obj;
128 SuccessfulOutcome_t * _successMsg;
129 RICcontrolAcknowledge_IEs_t *IE_array;
130 std::string _error_string;
131 bool setfields(SuccessfulOutcome_t *);
132 bool getfields(SuccessfulOutcome_t *);
133 std::unique_ptr<ControlAcknowledgeIEs> _cntrlIEs;
135 size_t _errbuf_len = IE_SIZE;
141 #endif /* SRC_XAPP_ASN_E2AP_E2AP_CONTROL_ACK_HPP_ */