Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
63cb0677
Commit
63cb0677
authored
Feb 08, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup for Identity Request/Response
parent
525280bd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
17 deletions
+21
-17
src/nas/msgs/IdentityRequest.cpp
src/nas/msgs/IdentityRequest.cpp
+6
-6
src/nas/msgs/IdentityRequest.hpp
src/nas/msgs/IdentityRequest.hpp
+1
-1
src/nas/msgs/IdentityResponse.cpp
src/nas/msgs/IdentityResponse.cpp
+8
-6
src/nas/msgs/IdentityResponse.hpp
src/nas/msgs/IdentityResponse.hpp
+6
-4
No files found.
src/nas/msgs/IdentityRequest.cpp
View file @
63cb0677
...
...
@@ -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
(
"
e
ncoding IdentityRequest message"
);
Logger
::
nas_mm
().
debug
(
"
E
ncoding 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
());
...
...
src/nas/msgs/IdentityRequest.hpp
View file @
63cb0677
...
...
@@ -40,7 +40,7 @@ class IdentityRequest : public NasMmPlainHeader {
// TODO: Get
public:
_5gsIdentityType
_5gs_identity_type_
;
// Mandatory
_5gsIdentityType
ie_5gs_identity_type
;
// Mandatory
};
}
// namespace nas
...
...
src/nas/msgs/IdentityResponse.cpp
View file @
63cb0677
...
...
@@ -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
,
routing
I
nd
,
protection_sch_id
,
msin
);
mcc
,
mnc
,
routing
_i
nd
,
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
(
"
e
ncoding IdentityResponse message"
);
Logger
::
nas_mm
().
debug
(
"
E
ncoding IdentityResponse message"
);
int
encoded_size
=
0
;
int
encoded_ie_size
=
0
;
...
...
src/nas/msgs/IdentityResponse.hpp
View file @
63cb0677
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment