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 <iostream>
using namespace std;
namespace ngap{
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)
{
amfUeNgapId = m_amfUeNgapId;
}
unsigned long AMF_UE_NGAP_ID::getAMF_UE_NGAP_ID()
{
return amfUeNgapId;
}
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;
}
namespace ngap {
//------------------------------------------------------------------------------
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) {
amfUeNgapId = m_amfUeNgapId;
}
//------------------------------------------------------------------------------
unsigned long AMF_UE_NGAP_ID::getAMF_UE_NGAP_ID() {
return amfUeNgapId;
}
//------------------------------------------------------------------------------
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_
#define _AMF_UE_NGAP_ID_H_
extern "C"{
#include "Ngap_AMF-UE-NGAP-ID.h"
extern "C" {
#include "Ngap_AMF-UE-NGAP-ID.h"
}
namespace ngap{
class AMF_UE_NGAP_ID{
public:
AMF_UE_NGAP_ID();
virtual ~AMF_UE_NGAP_ID();
void setAMF_UE_NGAP_ID(unsigned long);
unsigned long getAMF_UE_NGAP_ID();
bool encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t &);
bool decodefromAMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t &);
private:
unsigned long amfUeNgapId;
namespace ngap {
class AMF_UE_NGAP_ID {
public:
AMF_UE_NGAP_ID();
virtual ~AMF_UE_NGAP_ID();
void setAMF_UE_NGAP_ID(unsigned long);
unsigned long getAMF_UE_NGAP_ID();
bool encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t&);
bool decodefromAMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t&);
private:
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"
extern "C"{
#include "OCTET_STRING.h"
extern "C" {
#include "OCTET_STRING.h"
}
#include <iostream>
using namespace std;
namespace ngap{
AmfName::AmfName()
{
amfname = NULL;
}
AmfName::~AmfName()
{
free(amfname);
amfname = NULL;
}
void AmfName::setValue(const std::string m_amfName)
{
if(amfname)
{
free(amfname);
amfname = NULL;
}
amfname = (char *)calloc(1,m_amfName.size()+1);
memcpy(amfname, m_amfName.c_str(), m_amfName.size());
amfname[m_amfName.size()] = '\0';
}
void AmfName::getValue(std::string &m_amfName)
{
m_amfName = amfname;
}
bool AmfName::encode2AmfName(Ngap_AMFName_t *amfNameIe)
{
if(OCTET_STRING_fromBuf (amfNameIe, amfname, strlen(amfname)) < 0) return false;
return true;
}
bool AmfName::decodefromAmfName(Ngap_AMFName_t * pdu)
{
if(!pdu->buf) return false;
amfname = (char *)pdu->buf;
return true;
}
namespace ngap {
//------------------------------------------------------------------------------
AmfName::AmfName() {
amfname = NULL;
}
//------------------------------------------------------------------------------
AmfName::~AmfName() {
free(amfname);
amfname = NULL;
}
//------------------------------------------------------------------------------
void AmfName::setValue(const std::string m_amfName) {
if (amfname) {
free(amfname);
amfname = NULL;
}
amfname = (char*) calloc(1, m_amfName.size() + 1);
memcpy(amfname, m_amfName.c_str(), m_amfName.size());
amfname[m_amfName.size()] = '\0';
}
//------------------------------------------------------------------------------
void AmfName::getValue(std::string &m_amfName) {
m_amfName = amfname;
}
//------------------------------------------------------------------------------
bool AmfName::encode2AmfName(Ngap_AMFName_t *amfNameIe) {
if (OCTET_STRING_fromBuf(amfNameIe, amfname, strlen(amfname)) < 0)
return false;
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_
#define _AMFNAME_H_
#include <string>
extern "C"{
#include "Ngap_AMFName.h"
extern "C" {
#include "Ngap_AMFName.h"
}
namespace ngap{
class AmfName{
public:
AmfName();
virtual ~AmfName();
bool encode2AmfName(Ngap_AMFName_t *);
bool decodefromAmfName(Ngap_AMFName_t *);
void setValue(const std::string m_amfName);
void getValue(std::string &);
private:
char* amfname;
};
namespace ngap {
class AmfName {
public:
AmfName();
virtual ~AmfName();
bool encode2AmfName(Ngap_AMFName_t*);
bool decodefromAmfName(Ngap_AMFName_t*);
void setValue(const std::string m_amfName);
void getValue(std::string&);
private:
char *amfname;
};
}
#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 "String2Value.hpp"
#include <iostream>
using namespace std;
namespace ngap{
AMFPointer::AMFPointer(){}
AMFPointer::~AMFPointer(){}
void AMFPointer::setAMFPointer(const std::string charPointer)
{
pointer = fromString<int>(charPointer);
}
void AMFPointer::getAMFPointer(std::string &charPointer)
{
charPointer = to_string(pointer);
}
bool AMFPointer::encode2bitstring(Ngap_AMFPointer_t &amfpointer)
{
amfpointer.size = 1;
uint8_t *buffer = (uint8_t *)calloc(1,sizeof(uint8_t));
if(!buffer) return false;
*buffer =((pointer & 0x3f)<<2);
amfpointer.buf = buffer;
amfpointer.bits_unused = 2;
return true;
}
bool AMFPointer::decodefrombitstring(Ngap_AMFPointer_t &amfpointer)
{
if(!amfpointer.buf) return false;
pointer = (amfpointer.buf[0] & 0xfc)>>2;//1111 1100
return true;
}
namespace ngap {
//------------------------------------------------------------------------------
AMFPointer::AMFPointer() {
}
//------------------------------------------------------------------------------
AMFPointer::~AMFPointer() {
}
//------------------------------------------------------------------------------
void AMFPointer::setAMFPointer(const std::string charPointer) {
pointer = fromString<int>(charPointer);
}
//------------------------------------------------------------------------------
void AMFPointer::getAMFPointer(std::string &charPointer) {
charPointer = to_string(pointer);
}
//------------------------------------------------------------------------------
bool AMFPointer::encode2bitstring(Ngap_AMFPointer_t &amfpointer) {
amfpointer.size = 1;
uint8_t *buffer = (uint8_t*) calloc(1, sizeof(uint8_t));
if (!buffer)
return false;
*buffer = ((pointer & 0x3f) << 2);
amfpointer.buf = buffer;
amfpointer.bits_unused = 2;
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_
#define _AMFPOINTER_H_
#include <string>
extern "C"{
#include "Ngap_AMFPointer.h"
extern "C" {
#include "Ngap_AMFPointer.h"
}
namespace ngap{
class AMFPointer{
public:
AMFPointer();
virtual ~AMFPointer();
void setAMFPointer(const std::string);
void getAMFPointer(std::string &);
bool encode2bitstring(Ngap_AMFPointer_t &);
bool decodefrombitstring(Ngap_AMFPointer_t &);
private:
uint8_t pointer;
namespace ngap {
class AMFPointer {
public:
AMFPointer();
virtual ~AMFPointer();
void setAMFPointer(const std::string);
void getAMFPointer(std::string&);
bool encode2bitstring(Ngap_AMFPointer_t&);
bool decodefrombitstring(Ngap_AMFPointer_t&);
private:
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 "String2Value.hpp"
#include <iostream>
using namespace std;
namespace ngap{
AMFRegionID::AMFRegionID(){}
AMFRegionID::~AMFRegionID(){}
void AMFRegionID::setAMFRegionID(const std::string charid)
{
regionid = fromString<int>(charid);
}
void AMFRegionID::getAMFRegionID(std::string & charid)
{
charid = to_string(regionid);
}
bool AMFRegionID::encode2bitstring(Ngap_AMFRegionID_t &amfregionid)
{
amfregionid.size = 1;
uint8_t *buffer = (uint8_t *)calloc(1,sizeof(uint8_t));
if(!buffer) return false;
*buffer = regionid;
amfregionid.buf = buffer;
amfregionid.bits_unused = 0;
return true;
}
bool AMFRegionID::decodefrombitstring(Ngap_AMFRegionID_t &amfregionid)
{
if(!amfregionid.buf) return false;
regionid = *amfregionid.buf;
return true;
}
namespace ngap {
//------------------------------------------------------------------------------
AMFRegionID::AMFRegionID() {
}
//------------------------------------------------------------------------------
AMFRegionID::~AMFRegionID() {
}
//------------------------------------------------------------------------------
void AMFRegionID::setAMFRegionID(const std::string charid) {
regionid = fromString<int>(charid);
}
//------------------------------------------------------------------------------
void AMFRegionID::getAMFRegionID(std::string &charid) {
charid = to_string(regionid);
}
//------------------------------------------------------------------------------
bool AMFRegionID::encode2bitstring(Ngap_AMFRegionID_t &amfregionid) {
amfregionid.size = 1;
uint8_t *buffer = (uint8_t*) calloc(1, sizeof(uint8_t));
if (!buffer)
return false;
*buffer = regionid;
amfregionid.buf = buffer;
amfregionid.bits_unused = 0;
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_
#define _AMFREGIONID_H_
#include <string>
extern "C"{
#include "Ngap_AMFRegionID.h"
extern "C" {
#include "Ngap_AMFRegionID.h"
}
namespace ngap{
class AMFRegionID{
public:
AMFRegionID();
virtual ~AMFRegionID();
void setAMFRegionID(const std::string );
void getAMFRegionID(std::string &);
bool encode2bitstring(Ngap_AMFRegionID_t &);
bool decodefrombitstring(Ngap_AMFRegionID_t &);
private:
uint8_t regionid;
namespace ngap {
class AMFRegionID {
public:
AMFRegionID();
virtual ~AMFRegionID();
void setAMFRegionID(const std::string);
void getAMFRegionID(std::string&);
bool encode2bitstring(Ngap_AMFRegionID_t&);
bool decodefrombitstring(Ngap_AMFRegionID_t&);
private:
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 "String2Value.hpp"
#include <iostream>
using namespace std;
namespace ngap{
AMFSetID::AMFSetID(){}
AMFSetID::~AMFSetID(){}
void AMFSetID::setAMFSetID(const std::string charid)
{
setid = fromString<uint16_t>(charid);
}
void AMFSetID::getAMFSetID(std::string &charid)
{
charid = to_string(setid);
}
bool AMFSetID::encode2bitstring(Ngap_AMFSetID_t &amfsetid)
{
amfsetid.size = 2;
uint8_t *buffer = (uint8_t *)calloc(1,sizeof(uint16_t));
if(!buffer) return false;
//*(uint16_t *)buffer = setid & 0x3ff;
buffer[0] = ((setid & 0x03fc)>>2);
buffer[1] = ((setid & 0x0003)<<6);
amfsetid.buf = buffer;
amfsetid.bits_unused = 6;
return true;
}
bool AMFSetID::decodefrombitstring(Ngap_AMFSetID_t &amfsetid)
{
if(!amfsetid.buf) return false;
printf("test for amfsetid\n");
for(int i=0; i<amfsetid.size; i++){
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;
}
namespace ngap {
//------------------------------------------------------------------------------
AMFSetID::AMFSetID() {
}
//------------------------------------------------------------------------------
AMFSetID::~AMFSetID() {
}
//------------------------------------------------------------------------------
void AMFSetID::setAMFSetID(const std::string charid) {
setid = fromString<uint16_t>(charid);
}
//------------------------------------------------------------------------------
void AMFSetID::getAMFSetID(std::string &charid) {
charid = to_string(setid);
}
//------------------------------------------------------------------------------
bool AMFSetID::encode2bitstring(Ngap_AMFSetID_t &amfsetid) {
amfsetid.size = 2;
uint8_t *buffer = (uint8_t*) calloc(1, sizeof(uint16_t));
if (!buffer)
return false;
//*(uint16_t *)buffer = setid & 0x3ff;
buffer[0] = ((setid & 0x03fc) >> 2);
buffer[1] = ((setid & 0x0003) << 6);
amfsetid.buf = buffer;
amfsetid.bits_unused = 6;
return true;
}
//------------------------------------------------------------------------------
bool AMFSetID::decodefrombitstring(Ngap_AMFSetID_t &amfsetid) {
if (!amfsetid.buf)
return false;
printf("test for amfsetid\n");
for (int i = 0; i < amfsetid.size; i++) {
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_
#define _AMFSETID_H_
#include <string>
extern "C"{
#include "Ngap_AMFSetID.h"
extern "C" {
#include "Ngap_AMFSetID.h"
}
namespace ngap{
class AMFSetID{
public:
AMFSetID();
virtual ~AMFSetID();
void setAMFSetID(const std::string);
void getAMFSetID(std::string &);
bool encode2bitstring(Ngap_AMFSetID_t &);
bool decodefrombitstring(Ngap_AMFSetID_t &);
private:
uint16_t setid;
namespace ngap {
class AMFSetID {
public:
AMFSetID();
virtual ~AMFSetID();
void setAMFSetID(const std::string);
void getAMFSetID(std::string&);
bool encode2bitstring(Ngap_AMFSetID_t&);
bool decodefrombitstring(Ngap_AMFSetID_t&);
private:
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 <iostream>
using namespace std;
namespace ngap{
AdditionalQosFlowInformation::AdditionalQosFlowInformation(){}
AdditionalQosFlowInformation::~AdditionalQosFlowInformation(){}
void AdditionalQosFlowInformation::setAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation value)
{
additional = value;
}
bool AdditionalQosFlowInformation::getAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation &value)
{
if(additional == Ngap_AdditionalQosFlowInformation_more_likely)
value = (e_Ngap_AdditionalQosFlowInformation)additional;
else
return false;
return true;
}
bool AdditionalQosFlowInformation::encode2AdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *additionalQosFlowInfo)
{
*additionalQosFlowInfo = additional;
return true;
}
bool AdditionalQosFlowInformation::decodefromAdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *additionalQosFlowInfo)
{
additional = *additionalQosFlowInfo;
return true;
}
namespace ngap {
//------------------------------------------------------------------------------
AdditionalQosFlowInformation::AdditionalQosFlowInformation() {
}
//------------------------------------------------------------------------------
AdditionalQosFlowInformation::~AdditionalQosFlowInformation() {
}
//------------------------------------------------------------------------------
void AdditionalQosFlowInformation::setAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation value) {
additional = value;
}
//------------------------------------------------------------------------------
bool AdditionalQosFlowInformation::getAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation &value) {
if (additional == Ngap_AdditionalQosFlowInformation_more_likely)
value = (e_Ngap_AdditionalQosFlowInformation) additional;
else
return false;
return true;
}
//------------------------------------------------------------------------------
bool AdditionalQosFlowInformation::encode2AdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *additionalQosFlowInfo) {
*additionalQosFlowInfo = additional;
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_
#define _ADDITIONALQOSFLOWINFORMATION_H_
extern "C"{
#include "Ngap_AdditionalQosFlowInformation.h"
extern "C" {
#include "Ngap_AdditionalQosFlowInformation.h"
}
namespace ngap{
class AdditionalQosFlowInformation{
public:
AdditionalQosFlowInformation();
virtual ~AdditionalQosFlowInformation();
void setAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation value);
bool getAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation &value);
bool encode2AdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *);
bool decodefromAdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t *);
private:
long additional;
};
namespace ngap {
class AdditionalQosFlowInformation {
public:
AdditionalQosFlowInformation();
virtual ~AdditionalQosFlowInformation();
void setAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation value);
bool getAdditionalQosFlowInformation(e_Ngap_AdditionalQosFlowInformation &value);
bool encode2AdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t*);
bool decodefromAdditionalQosFlowInformation(Ngap_AdditionalQosFlowInformation_t*);
private:
long additional;
};
}
#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 <iostream>
using namespace std;
namespace ngap{
AllocationAndRetentionPriority::AllocationAndRetentionPriority()
{
priorityLevelARP = NULL;
pre_emptionCapability = NULL;
pre_emptionVulnerability = NULL;
}
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;
pre_emptionVulnerability = m_pre_emptionVulnerability;
}
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;
}
namespace ngap {
//------------------------------------------------------------------------------
AllocationAndRetentionPriority::AllocationAndRetentionPriority() {
priorityLevelARP = NULL;
pre_emptionCapability = NULL;
pre_emptionVulnerability = NULL;
}
//------------------------------------------------------------------------------
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;
pre_emptionVulnerability = m_pre_emptionVulnerability;
}
//------------------------------------------------------------------------------
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_
#define _ALLOCATIONANDRETENTIONPRIORITY_H_
......@@ -5,27 +33,27 @@
#include "Pre-emptionCapability.hpp"
#include "Pre-emptionVulnerability.hpp"
extern "C"{
#include "Ngap_AllocationAndRetentionPriority.h"
extern "C" {
#include "Ngap_AllocationAndRetentionPriority.h"
}
namespace ngap{
class AllocationAndRetentionPriority{
public:
AllocationAndRetentionPriority();
virtual ~AllocationAndRetentionPriority();
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 encode2AllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t *);
bool decodefromAllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t *);
private:
PriorityLevelARP *priorityLevelARP;
Pre_emptionCapability *pre_emptionCapability;
Pre_emptionVulnerability *pre_emptionVulnerability;
};
namespace ngap {
class AllocationAndRetentionPriority {
public:
AllocationAndRetentionPriority();
virtual ~AllocationAndRetentionPriority();
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 encode2AllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t*);
bool decodefromAllocationAndRetentionPriority(Ngap_AllocationAndRetentionPriority_t*);
private:
PriorityLevelARP *priorityLevelARP;
Pre_emptionCapability *pre_emptionCapability;
Pre_emptionVulnerability *pre_emptionVulnerability;
};
}
#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"
extern "C"{
#include "Ngap_AllowedNSSAI-Item.h"
// #include "Ngap_SliceSupportItem.h"
}
#include <iostream>
using namespace std;
namespace ngap{
AllowedNSSAI::AllowedNSSAI()
{
snssai = NULL;
numofSnssai = 0;
}
AllowedNSSAI::~AllowedNSSAI(){}
void AllowedNSSAI::setAllowedNSSAI(S_NSSAI * m_snssai, int m_numofsnssai)
{
snssai = m_snssai;
numofSnssai = m_numofsnssai;
}
bool AllowedNSSAI::getAllowedNSSAI(S_NSSAI * & m_snssai, int & m_numofsnssai)
{
m_snssai = snssai;
m_numofsnssai = numofSnssai;
if(!snssai) return false;
if(!numofSnssai) return false;
return true;
}
bool AllowedNSSAI::encode2AllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList)
{
cout<<"AllowedNSSAI::numOfSnssai "<<numofSnssai<<endl;
for(int i=0;i<numofSnssai;i++)
{
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;
}
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;
}
}
extern "C" {
#include "Ngap_AllowedNSSAI-Item.h"
// #include "Ngap_SliceSupportItem.h"
}
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AllowedNSSAI::AllowedNSSAI() {
snssai = NULL;
numofSnssai = 0;
}
//------------------------------------------------------------------------------
AllowedNSSAI::~AllowedNSSAI() {
}
//------------------------------------------------------------------------------
void AllowedNSSAI::setAllowedNSSAI(S_NSSAI *m_snssai, int m_numofsnssai) {
snssai = m_snssai;
numofSnssai = m_numofsnssai;
}
//------------------------------------------------------------------------------
bool AllowedNSSAI::getAllowedNSSAI(S_NSSAI *&m_snssai, int &m_numofsnssai) {
m_snssai = snssai;
m_numofsnssai = numofSnssai;
if (!snssai)
return false;
if (!numofSnssai)
return false;
return true;
}
//------------------------------------------------------------------------------
bool AllowedNSSAI::encode2AllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList) {
cout << "AllowedNSSAI::numOfSnssai " << numofSnssai << endl;
for (int i = 0; i < numofSnssai; i++) {
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;
}
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_
#define _ALLOWEDNSSAI_H_
#include "S-NSSAI.hpp"
extern "C"{
#include "Ngap_AllowedNSSAI.h"
}
namespace ngap{
class AllowedNSSAI{
public:
AllowedNSSAI();
virtual ~AllowedNSSAI();
void setAllowedNSSAI(S_NSSAI * m_snssai, int m_numofsnssai);
bool getAllowedNSSAI(S_NSSAI * & m_snssai, int & m_numofsnssai);
bool encode2AllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList);
bool decodefromAllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList);
private:
S_NSSAI * snssai;
int numofSnssai;
};
}
#endif
#include "S-NSSAI.hpp"
extern "C" {
#include "Ngap_AllowedNSSAI.h"
}
namespace ngap {
class AllowedNSSAI {
public:
AllowedNSSAI();
virtual ~AllowedNSSAI();
void setAllowedNSSAI(S_NSSAI *m_snssai, int m_numofsnssai);
bool getAllowedNSSAI(S_NSSAI *&m_snssai, int &m_numofsnssai);
bool encode2AllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList);
bool decodefromAllowedNSSAI(Ngap_AllowedNSSAI_t *allowedNssaiList);
private:
S_NSSAI *snssai;
int numofSnssai;
};
}
#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 <iostream>
using namespace std;
namespace ngap{
AssociatedQosFlowItem::AssociatedQosFlowItem()
{
qosFlowIdentifier = NULL;
qosFlowMappingIndication = -1;
}
AssociatedQosFlowItem::~AssociatedQosFlowItem(){}
void AssociatedQosFlowItem::setAssociatedQosFlowItem(e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication m_qosFlowMappingIndication,QosFlowIdentifier *m_qosFlowIdentifier)
{
qosFlowMappingIndication = m_qosFlowMappingIndication;
qosFlowIdentifier = m_qosFlowIdentifier;
}
void AssociatedQosFlowItem::setAssociatedQosFlowItem(QosFlowIdentifier *m_qosFlowIdentifier)
{
qosFlowIdentifier = m_qosFlowIdentifier;
}
bool AssociatedQosFlowItem::getAssociatedQosFlowItem(long &m_qosFlowMappingIndication,QosFlowIdentifier *&m_qosFlowIdentifier)
{
m_qosFlowMappingIndication = qosFlowMappingIndication;
m_qosFlowIdentifier = qosFlowIdentifier;
return true;
}
bool AssociatedQosFlowItem::encode2AssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem)
{
if(qosFlowMappingIndication >= 0)
{
associatedQosFlowItem->qosFlowMappingIndication = (long *)calloc(1,sizeof(long));
*associatedQosFlowItem->qosFlowMappingIndication = qosFlowMappingIndication;
}
if(!qosFlowIdentifier->encode2QosFlowIdentifier(&associatedQosFlowItem->qosFlowIdentifier)) return false;
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;
}
namespace ngap {
//------------------------------------------------------------------------------
AssociatedQosFlowItem::AssociatedQosFlowItem() {
qosFlowIdentifier = NULL;
qosFlowMappingIndication = -1;
}
//------------------------------------------------------------------------------
AssociatedQosFlowItem::~AssociatedQosFlowItem() {
}
//------------------------------------------------------------------------------
void AssociatedQosFlowItem::setAssociatedQosFlowItem(e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication m_qosFlowMappingIndication, QosFlowIdentifier *m_qosFlowIdentifier) {
qosFlowMappingIndication = m_qosFlowMappingIndication;
qosFlowIdentifier = m_qosFlowIdentifier;
}
//------------------------------------------------------------------------------
void AssociatedQosFlowItem::setAssociatedQosFlowItem(QosFlowIdentifier *m_qosFlowIdentifier) {
qosFlowIdentifier = m_qosFlowIdentifier;
}
//------------------------------------------------------------------------------
bool AssociatedQosFlowItem::getAssociatedQosFlowItem(long &m_qosFlowMappingIndication, QosFlowIdentifier *&m_qosFlowIdentifier) {
m_qosFlowMappingIndication = qosFlowMappingIndication;
m_qosFlowIdentifier = qosFlowIdentifier;
return true;
}
//------------------------------------------------------------------------------
bool AssociatedQosFlowItem::encode2AssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem) {
if (qosFlowMappingIndication >= 0) {
associatedQosFlowItem->qosFlowMappingIndication = (long*) calloc(1, sizeof(long));
*associatedQosFlowItem->qosFlowMappingIndication = qosFlowMappingIndication;
}
if (!qosFlowIdentifier->encode2QosFlowIdentifier(&associatedQosFlowItem->qosFlowIdentifier))
return false;
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_
#define _ASSOCIATEDQOSFLOWITEM_H_
#include "QosFlowIdentifier.hpp"
extern "C"{
#include "Ngap_AssociatedQosFlowItem.h"
extern "C" {
#include "Ngap_AssociatedQosFlowItem.h"
}
namespace ngap{
class AssociatedQosFlowItem{
public:
AssociatedQosFlowItem();
virtual ~AssociatedQosFlowItem();
void setAssociatedQosFlowItem(e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication m_qosFlowMappingIndication,QosFlowIdentifier *m_qosFlowIdentifier);
void setAssociatedQosFlowItem(QosFlowIdentifier *m_qosFlowIdentifier);
bool getAssociatedQosFlowItem(long &m_qosFlowMappingIndication,QosFlowIdentifier *&m_qosFlowIdentifier);
bool encode2AssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem);
bool decodefromAssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem);
private:
QosFlowIdentifier *qosFlowIdentifier;
long qosFlowMappingIndication;
};
namespace ngap {
class AssociatedQosFlowItem {
public:
AssociatedQosFlowItem();
virtual ~AssociatedQosFlowItem();
void setAssociatedQosFlowItem(e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication m_qosFlowMappingIndication, QosFlowIdentifier *m_qosFlowIdentifier);
void setAssociatedQosFlowItem(QosFlowIdentifier *m_qosFlowIdentifier);
bool getAssociatedQosFlowItem(long &m_qosFlowMappingIndication, QosFlowIdentifier *&m_qosFlowIdentifier);
bool encode2AssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem);
bool decodefromAssociatedQosFlowItem(Ngap_AssociatedQosFlowItem_t *associatedQosFlowItem);
private:
QosFlowIdentifier *qosFlowIdentifier;
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 <iostream>
using namespace std;
namespace ngap{
AssociatedQosFlowList::AssociatedQosFlowList()
{
associatedQosFlowItem = NULL;
numofassociatedQosFlowItem = 0;
}
AssociatedQosFlowList::~AssociatedQosFlowList(){}
void AssociatedQosFlowList::setAssociatedQosFlowList(AssociatedQosFlowItem *m_associatedQosFlowItem,int numofitem)
{
associatedQosFlowItem = m_associatedQosFlowItem;
numofassociatedQosFlowItem = numofitem;
}
bool AssociatedQosFlowList::getAssociatedQosFlowList(AssociatedQosFlowItem *&m_associatedQosFlowItem,int &numofitem)
{
m_associatedQosFlowItem = associatedQosFlowItem;
numofitem = numofassociatedQosFlowItem;
return true;
}
bool AssociatedQosFlowList::encode2AssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList)
{
for(int i=0;i<numofassociatedQosFlowItem;i++)
{
Ngap_AssociatedQosFlowItem_t *ie = (Ngap_AssociatedQosFlowItem_t *)calloc(1,sizeof(Ngap_AssociatedQosFlowItem_t));
if(!ie) return false;
if(!associatedQosFlowItem[i].encode2AssociatedQosFlowItem(ie)) return false;
if(ASN_SEQUENCE_ADD(&associatedQosFlowList.list, ie) != 0) return false;
}
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;
}
namespace ngap {
//------------------------------------------------------------------------------
AssociatedQosFlowList::AssociatedQosFlowList() {
associatedQosFlowItem = NULL;
numofassociatedQosFlowItem = 0;
}
//------------------------------------------------------------------------------
AssociatedQosFlowList::~AssociatedQosFlowList() {
}
//------------------------------------------------------------------------------
void AssociatedQosFlowList::setAssociatedQosFlowList(AssociatedQosFlowItem *m_associatedQosFlowItem, int numofitem) {
associatedQosFlowItem = m_associatedQosFlowItem;
numofassociatedQosFlowItem = numofitem;
}
//------------------------------------------------------------------------------
bool AssociatedQosFlowList::getAssociatedQosFlowList(AssociatedQosFlowItem *&m_associatedQosFlowItem, int &numofitem) {
m_associatedQosFlowItem = associatedQosFlowItem;
numofitem = numofassociatedQosFlowItem;
return true;
}
//------------------------------------------------------------------------------
bool AssociatedQosFlowList::encode2AssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList) {
for (int i = 0; i < numofassociatedQosFlowItem; i++) {
Ngap_AssociatedQosFlowItem_t *ie = (Ngap_AssociatedQosFlowItem_t*) calloc(1, sizeof(Ngap_AssociatedQosFlowItem_t));
if (!ie)
return false;
if (!associatedQosFlowItem[i].encode2AssociatedQosFlowItem(ie))
return false;
if (ASN_SEQUENCE_ADD(&associatedQosFlowList.list, ie) != 0)
return false;
}
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_
#define _ASSOCIATEDQOSFLOWLIST_H_
#include "AssociatedQosFlowItem.hpp"
extern "C"{
#include "Ngap_AssociatedQosFlowList.h"
extern "C" {
#include "Ngap_AssociatedQosFlowList.h"
}
namespace ngap{
class AssociatedQosFlowList{
public:
AssociatedQosFlowList();
virtual ~AssociatedQosFlowList();
void setAssociatedQosFlowList(AssociatedQosFlowItem *m_associatedQosFlowItem,int numofitem);
bool getAssociatedQosFlowList(AssociatedQosFlowItem *&m_associatedQosFlowItem,int &numofitem);
bool encode2AssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList);
bool decodefromAssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList);
private:
AssociatedQosFlowItem *associatedQosFlowItem;
int numofassociatedQosFlowItem;
};
namespace ngap {
class AssociatedQosFlowList {
public:
AssociatedQosFlowList();
virtual ~AssociatedQosFlowList();
void setAssociatedQosFlowList(AssociatedQosFlowItem *m_associatedQosFlowItem, int numofitem);
bool getAssociatedQosFlowList(AssociatedQosFlowItem *&m_associatedQosFlowItem, int &numofitem);
bool encode2AssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList);
bool decodefromAssociatedQosFlowList(Ngap_AssociatedQosFlowList_t &associatedQosFlowList);
private:
AssociatedQosFlowItem *associatedQosFlowItem;
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 <iostream>
using namespace std;
namespace ngap{
AveragingWindow::AveragingWindow(){}
AveragingWindow::~AveragingWindow(){}
void AveragingWindow::setAveragingWindow(long value)
{
averagingwindow = value;
}
bool AveragingWindow::getAveragingWindow(long &value)
{
value = averagingwindow;
return true;
}
bool AveragingWindow::encode2AveragingWindow(Ngap_AveragingWindow_t *averagingWindow)
{
*averagingWindow = averagingwindow;
return true;
}
bool AveragingWindow::decodefromAveragingWindow(Ngap_AveragingWindow_t *averagingWindow)
{
averagingwindow = *averagingWindow;
return true;
}
namespace ngap {
//------------------------------------------------------------------------------
AveragingWindow::AveragingWindow() {
}
//------------------------------------------------------------------------------
AveragingWindow::~AveragingWindow() {
}
//------------------------------------------------------------------------------
void AveragingWindow::setAveragingWindow(long value) {
averagingwindow = value;
}
//------------------------------------------------------------------------------
bool AveragingWindow::getAveragingWindow(long &value) {
value = averagingwindow;
return true;
}
//------------------------------------------------------------------------------
bool AveragingWindow::encode2AveragingWindow(Ngap_AveragingWindow_t *averagingWindow) {
*averagingWindow = averagingwindow;
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_
#define _AVERAGINGWINDOW_H_
extern "C"{
#include "Ngap_AveragingWindow.h"
extern "C" {
#include "Ngap_AveragingWindow.h"
}
namespace ngap{
class AveragingWindow{
public:
AveragingWindow();
virtual ~AveragingWindow();
void setAveragingWindow(long value);
bool getAveragingWindow(long &value);
bool encode2AveragingWindow(Ngap_AveragingWindow_t *);
bool decodefromAveragingWindow(Ngap_AveragingWindow_t *);
private:
long averagingwindow;
};
namespace ngap {
class AveragingWindow {
public:
AveragingWindow();
virtual ~AveragingWindow();
void setAveragingWindow(long value);
bool getAveragingWindow(long &value);
bool encode2AveragingWindow(Ngap_AveragingWindow_t*);
bool decodefromAveragingWindow(Ngap_AveragingWindow_t*);
private:
long averagingwindow;
};
}
#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 "S-NSSAI.hpp"
#include "PlmnId.hpp"
extern "C"{
#include "Ngap_BroadcastPLMNList.h"
#include "Ngap_SliceSupportItem.h"
extern "C" {
#include "Ngap_BroadcastPLMNList.h"
#include "Ngap_SliceSupportItem.h"
}
#include <iostream>
using namespace std;
namespace ngap{
BroadcastPLMNItem::BroadcastPLMNItem()
{
plmn = NULL;
snssai = NULL;
numOfSnssai = 0;
}
BroadcastPLMNItem::~BroadcastPLMNItem(){}
void BroadcastPLMNItem::setPlmnSliceSupportList(PlmnId * m_plmn, S_NSSAI * m_snssai, int num)
{
plmn = m_plmn;
snssai = m_snssai;
numOfSnssai = num;
}
void BroadcastPLMNItem::getPlmnSliceSupportList(PlmnId * & m_plmn, S_NSSAI * & m_snssai, int & snssainum)
{
m_plmn = plmn;
m_snssai = snssai;
snssainum = numOfSnssai;
}
bool BroadcastPLMNItem::encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t * plmnItem)
{
if(!plmn->encode2octetstring(plmnItem->pLMNIdentity)) return false;
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));
if(!slice) return false;
if(!snssai[i].encode2S_NSSAI(&slice->s_NSSAI)) return false;
if(ASN_SEQUENCE_ADD(&plmnItem->tAISliceSupportList.list, slice) != 0) 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;
}
namespace ngap {
//------------------------------------------------------------------------------
BroadcastPLMNItem::BroadcastPLMNItem() {
plmn = NULL;
snssai = NULL;
numOfSnssai = 0;
}
//------------------------------------------------------------------------------
BroadcastPLMNItem::~BroadcastPLMNItem() {
}
//------------------------------------------------------------------------------
void BroadcastPLMNItem::setPlmnSliceSupportList(PlmnId *m_plmn, S_NSSAI *m_snssai, int num) {
plmn = m_plmn;
snssai = m_snssai;
numOfSnssai = num;
}
//------------------------------------------------------------------------------
void BroadcastPLMNItem::getPlmnSliceSupportList(PlmnId *&m_plmn, S_NSSAI *&m_snssai, int &snssainum) {
m_plmn = plmn;
m_snssai = snssai;
snssainum = numOfSnssai;
}
//------------------------------------------------------------------------------
bool BroadcastPLMNItem::encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t *plmnItem) {
if (!plmn->encode2octetstring(plmnItem->pLMNIdentity))
return false;
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));
if (!slice)
return false;
if (!snssai[i].encode2S_NSSAI(&slice->s_NSSAI))
return false;
if (ASN_SEQUENCE_ADD(&plmnItem->tAISliceSupportList.list, slice) != 0)
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
#define _BroadcastPLMNItem_H
#include "PlmnId.hpp"
#include "S-NSSAI.hpp"
extern "C"{
#include "Ngap_BroadcastPLMNItem.h"
extern "C" {
#include "Ngap_BroadcastPLMNItem.h"
}
namespace ngap{
namespace ngap {
class BroadcastPLMNItem {
public:
BroadcastPLMNItem();
virtual ~BroadcastPLMNItem();
class BroadcastPLMNItem{
public:
BroadcastPLMNItem();
virtual ~BroadcastPLMNItem();
void setPlmnSliceSupportList(PlmnId * m_plmn, S_NSSAI * snssai, int num);
void getPlmnSliceSupportList(PlmnId * & m_plmn, S_NSSAI * & m_snssai, int & snssainum);
bool encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t *);
bool decodefromBroadcastPLMNItem( Ngap_BroadcastPLMNItem_t * pdu);
private:
PlmnId *plmn;
S_NSSAI * snssai;
int numOfSnssai;
};
void setPlmnSliceSupportList(PlmnId *m_plmn, S_NSSAI *snssai, int num);
void getPlmnSliceSupportList(PlmnId *&m_plmn, S_NSSAI *&m_snssai, int &snssainum);
bool encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t*);
bool decodefromBroadcastPLMNItem(Ngap_BroadcastPLMNItem_t *pdu);
private:
PlmnId *plmn;
S_NSSAI *snssai;
int numOfSnssai;
};
}
#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<iostream>
using namespace std;
namespace ngap{
namespace ngap {
Cause::Cause()
{
causeValue = -1;
}
Cause::~Cause(){}
//------------------------------------------------------------------------------
Cause::Cause() {
causeValue = -1;
}
//------------------------------------------------------------------------------
Cause::~Cause() {
}
void Cause::setChoiceOfCause(Ngap_Cause_PR m_causePresent)
{
causePresent = m_causePresent;
}
//------------------------------------------------------------------------------
void Cause::setChoiceOfCause(Ngap_Cause_PR m_causePresent) {
causePresent = m_causePresent;
}
void Cause::setValue(long m_causeValue)
{
causeValue = m_causeValue;
}
//------------------------------------------------------------------------------
void Cause::setValue(long m_causeValue) {
causeValue = m_causeValue;
}
bool Cause::encode2Cause(Ngap_Cause_t *cause)
{
cause->present = causePresent;
switch(causePresent)
{
case Ngap_Cause_PR_radioNetwork:{
cause->choice.radioNetwork = causeValue;
break;}
case Ngap_Cause_PR_transport:{
cause->choice.transport = causeValue;
break;}
case Ngap_Cause_PR_nas:{
cause->choice.nas = causeValue;
break;}
case Ngap_Cause_PR_protocol:{
cause->choice.protocol = causeValue;
break;}
case Ngap_Cause_PR_misc:{
cause->choice.misc = causeValue;
break;}
default:{
cout<<"[Warning] Cause Present error!"<<endl;
return false;
break;}
}
return true;
}
bool Cause::decodefromCause(Ngap_Cause_t * pdu)
{
causePresent = pdu->present;
switch(causePresent)
{
case Ngap_Cause_PR_radioNetwork:{
causeValue = pdu->choice.radioNetwork;
}break;
case Ngap_Cause_PR_transport:{
causeValue = pdu->choice.transport;
}break;
case Ngap_Cause_PR_nas:{
causeValue = pdu->choice.nas;
}break;
case Ngap_Cause_PR_protocol:{
causeValue = pdu->choice.protocol;
}break;
case Ngap_Cause_PR_misc:{
causeValue = pdu->choice.misc;
}break;
default:{
cout<<"[Warning] Cause Present error!"<<endl;
return false;
}
}
return true;
}
Ngap_Cause_PR Cause::getChoiceOfCause()
{
return causePresent;
}
long Cause::getValue()
{
return causeValue;
}
//------------------------------------------------------------------------------
bool Cause::encode2Cause(Ngap_Cause_t *cause) {
cause->present = causePresent;
switch (causePresent) {
case Ngap_Cause_PR_radioNetwork: {
cause->choice.radioNetwork = causeValue;
break;
}
case Ngap_Cause_PR_transport: {
cause->choice.transport = causeValue;
break;
}
case Ngap_Cause_PR_nas: {
cause->choice.nas = causeValue;
break;
}
case Ngap_Cause_PR_protocol: {
cause->choice.protocol = causeValue;
break;
}
case Ngap_Cause_PR_misc: {
cause->choice.misc = causeValue;
break;
}
default: {
cout << "[Warning] Cause Present error!" << endl;
return false;
break;
}
}
return true;
}
//------------------------------------------------------------------------------
bool Cause::decodefromCause(Ngap_Cause_t *pdu) {
causePresent = pdu->present;
switch (causePresent) {
case Ngap_Cause_PR_radioNetwork: {
causeValue = pdu->choice.radioNetwork;
}
break;
case Ngap_Cause_PR_transport: {
causeValue = pdu->choice.transport;
}
break;
case Ngap_Cause_PR_nas: {
causeValue = pdu->choice.nas;
}
break;
case Ngap_Cause_PR_protocol: {
causeValue = pdu->choice.protocol;
}
break;
case Ngap_Cause_PR_misc: {
causeValue = pdu->choice.misc;
}
break;
default: {
cout << "[Warning] Cause Present error!" << endl;
return false;
}
}
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_
#define _CAUSE_H_
extern "C"{
#include "Ngap_Cause.h"
extern "C" {
#include "Ngap_Cause.h"
}
namespace ngap{
namespace ngap {
class Cause {
public:
Cause();
virtual ~Cause();
class Cause{
public:
Cause();
virtual ~Cause();
bool encode2Cause(Ngap_Cause_t *cause);
bool decodefromCause(Ngap_Cause_t * pdu);
void setChoiceOfCause(Ngap_Cause_PR m_causePresent);
Ngap_Cause_PR getChoiceOfCause();
void setValue(long);
long getValue();
private:
long causeValue;
Ngap_Cause_PR causePresent;
};
bool encode2Cause(Ngap_Cause_t *cause);
bool decodefromCause(Ngap_Cause_t *pdu);
void setChoiceOfCause(Ngap_Cause_PR m_causePresent);
Ngap_Cause_PR getChoiceOfCause();
void setValue(long);
long getValue();
private:
long causeValue;
Ngap_Cause_PR causePresent;
};
}
#endif
\ No newline at end of file
#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 "ConfidentialityProtectionIndication.hpp"
#include <iostream>
using namespace std;
namespace ngap{
ConfidentialityProtectionIndication::ConfidentialityProtectionIndication(){}
ConfidentialityProtectionIndication::~ConfidentialityProtectionIndication(){}
void ConfidentialityProtectionIndication::setConfidentialityProtectionIndication(e_Ngap_ConfidentialityProtectionIndication m_indication)
{
indication = m_indication;
}
bool ConfidentialityProtectionIndication::getConfidentialityProtectionIndication(long &m_indication)
{
m_indication = indication;
return true;
}
bool ConfidentialityProtectionIndication::encode2ConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t &confidentialityProtectionIndication)
{
confidentialityProtectionIndication = indication;
return true;
}
bool ConfidentialityProtectionIndication::decodefromConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t confidentialityProtectionIndication)
{
indication = confidentialityProtectionIndication;
return true;
}
namespace ngap {
//------------------------------------------------------------------------------
ConfidentialityProtectionIndication::ConfidentialityProtectionIndication() {
}
//------------------------------------------------------------------------------
ConfidentialityProtectionIndication::~ConfidentialityProtectionIndication() {
}
//------------------------------------------------------------------------------
void ConfidentialityProtectionIndication::setConfidentialityProtectionIndication(e_Ngap_ConfidentialityProtectionIndication m_indication) {
indication = m_indication;
}
//------------------------------------------------------------------------------
bool ConfidentialityProtectionIndication::getConfidentialityProtectionIndication(long &m_indication) {
m_indication = indication;
return true;
}
//------------------------------------------------------------------------------
bool ConfidentialityProtectionIndication::encode2ConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t &confidentialityProtectionIndication) {
confidentialityProtectionIndication = indication;
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_
#define _CONFIDENTIALITYPROTECTIONINDICATION_H_
extern "C"{
#include "Ngap_ConfidentialityProtectionIndication.h"
extern "C" {
#include "Ngap_ConfidentialityProtectionIndication.h"
}
namespace ngap{
class ConfidentialityProtectionIndication{
public:
ConfidentialityProtectionIndication();
virtual ~ConfidentialityProtectionIndication();
void setConfidentialityProtectionIndication(e_Ngap_ConfidentialityProtectionIndication m_indication);
bool getConfidentialityProtectionIndication(long &m_indication);
bool encode2ConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t &);
bool decodefromConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t );
private:
long indication;
namespace ngap {
class ConfidentialityProtectionIndication {
public:
ConfidentialityProtectionIndication();
virtual ~ConfidentialityProtectionIndication();
void setConfidentialityProtectionIndication(e_Ngap_ConfidentialityProtectionIndication m_indication);
bool getConfidentialityProtectionIndication(long &m_indication);
bool encode2ConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t&);
bool decodefromConfidentialityProtectionIndication(Ngap_ConfidentialityProtectionIndication_t);
private:
long indication;
};
}
#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 <iostream>
using namespace std;
namespace ngap{
ConfidentialityProtectionResult::ConfidentialityProtectionResult()
{
confidentialityProtectionResult = -1;
}
ConfidentialityProtectionResult::~ConfidentialityProtectionResult(){}
void ConfidentialityProtectionResult::setConfidentialityProtectionResult(e_Ngap_ConfidentialityProtectionResult m_confidentialityProtectionResult)
{
confidentialityProtectionResult = m_confidentialityProtectionResult;
}
bool ConfidentialityProtectionResult::getConfidentialityProtectionResult(long &m_confidentialityProtectionResult)
{
m_confidentialityProtectionResult = confidentialityProtectionResult;
return true;
}
bool ConfidentialityProtectionResult::encode2ConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t &confidentialityProtectionResultValue)
{
confidentialityProtectionResultValue = confidentialityProtectionResult;
return true;
}
bool ConfidentialityProtectionResult::decodefromConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t confidentialityProtectionResultValue)
{
confidentialityProtectionResult = confidentialityProtectionResultValue;
return true;
}
namespace ngap {
//------------------------------------------------------------------------------
ConfidentialityProtectionResult::ConfidentialityProtectionResult() {
confidentialityProtectionResult = -1;
}
//------------------------------------------------------------------------------
ConfidentialityProtectionResult::~ConfidentialityProtectionResult() {
}
//------------------------------------------------------------------------------
void ConfidentialityProtectionResult::setConfidentialityProtectionResult(e_Ngap_ConfidentialityProtectionResult m_confidentialityProtectionResult) {
confidentialityProtectionResult = m_confidentialityProtectionResult;
}
//------------------------------------------------------------------------------
bool ConfidentialityProtectionResult::getConfidentialityProtectionResult(long &m_confidentialityProtectionResult) {
m_confidentialityProtectionResult = confidentialityProtectionResult;
return true;
}
//------------------------------------------------------------------------------
bool ConfidentialityProtectionResult::encode2ConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t &confidentialityProtectionResultValue) {
confidentialityProtectionResultValue = confidentialityProtectionResult;
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_
#define _CONFIDENTIALITYPROTECTIONRESULT_H_
extern "C"{
#include "Ngap_ConfidentialityProtectionResult.h"
extern "C" {
#include "Ngap_ConfidentialityProtectionResult.h"
}
namespace ngap{
class ConfidentialityProtectionResult{
public:
ConfidentialityProtectionResult();
virtual ~ConfidentialityProtectionResult();
void setConfidentialityProtectionResult(e_Ngap_ConfidentialityProtectionResult m_confidentialityProtectionResult);
bool getConfidentialityProtectionResult(long &m_confidentialityProtectionResult);
bool encode2ConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t &);
bool decodefromConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t);
private:
long confidentialityProtectionResult;
};
namespace ngap {
class ConfidentialityProtectionResult {
public:
ConfidentialityProtectionResult();
virtual ~ConfidentialityProtectionResult();
void setConfidentialityProtectionResult(e_Ngap_ConfidentialityProtectionResult m_confidentialityProtectionResult);
bool getConfidentialityProtectionResult(long &m_confidentialityProtectionResult);
bool encode2ConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t&);
bool decodefromConfidentialityProtectionResult(Ngap_ConfidentialityProtectionResult_t);
private:
long confidentialityProtectionResult;
};
}
#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_
#define _CORENETWORKASSISTANCEINFORMATION_H_
......@@ -7,30 +35,30 @@
#include "MICOModeIndication.hpp"
#include "TAI.hpp"
extern "C"{
#include "Ngap_CoreNetworkAssistanceInformation.h"
extern "C" {
#include "Ngap_CoreNetworkAssistanceInformation.h"
}
namespace ngap{
class CoreNetworkAssistanceInfo{
public:
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, 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 decodefromCoreNetworkAssistanceInfo(Ngap_CoreNetworkAssistanceInformation_t *coreNetworkAssistanceInformation);
private:
UEIdentityIndexValue *ueIdentityIndexValue;
DefaultPagingDRX *pagingDRX;
PeriodicRegistrationUpdateTimer *periodicRegUpdateTimer;
MICOModeIndication *micoModeInd;
TAI *tai;
int numoftai;
namespace ngap {
class CoreNetworkAssistanceInfo {
public:
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, 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 decodefromCoreNetworkAssistanceInfo(Ngap_CoreNetworkAssistanceInformation_t *coreNetworkAssistanceInformation);
private:
UEIdentityIndexValue *ueIdentityIndexValue;
DefaultPagingDRX *pagingDRX;
PeriodicRegistrationUpdateTimer *periodicRegUpdateTimer;
MICOModeIndication *micoModeInd;
TAI *tai;
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_
#define _CRITICALITYDIAGNOSTICS_H_
#include "IEsCriticalityDiagnostics.hpp"
extern "C"{
#include "Ngap_NGSetupFailure.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_CriticalityDiagnostics.h"
#include "Ngap_CriticalityDiagnostics-IE-List.h"
extern "C" {
#include "Ngap_NGSetupFailure.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_CriticalityDiagnostics.h"
#include "Ngap_CriticalityDiagnostics-IE-List.h"
}
namespace ngap{
class CriticalityDiagnostics{
public:
CriticalityDiagnostics();
virtual ~CriticalityDiagnostics();
int encode2pdu(Ngap_NGSetupFailure_t *);
bool decodefrompdu(Ngap_CriticalityDiagnostics_t *);
void setProcedureCodeValue(Ngap_ProcedureCode_t);
void setTriggeringMessageValue(Ngap_TriggeringMessage_t);
void setCriticalityValue(Ngap_Criticality_t);
void setIEsCriticalityDiagnosticsList(IEsCriticalityDiagnostics *m_iEsCriticalityDiagnostics,int num);
bool getProcedureCodeValue(Ngap_ProcedureCode_t&);
bool getTriggeringMessageValue(Ngap_TriggeringMessage_t&);
bool getCriticalityValue(Ngap_Criticality_t&);
bool getIEsCriticalityDiagnosticsList(IEsCriticalityDiagnostics* &m_iEsCriticalityDiagnostics,int &num);
private:
Ngap_ProcedureCode_t procedureCode; /* OPTIONAL */
Ngap_TriggeringMessage_t triggeringMessage; /* OPTIONAL */
Ngap_Criticality_t procedureCriticality; /* OPTIONAL */
//Ngap_CriticalityDiagnostics_IE_List_t iEsCriticalityDiagnostics; /* OPTIONAL */
IEsCriticalityDiagnostics *iEsCriticalityDiagnostics;
bool procedureCodeIsSet;
bool triggeringMessageIsSet;
bool procedureCriticalityIsSet;
int numberOfIEsCriticalityDiagnostics;
};
namespace ngap {
class CriticalityDiagnostics {
public:
CriticalityDiagnostics();
virtual ~CriticalityDiagnostics();
int encode2pdu(Ngap_NGSetupFailure_t*);
bool decodefrompdu(Ngap_CriticalityDiagnostics_t*);
void setProcedureCodeValue(Ngap_ProcedureCode_t);
void setTriggeringMessageValue(Ngap_TriggeringMessage_t);
void setCriticalityValue(Ngap_Criticality_t);
void setIEsCriticalityDiagnosticsList(IEsCriticalityDiagnostics *m_iEsCriticalityDiagnostics, int num);
bool getProcedureCodeValue(Ngap_ProcedureCode_t&);
bool getTriggeringMessageValue(Ngap_TriggeringMessage_t&);
bool getCriticalityValue(Ngap_Criticality_t&);
bool getIEsCriticalityDiagnosticsList(IEsCriticalityDiagnostics *&m_iEsCriticalityDiagnostics, int &num);
private:
Ngap_ProcedureCode_t procedureCode; /* OPTIONAL */
Ngap_TriggeringMessage_t triggeringMessage; /* OPTIONAL */
Ngap_Criticality_t procedureCriticality; /* OPTIONAL */
//Ngap_CriticalityDiagnostics_IE_List_t iEsCriticalityDiagnostics; /* OPTIONAL */
IEsCriticalityDiagnostics *iEsCriticalityDiagnostics;
bool procedureCodeIsSet;
bool triggeringMessageIsSet;
bool procedureCriticalityIsSet;
int numberOfIEsCriticalityDiagnostics;
};
}
#endif
\ No newline at end of file
#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 "DLQoSFlowPerTNLInformation.hpp"
#include <iostream>
using namespace std;
namespace ngap{
DLQoSFlowPerTNLInformation::DLQoSFlowPerTNLInformation()
{
uPTransportLayerInformation = NULL;
associatedQosFlowList = NULL;
}
DLQoSFlowPerTNLInformation::~DLQoSFlowPerTNLInformation(){}
void DLQoSFlowPerTNLInformation::setDLQoSFlowPerTNLInformation(UpTransportLayerInformation *m_uPTransportLayerInformation, AssociatedQosFlowList *m_associatedQosFlowList)
{
uPTransportLayerInformation = m_uPTransportLayerInformation;
associatedQosFlowList = m_associatedQosFlowList;
}
bool DLQoSFlowPerTNLInformation::getDLQoSFlowPerTNLInformation(UpTransportLayerInformation *&m_uPTransportLayerInformation, AssociatedQosFlowList *&m_associatedQosFlowList)
{
m_uPTransportLayerInformation = uPTransportLayerInformation;
m_associatedQosFlowList = associatedQosFlowList;
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;
}
namespace ngap {
//------------------------------------------------------------------------------
DLQoSFlowPerTNLInformation::DLQoSFlowPerTNLInformation() {
uPTransportLayerInformation = NULL;
associatedQosFlowList = NULL;
}
//------------------------------------------------------------------------------
DLQoSFlowPerTNLInformation::~DLQoSFlowPerTNLInformation() {
}
//------------------------------------------------------------------------------
void DLQoSFlowPerTNLInformation::setDLQoSFlowPerTNLInformation(UpTransportLayerInformation *m_uPTransportLayerInformation, AssociatedQosFlowList *m_associatedQosFlowList) {
uPTransportLayerInformation = m_uPTransportLayerInformation;
associatedQosFlowList = m_associatedQosFlowList;
}
//------------------------------------------------------------------------------
bool DLQoSFlowPerTNLInformation::getDLQoSFlowPerTNLInformation(UpTransportLayerInformation *&m_uPTransportLayerInformation, AssociatedQosFlowList *&m_associatedQosFlowList) {
m_uPTransportLayerInformation = uPTransportLayerInformation;
m_associatedQosFlowList = associatedQosFlowList;
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_
#define _DLQOSFLOWPERTNLINFORMATION_H_
#include "UPTransportLayerInformation.hpp"
#include "AssociatedQosFlowList.hpp"
extern "C"{
#include "Ngap_QosFlowPerTNLInformation.h"
extern "C" {
#include "Ngap_QosFlowPerTNLInformation.h"
}
namespace ngap{
class DLQoSFlowPerTNLInformation{
public:
DLQoSFlowPerTNLInformation();
virtual ~DLQoSFlowPerTNLInformation();
void setDLQoSFlowPerTNLInformation(UpTransportLayerInformation *m_uPTransportLayerInformation, AssociatedQosFlowList *m_associatedQosFlowList);
bool getDLQoSFlowPerTNLInformation(UpTransportLayerInformation *&m_uPTransportLayerInformation, AssociatedQosFlowList *&m_associatedQosFlowList);
bool encode2DLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation);
bool decodefromDLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation);
private:
UpTransportLayerInformation *uPTransportLayerInformation;
AssociatedQosFlowList *associatedQosFlowList;
};
namespace ngap {
class DLQoSFlowPerTNLInformation {
public:
DLQoSFlowPerTNLInformation();
virtual ~DLQoSFlowPerTNLInformation();
void setDLQoSFlowPerTNLInformation(UpTransportLayerInformation *m_uPTransportLayerInformation, AssociatedQosFlowList *m_associatedQosFlowList);
bool getDLQoSFlowPerTNLInformation(UpTransportLayerInformation *&m_uPTransportLayerInformation, AssociatedQosFlowList *&m_associatedQosFlowList);
bool encode2DLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation);
bool decodefromDLQoSFlowPerTNLInformation(Ngap_QosFlowPerTNLInformation_t *qosFlowPerTNLInformation);
private:
UpTransportLayerInformation *uPTransportLayerInformation;
AssociatedQosFlowList *associatedQosFlowList;
};
}
#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 <iostream>
using namespace std;
namespace ngap{
namespace ngap {
DataForwardingNotPossible::DataForwardingNotPossible(){}
//------------------------------------------------------------------------------
DataForwardingNotPossible::DataForwardingNotPossible() {
}
DataForwardingNotPossible::~DataForwardingNotPossible(){}
#if 0
//------------------------------------------------------------------------------
DataForwardingNotPossible::~DataForwardingNotPossible() {
}
//------------------------------------------------------------------------------
#if 0
void DataForwardingNotPossible::setDataForwardingNotPossible(const uint32_t m_gtp_teid)
{
gtp_teid = m_gtp_teid;
......@@ -21,22 +54,21 @@ namespace ngap{
return true;
}
#endif
bool DataForwardingNotPossible::encode2DataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible)
{
dataForwardingNotPossible = Ngap_DataForwardingNotPossible_data_forwarding_not_possible;
return true;
}
bool DataForwardingNotPossible::decodefromDataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible)
{
if(dataForwardingNotPossible != Ngap_DataForwardingNotPossible_data_forwarding_not_possible) return false;
return true;
}
//------------------------------------------------------------------------------
bool DataForwardingNotPossible::encode2DataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible) {
dataForwardingNotPossible = Ngap_DataForwardingNotPossible_data_forwarding_not_possible;
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_
#define _DATAFORWARDINGNOTPOSSIBLE_H_
extern "C"{
#include "Ngap_DataForwardingNotPossible.h"
extern "C" {
#include "Ngap_DataForwardingNotPossible.h"
}
namespace ngap{
class DataForwardingNotPossible{
public:
DataForwardingNotPossible();
virtual ~DataForwardingNotPossible();
//void setDataForwardingNotPossible(const bool m_gtp_teid);
//bool getDataForwardingNotPossible(uint32_t &m_gtp_teid);
bool encode2DataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible);
bool decodefromDataForwardingNotPossible(Ngap_DataForwardingNotPossible_t &dataForwardingNotPossible);
};
namespace ngap {
class DataForwardingNotPossible {
public:
DataForwardingNotPossible();
virtual ~DataForwardingNotPossible();
//void setDataForwardingNotPossible(const bool m_gtp_teid);
//bool getDataForwardingNotPossible(uint32_t &m_gtp_teid);
bool encode2DataForwardingNotPossible(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 <iostream>
using namespace std;
namespace ngap{
DefaultPagingDRX::DefaultPagingDRX(){}
DefaultPagingDRX::~DefaultPagingDRX(){}
void DefaultPagingDRX::setValue(e_Ngap_PagingDRX m_pagingDrx)
{
pagingDrx = m_pagingDrx;
}
bool DefaultPagingDRX::encode2DefaultPagingDRX(Ngap_PagingDRX_t & pagingdrx)
{
pagingdrx = pagingDrx;
return true;
}
bool DefaultPagingDRX::decodefromDefaultPagingDRX(Ngap_PagingDRX_t &pagingdrx)
{
pagingDrx = pagingdrx;
return true;
}
int DefaultPagingDRX::getValue()
{
return pagingDrx;
}
namespace ngap {
//------------------------------------------------------------------------------
DefaultPagingDRX::DefaultPagingDRX() {
}
//------------------------------------------------------------------------------
DefaultPagingDRX::~DefaultPagingDRX() {
}
//------------------------------------------------------------------------------
void DefaultPagingDRX::setValue(e_Ngap_PagingDRX m_pagingDrx) {
pagingDrx = m_pagingDrx;
}
//------------------------------------------------------------------------------
bool DefaultPagingDRX::encode2DefaultPagingDRX(Ngap_PagingDRX_t &pagingdrx) {
pagingdrx = pagingDrx;
return true;
}
//------------------------------------------------------------------------------
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_
#define _DEFAULT_PAGING_DRX_H_
extern "C"{
#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;
};
extern "C" {
#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;
};
}
#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 <iostream>
using namespace std;
namespace ngap{
DelayCritical::DelayCritical(){}
DelayCritical::~DelayCritical(){}
void DelayCritical::setDelayCritical(e_Ngap_DelayCritical value)
{
delaycritical = value;
}
bool DelayCritical::getDelayCritical(e_Ngap_DelayCritical &value)
{
if((delaycritical>=0) && (delaycritical<=1))
value = (e_Ngap_DelayCritical)delaycritical;
else
false;
return true;
}
bool DelayCritical::encode2DelayCritical(Ngap_DelayCritical_t *delayCritical)
{
*delayCritical = delaycritical;
return true;
}
bool DelayCritical::decodefromDelayCritical(Ngap_DelayCritical_t *delayCritical)
{
delaycritical = *delayCritical;
return true;
}
namespace ngap {
//------------------------------------------------------------------------------
DelayCritical::DelayCritical() {
}
//------------------------------------------------------------------------------
DelayCritical::~DelayCritical() {
}
//------------------------------------------------------------------------------
void DelayCritical::setDelayCritical(e_Ngap_DelayCritical value) {
delaycritical = value;
}
//------------------------------------------------------------------------------
bool DelayCritical::getDelayCritical(e_Ngap_DelayCritical &value) {
if ((delaycritical >= 0) && (delaycritical <= 1))
value = (e_Ngap_DelayCritical) delaycritical;
else
false;
return true;
}
//------------------------------------------------------------------------------
bool DelayCritical::encode2DelayCritical(Ngap_DelayCritical_t *delayCritical) {
*delayCritical = delaycritical;
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_
#define _DELAYCRITICAL_H_
extern "C"{
#include "Ngap_DelayCritical.h"
extern "C" {
#include "Ngap_DelayCritical.h"
}
namespace ngap{
class DelayCritical{
public:
DelayCritical();
virtual ~DelayCritical();
void setDelayCritical(e_Ngap_DelayCritical value);
bool getDelayCritical(e_Ngap_DelayCritical &value);
bool encode2DelayCritical(Ngap_DelayCritical_t *);
bool decodefromDelayCritical(Ngap_DelayCritical_t *);
private:
long delaycritical;
};
namespace ngap {
class DelayCritical {
public:
DelayCritical();
virtual ~DelayCritical();
void setDelayCritical(e_Ngap_DelayCritical value);
bool getDelayCritical(e_Ngap_DelayCritical &value);
bool encode2DelayCritical(Ngap_DelayCritical_t*);
bool decodefromDelayCritical(Ngap_DelayCritical_t*);
private:
long delaycritical;
};
}
#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_
#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 <iostream>
using namespace std;
namespace ngap{
EUTRA_CGI::EUTRA_CGI()
{
plmnId = NULL;
eUTRACellIdentity = NULL;
}
EUTRA_CGI::~EUTRA_CGI(){}
void EUTRA_CGI::setEUTRA_CGI(PlmnId* m_plmnId,EUTRACellIdentity* m_eUTRACellIdentity)
{
plmnId = m_plmnId;
eUTRACellIdentity = m_eUTRACellIdentity;
}
bool EUTRA_CGI::encode2EUTRA_CGI(Ngap_EUTRA_CGI_t *eutra_cgi)
{
if(!plmnId->encode2octetstring(eutra_cgi->pLMNIdentity)) return false;
if(!eUTRACellIdentity->encode2bitstring(eutra_cgi->eUTRACellIdentity)) return false;
return true;
}
bool EUTRA_CGI::decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t *eutra_cgi)
{
plmnId = new PlmnId();
eUTRACellIdentity = new 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;
}
namespace ngap {
//------------------------------------------------------------------------------
EUTRA_CGI::EUTRA_CGI() {
plmnId = NULL;
eUTRACellIdentity = NULL;
}
//------------------------------------------------------------------------------
EUTRA_CGI::~EUTRA_CGI() {
}
//------------------------------------------------------------------------------
void EUTRA_CGI::setEUTRA_CGI(PlmnId *m_plmnId, EUTRACellIdentity *m_eUTRACellIdentity) {
plmnId = m_plmnId;
eUTRACellIdentity = m_eUTRACellIdentity;
}
//------------------------------------------------------------------------------
bool EUTRA_CGI::encode2EUTRA_CGI(Ngap_EUTRA_CGI_t *eutra_cgi) {
if (!plmnId->encode2octetstring(eutra_cgi->pLMNIdentity))
return false;
if (!eUTRACellIdentity->encode2bitstring(eutra_cgi->eUTRACellIdentity))
return false;
return true;
}
//------------------------------------------------------------------------------
bool EUTRA_CGI::decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t *eutra_cgi) {
plmnId = new PlmnId();
eUTRACellIdentity = new 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_
#define _EUTRA_CGI_H_
#include "PlmnId.hpp"
#include "EUTRACellIdentity.hpp"
extern "C"{
#include "Ngap_EUTRA-CGI.h"
extern "C" {
#include "Ngap_EUTRA-CGI.h"
}
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;
};
}
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;
};
}
#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