Commit 63cb0677 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Code cleanup for Identity Request/Response

parent 525280bd
......@@ -40,12 +40,12 @@ void IdentityRequest::SetHeader(uint8_t security_header_type) {
//------------------------------------------------------------------------------
void IdentityRequest::Set5gsIdentityType(uint8_t value) {
_5gs_identity_type_.SetValue(value);
ie_5gs_identity_type.SetValue(value);
}
//------------------------------------------------------------------------------
int IdentityRequest::Encode(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding IdentityRequest message");
Logger::nas_mm().debug("Encoding IdentityRequest message");
int encoded_size = 0;
int encoded_ie_size = 0;
......@@ -57,8 +57,8 @@ int IdentityRequest::Encode(uint8_t* buf, int len) {
}
encoded_size += encoded_ie_size;
int size = _5gs_identity_type_.Encode(buf + encoded_size, len - encoded_size);
int size =
ie_5gs_identity_type.Encode(buf + encoded_size, len - encoded_size);
if (size != KEncodeDecodeError) {
encoded_size += size;
} else {
......@@ -90,8 +90,8 @@ int IdentityRequest::Decode(uint8_t* buf, int len) {
}
decoded_size += decoded_result;
decoded_result =
_5gs_identity_type_.Decode(buf + decoded_size, len - decoded_size, false);
decoded_result = ie_5gs_identity_type.Decode(
buf + decoded_size, len - decoded_size, false);
if (decoded_result == KEncodeDecodeError) {
Logger::nas_mm().error(
"Decoding %s error", _5gsIdentityType::GetIeName().c_str());
......
......@@ -40,7 +40,7 @@ class IdentityRequest : public NasMmPlainHeader {
// TODO: Get
public:
_5gsIdentityType _5gs_identity_type_; // Mandatory
_5gsIdentityType ie_5gs_identity_type; // Mandatory
};
} // namespace nas
......
......@@ -45,8 +45,9 @@ void IdentityResponse::Get5gsMobileIdentity(
}
//------------------------------------------------------------------------------
void IdentityResponse::SetSuciSupiFormatImsi(
const string mcc, const string mnc, const string routingInd,
uint8_t protection_sch_id, const string msin) {
const std::string& mcc, const std::string& mnc,
const std::string& routing_ind, uint8_t protection_sch_id,
const std::string& msin) {
if (protection_sch_id != NULL_SCHEME) {
Logger::nas_mm().error(
"Encoding suci and supi format for imsi error, please choose right "
......@@ -54,14 +55,15 @@ void IdentityResponse::SetSuciSupiFormatImsi(
return;
} else {
ie_mobile_identity.SetSuciWithSupiImsi(
mcc, mnc, routingInd, protection_sch_id, msin);
mcc, mnc, routing_ind, protection_sch_id, msin);
}
}
//------------------------------------------------------------------------------
void IdentityResponse::SetSuciSupiFormatImsi(
const string mcc, const string mnc, const string routingInd,
uint8_t protection_sch_id, uint8_t hnpki, const string msin) {
const std::string& mcc, const std::string& mnc,
const std::string& routingInd, uint8_t protection_sch_id, uint8_t hnpki,
const std::string& msin) {
// TODO:
}
......@@ -82,7 +84,7 @@ void IdentityResponse::Set5gSTmsi() {
//------------------------------------------------------------------------------
int IdentityResponse::Encode(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding IdentityResponse message");
Logger::nas_mm().debug("Encoding IdentityResponse message");
int encoded_size = 0;
int encoded_ie_size = 0;
......
......@@ -39,11 +39,13 @@ class IdentityResponse : public NasMmPlainHeader {
void Get5gsMobileIdentity(_5GSMobileIdentity& mobile_identity) const;
void SetSuciSupiFormatImsi(
const string mcc, const string mnc, const string routingInd,
uint8_t protection_sch_id, const string msin);
const std::string& mcc, const std::string& mnc,
const std::string& routing_ind, uint8_t protection_sch_id,
const std::string& msin);
void SetSuciSupiFormatImsi(
const string mcc, const string mnc, const string routingInd,
uint8_t protection_sch_id, uint8_t hnpki, const string msin);
const std::string& mcc, const std::string& mnc,
const std::string& routing_ind, uint8_t protection_sch_id, uint8_t hnpki,
const std::string& msin);
void Set5gGuti();
void SetImeiImeisv();
......
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