First release
[sim/ns3-o-ran-e2.git] / model / function-description.cc
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 #include <ns3/function-description.h>
26 #include <ns3/asn1c-types.h>
27 #include <ns3/log.h>
28
29
30 namespace ns3 {
31
32 NS_LOG_COMPONENT_DEFINE ("FunctionDescription");
33
34 FunctionDescription::FunctionDescription ()
35 {
36 //   E2SM_KPM_RANfunction_Description_t *descriptor = new E2SM_KPM_RANfunction_Description_t ();
37 //   FillAndEncodeKpmFunctionDescription (descriptor);
38 //   ASN_STRUCT_FREE_CONTENTS_ONLY (asn_DEF_E2SM_KPM_RANfunction_Description, descriptor);
39 //   delete descriptor;
40     m_size = 0;
41 }
42
43 FunctionDescription::~FunctionDescription ()
44 {
45   free (m_buffer);
46   m_size = 0;
47 }
48
49 // TODO improve
50 // void
51 // FunctionDescription::Encode (E2SM_KPM_RANfunction_Description_t *descriptor)
52 // {
53 //   asn_codec_ctx_t *opt_cod = 0; // disable stack bounds checking
54 //   // encode the structure into the e2smbuffer
55 //   asn_encode_to_new_buffer_result_s encodedMsg = asn_encode_to_new_buffer (
56 //       opt_cod, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2SM_KPM_RANfunction_Description, descriptor);
57
58 //   if (encodedMsg.result.encoded < 0)
59 //     {
60 //       NS_FATAL_ERROR ("Error during the encoding of the RIC Indication Header, errno: "
61 //                       << strerror (errno) << ", failed_type " << encodedMsg.result.failed_type->name
62 //                       << ", structure_ptr " << encodedMsg.result.structure_ptr);
63 //     }
64
65 //   m_buffer = encodedMsg.buffer;
66 //   m_size = encodedMsg.result.encoded;
67 // }
68
69 } // namespace ns3