Commit 4e07d96d authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Add header/format for NGAP

parent 933be385
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AMF-UE-NGAP-ID.hpp" #include "AMF-UE-NGAP-ID.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AMF_UE_NGAP_ID::AMF_UE_NGAP_ID(){} //------------------------------------------------------------------------------
AMF_UE_NGAP_ID::AMF_UE_NGAP_ID() {
AMF_UE_NGAP_ID::~AMF_UE_NGAP_ID(){} }
void AMF_UE_NGAP_ID::setAMF_UE_NGAP_ID(unsigned long m_amfUeNgapId) //------------------------------------------------------------------------------
{ AMF_UE_NGAP_ID::~AMF_UE_NGAP_ID() {
amfUeNgapId = m_amfUeNgapId; }
}
unsigned long AMF_UE_NGAP_ID::getAMF_UE_NGAP_ID() //------------------------------------------------------------------------------
{ void AMF_UE_NGAP_ID::setAMF_UE_NGAP_ID(unsigned long m_amfUeNgapId) {
return amfUeNgapId; amfUeNgapId = m_amfUeNgapId;
} }
bool AMF_UE_NGAP_ID::encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t &amfuengapid) //------------------------------------------------------------------------------
{ unsigned long AMF_UE_NGAP_ID::getAMF_UE_NGAP_ID() {
amfuengapid.size = 5; return amfUeNgapId;
amfuengapid.buf = (uint8_t *)calloc(1,amfuengapid.size);
if(!amfuengapid.buf ) return false;
for(int i=0;i<amfuengapid.size;i++)
{
amfuengapid.buf[i] = (amfUeNgapId & (0xff00000000>>i*8))>>((amfuengapid.size-i-1)*8);
}
return true;
}
bool AMF_UE_NGAP_ID::decodefromAMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t &amfuengapid)
{
if(!amfuengapid.buf) return false;
amfUeNgapId = 0;
for(int i=0;i<amfuengapid.size;i++)
{
amfUeNgapId = amfUeNgapId<<8;
amfUeNgapId |= amfuengapid.buf[i];
}
return true;
}
} }
//------------------------------------------------------------------------------
bool AMF_UE_NGAP_ID::encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t &amfuengapid) {
amfuengapid.size = 5;
amfuengapid.buf = (uint8_t*) calloc(1, amfuengapid.size);
if (!amfuengapid.buf)
return false;
for (int i = 0; i < amfuengapid.size; i++) {
amfuengapid.buf[i] = (amfUeNgapId & (0xff00000000 >> i * 8)) >> ((amfuengapid.size - i - 1) * 8);
}
return true;
}
//------------------------------------------------------------------------------
bool AMF_UE_NGAP_ID::decodefromAMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t &amfuengapid) {
if (!amfuengapid.buf)
return false;
amfUeNgapId = 0;
for (int i = 0; i < amfuengapid.size; i++) {
amfUeNgapId = amfUeNgapId << 8;
amfUeNgapId |= amfuengapid.buf[i];
}
return true;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_UE_NGAP_ID_H_ #ifndef _AMF_UE_NGAP_ID_H_
#define _AMF_UE_NGAP_ID_H_ #define _AMF_UE_NGAP_ID_H_
extern "C"{ extern "C" {
#include "Ngap_AMF-UE-NGAP-ID.h" #include "Ngap_AMF-UE-NGAP-ID.h"
} }
namespace ngap{ namespace ngap {
class AMF_UE_NGAP_ID{ class AMF_UE_NGAP_ID {
public: public:
AMF_UE_NGAP_ID(); AMF_UE_NGAP_ID();
virtual ~AMF_UE_NGAP_ID(); virtual ~AMF_UE_NGAP_ID();
void setAMF_UE_NGAP_ID(unsigned long); void setAMF_UE_NGAP_ID(unsigned long);
unsigned long getAMF_UE_NGAP_ID(); unsigned long getAMF_UE_NGAP_ID();
bool encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t &); bool encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t&);
bool decodefromAMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t &); bool decodefromAMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t&);
private: private:
unsigned long amfUeNgapId; unsigned long amfUeNgapId;
}; };
} }
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AMFName.hpp" #include "AMFName.hpp"
extern "C"{ extern "C" {
#include "OCTET_STRING.h" #include "OCTET_STRING.h"
} }
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AmfName::AmfName() //------------------------------------------------------------------------------
{ AmfName::AmfName() {
amfname = NULL; amfname = NULL;
} }
AmfName::~AmfName()
{ //------------------------------------------------------------------------------
free(amfname); AmfName::~AmfName() {
amfname = NULL; free(amfname);
} amfname = NULL;
}
void AmfName::setValue(const std::string m_amfName)
{ //------------------------------------------------------------------------------
if(amfname) void AmfName::setValue(const std::string m_amfName) {
{ if (amfname) {
free(amfname); free(amfname);
amfname = NULL; amfname = NULL;
} }
amfname = (char *)calloc(1,m_amfName.size()+1); amfname = (char*) calloc(1, m_amfName.size() + 1);
memcpy(amfname, m_amfName.c_str(), m_amfName.size()); memcpy(amfname, m_amfName.c_str(), m_amfName.size());
amfname[m_amfName.size()] = '\0'; amfname[m_amfName.size()] = '\0';
}
}
void AmfName::getValue(std::string &m_amfName) //------------------------------------------------------------------------------
{ void AmfName::getValue(std::string &m_amfName) {
m_amfName = amfname; m_amfName = amfname;
} }
bool AmfName::encode2AmfName(Ngap_AMFName_t *amfNameIe)
{ //------------------------------------------------------------------------------
if(OCTET_STRING_fromBuf (amfNameIe, amfname, strlen(amfname)) < 0) return false; bool AmfName::encode2AmfName(Ngap_AMFName_t *amfNameIe) {
if (OCTET_STRING_fromBuf(amfNameIe, amfname, strlen(amfname)) < 0)
return true; return false;
}
bool AmfName::decodefromAmfName(Ngap_AMFName_t * pdu) return true;
{ }
if(!pdu->buf) return false;
amfname = (char *)pdu->buf; //------------------------------------------------------------------------------
return true; bool AmfName::decodefromAmfName(Ngap_AMFName_t *pdu) {
} if (!pdu->buf)
return false;
amfname = (char*) pdu->buf;
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMFNAME_H_ #ifndef _AMFNAME_H_
#define _AMFNAME_H_ #define _AMFNAME_H_
#include <string> #include <string>
extern "C"{ extern "C" {
#include "Ngap_AMFName.h" #include "Ngap_AMFName.h"
} }
namespace ngap{ namespace ngap {
class AmfName{ class AmfName {
public: public:
AmfName(); AmfName();
virtual ~AmfName(); virtual ~AmfName();
bool encode2AmfName(Ngap_AMFName_t *); bool encode2AmfName(Ngap_AMFName_t*);
bool decodefromAmfName(Ngap_AMFName_t *); bool decodefromAmfName(Ngap_AMFName_t*);
void setValue(const std::string m_amfName); void setValue(const std::string m_amfName);
void getValue(std::string &); void getValue(std::string&);
private: private:
char* amfname; char *amfname;
}; };
} }
#endif #endif
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AMFPointer.hpp" #include "AMFPointer.hpp"
#include "String2Value.hpp" #include "String2Value.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AMFPointer::AMFPointer(){} //------------------------------------------------------------------------------
AMFPointer::AMFPointer() {
AMFPointer::~AMFPointer(){} }
void AMFPointer::setAMFPointer(const std::string charPointer) //------------------------------------------------------------------------------
{ AMFPointer::~AMFPointer() {
pointer = fromString<int>(charPointer); }
}
void AMFPointer::getAMFPointer(std::string &charPointer) //------------------------------------------------------------------------------
{ void AMFPointer::setAMFPointer(const std::string charPointer) {
charPointer = to_string(pointer); pointer = fromString<int>(charPointer);
} }
bool AMFPointer::encode2bitstring(Ngap_AMFPointer_t &amfpointer) //------------------------------------------------------------------------------
{ void AMFPointer::getAMFPointer(std::string &charPointer) {
amfpointer.size = 1; charPointer = to_string(pointer);
uint8_t *buffer = (uint8_t *)calloc(1,sizeof(uint8_t)); }
if(!buffer) return false;
*buffer =((pointer & 0x3f)<<2); //------------------------------------------------------------------------------
amfpointer.buf = buffer; bool AMFPointer::encode2bitstring(Ngap_AMFPointer_t &amfpointer) {
amfpointer.bits_unused = 2; amfpointer.size = 1;
uint8_t *buffer = (uint8_t*) calloc(1, sizeof(uint8_t));
return true; if (!buffer)
} return false;
bool AMFPointer::decodefrombitstring(Ngap_AMFPointer_t &amfpointer) *buffer = ((pointer & 0x3f) << 2);
{ amfpointer.buf = buffer;
if(!amfpointer.buf) return false; amfpointer.bits_unused = 2;
pointer = (amfpointer.buf[0] & 0xfc)>>2;//1111 1100
return true;
return true; }
}
//------------------------------------------------------------------------------
bool AMFPointer::decodefrombitstring(Ngap_AMFPointer_t &amfpointer) {
if (!amfpointer.buf)
return false;
pointer = (amfpointer.buf[0] & 0xfc) >> 2; //1111 1100
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMFPOINTER_H_ #ifndef _AMFPOINTER_H_
#define _AMFPOINTER_H_ #define _AMFPOINTER_H_
#include <string> #include <string>
extern "C"{ extern "C" {
#include "Ngap_AMFPointer.h" #include "Ngap_AMFPointer.h"
} }
namespace ngap{ namespace ngap {
class AMFPointer{ class AMFPointer {
public: public:
AMFPointer(); AMFPointer();
virtual ~AMFPointer(); virtual ~AMFPointer();
void setAMFPointer(const std::string); void setAMFPointer(const std::string);
void getAMFPointer(std::string &); void getAMFPointer(std::string&);
bool encode2bitstring(Ngap_AMFPointer_t &); bool encode2bitstring(Ngap_AMFPointer_t&);
bool decodefrombitstring(Ngap_AMFPointer_t &); bool decodefrombitstring(Ngap_AMFPointer_t&);
private: private:
uint8_t pointer; uint8_t pointer;
}; };
} }
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AMFRegionID.hpp" #include "AMFRegionID.hpp"
#include "String2Value.hpp" #include "String2Value.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AMFRegionID::AMFRegionID(){} //------------------------------------------------------------------------------
AMFRegionID::AMFRegionID() {
AMFRegionID::~AMFRegionID(){} }
void AMFRegionID::setAMFRegionID(const std::string charid) //------------------------------------------------------------------------------
{ AMFRegionID::~AMFRegionID() {
regionid = fromString<int>(charid); }
}
void AMFRegionID::getAMFRegionID(std::string & charid) //------------------------------------------------------------------------------
{ void AMFRegionID::setAMFRegionID(const std::string charid) {
charid = to_string(regionid); regionid = fromString<int>(charid);
} }
bool AMFRegionID::encode2bitstring(Ngap_AMFRegionID_t &amfregionid) //------------------------------------------------------------------------------
{ void AMFRegionID::getAMFRegionID(std::string &charid) {
amfregionid.size = 1; charid = to_string(regionid);
uint8_t *buffer = (uint8_t *)calloc(1,sizeof(uint8_t)); }
if(!buffer) return false;
*buffer = regionid; //------------------------------------------------------------------------------
amfregionid.buf = buffer; bool AMFRegionID::encode2bitstring(Ngap_AMFRegionID_t &amfregionid) {
amfregionid.bits_unused = 0; amfregionid.size = 1;
uint8_t *buffer = (uint8_t*) calloc(1, sizeof(uint8_t));
return true; if (!buffer)
} return false;
bool AMFRegionID::decodefrombitstring(Ngap_AMFRegionID_t &amfregionid) *buffer = regionid;
{ amfregionid.buf = buffer;
if(!amfregionid.buf) return false; amfregionid.bits_unused = 0;
regionid = *amfregionid.buf;
return true;
return true; }
}
//------------------------------------------------------------------------------
bool AMFRegionID::decodefrombitstring(Ngap_AMFRegionID_t &amfregionid) {
if (!amfregionid.buf)
return false;
regionid = *amfregionid.buf;
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMFREGIONID_H_ #ifndef _AMFREGIONID_H_
#define _AMFREGIONID_H_ #define _AMFREGIONID_H_
#include <string> #include <string>
extern "C"{ extern "C" {
#include "Ngap_AMFRegionID.h" #include "Ngap_AMFRegionID.h"
} }
namespace ngap{ namespace ngap {
class AMFRegionID{ class AMFRegionID {
public: public:
AMFRegionID(); AMFRegionID();
virtual ~AMFRegionID(); virtual ~AMFRegionID();
void setAMFRegionID(const std::string ); void setAMFRegionID(const std::string);
void getAMFRegionID(std::string &); void getAMFRegionID(std::string&);
bool encode2bitstring(Ngap_AMFRegionID_t &); bool encode2bitstring(Ngap_AMFRegionID_t&);
bool decodefrombitstring(Ngap_AMFRegionID_t &); bool decodefrombitstring(Ngap_AMFRegionID_t&);
private: private:
uint8_t regionid; uint8_t regionid;
}; };
} }
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AMFSetID.hpp" #include "AMFSetID.hpp"
#include "String2Value.hpp" #include "String2Value.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AMFSetID::AMFSetID(){} //------------------------------------------------------------------------------
AMFSetID::AMFSetID() {
AMFSetID::~AMFSetID(){} }
void AMFSetID::setAMFSetID(const std::string charid) //------------------------------------------------------------------------------
{ AMFSetID::~AMFSetID() {
setid = fromString<uint16_t>(charid); }
}
void AMFSetID::getAMFSetID(std::string &charid) //------------------------------------------------------------------------------
{ void AMFSetID::setAMFSetID(const std::string charid) {
charid = to_string(setid); setid = fromString<uint16_t>(charid);
} }
bool AMFSetID::encode2bitstring(Ngap_AMFSetID_t &amfsetid) //------------------------------------------------------------------------------
{ void AMFSetID::getAMFSetID(std::string &charid) {
amfsetid.size = 2; charid = to_string(setid);
uint8_t *buffer = (uint8_t *)calloc(1,sizeof(uint16_t)); }
if(!buffer) return false;
//*(uint16_t *)buffer = setid & 0x3ff; //------------------------------------------------------------------------------
buffer[0] = ((setid & 0x03fc)>>2); bool AMFSetID::encode2bitstring(Ngap_AMFSetID_t &amfsetid) {
buffer[1] = ((setid & 0x0003)<<6); amfsetid.size = 2;
amfsetid.buf = buffer; uint8_t *buffer = (uint8_t*) calloc(1, sizeof(uint16_t));
amfsetid.bits_unused = 6; if (!buffer)
return false;
return true; //*(uint16_t *)buffer = setid & 0x3ff;
} buffer[0] = ((setid & 0x03fc) >> 2);
bool AMFSetID::decodefrombitstring(Ngap_AMFSetID_t &amfsetid) buffer[1] = ((setid & 0x0003) << 6);
{ amfsetid.buf = buffer;
if(!amfsetid.buf) return false; amfsetid.bits_unused = 6;
printf("test for amfsetid\n");
for(int i=0; i<amfsetid.size; i++){ return true;
printf("%x ", amfsetid.buf[i]); }
}
printf("\n"); //------------------------------------------------------------------------------
uint16_t temp = 0; bool AMFSetID::decodefrombitstring(Ngap_AMFSetID_t &amfsetid) {
temp |= amfsetid.buf[0]<<8; if (!amfsetid.buf)
temp |= amfsetid.buf[1]; return false;
setid = (temp&0xffc0)>>6;//1111 1111 11 00 0000 printf("test for amfsetid\n");
for (int i = 0; i < amfsetid.size; i++) {
return true; printf("%x ", amfsetid.buf[i]);
} }
printf("\n");
uint16_t temp = 0;
temp |= amfsetid.buf[0] << 8;
temp |= amfsetid.buf[1];
setid = (temp & 0xffc0) >> 6; //1111 1111 11 00 0000
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMFSETID_H_ #ifndef _AMFSETID_H_
#define _AMFSETID_H_ #define _AMFSETID_H_
#include <string> #include <string>
extern "C"{ extern "C" {
#include "Ngap_AMFSetID.h" #include "Ngap_AMFSetID.h"
} }
namespace ngap{ namespace ngap {
class AMFSetID{ class AMFSetID {
public: public:
AMFSetID(); AMFSetID();
virtual ~AMFSetID(); virtual ~AMFSetID();
void setAMFSetID(const std::string); void setAMFSetID(const std::string);
void getAMFSetID(std::string &); void getAMFSetID(std::string&);
bool encode2bitstring(Ngap_AMFSetID_t &); bool encode2bitstring(Ngap_AMFSetID_t&);
bool decodefrombitstring(Ngap_AMFSetID_t &); bool decodefrombitstring(Ngap_AMFSetID_t&);
private: private:
uint16_t setid; uint16_t setid;
}; };
} }
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AdditionalQosFlowInformation.hpp" #include "AdditionalQosFlowInformation.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AdditionalQosFlowInformation::AdditionalQosFlowInformation(){} //------------------------------------------------------------------------------
AdditionalQosFlowInformation::AdditionalQosFlowInformation() {
AdditionalQosFlowInformation::~AdditionalQosFlowInformation(){} }
void AdditionalQosFlowInformation::setAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation value) //------------------------------------------------------------------------------
{ AdditionalQosFlowInformation::~AdditionalQosFlowInformation() {
additional = value; }
}
bool AdditionalQosFlowInformation::getAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation &value) //------------------------------------------------------------------------------
{ void AdditionalQosFlowInformation::setAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation value) {
if(additional == Ngap_AdditionalQosFlowInformation_more_likely) additional = value;
value = (e_Ngap_AdditionalQosFlowInformation)additional; }
else
return false; //------------------------------------------------------------------------------
bool AdditionalQosFlowInformation::getAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation &value) {
return true; if (additional == Ngap_AdditionalQosFlowInformation_more_likely)
} value = (e_Ngap_AdditionalQosFlowInformation) additional;
else
bool AdditionalQosFlowInformation::encode2AdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *additionalQosFlowInfo) return false;
{
*additionalQosFlowInfo = additional; return true;
}
return true;
} //------------------------------------------------------------------------------
bool AdditionalQosFlowInformation::decodefromAdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *additionalQosFlowInfo) bool AdditionalQosFlowInformation::encode2AdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *additionalQosFlowInfo) {
{ *additionalQosFlowInfo = additional;
additional = *additionalQosFlowInfo;
return true;
return true; }
}
//------------------------------------------------------------------------------
bool AdditionalQosFlowInformation::decodefromAdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *additionalQosFlowInfo) {
additional = *additionalQosFlowInfo;
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _ADDITIONALQOSFLOWINFORMATION_H_ #ifndef _ADDITIONALQOSFLOWINFORMATION_H_
#define _ADDITIONALQOSFLOWINFORMATION_H_ #define _ADDITIONALQOSFLOWINFORMATION_H_
extern "C"{ extern "C" {
#include "Ngap_AdditionalQosFlowInformation.h" #include "Ngap_AdditionalQosFlowInformation.h"
} }
namespace ngap{ namespace ngap {
class AdditionalQosFlowInformation{ class AdditionalQosFlowInformation {
public: public:
AdditionalQosFlowInformation(); AdditionalQosFlowInformation();
virtual ~AdditionalQosFlowInformation(); virtual ~AdditionalQosFlowInformation();
void setAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation value); void setAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation value);
bool getAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation &value); bool getAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation &value);
bool encode2AdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *); bool encode2AdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t*);
bool decodefromAdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *); bool decodefromAdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t*);
private: private:
long additional; long additional;
}; };
} }
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AllocationAndRetentionPriority.hpp" #include "AllocationAndRetentionPriority.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AllocationAndRetentionPriority::AllocationAndRetentionPriority() //------------------------------------------------------------------------------
{ AllocationAndRetentionPriority::AllocationAndRetentionPriority() {
priorityLevelARP = NULL; priorityLevelARP = NULL;
pre_emptionCapability = NULL; pre_emptionCapability = NULL;
pre_emptionVulnerability = NULL; pre_emptionVulnerability = NULL;
} }
AllocationAndRetentionPriority::~AllocationAndRetentionPriority(){} //------------------------------------------------------------------------------
AllocationAndRetentionPriority::~AllocationAndRetentionPriority() {
void AllocationAndRetentionPriority::setAllocationAndRetentionPriority(PriorityLevelARP *m_priorityLevelARP,Pre_emptionCapability *m_pre_emptionCapability,Pre_emptionVulnerability *m_pre_emptionVulnerability) }
{
priorityLevelARP = m_priorityLevelARP; //------------------------------------------------------------------------------
pre_emptionCapability = m_pre_emptionCapability; void AllocationAndRetentionPriority::setAllocationAndRetentionPriority(PriorityLevelARP *m_priorityLevelARP, Pre_emptionCapability *m_pre_emptionCapability, Pre_emptionVulnerability *m_pre_emptionVulnerability) {
pre_emptionVulnerability = m_pre_emptionVulnerability; priorityLevelARP = m_priorityLevelARP;
} pre_emptionCapability = m_pre_emptionCapability;
bool AllocationAndRetentionPriority::getAllocationAndRetentionPriority(PriorityLevelARP *&m_priorityLevelARP,Pre_emptionCapability *&m_pre_emptionCapability,Pre_emptionVulnerability *&m_pre_emptionVulnerability) pre_emptionVulnerability = m_pre_emptionVulnerability;
{
if(!priorityLevelARP) return false;
m_priorityLevelARP = priorityLevelARP;
if(!pre_emptionCapability) return false;
m_pre_emptionCapability = pre_emptionCapability;
if(!pre_emptionVulnerability) return false;
m_pre_emptionVulnerability = pre_emptionVulnerability;
return true;
}
bool AllocationAndRetentionPriority::encode2AllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t *allocationAndRetentionPriority)
{
if(!priorityLevelARP->encode2PriorityLevelARP(&allocationAndRetentionPriority->priorityLevelARP)) return false;
if(!pre_emptionCapability->encode2Pre_emptionCapability(&allocationAndRetentionPriority->pre_emptionCapability)) return false;
if(!pre_emptionVulnerability->encode2Pre_emptionVulnerability(&allocationAndRetentionPriority->pre_emptionVulnerability)) return false;
return true;
}
bool AllocationAndRetentionPriority::decodefromAllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t *allocationAndRetentionPriority)
{
priorityLevelARP = new PriorityLevelARP();
pre_emptionCapability = new Pre_emptionCapability();
pre_emptionVulnerability = new Pre_emptionVulnerability();
if(!priorityLevelARP->decodefromPriorityLevelARP(&allocationAndRetentionPriority->priorityLevelARP)) return false;
if(!pre_emptionCapability->decodefromPre_emptionCapability(&allocationAndRetentionPriority->pre_emptionCapability)) return false;
if(!pre_emptionVulnerability->decodefromPre_emptionVulnerability(&allocationAndRetentionPriority->pre_emptionVulnerability)) return false;
return true;
}
} }
//------------------------------------------------------------------------------
bool AllocationAndRetentionPriority::getAllocationAndRetentionPriority(PriorityLevelARP *&m_priorityLevelARP, Pre_emptionCapability *&m_pre_emptionCapability, Pre_emptionVulnerability *&m_pre_emptionVulnerability) {
if (!priorityLevelARP)
return false;
m_priorityLevelARP = priorityLevelARP;
if (!pre_emptionCapability)
return false;
m_pre_emptionCapability = pre_emptionCapability;
if (!pre_emptionVulnerability)
return false;
m_pre_emptionVulnerability = pre_emptionVulnerability;
return true;
}
//------------------------------------------------------------------------------
bool AllocationAndRetentionPriority::encode2AllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t *allocationAndRetentionPriority) {
if (!priorityLevelARP->encode2PriorityLevelARP(&allocationAndRetentionPriority->priorityLevelARP))
return false;
if (!pre_emptionCapability->encode2Pre_emptionCapability(&allocationAndRetentionPriority->pre_emptionCapability))
return false;
if (!pre_emptionVulnerability->encode2Pre_emptionVulnerability(&allocationAndRetentionPriority->pre_emptionVulnerability))
return false;
return true;
}
//------------------------------------------------------------------------------
bool AllocationAndRetentionPriority::decodefromAllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t *allocationAndRetentionPriority) {
priorityLevelARP = new PriorityLevelARP();
pre_emptionCapability = new Pre_emptionCapability();
pre_emptionVulnerability = new Pre_emptionVulnerability();
if (!priorityLevelARP->decodefromPriorityLevelARP(&allocationAndRetentionPriority->priorityLevelARP))
return false;
if (!pre_emptionCapability->decodefromPre_emptionCapability(&allocationAndRetentionPriority->pre_emptionCapability))
return false;
if (!pre_emptionVulnerability->decodefromPre_emptionVulnerability(&allocationAndRetentionPriority->pre_emptionVulnerability))
return false;
return true;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _ALLOCATIONANDRETENTIONPRIORITY_H_ #ifndef _ALLOCATIONANDRETENTIONPRIORITY_H_
#define _ALLOCATIONANDRETENTIONPRIORITY_H_ #define _ALLOCATIONANDRETENTIONPRIORITY_H_
...@@ -5,27 +33,27 @@ ...@@ -5,27 +33,27 @@
#include "Pre-emptionCapability.hpp" #include "Pre-emptionCapability.hpp"
#include "Pre-emptionVulnerability.hpp" #include "Pre-emptionVulnerability.hpp"
extern "C"{ extern "C" {
#include "Ngap_AllocationAndRetentionPriority.h" #include "Ngap_AllocationAndRetentionPriority.h"
} }
namespace ngap{ namespace ngap {
class AllocationAndRetentionPriority{ class AllocationAndRetentionPriority {
public: public:
AllocationAndRetentionPriority(); AllocationAndRetentionPriority();
virtual ~AllocationAndRetentionPriority(); virtual ~AllocationAndRetentionPriority();
void setAllocationAndRetentionPriority(PriorityLevelARP *m_priorityLevelARP,Pre_emptionCapability *m_pre_emptionCapability,Pre_emptionVulnerability *m_pre_emptionVulnerability); void setAllocationAndRetentionPriority(PriorityLevelARP *m_priorityLevelARP, Pre_emptionCapability *m_pre_emptionCapability, Pre_emptionVulnerability *m_pre_emptionVulnerability);
bool getAllocationAndRetentionPriority(PriorityLevelARP *&m_priorityLevelARP,Pre_emptionCapability *&m_pre_emptionCapability,Pre_emptionVulnerability *&m_pre_emptionVulnerability); bool getAllocationAndRetentionPriority(PriorityLevelARP *&m_priorityLevelARP, Pre_emptionCapability *&m_pre_emptionCapability, Pre_emptionVulnerability *&m_pre_emptionVulnerability);
bool encode2AllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t *); bool encode2AllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t*);
bool decodefromAllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t *); bool decodefromAllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t*);
private: private:
PriorityLevelARP *priorityLevelARP; PriorityLevelARP *priorityLevelARP;
Pre_emptionCapability *pre_emptionCapability; Pre_emptionCapability *pre_emptionCapability;
Pre_emptionVulnerability *pre_emptionVulnerability; Pre_emptionVulnerability *pre_emptionVulnerability;
}; };
} }
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AllowedNssai.hpp" #include "AllowedNssai.hpp"
extern "C"{ extern "C" {
#include "Ngap_AllowedNSSAI-Item.h" #include "Ngap_AllowedNSSAI-Item.h"
// #include "Ngap_SliceSupportItem.h" // #include "Ngap_SliceSupportItem.h"
} }
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AllowedNSSAI::AllowedNSSAI()
{ //------------------------------------------------------------------------------
snssai = NULL; AllowedNSSAI::AllowedNSSAI() {
numofSnssai = 0; snssai = NULL;
} numofSnssai = 0;
AllowedNSSAI::~AllowedNSSAI(){} }
void AllowedNSSAI::setAllowedNSSAI(S_NSSAI * m_snssai, int m_numofsnssai) //------------------------------------------------------------------------------
{ AllowedNSSAI::~AllowedNSSAI() {
snssai = m_snssai; }
numofSnssai = m_numofsnssai;
} //------------------------------------------------------------------------------
bool AllowedNSSAI::getAllowedNSSAI(S_NSSAI * & m_snssai, int & m_numofsnssai) void AllowedNSSAI::setAllowedNSSAI(S_NSSAI *m_snssai, int m_numofsnssai) {
{ snssai = m_snssai;
m_snssai = snssai; numofSnssai = m_numofsnssai;
m_numofsnssai = numofSnssai; }
if(!snssai) return false; //------------------------------------------------------------------------------
if(!numofSnssai) return false; bool AllowedNSSAI::getAllowedNSSAI(S_NSSAI *&m_snssai, int &m_numofsnssai) {
m_snssai = snssai;
return true; m_numofsnssai = numofSnssai;
}
if (!snssai)
bool AllowedNSSAI::encode2AllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList) return false;
{ if (!numofSnssai)
cout<<"AllowedNSSAI::numOfSnssai "<<numofSnssai<<endl; return false;
for(int i=0;i<numofSnssai;i++)
{ return true;
Ngap_AllowedNSSAI_Item_t *allowednssaiitem = (Ngap_AllowedNSSAI_Item_t*)calloc(1,sizeof(Ngap_AllowedNSSAI_Item_t)); }
if(!allowednssaiitem) return false;
if(!snssai[i].encode2S_NSSAI(&allowednssaiitem->s_NSSAI)) return false; //------------------------------------------------------------------------------
if(ASN_SEQUENCE_ADD(&allowedNssaiList->list, allowednssaiitem) != 0) return false; bool AllowedNSSAI::encode2AllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList) {
} cout << "AllowedNSSAI::numOfSnssai " << numofSnssai << endl;
return true; for (int i = 0; i < numofSnssai; i++) {
} Ngap_AllowedNSSAI_Item_t *allowednssaiitem = (Ngap_AllowedNSSAI_Item_t*) calloc(1, sizeof(Ngap_AllowedNSSAI_Item_t));
bool AllowedNSSAI::decodefromAllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList) if (!allowednssaiitem)
{ return false;
numofSnssai = allowedNssaiList->list.count; if (!snssai[i].encode2S_NSSAI(&allowednssaiitem->s_NSSAI))
snssai = new S_NSSAI[numofSnssai](); return false;
for(int i=0;i<numofSnssai;i++) if (ASN_SEQUENCE_ADD(&allowedNssaiList->list, allowednssaiitem) != 0)
{ return false;
if(!snssai[i].decodefromS_NSSAI(&allowedNssaiList->list.array[i]->s_NSSAI)) return false; }
} return true;
return true; }
}
//------------------------------------------------------------------------------
} bool AllowedNSSAI::decodefromAllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList) {
numofSnssai = allowedNssaiList->list.count;
snssai = new S_NSSAI[numofSnssai]();
for (int i = 0; i < numofSnssai; i++) {
if (!snssai[i].decodefromS_NSSAI(&allowedNssaiList->list.array[i]->s_NSSAI))
return false;
}
return true;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _ALLOWEDNSSAI_H_ #ifndef _ALLOWEDNSSAI_H_
#define _ALLOWEDNSSAI_H_ #define _ALLOWEDNSSAI_H_
#include "S-NSSAI.hpp" #include "S-NSSAI.hpp"
extern "C"{ extern "C" {
#include "Ngap_AllowedNSSAI.h" #include "Ngap_AllowedNSSAI.h"
} }
namespace ngap{ namespace ngap {
class AllowedNSSAI{ class AllowedNSSAI {
public: public:
AllowedNSSAI(); AllowedNSSAI();
virtual ~AllowedNSSAI(); virtual ~AllowedNSSAI();
void setAllowedNSSAI(S_NSSAI * m_snssai, int m_numofsnssai); void setAllowedNSSAI(S_NSSAI *m_snssai, int m_numofsnssai);
bool getAllowedNSSAI(S_NSSAI * & m_snssai, int & m_numofsnssai); bool getAllowedNSSAI(S_NSSAI *&m_snssai, int &m_numofsnssai);
bool encode2AllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList); bool encode2AllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList);
bool decodefromAllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList); bool decodefromAllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList);
private: private:
S_NSSAI * snssai; S_NSSAI *snssai;
int numofSnssai; int numofSnssai;
}; };
} }
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AssociatedQosFlowItem.hpp" #include "AssociatedQosFlowItem.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AssociatedQosFlowItem::AssociatedQosFlowItem() //------------------------------------------------------------------------------
{ AssociatedQosFlowItem::AssociatedQosFlowItem() {
qosFlowIdentifier = NULL; qosFlowIdentifier = NULL;
qosFlowMappingIndication = -1; qosFlowMappingIndication = -1;
} }
AssociatedQosFlowItem::~AssociatedQosFlowItem(){} //------------------------------------------------------------------------------
AssociatedQosFlowItem::~AssociatedQosFlowItem() {
}
void AssociatedQosFlowItem::setAssociatedQosFlowItem(e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication m_qosFlowMappingIndication,QosFlowIdentifier *m_qosFlowIdentifier)
{ //------------------------------------------------------------------------------
qosFlowMappingIndication = m_qosFlowMappingIndication; void AssociatedQosFlowItem::setAssociatedQosFlowItem(e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication m_qosFlowMappingIndication, QosFlowIdentifier *m_qosFlowIdentifier) {
qosFlowIdentifier = m_qosFlowIdentifier; qosFlowMappingIndication = m_qosFlowMappingIndication;
} qosFlowIdentifier = m_qosFlowIdentifier;
void AssociatedQosFlowItem::setAssociatedQosFlowItem(QosFlowIdentifier *m_qosFlowIdentifier) }
{
qosFlowIdentifier = m_qosFlowIdentifier; //------------------------------------------------------------------------------
} void AssociatedQosFlowItem::setAssociatedQosFlowItem(QosFlowIdentifier *m_qosFlowIdentifier) {
bool AssociatedQosFlowItem::getAssociatedQosFlowItem(long &m_qosFlowMappingIndication,QosFlowIdentifier *&m_qosFlowIdentifier) qosFlowIdentifier = m_qosFlowIdentifier;
{ }
m_qosFlowMappingIndication = qosFlowMappingIndication;
m_qosFlowIdentifier = qosFlowIdentifier; //------------------------------------------------------------------------------
bool AssociatedQosFlowItem::getAssociatedQosFlowItem(long &m_qosFlowMappingIndication, QosFlowIdentifier *&m_qosFlowIdentifier) {
return true; m_qosFlowMappingIndication = qosFlowMappingIndication;
} m_qosFlowIdentifier = qosFlowIdentifier;
bool AssociatedQosFlowItem::encode2AssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem) return true;
{ }
if(qosFlowMappingIndication >= 0)
{ //------------------------------------------------------------------------------
associatedQosFlowItem->qosFlowMappingIndication = (long *)calloc(1,sizeof(long)); bool AssociatedQosFlowItem::encode2AssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem) {
*associatedQosFlowItem->qosFlowMappingIndication = qosFlowMappingIndication; if (qosFlowMappingIndication >= 0) {
} associatedQosFlowItem->qosFlowMappingIndication = (long*) calloc(1, sizeof(long));
if(!qosFlowIdentifier->encode2QosFlowIdentifier(&associatedQosFlowItem->qosFlowIdentifier)) return false; *associatedQosFlowItem->qosFlowMappingIndication = qosFlowMappingIndication;
}
return true; if (!qosFlowIdentifier->encode2QosFlowIdentifier(&associatedQosFlowItem->qosFlowIdentifier))
} return false;
bool AssociatedQosFlowItem::decodefromAssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem)
{
qosFlowIdentifier = new QosFlowIdentifier();
if(!qosFlowIdentifier->decodefromQosFlowIdentifier(&associatedQosFlowItem->qosFlowIdentifier)) return false;
if(associatedQosFlowItem->qosFlowMappingIndication)
{
qosFlowMappingIndication = *associatedQosFlowItem->qosFlowMappingIndication;
}
return true;
}
return true;
} }
//------------------------------------------------------------------------------
bool AssociatedQosFlowItem::decodefromAssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem) {
qosFlowIdentifier = new QosFlowIdentifier();
if (!qosFlowIdentifier->decodefromQosFlowIdentifier(&associatedQosFlowItem->qosFlowIdentifier))
return false;
if (associatedQosFlowItem->qosFlowMappingIndication) {
qosFlowMappingIndication = *associatedQosFlowItem->qosFlowMappingIndication;
}
return true;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _ASSOCIATEDQOSFLOWITEM_H_ #ifndef _ASSOCIATEDQOSFLOWITEM_H_
#define _ASSOCIATEDQOSFLOWITEM_H_ #define _ASSOCIATEDQOSFLOWITEM_H_
#include "QosFlowIdentifier.hpp" #include "QosFlowIdentifier.hpp"
extern "C"{ extern "C" {
#include "Ngap_AssociatedQosFlowItem.h" #include "Ngap_AssociatedQosFlowItem.h"
} }
namespace ngap{ namespace ngap {
class AssociatedQosFlowItem{ class AssociatedQosFlowItem {
public: public:
AssociatedQosFlowItem(); AssociatedQosFlowItem();
virtual ~AssociatedQosFlowItem(); virtual ~AssociatedQosFlowItem();
void setAssociatedQosFlowItem(e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication m_qosFlowMappingIndication,QosFlowIdentifier *m_qosFlowIdentifier); void setAssociatedQosFlowItem(e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication m_qosFlowMappingIndication, QosFlowIdentifier *m_qosFlowIdentifier);
void setAssociatedQosFlowItem(QosFlowIdentifier *m_qosFlowIdentifier); void setAssociatedQosFlowItem(QosFlowIdentifier *m_qosFlowIdentifier);
bool getAssociatedQosFlowItem(long &m_qosFlowMappingIndication,QosFlowIdentifier *&m_qosFlowIdentifier); bool getAssociatedQosFlowItem(long &m_qosFlowMappingIndication, QosFlowIdentifier *&m_qosFlowIdentifier);
bool encode2AssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem); bool encode2AssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem);
bool decodefromAssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem); bool decodefromAssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem);
private: private:
QosFlowIdentifier *qosFlowIdentifier; QosFlowIdentifier *qosFlowIdentifier;
long qosFlowMappingIndication; long qosFlowMappingIndication;
}; };
} }
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AssociatedQosFlowList.hpp" #include "AssociatedQosFlowList.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AssociatedQosFlowList::AssociatedQosFlowList() //------------------------------------------------------------------------------
{ AssociatedQosFlowList::AssociatedQosFlowList() {
associatedQosFlowItem = NULL; associatedQosFlowItem = NULL;
numofassociatedQosFlowItem = 0; numofassociatedQosFlowItem = 0;
} }
AssociatedQosFlowList::~AssociatedQosFlowList(){} //------------------------------------------------------------------------------
AssociatedQosFlowList::~AssociatedQosFlowList() {
}
void AssociatedQosFlowList::setAssociatedQosFlowList(AssociatedQosFlowItem *m_associatedQosFlowItem,int numofitem)
{ //------------------------------------------------------------------------------
associatedQosFlowItem = m_associatedQosFlowItem; void AssociatedQosFlowList::setAssociatedQosFlowList(AssociatedQosFlowItem *m_associatedQosFlowItem, int numofitem) {
numofassociatedQosFlowItem = numofitem; associatedQosFlowItem = m_associatedQosFlowItem;
} numofassociatedQosFlowItem = numofitem;
bool AssociatedQosFlowList::getAssociatedQosFlowList(AssociatedQosFlowItem *&m_associatedQosFlowItem,int &numofitem) }
{
m_associatedQosFlowItem = associatedQosFlowItem; //------------------------------------------------------------------------------
numofitem = numofassociatedQosFlowItem; bool AssociatedQosFlowList::getAssociatedQosFlowList(AssociatedQosFlowItem *&m_associatedQosFlowItem, int &numofitem) {
m_associatedQosFlowItem = associatedQosFlowItem;
return true; numofitem = numofassociatedQosFlowItem;
}
return true;
bool AssociatedQosFlowList::encode2AssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList) }
{
for(int i=0;i<numofassociatedQosFlowItem;i++) //------------------------------------------------------------------------------
{ bool AssociatedQosFlowList::encode2AssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList) {
Ngap_AssociatedQosFlowItem_t *ie = (Ngap_AssociatedQosFlowItem_t *)calloc(1,sizeof(Ngap_AssociatedQosFlowItem_t)); for (int i = 0; i < numofassociatedQosFlowItem; i++) {
if(!ie) return false; Ngap_AssociatedQosFlowItem_t *ie = (Ngap_AssociatedQosFlowItem_t*) calloc(1, sizeof(Ngap_AssociatedQosFlowItem_t));
if(!associatedQosFlowItem[i].encode2AssociatedQosFlowItem(ie)) return false; if (!ie)
if(ASN_SEQUENCE_ADD(&associatedQosFlowList.list, ie) != 0) return false; return false;
} if (!associatedQosFlowItem[i].encode2AssociatedQosFlowItem(ie))
return false;
return true; if (ASN_SEQUENCE_ADD(&associatedQosFlowList.list, ie) != 0)
} return false;
bool AssociatedQosFlowList::decodefromAssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList) }
{
numofassociatedQosFlowItem = associatedQosFlowList.list.count;
associatedQosFlowItem = new AssociatedQosFlowItem[numofassociatedQosFlowItem]();
for(int i=0;i<numofassociatedQosFlowItem;i++)
{
if(!associatedQosFlowItem[i].decodefromAssociatedQosFlowItem(associatedQosFlowList.list.array[i])) return false;
}
return true;
}
return true;
} }
//------------------------------------------------------------------------------
bool AssociatedQosFlowList::decodefromAssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList) {
numofassociatedQosFlowItem = associatedQosFlowList.list.count;
associatedQosFlowItem = new AssociatedQosFlowItem[numofassociatedQosFlowItem]();
for (int i = 0; i < numofassociatedQosFlowItem; i++) {
if (!associatedQosFlowItem[i].decodefromAssociatedQosFlowItem(associatedQosFlowList.list.array[i]))
return false;
}
return true;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _ASSOCIATEDQOSFLOWLIST_H_ #ifndef _ASSOCIATEDQOSFLOWLIST_H_
#define _ASSOCIATEDQOSFLOWLIST_H_ #define _ASSOCIATEDQOSFLOWLIST_H_
#include "AssociatedQosFlowItem.hpp" #include "AssociatedQosFlowItem.hpp"
extern "C"{ extern "C" {
#include "Ngap_AssociatedQosFlowList.h" #include "Ngap_AssociatedQosFlowList.h"
} }
namespace ngap{ namespace ngap {
class AssociatedQosFlowList{ class AssociatedQosFlowList {
public: public:
AssociatedQosFlowList(); AssociatedQosFlowList();
virtual ~AssociatedQosFlowList(); virtual ~AssociatedQosFlowList();
void setAssociatedQosFlowList(AssociatedQosFlowItem *m_associatedQosFlowItem,int numofitem); void setAssociatedQosFlowList(AssociatedQosFlowItem *m_associatedQosFlowItem, int numofitem);
bool getAssociatedQosFlowList(AssociatedQosFlowItem *&m_associatedQosFlowItem,int &numofitem); bool getAssociatedQosFlowList(AssociatedQosFlowItem *&m_associatedQosFlowItem, int &numofitem);
bool encode2AssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList); bool encode2AssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList);
bool decodefromAssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList); bool decodefromAssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList);
private: private:
AssociatedQosFlowItem *associatedQosFlowItem; AssociatedQosFlowItem *associatedQosFlowItem;
int numofassociatedQosFlowItem; int numofassociatedQosFlowItem;
}; };
} }
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AveragingWindow.hpp" #include "AveragingWindow.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
AveragingWindow::AveragingWindow(){}
//------------------------------------------------------------------------------
AveragingWindow::~AveragingWindow(){} AveragingWindow::AveragingWindow() {
}
void AveragingWindow::setAveragingWindow(long value)
{ //------------------------------------------------------------------------------
averagingwindow = value; AveragingWindow::~AveragingWindow() {
} }
bool AveragingWindow::getAveragingWindow(long &value)
{ //------------------------------------------------------------------------------
value = averagingwindow; void AveragingWindow::setAveragingWindow(long value) {
averagingwindow = value;
return true; }
}
//------------------------------------------------------------------------------
bool AveragingWindow::encode2AveragingWindow(Ngap_AveragingWindow_t *averagingWindow) bool AveragingWindow::getAveragingWindow(long &value) {
{ value = averagingwindow;
*averagingWindow = averagingwindow;
return true;
return true; }
}
bool AveragingWindow::decodefromAveragingWindow(Ngap_AveragingWindow_t *averagingWindow) //------------------------------------------------------------------------------
{ bool AveragingWindow::encode2AveragingWindow(Ngap_AveragingWindow_t *averagingWindow) {
averagingwindow = *averagingWindow; *averagingWindow = averagingwindow;
return true; return true;
} }
//------------------------------------------------------------------------------
bool AveragingWindow::decodefromAveragingWindow(Ngap_AveragingWindow_t *averagingWindow) {
averagingwindow = *averagingWindow;
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AVERAGINGWINDOW_H_ #ifndef _AVERAGINGWINDOW_H_
#define _AVERAGINGWINDOW_H_ #define _AVERAGINGWINDOW_H_
extern "C"{ extern "C" {
#include "Ngap_AveragingWindow.h" #include "Ngap_AveragingWindow.h"
} }
namespace ngap{ namespace ngap {
class AveragingWindow{ class AveragingWindow {
public: public:
AveragingWindow(); AveragingWindow();
virtual ~AveragingWindow(); virtual ~AveragingWindow();
void setAveragingWindow(long value); void setAveragingWindow(long value);
bool getAveragingWindow(long &value); bool getAveragingWindow(long &value);
bool encode2AveragingWindow(Ngap_AveragingWindow_t *); bool encode2AveragingWindow(Ngap_AveragingWindow_t*);
bool decodefromAveragingWindow(Ngap_AveragingWindow_t *); bool decodefromAveragingWindow(Ngap_AveragingWindow_t*);
private: private:
long averagingwindow; long averagingwindow;
}; };
} }
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "BroadcastPLMNItem.hpp" #include "BroadcastPLMNItem.hpp"
#include "S-NSSAI.hpp" #include "S-NSSAI.hpp"
#include "PlmnId.hpp" #include "PlmnId.hpp"
extern "C"{ extern "C" {
#include "Ngap_BroadcastPLMNList.h" #include "Ngap_BroadcastPLMNList.h"
#include "Ngap_SliceSupportItem.h" #include "Ngap_SliceSupportItem.h"
} }
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
BroadcastPLMNItem::BroadcastPLMNItem()
{ //------------------------------------------------------------------------------
plmn = NULL; BroadcastPLMNItem::BroadcastPLMNItem() {
snssai = NULL; plmn = NULL;
numOfSnssai = 0; snssai = NULL;
} numOfSnssai = 0;
BroadcastPLMNItem::~BroadcastPLMNItem(){} }
void BroadcastPLMNItem::setPlmnSliceSupportList(PlmnId * m_plmn, S_NSSAI * m_snssai, int num) //------------------------------------------------------------------------------
{ BroadcastPLMNItem::~BroadcastPLMNItem() {
plmn = m_plmn; }
snssai = m_snssai;
numOfSnssai = num; //------------------------------------------------------------------------------
} void BroadcastPLMNItem::setPlmnSliceSupportList(PlmnId *m_plmn, S_NSSAI *m_snssai, int num) {
void BroadcastPLMNItem::getPlmnSliceSupportList(PlmnId * & m_plmn, S_NSSAI * & m_snssai, int & snssainum) plmn = m_plmn;
{ snssai = m_snssai;
m_plmn = plmn; numOfSnssai = num;
m_snssai = snssai; }
snssainum = numOfSnssai;
} //------------------------------------------------------------------------------
void BroadcastPLMNItem::getPlmnSliceSupportList(PlmnId *&m_plmn, S_NSSAI *&m_snssai, int &snssainum) {
bool BroadcastPLMNItem::encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t * plmnItem) m_plmn = plmn;
{ m_snssai = snssai;
if(!plmn->encode2octetstring(plmnItem->pLMNIdentity)) return false; snssainum = numOfSnssai;
cout<<"BroadcastPLMNItem::numOfSnssai "<<numOfSnssai<<endl; }
for(int i=0;i<numOfSnssai;i++)
{ //------------------------------------------------------------------------------
Ngap_SliceSupportItem_t *slice = (Ngap_SliceSupportItem_t*)calloc(1,sizeof(Ngap_SliceSupportItem_t)); bool BroadcastPLMNItem::encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t *plmnItem) {
if(!slice) return false; if (!plmn->encode2octetstring(plmnItem->pLMNIdentity))
if(!snssai[i].encode2S_NSSAI(&slice->s_NSSAI)) return false; return false;
if(ASN_SEQUENCE_ADD(&plmnItem->tAISliceSupportList.list, slice) != 0) return false; cout << "BroadcastPLMNItem::numOfSnssai " << numOfSnssai << endl;
} for (int i = 0; i < numOfSnssai; i++) {
return true; Ngap_SliceSupportItem_t *slice = (Ngap_SliceSupportItem_t*) calloc(1, sizeof(Ngap_SliceSupportItem_t));
} if (!slice)
bool BroadcastPLMNItem::decodefromBroadcastPLMNItem(Ngap_BroadcastPLMNItem_t * pdu) return false;
{ if (!snssai[i].encode2S_NSSAI(&slice->s_NSSAI))
plmn = new PlmnId(); return false;
if(!plmn->decodefromoctetstring(pdu->pLMNIdentity)) return false; if (ASN_SEQUENCE_ADD(&plmnItem->tAISliceSupportList.list, slice) != 0)
numOfSnssai = pdu->tAISliceSupportList.list.count; return false;
snssai = new S_NSSAI[numOfSnssai](); }
for(int i=0;i<numOfSnssai;i++) return true;
{ }
if(!snssai[i].decodefromS_NSSAI(&pdu->tAISliceSupportList.list.array[i]->s_NSSAI)) return false;
} //------------------------------------------------------------------------------
return true; bool BroadcastPLMNItem::decodefromBroadcastPLMNItem(Ngap_BroadcastPLMNItem_t *pdu) {
} plmn = new PlmnId();
if (!plmn->decodefromoctetstring(pdu->pLMNIdentity))
return false;
numOfSnssai = pdu->tAISliceSupportList.list.count;
snssai = new S_NSSAI[numOfSnssai]();
for (int i = 0; i < numOfSnssai; i++) {
if (!snssai[i].decodefromS_NSSAI(&pdu->tAISliceSupportList.list.array[i]->s_NSSAI))
return false;
}
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _BroadcastPLMNItem_H #ifndef _BroadcastPLMNItem_H
#define _BroadcastPLMNItem_H #define _BroadcastPLMNItem_H
#include "PlmnId.hpp" #include "PlmnId.hpp"
#include "S-NSSAI.hpp" #include "S-NSSAI.hpp"
extern "C"{ extern "C" {
#include "Ngap_BroadcastPLMNItem.h" #include "Ngap_BroadcastPLMNItem.h"
} }
namespace ngap{ namespace ngap {
class BroadcastPLMNItem {
public:
BroadcastPLMNItem();
virtual ~BroadcastPLMNItem();
class BroadcastPLMNItem{ void setPlmnSliceSupportList(PlmnId *m_plmn, S_NSSAI *snssai, int num);
public: void getPlmnSliceSupportList(PlmnId *&m_plmn, S_NSSAI *&m_snssai, int &snssainum);
BroadcastPLMNItem(); bool encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t*);
virtual ~BroadcastPLMNItem(); bool decodefromBroadcastPLMNItem(Ngap_BroadcastPLMNItem_t *pdu);
private:
void setPlmnSliceSupportList(PlmnId * m_plmn, S_NSSAI * snssai, int num); PlmnId *plmn;
void getPlmnSliceSupportList(PlmnId * & m_plmn, S_NSSAI * & m_snssai, int & snssainum); S_NSSAI *snssai;
bool encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t *); int numOfSnssai;
bool decodefromBroadcastPLMNItem( Ngap_BroadcastPLMNItem_t * pdu); };
private:
PlmnId *plmn;
S_NSSAI * snssai;
int numOfSnssai;
};
} }
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Cause.hpp" #include "Cause.hpp"
#include<iostream> #include<iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
Cause::Cause() //------------------------------------------------------------------------------
{ Cause::Cause() {
causeValue = -1; causeValue = -1;
} }
Cause::~Cause(){}
//------------------------------------------------------------------------------
Cause::~Cause() {
}
void Cause::setChoiceOfCause(Ngap_Cause_PR m_causePresent) //------------------------------------------------------------------------------
{ void Cause::setChoiceOfCause(Ngap_Cause_PR m_causePresent) {
causePresent = m_causePresent; causePresent = m_causePresent;
} }
void Cause::setValue(long m_causeValue) //------------------------------------------------------------------------------
{ void Cause::setValue(long m_causeValue) {
causeValue = m_causeValue; causeValue = m_causeValue;
} }
bool Cause::encode2Cause(Ngap_Cause_t *cause) //------------------------------------------------------------------------------
{ bool Cause::encode2Cause(Ngap_Cause_t *cause) {
cause->present = causePresent; cause->present = causePresent;
switch(causePresent) switch (causePresent) {
{ case Ngap_Cause_PR_radioNetwork: {
case Ngap_Cause_PR_radioNetwork:{ cause->choice.radioNetwork = causeValue;
cause->choice.radioNetwork = causeValue; break;
break;} }
case Ngap_Cause_PR_transport:{ case Ngap_Cause_PR_transport: {
cause->choice.transport = causeValue; cause->choice.transport = causeValue;
break;} break;
case Ngap_Cause_PR_nas:{ }
cause->choice.nas = causeValue; case Ngap_Cause_PR_nas: {
break;} cause->choice.nas = causeValue;
case Ngap_Cause_PR_protocol:{ break;
cause->choice.protocol = causeValue; }
break;} case Ngap_Cause_PR_protocol: {
case Ngap_Cause_PR_misc:{ cause->choice.protocol = causeValue;
cause->choice.misc = causeValue; break;
break;} }
default:{ case Ngap_Cause_PR_misc: {
cout<<"[Warning] Cause Present error!"<<endl; cause->choice.misc = causeValue;
return false; break;
break;} }
} default: {
return true; cout << "[Warning] Cause Present error!" << endl;
} return false;
break;
bool Cause::decodefromCause(Ngap_Cause_t * pdu) }
{ }
causePresent = pdu->present; return true;
switch(causePresent) }
{
case Ngap_Cause_PR_radioNetwork:{ //------------------------------------------------------------------------------
causeValue = pdu->choice.radioNetwork; bool Cause::decodefromCause(Ngap_Cause_t *pdu) {
}break; causePresent = pdu->present;
case Ngap_Cause_PR_transport:{ switch (causePresent) {
causeValue = pdu->choice.transport; case Ngap_Cause_PR_radioNetwork: {
}break; causeValue = pdu->choice.radioNetwork;
case Ngap_Cause_PR_nas:{ }
causeValue = pdu->choice.nas; break;
}break; case Ngap_Cause_PR_transport: {
case Ngap_Cause_PR_protocol:{ causeValue = pdu->choice.transport;
causeValue = pdu->choice.protocol; }
}break; break;
case Ngap_Cause_PR_misc:{ case Ngap_Cause_PR_nas: {
causeValue = pdu->choice.misc; causeValue = pdu->choice.nas;
}break; }
default:{ break;
cout<<"[Warning] Cause Present error!"<<endl; case Ngap_Cause_PR_protocol: {
return false; causeValue = pdu->choice.protocol;
} }
} break;
return true; case Ngap_Cause_PR_misc: {
} causeValue = pdu->choice.misc;
Ngap_Cause_PR Cause::getChoiceOfCause() }
{ break;
return causePresent; default: {
} cout << "[Warning] Cause Present error!" << endl;
long Cause::getValue() return false;
{ }
return causeValue; }
} return true;
}
//------------------------------------------------------------------------------
Ngap_Cause_PR Cause::getChoiceOfCause() {
return causePresent;
}
//------------------------------------------------------------------------------
long Cause::getValue() {
return causeValue;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _CAUSE_H_ #ifndef _CAUSE_H_
#define _CAUSE_H_ #define _CAUSE_H_
extern "C"{ extern "C" {
#include "Ngap_Cause.h" #include "Ngap_Cause.h"
} }
namespace ngap{ namespace ngap {
class Cause {
public:
Cause();
virtual ~Cause();
class Cause{ bool encode2Cause(Ngap_Cause_t *cause);
public: bool decodefromCause(Ngap_Cause_t *pdu);
Cause(); void setChoiceOfCause(Ngap_Cause_PR m_causePresent);
virtual ~Cause(); Ngap_Cause_PR getChoiceOfCause();
void setValue(long);
bool encode2Cause(Ngap_Cause_t *cause); long getValue();
bool decodefromCause(Ngap_Cause_t * pdu); private:
void setChoiceOfCause(Ngap_Cause_PR m_causePresent); long causeValue;
Ngap_Cause_PR getChoiceOfCause(); Ngap_Cause_PR causePresent;
void setValue(long); };
long getValue();
private:
long causeValue;
Ngap_Cause_PR causePresent;
};
} }
#endif #endif
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "ConfidentialityProtectionIndication.hpp" #include "ConfidentialityProtectionIndication.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
ConfidentialityProtectionIndication::ConfidentialityProtectionIndication(){} //------------------------------------------------------------------------------
ConfidentialityProtectionIndication::ConfidentialityProtectionIndication() {
ConfidentialityProtectionIndication::~ConfidentialityProtectionIndication(){} }
void ConfidentialityProtectionIndication::setConfidentialityProtectionIndication(e_Ngap_ConfidentialityProtectionIndication m_indication) //------------------------------------------------------------------------------
{ ConfidentialityProtectionIndication::~ConfidentialityProtectionIndication() {
indication = m_indication; }
}
bool ConfidentialityProtectionIndication::getConfidentialityProtectionIndication(long &m_indication) //------------------------------------------------------------------------------
{ void ConfidentialityProtectionIndication::setConfidentialityProtectionIndication(e_Ngap_ConfidentialityProtectionIndication m_indication) {
m_indication = indication; indication = m_indication;
}
return true;
} //------------------------------------------------------------------------------
bool ConfidentialityProtectionIndication::getConfidentialityProtectionIndication(long &m_indication) {
bool ConfidentialityProtectionIndication::encode2ConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t &confidentialityProtectionIndication) m_indication = indication;
{
confidentialityProtectionIndication = indication; return true;
}
return true;
} //------------------------------------------------------------------------------
bool ConfidentialityProtectionIndication::decodefromConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t confidentialityProtectionIndication) bool ConfidentialityProtectionIndication::encode2ConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t &confidentialityProtectionIndication) {
{ confidentialityProtectionIndication = indication;
indication = confidentialityProtectionIndication;
return true;
return true; }
}
//------------------------------------------------------------------------------
bool ConfidentialityProtectionIndication::decodefromConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t confidentialityProtectionIndication) {
indication = confidentialityProtectionIndication;
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _CONFIDENTIALITYPROTECTIONINDICATION_H_ #ifndef _CONFIDENTIALITYPROTECTIONINDICATION_H_
#define _CONFIDENTIALITYPROTECTIONINDICATION_H_ #define _CONFIDENTIALITYPROTECTIONINDICATION_H_
extern "C"{ extern "C" {
#include "Ngap_ConfidentialityProtectionIndication.h" #include "Ngap_ConfidentialityProtectionIndication.h"
} }
namespace ngap{ namespace ngap {
class ConfidentialityProtectionIndication{ class ConfidentialityProtectionIndication {
public: public:
ConfidentialityProtectionIndication(); ConfidentialityProtectionIndication();
virtual ~ConfidentialityProtectionIndication(); virtual ~ConfidentialityProtectionIndication();
void setConfidentialityProtectionIndication(e_Ngap_ConfidentialityProtectionIndication m_indication); void setConfidentialityProtectionIndication(e_Ngap_ConfidentialityProtectionIndication m_indication);
bool getConfidentialityProtectionIndication(long &m_indication); bool getConfidentialityProtectionIndication(long &m_indication);
bool encode2ConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t &); bool encode2ConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t&);
bool decodefromConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t ); bool decodefromConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t);
private: private:
long indication; long indication;
}; };
} }
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "ConfidentialityProtectionResult.hpp" #include "ConfidentialityProtectionResult.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
ConfidentialityProtectionResult::ConfidentialityProtectionResult() //------------------------------------------------------------------------------
{ ConfidentialityProtectionResult::ConfidentialityProtectionResult() {
confidentialityProtectionResult = -1; confidentialityProtectionResult = -1;
} }
ConfidentialityProtectionResult::~ConfidentialityProtectionResult(){} //------------------------------------------------------------------------------
ConfidentialityProtectionResult::~ConfidentialityProtectionResult() {
void ConfidentialityProtectionResult::setConfidentialityProtectionResult(e_Ngap_ConfidentialityProtectionResult m_confidentialityProtectionResult) }
{
confidentialityProtectionResult = m_confidentialityProtectionResult; //------------------------------------------------------------------------------
} void ConfidentialityProtectionResult::setConfidentialityProtectionResult(e_Ngap_ConfidentialityProtectionResult m_confidentialityProtectionResult) {
bool ConfidentialityProtectionResult::getConfidentialityProtectionResult(long &m_confidentialityProtectionResult) confidentialityProtectionResult = m_confidentialityProtectionResult;
{ }
m_confidentialityProtectionResult = confidentialityProtectionResult;
//------------------------------------------------------------------------------
return true; bool ConfidentialityProtectionResult::getConfidentialityProtectionResult(long &m_confidentialityProtectionResult) {
} m_confidentialityProtectionResult = confidentialityProtectionResult;
bool ConfidentialityProtectionResult::encode2ConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t &confidentialityProtectionResultValue) return true;
{ }
confidentialityProtectionResultValue = confidentialityProtectionResult;
//------------------------------------------------------------------------------
return true; bool ConfidentialityProtectionResult::encode2ConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t &confidentialityProtectionResultValue) {
} confidentialityProtectionResultValue = confidentialityProtectionResult;
bool ConfidentialityProtectionResult::decodefromConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t confidentialityProtectionResultValue)
{ return true;
confidentialityProtectionResult = confidentialityProtectionResultValue;
return true;
}
} }
//------------------------------------------------------------------------------
bool ConfidentialityProtectionResult::decodefromConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t confidentialityProtectionResultValue) {
confidentialityProtectionResult = confidentialityProtectionResultValue;
return true;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _CONFIDENTIALITYPROTECTIONRESULT_H_ #ifndef _CONFIDENTIALITYPROTECTIONRESULT_H_
#define _CONFIDENTIALITYPROTECTIONRESULT_H_ #define _CONFIDENTIALITYPROTECTIONRESULT_H_
extern "C"{ extern "C" {
#include "Ngap_ConfidentialityProtectionResult.h" #include "Ngap_ConfidentialityProtectionResult.h"
} }
namespace ngap{ namespace ngap {
class ConfidentialityProtectionResult{ class ConfidentialityProtectionResult {
public: public:
ConfidentialityProtectionResult(); ConfidentialityProtectionResult();
virtual ~ConfidentialityProtectionResult(); virtual ~ConfidentialityProtectionResult();
void setConfidentialityProtectionResult(e_Ngap_ConfidentialityProtectionResult m_confidentialityProtectionResult); void setConfidentialityProtectionResult(e_Ngap_ConfidentialityProtectionResult m_confidentialityProtectionResult);
bool getConfidentialityProtectionResult(long &m_confidentialityProtectionResult); bool getConfidentialityProtectionResult(long &m_confidentialityProtectionResult);
bool encode2ConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t &); bool encode2ConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t&);
bool decodefromConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t); bool decodefromConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t);
private: private:
long confidentialityProtectionResult; long confidentialityProtectionResult;
}; };
} }
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _CORENETWORKASSISTANCEINFORMATION_H_ #ifndef _CORENETWORKASSISTANCEINFORMATION_H_
#define _CORENETWORKASSISTANCEINFORMATION_H_ #define _CORENETWORKASSISTANCEINFORMATION_H_
...@@ -7,30 +35,30 @@ ...@@ -7,30 +35,30 @@
#include "MICOModeIndication.hpp" #include "MICOModeIndication.hpp"
#include "TAI.hpp" #include "TAI.hpp"
extern "C"{ extern "C" {
#include "Ngap_CoreNetworkAssistanceInformation.h" #include "Ngap_CoreNetworkAssistanceInformation.h"
} }
namespace ngap{ namespace ngap {
class CoreNetworkAssistanceInfo{ class CoreNetworkAssistanceInfo {
public: public:
CoreNetworkAssistanceInfo(); CoreNetworkAssistanceInfo();
virtual ~CoreNetworkAssistanceInfo(); virtual ~CoreNetworkAssistanceInfo();
void setCoreNetworkAssistanceInfo(UEIdentityIndexValue *m_ueIdentityIndexValue, DefaultPagingDRX *m_pagingDRX, PeriodicRegistrationUpdateTimer *m_periodicRegUpdateTimer, bool m_micoModeInd, TAI *m_tai,int m_numoftai); void setCoreNetworkAssistanceInfo(UEIdentityIndexValue *m_ueIdentityIndexValue, DefaultPagingDRX *m_pagingDRX, PeriodicRegistrationUpdateTimer *m_periodicRegUpdateTimer, bool m_micoModeInd, TAI *m_tai, int m_numoftai);
void setCoreNetworkAssistanceInfo(UEIdentityIndexValue *m_ueIdentityIndexValue, PeriodicRegistrationUpdateTimer *m_periodicRegUpdateTimer, bool m_micoModeInd, TAI *m_tai,int m_numoftai); void setCoreNetworkAssistanceInfo(UEIdentityIndexValue *m_ueIdentityIndexValue, PeriodicRegistrationUpdateTimer *m_periodicRegUpdateTimer, bool m_micoModeInd, TAI *m_tai, int m_numoftai);
void getCoreNetworkAssistanceInfo(UEIdentityIndexValue *&m_ueIdentityIndexValue, DefaultPagingDRX *&m_pagingDRX, PeriodicRegistrationUpdateTimer *&m_periodicRegUpdateTimer, bool &m_micoModeInd, TAI *&m_tai,int &m_numoftai); void getCoreNetworkAssistanceInfo(UEIdentityIndexValue *&m_ueIdentityIndexValue, DefaultPagingDRX *&m_pagingDRX, PeriodicRegistrationUpdateTimer *&m_periodicRegUpdateTimer, bool &m_micoModeInd, TAI *&m_tai, int &m_numoftai);
bool encode2CoreNetworkAssistanceInfo(Ngap_CoreNetworkAssistanceInformation_t *coreNetworkAssistanceInformation); bool encode2CoreNetworkAssistanceInfo(Ngap_CoreNetworkAssistanceInformation_t *coreNetworkAssistanceInformation);
bool decodefromCoreNetworkAssistanceInfo(Ngap_CoreNetworkAssistanceInformation_t *coreNetworkAssistanceInformation); bool decodefromCoreNetworkAssistanceInfo(Ngap_CoreNetworkAssistanceInformation_t *coreNetworkAssistanceInformation);
private: private:
UEIdentityIndexValue *ueIdentityIndexValue; UEIdentityIndexValue *ueIdentityIndexValue;
DefaultPagingDRX *pagingDRX; DefaultPagingDRX *pagingDRX;
PeriodicRegistrationUpdateTimer *periodicRegUpdateTimer; PeriodicRegistrationUpdateTimer *periodicRegUpdateTimer;
MICOModeIndication *micoModeInd; MICOModeIndication *micoModeInd;
TAI *tai; TAI *tai;
int numoftai; int numoftai;
}; };
} }
......
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _CRITICALITYDIAGNOSTICS_H_ #ifndef _CRITICALITYDIAGNOSTICS_H_
#define _CRITICALITYDIAGNOSTICS_H_ #define _CRITICALITYDIAGNOSTICS_H_
#include "IEsCriticalityDiagnostics.hpp" #include "IEsCriticalityDiagnostics.hpp"
extern "C"{ extern "C" {
#include "Ngap_NGSetupFailure.h" #include "Ngap_NGSetupFailure.h"
#include "Ngap_ProtocolIE-Field.h" #include "Ngap_ProtocolIE-Field.h"
#include "Ngap_CriticalityDiagnostics.h" #include "Ngap_CriticalityDiagnostics.h"
#include "Ngap_CriticalityDiagnostics-IE-List.h" #include "Ngap_CriticalityDiagnostics-IE-List.h"
} }
namespace ngap{ namespace ngap {
class CriticalityDiagnostics{ class CriticalityDiagnostics {
public: public:
CriticalityDiagnostics(); CriticalityDiagnostics();
virtual ~CriticalityDiagnostics(); virtual ~CriticalityDiagnostics();
int encode2pdu(Ngap_NGSetupFailure_t *); int encode2pdu(Ngap_NGSetupFailure_t*);
bool decodefrompdu(Ngap_CriticalityDiagnostics_t *); bool decodefrompdu(Ngap_CriticalityDiagnostics_t*);
void setProcedureCodeValue(Ngap_ProcedureCode_t); void setProcedureCodeValue(Ngap_ProcedureCode_t);
void setTriggeringMessageValue(Ngap_TriggeringMessage_t); void setTriggeringMessageValue(Ngap_TriggeringMessage_t);
void setCriticalityValue(Ngap_Criticality_t); void setCriticalityValue(Ngap_Criticality_t);
void setIEsCriticalityDiagnosticsList(IEsCriticalityDiagnostics *m_iEsCriticalityDiagnostics,int num); void setIEsCriticalityDiagnosticsList(IEsCriticalityDiagnostics *m_iEsCriticalityDiagnostics, int num);
bool getProcedureCodeValue(Ngap_ProcedureCode_t&); bool getProcedureCodeValue(Ngap_ProcedureCode_t&);
bool getTriggeringMessageValue(Ngap_TriggeringMessage_t&); bool getTriggeringMessageValue(Ngap_TriggeringMessage_t&);
bool getCriticalityValue(Ngap_Criticality_t&); bool getCriticalityValue(Ngap_Criticality_t&);
bool getIEsCriticalityDiagnosticsList(IEsCriticalityDiagnostics* &m_iEsCriticalityDiagnostics,int &num); bool getIEsCriticalityDiagnosticsList(IEsCriticalityDiagnostics *&m_iEsCriticalityDiagnostics, int &num);
private: private:
Ngap_ProcedureCode_t procedureCode; /* OPTIONAL */ Ngap_ProcedureCode_t procedureCode; /* OPTIONAL */
Ngap_TriggeringMessage_t triggeringMessage; /* OPTIONAL */ Ngap_TriggeringMessage_t triggeringMessage; /* OPTIONAL */
Ngap_Criticality_t procedureCriticality; /* OPTIONAL */ Ngap_Criticality_t procedureCriticality; /* OPTIONAL */
//Ngap_CriticalityDiagnostics_IE_List_t iEsCriticalityDiagnostics; /* OPTIONAL */ //Ngap_CriticalityDiagnostics_IE_List_t iEsCriticalityDiagnostics; /* OPTIONAL */
IEsCriticalityDiagnostics *iEsCriticalityDiagnostics; IEsCriticalityDiagnostics *iEsCriticalityDiagnostics;
bool procedureCodeIsSet; bool procedureCodeIsSet;
bool triggeringMessageIsSet; bool triggeringMessageIsSet;
bool procedureCriticalityIsSet; bool procedureCriticalityIsSet;
int numberOfIEsCriticalityDiagnostics; int numberOfIEsCriticalityDiagnostics;
}; };
} }
#endif #endif
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "DLQoSFlowPerTNLInformation.hpp" #include "DLQoSFlowPerTNLInformation.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
DLQoSFlowPerTNLInformation::DLQoSFlowPerTNLInformation() //------------------------------------------------------------------------------
{ DLQoSFlowPerTNLInformation::DLQoSFlowPerTNLInformation() {
uPTransportLayerInformation = NULL; uPTransportLayerInformation = NULL;
associatedQosFlowList = NULL; associatedQosFlowList = NULL;
} }
DLQoSFlowPerTNLInformation::~DLQoSFlowPerTNLInformation(){} //------------------------------------------------------------------------------
DLQoSFlowPerTNLInformation::~DLQoSFlowPerTNLInformation() {
}
void DLQoSFlowPerTNLInformation::setDLQoSFlowPerTNLInformation(UpTransportLayerInformation *m_uPTransportLayerInformation, AssociatedQosFlowList *m_associatedQosFlowList)
{ //------------------------------------------------------------------------------
uPTransportLayerInformation = m_uPTransportLayerInformation; void DLQoSFlowPerTNLInformation::setDLQoSFlowPerTNLInformation(UpTransportLayerInformation *m_uPTransportLayerInformation, AssociatedQosFlowList *m_associatedQosFlowList) {
associatedQosFlowList = m_associatedQosFlowList; uPTransportLayerInformation = m_uPTransportLayerInformation;
} associatedQosFlowList = m_associatedQosFlowList;
bool DLQoSFlowPerTNLInformation::getDLQoSFlowPerTNLInformation(UpTransportLayerInformation *&m_uPTransportLayerInformation, AssociatedQosFlowList *&m_associatedQosFlowList) }
{
m_uPTransportLayerInformation = uPTransportLayerInformation; //------------------------------------------------------------------------------
m_associatedQosFlowList = associatedQosFlowList; bool DLQoSFlowPerTNLInformation::getDLQoSFlowPerTNLInformation(UpTransportLayerInformation *&m_uPTransportLayerInformation, AssociatedQosFlowList *&m_associatedQosFlowList) {
m_uPTransportLayerInformation = uPTransportLayerInformation;
return true; m_associatedQosFlowList = associatedQosFlowList;
}
bool DLQoSFlowPerTNLInformation::encode2DLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation)
{
if(!uPTransportLayerInformation->encode2UpTransportLayerInformation(qosFlowPerTNLInformation->uPTransportLayerInformation)) return false;
if(!associatedQosFlowList->encode2AssociatedQosFlowList(qosFlowPerTNLInformation->associatedQosFlowList)) return false;
return true;
}
bool DLQoSFlowPerTNLInformation::decodefromDLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation)
{
uPTransportLayerInformation = new UpTransportLayerInformation();
associatedQosFlowList = new AssociatedQosFlowList();
if(!uPTransportLayerInformation->decodefromUpTransportLayerInformation(qosFlowPerTNLInformation->uPTransportLayerInformation)) return false;
if(!associatedQosFlowList->decodefromAssociatedQosFlowList(qosFlowPerTNLInformation->associatedQosFlowList)) return false;
return true;
}
return true;
} }
//------------------------------------------------------------------------------
bool DLQoSFlowPerTNLInformation::encode2DLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation) {
if (!uPTransportLayerInformation->encode2UpTransportLayerInformation(qosFlowPerTNLInformation->uPTransportLayerInformation))
return false;
if (!associatedQosFlowList->encode2AssociatedQosFlowList(qosFlowPerTNLInformation->associatedQosFlowList))
return false;
return true;
}
//------------------------------------------------------------------------------
bool DLQoSFlowPerTNLInformation::decodefromDLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation) {
uPTransportLayerInformation = new UpTransportLayerInformation();
associatedQosFlowList = new AssociatedQosFlowList();
if (!uPTransportLayerInformation->decodefromUpTransportLayerInformation(qosFlowPerTNLInformation->uPTransportLayerInformation))
return false;
if (!associatedQosFlowList->decodefromAssociatedQosFlowList(qosFlowPerTNLInformation->associatedQosFlowList))
return false;
return true;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _DLQOSFLOWPERTNLINFORMATION_H_ #ifndef _DLQOSFLOWPERTNLINFORMATION_H_
#define _DLQOSFLOWPERTNLINFORMATION_H_ #define _DLQOSFLOWPERTNLINFORMATION_H_
#include "UPTransportLayerInformation.hpp" #include "UPTransportLayerInformation.hpp"
#include "AssociatedQosFlowList.hpp" #include "AssociatedQosFlowList.hpp"
extern "C"{ extern "C" {
#include "Ngap_QosFlowPerTNLInformation.h" #include "Ngap_QosFlowPerTNLInformation.h"
} }
namespace ngap{ namespace ngap {
class DLQoSFlowPerTNLInformation{ class DLQoSFlowPerTNLInformation {
public: public:
DLQoSFlowPerTNLInformation(); DLQoSFlowPerTNLInformation();
virtual ~DLQoSFlowPerTNLInformation(); virtual ~DLQoSFlowPerTNLInformation();
void setDLQoSFlowPerTNLInformation(UpTransportLayerInformation *m_uPTransportLayerInformation, AssociatedQosFlowList *m_associatedQosFlowList); void setDLQoSFlowPerTNLInformation(UpTransportLayerInformation *m_uPTransportLayerInformation, AssociatedQosFlowList *m_associatedQosFlowList);
bool getDLQoSFlowPerTNLInformation(UpTransportLayerInformation *&m_uPTransportLayerInformation, AssociatedQosFlowList *&m_associatedQosFlowList); bool getDLQoSFlowPerTNLInformation(UpTransportLayerInformation *&m_uPTransportLayerInformation, AssociatedQosFlowList *&m_associatedQosFlowList);
bool encode2DLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation); bool encode2DLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation);
bool decodefromDLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation); bool decodefromDLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation);
private: private:
UpTransportLayerInformation *uPTransportLayerInformation; UpTransportLayerInformation *uPTransportLayerInformation;
AssociatedQosFlowList *associatedQosFlowList; AssociatedQosFlowList *associatedQosFlowList;
}; };
} }
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "DataForwardingNotPossible.hpp" #include "DataForwardingNotPossible.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
DataForwardingNotPossible::DataForwardingNotPossible(){} //------------------------------------------------------------------------------
DataForwardingNotPossible::DataForwardingNotPossible() {
}
DataForwardingNotPossible::~DataForwardingNotPossible(){} //------------------------------------------------------------------------------
DataForwardingNotPossible::~DataForwardingNotPossible() {
#if 0 }
//------------------------------------------------------------------------------
#if 0
void DataForwardingNotPossible::setDataForwardingNotPossible(const uint32_t m_gtp_teid) void DataForwardingNotPossible::setDataForwardingNotPossible(const uint32_t m_gtp_teid)
{ {
gtp_teid = m_gtp_teid; gtp_teid = m_gtp_teid;
...@@ -21,22 +54,21 @@ namespace ngap{ ...@@ -21,22 +54,21 @@ namespace ngap{
return true; return true;
} }
#endif #endif
bool DataForwardingNotPossible::encode2DataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible)
{
dataForwardingNotPossible = Ngap_DataForwardingNotPossible_data_forwarding_not_possible;
return true; //------------------------------------------------------------------------------
} bool DataForwardingNotPossible::encode2DataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible) {
bool DataForwardingNotPossible::decodefromDataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible) dataForwardingNotPossible = Ngap_DataForwardingNotPossible_data_forwarding_not_possible;
{
if(dataForwardingNotPossible != Ngap_DataForwardingNotPossible_data_forwarding_not_possible) return false;
return true;
}
return true;
} }
//------------------------------------------------------------------------------
bool DataForwardingNotPossible::decodefromDataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible) {
if (dataForwardingNotPossible != Ngap_DataForwardingNotPossible_data_forwarding_not_possible)
return false;
return true;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _DATAFORWARDINGNOTPOSSIBLE_H_ #ifndef _DATAFORWARDINGNOTPOSSIBLE_H_
#define _DATAFORWARDINGNOTPOSSIBLE_H_ #define _DATAFORWARDINGNOTPOSSIBLE_H_
extern "C"{ extern "C" {
#include "Ngap_DataForwardingNotPossible.h" #include "Ngap_DataForwardingNotPossible.h"
} }
namespace ngap{ namespace ngap {
class DataForwardingNotPossible{ class DataForwardingNotPossible {
public: public:
DataForwardingNotPossible(); DataForwardingNotPossible();
virtual ~DataForwardingNotPossible(); virtual ~DataForwardingNotPossible();
//void setDataForwardingNotPossible(const bool m_gtp_teid); //void setDataForwardingNotPossible(const bool m_gtp_teid);
//bool getDataForwardingNotPossible(uint32_t &m_gtp_teid); //bool getDataForwardingNotPossible(uint32_t &m_gtp_teid);
bool encode2DataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible); bool encode2DataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible);
bool decodefromDataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible); bool decodefromDataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible);
}; };
} }
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "DefaultPagingDRX.hpp" #include "DefaultPagingDRX.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
DefaultPagingDRX::DefaultPagingDRX(){}
DefaultPagingDRX::~DefaultPagingDRX(){} //------------------------------------------------------------------------------
DefaultPagingDRX::DefaultPagingDRX() {
void DefaultPagingDRX::setValue(e_Ngap_PagingDRX m_pagingDrx) }
{
pagingDrx = m_pagingDrx; //------------------------------------------------------------------------------
} DefaultPagingDRX::~DefaultPagingDRX() {
bool DefaultPagingDRX::encode2DefaultPagingDRX(Ngap_PagingDRX_t & pagingdrx) }
{
pagingdrx = pagingDrx; //------------------------------------------------------------------------------
return true; void DefaultPagingDRX::setValue(e_Ngap_PagingDRX m_pagingDrx) {
} pagingDrx = m_pagingDrx;
}
bool DefaultPagingDRX::decodefromDefaultPagingDRX(Ngap_PagingDRX_t &pagingdrx)
{ //------------------------------------------------------------------------------
pagingDrx = pagingdrx; bool DefaultPagingDRX::encode2DefaultPagingDRX(Ngap_PagingDRX_t &pagingdrx) {
return true; pagingdrx = pagingDrx;
} return true;
int DefaultPagingDRX::getValue() }
{
return pagingDrx; //------------------------------------------------------------------------------
} bool DefaultPagingDRX::decodefromDefaultPagingDRX(Ngap_PagingDRX_t &pagingdrx) {
pagingDrx = pagingdrx;
return true;
}
//------------------------------------------------------------------------------
int DefaultPagingDRX::getValue() {
return pagingDrx;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _DEFAULT_PAGING_DRX_H_ #ifndef _DEFAULT_PAGING_DRX_H_
#define _DEFAULT_PAGING_DRX_H_ #define _DEFAULT_PAGING_DRX_H_
extern "C"{ extern "C" {
#include "Ngap_PagingDRX.h" #include "Ngap_PagingDRX.h"
}
namespace ngap{
class DefaultPagingDRX{
public:
DefaultPagingDRX();
virtual ~DefaultPagingDRX();
void setValue(e_Ngap_PagingDRX m_pagingDrx);
int getValue();
bool encode2DefaultPagingDRX(Ngap_PagingDRX_t &);
bool decodefromDefaultPagingDRX(Ngap_PagingDRX_t &);
private:
int pagingDrx;
};
} }
namespace ngap {
class DefaultPagingDRX {
public:
DefaultPagingDRX();
virtual ~DefaultPagingDRX();
void setValue(e_Ngap_PagingDRX m_pagingDrx);
int getValue();
bool encode2DefaultPagingDRX(Ngap_PagingDRX_t&);
bool decodefromDefaultPagingDRX(Ngap_PagingDRX_t&);
private:
int pagingDrx;
};
}
#endif #endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "DelayCritical.hpp" #include "DelayCritical.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
DelayCritical::DelayCritical(){} //------------------------------------------------------------------------------
DelayCritical::DelayCritical() {
DelayCritical::~DelayCritical(){} }
void DelayCritical::setDelayCritical(e_Ngap_DelayCritical value) //------------------------------------------------------------------------------
{ DelayCritical::~DelayCritical() {
delaycritical = value; }
}
bool DelayCritical::getDelayCritical(e_Ngap_DelayCritical &value) //------------------------------------------------------------------------------
{ void DelayCritical::setDelayCritical(e_Ngap_DelayCritical value) {
if((delaycritical>=0) && (delaycritical<=1)) delaycritical = value;
value = (e_Ngap_DelayCritical)delaycritical; }
else
false; //------------------------------------------------------------------------------
bool DelayCritical::getDelayCritical(e_Ngap_DelayCritical &value) {
return true; if ((delaycritical >= 0) && (delaycritical <= 1))
} value = (e_Ngap_DelayCritical) delaycritical;
else
bool DelayCritical::encode2DelayCritical(Ngap_DelayCritical_t *delayCritical) false;
{
*delayCritical = delaycritical; return true;
}
return true;
} //------------------------------------------------------------------------------
bool DelayCritical::decodefromDelayCritical(Ngap_DelayCritical_t *delayCritical) bool DelayCritical::encode2DelayCritical(Ngap_DelayCritical_t *delayCritical) {
{ *delayCritical = delaycritical;
delaycritical = *delayCritical;
return true;
return true; }
}
//------------------------------------------------------------------------------
bool DelayCritical::decodefromDelayCritical(Ngap_DelayCritical_t *delayCritical) {
delaycritical = *delayCritical;
return true;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _DELAYCRITICAL_H_ #ifndef _DELAYCRITICAL_H_
#define _DELAYCRITICAL_H_ #define _DELAYCRITICAL_H_
extern "C"{ extern "C" {
#include "Ngap_DelayCritical.h" #include "Ngap_DelayCritical.h"
} }
namespace ngap{ namespace ngap {
class DelayCritical{ class DelayCritical {
public: public:
DelayCritical(); DelayCritical();
virtual ~DelayCritical(); virtual ~DelayCritical();
void setDelayCritical(e_Ngap_DelayCritical value); void setDelayCritical(e_Ngap_DelayCritical value);
bool getDelayCritical(e_Ngap_DelayCritical &value); bool getDelayCritical(e_Ngap_DelayCritical &value);
bool encode2DelayCritical(Ngap_DelayCritical_t *); bool encode2DelayCritical(Ngap_DelayCritical_t*);
bool decodefromDelayCritical(Ngap_DelayCritical_t *); bool decodefromDelayCritical(Ngap_DelayCritical_t*);
private: private:
long delaycritical; long delaycritical;
}; };
} }
#endif #endif
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _DYNAMIC5QIDESCRIPTOR_H_ #ifndef _DYNAMIC5QIDESCRIPTOR_H_
#define _DYNAMIC5QIDESCRIPTOR_H_ #define _DYNAMIC5QIDESCRIPTOR_H_
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "EUTRA-CGI.hpp" #include "EUTRA-CGI.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
EUTRA_CGI::EUTRA_CGI()
{ //------------------------------------------------------------------------------
plmnId = NULL; EUTRA_CGI::EUTRA_CGI() {
eUTRACellIdentity = NULL; plmnId = NULL;
} eUTRACellIdentity = NULL;
EUTRA_CGI::~EUTRA_CGI(){} }
void EUTRA_CGI::setEUTRA_CGI(PlmnId* m_plmnId,EUTRACellIdentity* m_eUTRACellIdentity) //------------------------------------------------------------------------------
{ EUTRA_CGI::~EUTRA_CGI() {
plmnId = m_plmnId; }
eUTRACellIdentity = m_eUTRACellIdentity;
} //------------------------------------------------------------------------------
bool EUTRA_CGI::encode2EUTRA_CGI(Ngap_EUTRA_CGI_t *eutra_cgi) void EUTRA_CGI::setEUTRA_CGI(PlmnId *m_plmnId, EUTRACellIdentity *m_eUTRACellIdentity) {
{ plmnId = m_plmnId;
if(!plmnId->encode2octetstring(eutra_cgi->pLMNIdentity)) return false; eUTRACellIdentity = m_eUTRACellIdentity;
if(!eUTRACellIdentity->encode2bitstring(eutra_cgi->eUTRACellIdentity)) return false; }
return true; //------------------------------------------------------------------------------
} bool EUTRA_CGI::encode2EUTRA_CGI(Ngap_EUTRA_CGI_t *eutra_cgi) {
bool EUTRA_CGI::decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t *eutra_cgi) if (!plmnId->encode2octetstring(eutra_cgi->pLMNIdentity))
{ return false;
plmnId = new PlmnId(); if (!eUTRACellIdentity->encode2bitstring(eutra_cgi->eUTRACellIdentity))
eUTRACellIdentity = new EUTRACellIdentity(); return false;
if(!plmnId->decodefromoctetstring(eutra_cgi->pLMNIdentity)) return false;
if(!eUTRACellIdentity->decodefrombitstring(eutra_cgi->eUTRACellIdentity)) return false; return true;
}
return true;
} //------------------------------------------------------------------------------
void EUTRA_CGI::getEUTRA_CGI(PlmnId* &m_plmnId,EUTRACellIdentity* &m_eUTRACellIdentity) bool EUTRA_CGI::decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t *eutra_cgi) {
{ plmnId = new PlmnId();
m_plmnId = plmnId; eUTRACellIdentity = new EUTRACellIdentity();
m_eUTRACellIdentity = eUTRACellIdentity; if (!plmnId->decodefromoctetstring(eutra_cgi->pLMNIdentity))
} return false;
if (!eUTRACellIdentity->decodefrombitstring(eutra_cgi->eUTRACellIdentity))
return false;
return true;
}
//------------------------------------------------------------------------------
void EUTRA_CGI::getEUTRA_CGI(PlmnId *&m_plmnId, EUTRACellIdentity *&m_eUTRACellIdentity) {
m_plmnId = plmnId;
m_eUTRACellIdentity = eUTRACellIdentity;
}
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _EUTRA_CGI_H_ #ifndef _EUTRA_CGI_H_
#define _EUTRA_CGI_H_ #define _EUTRA_CGI_H_
#include "PlmnId.hpp" #include "PlmnId.hpp"
#include "EUTRACellIdentity.hpp" #include "EUTRACellIdentity.hpp"
extern "C"{ extern "C" {
#include "Ngap_EUTRA-CGI.h" #include "Ngap_EUTRA-CGI.h"
} }
namespace ngap{ namespace ngap {
class EUTRA_CGI{
public:
EUTRA_CGI();
virtual ~EUTRA_CGI();
void setEUTRA_CGI(PlmnId*,EUTRACellIdentity*);
bool encode2EUTRA_CGI(Ngap_EUTRA_CGI_t *);
bool decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t *);
void getEUTRA_CGI(PlmnId* &,EUTRACellIdentity* &);
private:
PlmnId *plmnId;
EUTRACellIdentity *eUTRACellIdentity;
};
}
class EUTRA_CGI {
public:
EUTRA_CGI();
virtual ~EUTRA_CGI();
void setEUTRA_CGI(PlmnId*, EUTRACellIdentity*);
bool encode2EUTRA_CGI(Ngap_EUTRA_CGI_t*);
bool decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t*);
void getEUTRA_CGI(PlmnId*&, EUTRACellIdentity*&);
private:
PlmnId *plmnId;
EUTRACellIdentity *eUTRACellIdentity;
};
}
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment