First release
[sim/ns3-o-ran-e2.git] / model / ric-control-message.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2022 Northeastern University
4  * Copyright (c) 2022 Sapienza, University of Rome
5  * Copyright (c) 2022 University of Padova
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation;
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  * Author: Andrea Lacava <thecave003@gmail.com>
21  *                 Tommaso Zugno <tommasozugno@gmail.com>
22  *                 Michele Polese <michele.polese@gmail.com>
23  */
24  
25 #ifndef RIC_CONTROL_MESSAGE_H
26 #define RIC_CONTROL_MESSAGE_H
27
28 #include "ns3/object.h"
29 #include <ns3/asn1c-types.h>
30
31 extern "C" {
32   #include "E2AP-PDU.h"
33   #include "E2SM-RC-ControlHeader.h"
34   #include "E2SM-RC-ControlMessage.h"
35   #include "E2SM-RC-ControlHeader-Format1.h"
36   #include "E2SM-RC-ControlMessage-Format1.h"
37   #include "RICcontrolRequest.h"
38   #include "ProtocolIE-Field.h"
39   #include "InitiatingMessage.h"
40   #include "CellGlobalID.h"
41   #include "NRCGI.h"
42  }
43
44 namespace ns3 {
45
46   class RicControlMessage : public SimpleRefCount<RicControlMessage>
47   {
48   public:
49     enum ControlMessageRequestIdType { TS = 1001, QoS = 1002 };
50     RicControlMessage (E2AP_PDU_t *pdu);
51     ~RicControlMessage ();
52
53     ControlMessageRequestIdType m_requestType;
54     
55     static std::vector<RANParameterItem> ExtractRANParametersFromControlMessage (
56       E2SM_RC_ControlMessage_Format1_t *e2SmRcControlMessageFormat1);
57     
58     std::vector<RANParameterItem> m_valuesExtracted;
59     RANfunctionID_t m_ranFunctionId;
60     RICrequestID_t m_ricRequestId;
61     RICcallProcessID_t m_ricCallProcessId;
62     E2SM_RC_ControlHeader_Format1_t *m_e2SmRcControlHeaderFormat1;
63     std::string GetSecondaryCellIdHO ();
64
65   private:
66     /**
67     * Decodes the RIC Control message .
68     *
69     * \param pdu PDU passed by the RIC
70     */
71     void DecodeRicControlMessage (E2AP_PDU_t *pdu);
72     std::string m_secondaryCellId;
73   };
74 }
75
76 #endif /* RIC_CONTROL_MESSAGE_H */