Commit 58c0816c authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Address waring when building AMF in RHEL 8.2

parent 5b684075
......@@ -943,7 +943,7 @@ void amf_n1::registration_request_handle(
//------------------------------------------------------------------------------
// authentication vector handlers
bool amf_n1::generate_authentication_vector() {}
bool amf_n1::generate_authentication_vector() {return true;}
// context management functions
//------------------------------------------------------------------------------
......@@ -1307,6 +1307,7 @@ bool amf_n1::authentication_vectors_generator_in_udm(
Logger::amf_n1().error("Failed to fetch user data from MySQL");
return false;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -2043,6 +2044,7 @@ bool amf_n1::nas_message_integrity_protected(
} break;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -2086,8 +2088,8 @@ bool amf_n1::nas_message_cipher_protected(
nas_algorithms::nas_stream_encrypt_nea2(
&stream_cipher, (uint8_t*) bdata(output_nas));
} break;
}
return true;
}
//------------------------------------------------------------------------------
......
......@@ -81,6 +81,7 @@ class nf_profile : public std::enable_shared_from_this<nf_profile> {
nf_type = s.nf_type;
nf_instance_name = s.nf_instance_name;
nf_status = s.nf_status;
return *this;
}
// nf_profile(nf_profile &b) = delete;
......@@ -318,6 +319,7 @@ class amf_profile : public nf_profile {
custom_info = s.custom_info;
amf_info = s.amf_info;
nf_services = s.nf_services;
return *this;
}
// amf_profile(amf_profile &b) = delete;
......
......@@ -192,6 +192,7 @@ typedef struct subscription_condition_s {
}
}
// TODO:
return *this;
}
virtual ~subscription_condition_s(){};
......@@ -258,6 +259,7 @@ typedef struct nf_service_version_s {
nf_service_version_s& operator=(const nf_service_version_s& s) {
api_version_in_uri = s.api_version_in_uri;
api_full_version = s.api_full_version;
return *this;
}
std::string to_string() const {
......
......@@ -428,7 +428,7 @@ int _5GSMobilityIdentity::encodeRoutid2buffer(string routidstr, uint8_t* buf) {
}
//------------------------------------------------------------------------------
int _5GSMobilityIdentity::encodeMSIN2buffer(string msinstr, uint8_t* buf) {}
int _5GSMobilityIdentity::encodeMSIN2buffer(string msinstr, uint8_t* buf) {return 1;}
//------------------------------------------------------------------------------
int _5GSMobilityIdentity::imeisv_encode2buffer(uint8_t* buf, int len) {
......@@ -676,7 +676,7 @@ int _5GSMobilityIdentity::imeisv_decodefrombuffer(uint8_t* buf, int len) {
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug(
"decoded 5GSMobilityIdentity IMEISV value(0x%x)",
(uint8_t*) _IMEISV.identity->data[i]);
(uint8_t) _IMEISV.identity->data[i]);
}
Logger::nas_mm().debug(
"decoded 5GSMobilityIdentity IMEISV len(%d)", decoded_size);
......
......@@ -77,7 +77,7 @@ int Authentication_Failure_Parameter::encode2buffer(uint8_t* buf, int len) {
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug(
"encoded Authentication_Failure_Parameter len(%d)", encoded_size);
"Encoded Authentication_Failure_Parameter len (%d)", encoded_size);
return encoded_size;
}
......@@ -85,7 +85,7 @@ int Authentication_Failure_Parameter::encode2buffer(uint8_t* buf, int len) {
int Authentication_Failure_Parameter::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug(
"decoding Authentication_Failure_Parameter iei(0x%x)", *buf);
"Decoding Authentication_Failure_Parameter iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -93,15 +93,15 @@ int Authentication_Failure_Parameter::decodefrombuffer(
length = *(buf + decoded_size);
decoded_size++;
Logger::nas_mm().debug(
"decoded IE Authentication_Failure_Parameter length(%d)", length);
"Decoded IE Authentication_Failure_Parameter length (%d)", length);
decode_bstring(&value, length, (buf + decoded_size), len - decoded_size);
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug(
"decoded Authentication_Failure_Parameter value(0x%x)",
(uint8_t*) value->data[i]);
"Decoded Authentication_Failure_Parameter value (0x%x)",
(uint8_t) value->data[i]);
}
Logger::nas_mm().debug(
"decoded Authentication_Failure_Parameter len(%d)", decoded_size);
"Decoded Authentication_Failure_Parameter len (%d)", decoded_size);
return decoded_size;
}
......@@ -96,7 +96,7 @@ int Authentication_Response_Parameter::decodefrombuffer(
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug(
"Decoded NAS_Message_Container value 0x%x", (uint8_t*) PARA->data[i]);
"Decoded NAS_Message_Container value 0x%x", (uint8_t) PARA->data[i]);
}
Logger::nas_mm().debug(
"Decoded Authentication_Response_Parameter (len %d)", decoded_size);
......
......@@ -48,12 +48,6 @@ DNN::DNN() {}
//------------------------------------------------------------------------------
DNN::~DNN() {}
//------------------------------------------------------------------------------
/*void DNN::setValue(uint8_t iei, uint8_t value) {
_iei = iei;
_value = value;
}*/
//------------------------------------------------------------------------------
void DNN::getValue(bstring& dnn) {
// dnn = _DNN;
......@@ -100,7 +94,7 @@ int DNN::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
decoded_size += length;
for (int i = 0; i < blength(_DNN); i++) {
Logger::nas_mm().debug(
"Decoded DNN value: 0x%x", (uint8_t*) bdata(_DNN)[i]);
"Decoded DNN value: 0x%x", (uint8_t) bdata(_DNN)[i]);
}
Logger::nas_mm().debug("Decoded DNN len: %d", decoded_size);
return decoded_size;
......
......@@ -70,13 +70,13 @@ int EAP_Message::encode2buffer(uint8_t* buf, int len) {
int size = encode_bstring(EAP, (buf + encoded_size), len - encoded_size);
encoded_size += size;
Logger::nas_mm().debug("encoded EAP_Message len(%d)", encoded_size);
Logger::nas_mm().debug("encoded EAP_Message len (%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int EAP_Message::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding EAP_Message iei(0x%x)", *buf);
Logger::nas_mm().debug("decoding EAP_Message iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -90,8 +90,8 @@ int EAP_Message::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug(
"decoded EAP_Message value(0x%x)", (uint8_t*) EAP->data[i]);
"decoded EAP_Message value (0x%x)", (uint8_t) EAP->data[i]);
}
Logger::nas_mm().debug("decoded EAP_Message len(%d)", decoded_size);
Logger::nas_mm().debug("decoded EAP_Message len (%d)", decoded_size);
return decoded_size;
}
......@@ -61,9 +61,9 @@ void EPS_NAS_Message_Container::getValue(bstring& value) {
//------------------------------------------------------------------------------
int EPS_NAS_Message_Container::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding EPS_NAS_Message_Container iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding EPS_NAS_Message_Container iei (0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
Logger::nas_mm().error("Len is less than %d", length);
return 0;
}
int encoded_size = 0;
......@@ -82,14 +82,14 @@ int EPS_NAS_Message_Container::encode2buffer(uint8_t* buf, int len) {
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug(
"encoded EPS_NAS_Message_Container len(%d)", encoded_size);
"Encoded EPS_NAS_Message_Container len (%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int EPS_NAS_Message_Container::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding EPS_NAS_Message_Container iei(0x%x)", *buf);
Logger::nas_mm().debug("Decoding EPS_NAS_Message_Container iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -103,10 +103,10 @@ int EPS_NAS_Message_Container::decodefrombuffer(
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug(
"decoded EPS_NAS_Message_Container value(0x%x)",
(uint8_t*) _value->data[i]);
"Decoded EPS_NAS_Message_Container value (0x%x)",
(uint8_t) _value->data[i]);
}
Logger::nas_mm().debug(
"decoded EPS_NAS_Message_Container len(%d)", decoded_size);
"Decoded EPS_NAS_Message_Container len (%d)", decoded_size);
return decoded_size;
}
......@@ -59,9 +59,9 @@ uint8_t IMEISV_Request::getValue() {
//------------------------------------------------------------------------------
int IMEISV_Request::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding IMEISV_Request iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding IMEISV_Request iei (0x%x)", _iei);
if (len < 1) {
Logger::nas_mm().error("len is less than 1");
Logger::nas_mm().error("Len is less than 1");
return 0;
}
uint8_t octet = 0;
......@@ -73,15 +73,16 @@ int IMEISV_Request::encode2buffer(uint8_t* buf, int len) {
} else {
octet = (_iei << 4) | (_value & 0x07);
*buf = octet;
Logger::nas_mm().debug("encoded IMEISV_Request IE(len(1 octet))");
Logger::nas_mm().debug("Encoded IMEISV_Request IE (len - 1 octet)");
return 1;
}
return 1;
}
//------------------------------------------------------------------------------
int IMEISV_Request::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -91,7 +92,7 @@ int IMEISV_Request::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
_iei = 0;
}
_value = octet & 0x07;
Logger::nas_mm().debug("decoded IMEISV_Request value(0x%x)", _value);
Logger::nas_mm().debug("Decoded IMEISV_Request value (0x%x)", _value);
return 1;
}
}
......@@ -65,9 +65,9 @@ bool LADN_Indication::getValue(std::vector<bstring>& ladn) {
//------------------------------------------------------------------------------
int LADN_Indication::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding LADN_Indication iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding LADN_Indication iei (0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
Logger::nas_mm().error("Len is less than %d", length);
return 0;
}
int encoded_size = 0;
......@@ -88,13 +88,13 @@ int LADN_Indication::encode2buffer(uint8_t* buf, int len) {
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("encoded LADN_Indication len(%d)", encoded_size);
Logger::nas_mm().debug("Encoded LADN_Indication len (%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding LADN_Indication iei(0x%x)", *buf);
Logger::nas_mm().debug("Decoding LADN_Indication iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -104,7 +104,7 @@ int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
decoded_size++;
length |= (*(buf + decoded_size)) << 8;
decoded_size++;
Logger::nas_mm().debug("decoded LADN_Indication len(%d)", length);
Logger::nas_mm().debug("Decoded LADN_Indication len (%d)", length);
int LEAGTH = length;
uint8_t len_dnn;
bstring dnn;
......@@ -120,10 +120,10 @@ int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
for (int i = 0; i < LADN.size(); i++) {
for (int j = 0; j < blength(LADN.at(i)); j++) {
Logger::nas_mm().debug(
"decoded LADN_Indication value(0x%x)",
(uint8_t*) LADN.at(i)->data[j]);
"Decoded LADN_Indication value (0x%x)",
(uint8_t) LADN.at(i)->data[j]);
}
}
Logger::nas_mm().debug("decoded LADN_Indication len(%d)", decoded_size);
Logger::nas_mm().debug("Decoded LADN_Indication len (%d)", decoded_size);
return decoded_size;
}
......@@ -52,9 +52,9 @@ MICO_Indication::~MICO_Indication(){};
//------------------------------------------------------------------------------
int MICO_Indication::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding MICO_Indication IE iei(0x%x)", iei);
Logger::nas_mm().debug("Encoding MICO_Indication IE iei (0x%x)", iei);
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return -1;
} else {
uint8_t octet = 0;
......@@ -66,17 +66,18 @@ int MICO_Indication::encode2buffer(uint8_t* buf, int len) {
} else {
octet = (iei << 4) | (SPRTI << 1) | RAAI;
*buf = octet;
Logger::nas_mm().debug("encoded MICO_Indication IE(len(1 octet))");
Logger::nas_mm().debug("Encoded MICO_Indication IE (len: 1 octet)");
return 1;
}
}
return 1;
}
//------------------------------------------------------------------------------
int MICO_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding MICO_Indication IE");
Logger::nas_mm().debug("Decoding MICO_Indication IE");
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -88,7 +89,7 @@ int MICO_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
SPRTI = octet & 0x02;
RAAI = octet & 0x01;
Logger::nas_mm().debug(
"decoded MICO_Indication iei(0x%x) sprti(0x%x) raai(0x%x)", iei, SPRTI,
"decoded MICO_Indication iei (0x%x) sprti (0x%x) raai (0x%x)", iei, SPRTI,
RAAI);
return 1;
}
......
......@@ -63,7 +63,7 @@ void NAS_Message_Container::getValue(bstring& value) {
int NAS_Message_Container::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("Encoding NAS_Message_Container IEI 0x%x", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
Logger::nas_mm().error("Len is less than %d", length);
return 0;
}
int encoded_size = 0;
......@@ -89,7 +89,7 @@ int NAS_Message_Container::encode2buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
int NAS_Message_Container::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("Decoding NAS_Message_Container iei(0x%x)", *buf);
Logger::nas_mm().debug("Decoding NAS_Message_Container iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -103,7 +103,7 @@ int NAS_Message_Container::decodefrombuffer(
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug(
"Decoded NAS_Message_Container value 0x%x", (uint8_t*) _value->data[i]);
"Decoded NAS_Message_Container value 0x%x", (uint8_t) _value->data[i]);
}
Logger::nas_mm().debug(
"Decoded NAS_Message_Container (len %d)", decoded_size);
......
......@@ -60,7 +60,7 @@ NSSAI::~NSSAI() {}
void NSSAI::setS_NAASI(uint8_t SST) {}
//------------------------------------------------------------------------------
bool NSSAI::getValue(std::vector<struct SNSSAI_s>& nssai) {
void NSSAI::getValue(std::vector<struct SNSSAI_s>& nssai) {
nssai.assign(S_NSSAI.begin(), S_NSSAI.end());
}
......
......@@ -42,7 +42,7 @@ class NSSAI {
void setS_NAASI(uint8_t SST);
int encode2buffer(uint8_t* buf, int len);
int decodefrombuffer(uint8_t* buf, int len, bool is_option);
bool getValue(std::vector<struct SNSSAI_s>& nssai);
void getValue(std::vector<struct SNSSAI_s>& nssai);
private:
uint8_t _iei;
......
......@@ -54,9 +54,9 @@ uint8_t NSSAI_Inclusion_Mode::getValue() {
//------------------------------------------------------------------------------
int NSSAI_Inclusion_Mode::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding NSSAI_Inclusion_Mode IE iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding NSSAI_Inclusion_Mode IE iei (0x%x)", _iei);
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return -1;
} else {
uint8_t octet = 0;
......@@ -68,18 +68,19 @@ int NSSAI_Inclusion_Mode::encode2buffer(uint8_t* buf, int len) {
} else {
octet = (_iei << 4) | (_value & 0x0f);
*buf = octet;
Logger::nas_mm().debug("encoded NSSAI_Inclusion_Mode IE(len(1 octet))");
Logger::nas_mm().debug("Encoded NSSAI_Inclusion_Mode IE(len, 1 octet)");
return 1;
}
}
return 1;
}
//------------------------------------------------------------------------------
int NSSAI_Inclusion_Mode::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding NSSAI_Inclusion_Mode IE");
Logger::nas_mm().debug("Decoding NSSAI_Inclusion_Mode IE");
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -90,7 +91,7 @@ int NSSAI_Inclusion_Mode::decodefrombuffer(
}
_value = octet & 0x0f;
Logger::nas_mm().debug(
"decoded NSSAI_Inclusion_Mode iei(0x%x) value(0x%x)", _iei, _value);
"Decoded NSSAI_Inclusion_Mode iei (0x%x) value (0x%x)", _iei, _value);
return 1;
}
}
......@@ -71,7 +71,7 @@ bool Network_Slicing_Indication::getNSSCI() {
//------------------------------------------------------------------------------
int Network_Slicing_Indication::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding Network_Slicing_Indication iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding Network_Slicing_Indication iei (0x%x)", _iei);
if (len < 1) {
// Logger::nas_mm().error("len is less than %d", length);
return 0;
......@@ -85,20 +85,21 @@ int Network_Slicing_Indication::encode2buffer(uint8_t* buf, int len) {
} else {
octet = (_iei << 4) | (DCNI << 1) | NSSCI;
Logger::nas_mm().debug(
"decoded Network_Slicing_Indication DCNI(0x%x) NSSCI(0x%x)", octet,
"Decoded Network_Slicing_Indication DCNI (0x%x) NSSCI (0x%x)", octet,
NSSCI);
*buf = octet;
Logger::nas_mm().debug(
"encoded Network_Slicing_Indication IE(len(1 octet))");
"Encoded Network_Slicing_Indication IE (len, 1 octet)");
return 1;
}
return 1;
}
//------------------------------------------------------------------------------
int Network_Slicing_Indication::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -112,7 +113,7 @@ int Network_Slicing_Indication::decodefrombuffer(
DCNI = octet & 0x02;
NSSCI = octet & 0x01;
Logger::nas_mm().debug(
"decoded Network_Slicing_Indication DCNI(0x%x) NSSCI(0x%x)", DCNI,
"Decoded Network_Slicing_Indication DCNI (0x%x) NSSCI (0x%x)", DCNI,
NSSCI);
return 1;
}
......
......@@ -56,9 +56,9 @@ uint8_t Non_3GPP_NW_Provided_Policies::getValue() {
//------------------------------------------------------------------------------
int Non_3GPP_NW_Provided_Policies::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug(
"encoding Non_3GPP_NW_Provided_Policies IE iei(0x%x)", _iei);
"Encoding Non_3GPP_NW_Provided_Policies IE iei(0x%x)", _iei);
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return -1;
} else {
uint8_t octet = 0;
......@@ -71,18 +71,19 @@ int Non_3GPP_NW_Provided_Policies::encode2buffer(uint8_t* buf, int len) {
octet = (_iei << 4) | (_value & 0x0f);
*buf = octet;
Logger::nas_mm().debug(
"encoded Non_3GPP_NW_Provided_Policies IE(len(1 octet))");
"Encoded Non_3GPP_NW_Provided_Policies IE (len, 1 octet)");
return 1;
}
}
return 1;
}
//------------------------------------------------------------------------------
int Non_3GPP_NW_Provided_Policies::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding Non_3GPP_NW_Provided_Policies IE");
Logger::nas_mm().debug("Decoding Non_3GPP_NW_Provided_Policies IE");
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -93,7 +94,7 @@ int Non_3GPP_NW_Provided_Policies::decodefrombuffer(
}
_value = octet & 0x0f;
Logger::nas_mm().debug(
"decoded Non_3GPP_NW_Provided_Policies iei(0x%x) value(0x%x)", _iei,
"Decoded Non_3GPP_NW_Provided_Policies iei (0x%x) value (0x%x)", _iei,
_value);
return 1;
}
......
......@@ -83,7 +83,7 @@ void Payload_Container::getValue(bstring& cnt) {
//------------------------------------------------------------------------------
int Payload_Container::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding Payload_Container iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding Payload_Container iei(0x%x)", _iei);
if (len < length) {
// Logger::nas_mm().error("len is less than %d", length);
// return 0;
......@@ -147,19 +147,20 @@ int Payload_Container::encode2buffer(uint8_t* buf, int len) {
}
}
#endif
Logger::nas_mm().debug("encoded Payload_Container len(%d)", encoded_size);
Logger::nas_mm().debug("Encoded Payload_Container len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int Payload_Container::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
return 0;
}
//------------------------------------------------------------------------------
int Payload_Container::decodefrombuffer(
uint8_t* buf, int len, bool is_option, uint8_t type) {
Logger::nas_mm().debug("decoding Payload_Container iei(0x%x)", _iei);
Logger::nas_mm().debug("Decoding Payload_Container iei (0x%x)", _iei);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -211,7 +212,6 @@ int Payload_Container::decodefrombuffer(
CONTENT.insert(CONTENT.end(), payloadcontainerentry);
num_entries--;
}
// Logger::nas_mm().debug("decoded Payload_Container value(0x%x)", _value);
Logger::nas_mm().debug("decoded Payload_Container len(%d)", decoded_size);
Logger::nas_mm().debug("Decoded Payload_Container len (%d)", decoded_size);
return decoded_size;
}
......@@ -70,6 +70,7 @@ int ServiceType::decodefrombuffer(
value = (*buf) & 0x0f;
return 0;
}
return 0;
}
//------------------------------------------------------------------------------
......
......@@ -86,10 +86,11 @@ int _5GSDeregistrationType::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().error("Encoding 5GSDeregistrationType IE");
if (len < 1) {
Logger::nas_mm().error(
"encoding 5GSDeregistrationType error(len is less than one)");
"Encoding 5GSDeregistrationType error (len is less than one)");
return -1;
}
*buf = u1.b;
return 0;
}
//------------------------------------------------------------------------------
......
......@@ -94,11 +94,15 @@ int _5GSTrackingAreaIdList::encode_00_type(
//------------------------------------------------------------------------------
int _5GSTrackingAreaIdList::encode_01_type(
p_tai_t item, uint8_t* buf, int len) {}
p_tai_t item, uint8_t* buf, int len) {
return 1;
}
//------------------------------------------------------------------------------
int _5GSTrackingAreaIdList::encode_10_type(
p_tai_t item, uint8_t* buf, int len) {}
p_tai_t item, uint8_t* buf, int len) {
return 1;
}
//------------------------------------------------------------------------------
int _5GSTrackingAreaIdList::encode_mcc_mnc(
......
......@@ -143,4 +143,5 @@ int AuthenticationFailure::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationFailure message len (%d)", decoded_size);
return 1;
}
......@@ -102,4 +102,5 @@ int AuthenticationReject::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationReject message len (%d)", decoded_size);
return 1;
}
......@@ -203,4 +203,5 @@ int AuthenticationRequest::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationRequest message (len %d)", decoded_size);
return 1;
}
......@@ -152,4 +152,5 @@ int AuthenticationResponse::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationResponse message len (%d)", decoded_size);
return 1;
}
......@@ -143,4 +143,5 @@ int AuthenticationResult::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationResult message len (%d)", decoded_size);
return 1;
}
......@@ -71,4 +71,5 @@ int DeregistrationAccept::decodefrombuffer(
plain_header = header;
Logger::nas_mm().debug(
"decoded De-registrationReject message len (%d)", decoded_size);
return 1;
}
......@@ -92,4 +92,5 @@ int IdentityRequest::decodefrombuffer(
Logger::nas_mm().debug("decoded_size(%d)", decoded_size);
Logger::nas_mm().debug(
"decoded IdentityRequest message len(%d)", decoded_size);
return 1;
}
......@@ -842,4 +842,5 @@ int RegistrationAccept::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded RegistrationAccept message len (%d)", decoded_size);
return 1;
}
......@@ -105,4 +105,5 @@ int RegistrationComplete::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded RegistrationComplete message len (%d)", decoded_size);
return 1;
}
......@@ -233,6 +233,7 @@ bool RegistrationRequest::getUeSecurityCapability(uint8_t& ea, uint8_t& ia) {
} else {
return -1;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -249,6 +250,7 @@ bool RegistrationRequest::getRequestedNssai(
} else {
return -1;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -273,6 +275,7 @@ bool RegistrationRequest::getS1UeNetworkCapability(uint8_t& eea, uint8_t& eia) {
} else {
return -1;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -803,7 +806,7 @@ int RegistrationRequest::encode2buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
int RegistrationRequest::decodefrombuffer(
NasMmPlainHeader* header, uint8_t* buf, int len) {
Logger::nas_mm().debug("****Decoding RegistrationRequest message****");
Logger::nas_mm().debug("Decoding RegistrationRequest message");
int decoded_size = 3;
plain_header = header;
ie_5gsregistrationtype = new _5GSRegistrationType();
......@@ -1005,5 +1008,6 @@ int RegistrationRequest::decodefrombuffer(
}
}
Logger::nas_mm().debug(
"****Decoded RegistrationRequest message (len %d)****", decoded_size);
"Decoded RegistrationRequest message (len %d)", decoded_size);
return 1;
}
......@@ -303,4 +303,5 @@ int SecurityModeCommand::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded SecurityModeCommand message len (%d)", decoded_size);
return 1;
}
......@@ -187,4 +187,5 @@ int SecurityModeComplete::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded SecurityModeComplete message len (%d)", decoded_size);
return 1;
}
......@@ -93,4 +93,5 @@ int SecurityModeReject::decodefrombuffer(
Logger::nas_mm().debug("first option iei(0x%x)", octet);
Logger::nas_mm().debug(
"decoded SecurityModeReject message len(%d)", decoded_size);
return 1;
}
......@@ -232,6 +232,7 @@ int ServiceRequest::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded ServiceRequest message len (%d)", decoded_size);
return 1;
}
//------------------------------------------------------------------------------
......
......@@ -397,4 +397,5 @@ int ULNASTransport::decodefrombuffer(
}
Logger::nas_mm().debug(
"decoded ULNASTransport message len(%d)", decoded_size);
return 1;
}
......@@ -825,6 +825,7 @@ bool InitialContextSetupRequestMsg::getCoreNetworkAssistanceInfo(
taiListForRRcInactive.push_back(tai_str);
}
return true;
}
//------------------------------------------------------------------------------
......
......@@ -162,4 +162,5 @@ int UEContextReleaseCommandMsg::encode2buffer(uint8_t* buf, int buf_size) {
//------------------------------------------------------------------------------
bool UEContextReleaseCommandMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) {
pdu = ngap_msg_pdu;
return true;
}
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