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
16ea304a
Commit
16ea304a
authored
Sep 30, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Mobile Identity
parent
1b0cacb0
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
134 deletions
+136
-134
src/nas/ies/5GSMobileIdentity.cpp
src/nas/ies/5GSMobileIdentity.cpp
+106
-118
src/nas/ies/5GSMobileIdentity.hpp
src/nas/ies/5GSMobileIdentity.hpp
+11
-5
src/nas/ies/5GSRegistrationType.cpp
src/nas/ies/5GSRegistrationType.cpp
+1
-1
src/nas/msgs/DeregistrationRequest.cpp
src/nas/msgs/DeregistrationRequest.cpp
+8
-5
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+10
-5
No files found.
src/nas/ies/5GSMobileIdentity.cpp
View file @
16ea304a
This diff is collapsed.
Click to expand it.
src/nas/ies/5GSMobileIdentity.hpp
View file @
16ea304a
...
...
@@ -23,6 +23,7 @@
#define _5GS_MOBILE_IDENTITY_H_
#include <stdint.h>
#include <optional>
#include "struct.hpp"
extern
"C"
{
...
...
@@ -95,7 +96,10 @@ class _5GSMobileIdentity {
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
suci_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_guti_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
encodeMssMnc2buffer
(
string
mcc
,
string
mnc
,
uint8_t
*
buf
);
int
encodeMssMnc2buffer
(
const
std
::
string
&
mcc_str
,
const
std
::
string
&
mnc_str
,
uint8_t
*
buf
);
int
encodeRoutid2buffer
(
string
routid
,
uint8_t
*
buf
);
int
encodeMSIN2buffer
(
string
msinstr
,
uint8_t
*
buf
);
int
_5g_s_tmsi_encode2buffer
(
uint8_t
*
buf
,
int
len
);
...
...
@@ -105,13 +109,15 @@ class _5GSMobileIdentity {
int
imeisv_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
int
suci_decodefrombuffer
(
uint8_t
*
buf
,
int
len
,
int
length
);
int
_5g_guti_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
void
set5GGUTI
(
const
string
mcc
,
const
string
mnc
,
uint8_t
amf_region_id
,
uint16_t
amf_set_id
,
uint8_t
amf_pointer
,
const
uint32_t
_5g_tmsi
);
void
get5GGUTI
(
_5G_GUTI_t
&
);
const
string
&
mcc
,
const
string
&
mnc
,
const
uint8_t
&
amf_region_id
,
const
uint16_t
&
amf_set_id
,
const
uint8_t
&
amf_pointer
,
const
uint32_t
&
_5g_tmsi
);
void
get5GGUTI
(
std
::
optional
<
_5G_GUTI_t
>&
)
const
;
void
setSuciWithSupiImsi
(
const
string
&
mcc
,
const
string
&
mnc
,
const
string
&
routingInd
,
...
...
@@ -131,7 +137,7 @@ class _5GSMobileIdentity {
uint16_t
length
;
uint8_t
typeOfIdentity
:
3
;
_5G_GUTI_t
*
_5g_guti
;
std
::
optional
<
_5G_GUTI_t
>
_5g_guti
;
IMEI_IMEISV_t
*
imei_imeisv
;
SUCI_imsi_t
*
supi_format_imsi
;
_5G_S_TMSI_t
*
_5g_s_tmsi
;
...
...
src/nas/ies/5GSRegistrationType.cpp
View file @
16ea304a
...
...
@@ -104,7 +104,7 @@ int _5GSRegistrationType::decodeFromBuffer(
Logger
::
nas_mm
().
debug
(
"Decoded 5GSRegistrationType IE (%d octet)"
,
decoded_size
);
return
decoded_size
;
return
0
;
// to read NAS Key Set Identifier (1/2 octet)
}
//------------------------------------------------------------------------------
...
...
src/nas/msgs/DeregistrationRequest.cpp
View file @
16ea304a
...
...
@@ -132,12 +132,15 @@ bool DeregistrationRequest::getSuciSupiFormatImsi(nas::SUCI_imsi_t& imsi) {
//------------------------------------------------------------------------------
std
::
string
DeregistrationRequest
::
get_5g_guti
()
{
if
(
ie_5gs_mobility_id
)
{
nas
::
_5G_GUTI_t
guti
;
std
::
optional
<
nas
::
_5G_GUTI_t
>
guti
=
std
::
nullopt
;
ie_5gs_mobility_id
->
get5GGUTI
(
guti
);
std
::
string
guti_str
=
guti
.
mcc
+
guti
.
mnc
+
std
::
to_string
(
guti
.
amf_region_id
)
+
std
::
to_string
(
guti
.
amf_set_id
)
+
std
::
to_string
(
guti
.
amf_pointer
)
+
conv
::
tmsi_to_string
(
guti
.
_5g_tmsi
);
if
(
!
guti
.
has_value
())
return
{};
std
::
string
guti_str
=
guti
.
value
().
mcc
+
guti
.
value
().
mnc
+
std
::
to_string
(
guti
.
value
().
amf_region_id
)
+
std
::
to_string
(
guti
.
value
().
amf_set_id
)
+
std
::
to_string
(
guti
.
value
().
amf_pointer
)
+
conv
::
tmsi_to_string
(
guti
.
value
().
_5g_tmsi
);
Logger
::
nas_mm
().
debug
(
"5G GUTI %s"
,
guti_str
.
c_str
());
return
guti_str
;
}
else
{
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
16ea304a
...
...
@@ -138,12 +138,15 @@ bool RegistrationRequest::getSuciSupiFormatImsi(nas::SUCI_imsi_t& imsi) {
//------------------------------------------------------------------------------
std
::
string
RegistrationRequest
::
get_5g_guti
()
{
if
(
ie_5gs_mobility_id
)
{
nas
::
_5G_GUTI_t
guti
;
std
::
optional
<
nas
::
_5G_GUTI_t
>
guti
=
std
::
nullopt
;
ie_5gs_mobility_id
->
get5GGUTI
(
guti
);
std
::
string
guti_str
=
guti
.
mcc
+
guti
.
mnc
+
std
::
to_string
(
guti
.
amf_region_id
)
+
std
::
to_string
(
guti
.
amf_set_id
)
+
std
::
to_string
(
guti
.
amf_pointer
)
+
conv
::
tmsi_to_string
(
guti
.
_5g_tmsi
);
if
(
!
guti
.
has_value
())
return
{};
std
::
string
guti_str
=
guti
.
value
().
mcc
+
guti
.
value
().
mnc
+
std
::
to_string
(
guti
.
value
().
amf_region_id
)
+
std
::
to_string
(
guti
.
value
().
amf_set_id
)
+
std
::
to_string
(
guti
.
value
().
amf_pointer
)
+
conv
::
tmsi_to_string
(
guti
.
value
().
_5g_tmsi
);
Logger
::
nas_mm
().
debug
(
"5G GUTI %s"
,
guti_str
.
c_str
());
return
guti_str
;
}
else
{
...
...
@@ -172,7 +175,9 @@ void RegistrationRequest::setAdditional_GUTI_SUCI_SUPI_format_IMSI(
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
getAdditionalGuti
(
nas
::
_5G_GUTI_t
&
guti
)
{
if
(
ie_additional_guti
)
{
std
::
optional
<
nas
::
_5G_GUTI_t
>
guti
=
std
::
nullopt
;
ie_additional_guti
->
get5GGUTI
(
guti
);
if
(
!
guti
.
has_value
())
return
false
;
return
true
;
}
else
{
return
false
;
...
...
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