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
7b5b106a
Commit
7b5b106a
authored
Sep 25, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get 5G mobile identity in Deregistration msg
parent
99931b44
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
18 deletions
+36
-18
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+18
-1
src/nas/ies/5GSMobilityIdentity.cpp
src/nas/ies/5GSMobilityIdentity.cpp
+7
-1
src/nas/ies/5GSMobilityIdentity.hpp
src/nas/ies/5GSMobilityIdentity.hpp
+0
-5
src/nas/msgs/DeregistrationRequest.cpp
src/nas/msgs/DeregistrationRequest.cpp
+9
-9
src/nas/msgs/DeregistrationRequest.hpp
src/nas/msgs/DeregistrationRequest.hpp
+2
-2
No files found.
src/amf-app/amf_n1.cpp
View file @
7b5b106a
...
...
@@ -1509,9 +1509,26 @@ void amf_n1::ue_initiate_de_registration_handle(uint32_t ran_ue_ngap_id, long am
//decode NAS msg
DeregistrationRequest
*
deregReq
=
new
DeregistrationRequest
();
deregReq
->
decodefrombuffer
(
NULL
,
(
uint8_t
*
)
bdata
(
nas
),
blength
(
nas
));
/*
_5gs_deregistration_type_t type = {};
deregReq->getDeregistrationType(type);
uint8_t deregType = 0;
deregReq->getDeregistrationType(deregType);
Logger::amf_n1().debug("Deregistration Type %X", deregType);
*/
//TODO: validate 5G Mobile Identity
uint8_t
mobile_id_type
=
0
;
deregReq
->
getMobilityIdentityType
(
mobile_id_type
);
Logger
::
amf_n1
().
debug
(
"5G Mobile Identity %X"
,
mobile_id_type
);
switch
(
mobile_id_type
)
{
case
_5G_GUTI
:
{
Logger
::
amf_n1
().
debug
(
"5G Mobile Identity, GUTI %s"
,
deregReq
->
get_5g_guti
().
c_str
());
}
break
;
default:
{
}
}
//Prepare DeregistrationAccept
DeregistrationAccept
*
deregAccept
=
new
DeregistrationAccept
();
...
...
@@ -1773,7 +1790,7 @@ void amf_n1::run_mobility_registration_update_procedure(std::shared_ptr<nas_cont
//------------------------------------------------------------------------------
void
amf_n1
::
set_5gmm_state
(
std
::
shared_ptr
<
nas_context
>
nc
,
_5gmm_state_t
state
)
{
Logger
::
amf_n1
().
debug
(
"Set 5GMM state to %s"
,
_5gmm_state_e2str
[
state
]);
Logger
::
amf_n1
().
debug
(
"Set 5GMM state to %s"
,
_5gmm_state_e2str
[
state
]
.
c_str
()
);
std
::
unique_lock
lock
(
m_nas_context
);
nc
.
get
()
->
_5gmm_state
=
state
;
//TODO:
...
...
src/nas/ies/5GSMobilityIdentity.cpp
View file @
7b5b106a
...
...
@@ -194,7 +194,13 @@ void _5GSMobilityIdentity::getSuciWithSupiImsi(SUCI_imsi_t &ptr) {
//------------------------------------------------------------------------------
void
_5GSMobilityIdentity
::
get5GGUTI
(
_5G_GUTI_t
&
ptr
)
{
ptr
=
*
_5g_guti
;
//ptr = *_5g_guti;
ptr
.
mcc
=
_5g_guti
->
mcc
;
ptr
.
mnc
=
_5g_guti
->
mnc
;
ptr
.
amf_region_id
=
_5g_guti
->
amf_region_id
;
ptr
.
amf_set_id
=
_5g_guti
->
amf_set_id
;
ptr
.
amf_pointer
=
_5g_guti
->
amf_pointer
;
ptr
.
_5g_tmsi
=
_5g_guti
->
_5g_tmsi
;
}
//------------------------------------------------------------------------------
...
...
src/nas/ies/5GSMobilityIdentity.hpp
View file @
7b5b106a
...
...
@@ -48,11 +48,6 @@ typedef struct _5G_GUTI_s {
uint16_t
amf_pointer
;
uint32_t
_5g_tmsi
;
const
std
::
string
&
toString
()
const
{
std
::
string
str
;
str
=
mcc
+
mnc
+
std
::
to_string
(
amf_region_id
)
+
std
::
to_string
(
amf_set_id
)
+
std
::
to_string
(
amf_pointer
)
+
std
::
to_string
(
_5g_tmsi
);
return
str
;
}
}
_5G_GUTI_t
;
typedef
struct
IMEI_or_IMEISV_s
{
...
...
src/nas/msgs/DeregistrationRequest.cpp
View file @
7b5b106a
...
...
@@ -30,6 +30,7 @@
#include "3gpp_ts24501.hpp"
#include "logger.hpp"
#include "String2Value.hpp"
#include <string>
using
namespace
nas
;
//------------------------------------------------------------------------------
...
...
@@ -76,13 +77,11 @@ void DeregistrationRequest::getDeregistrationType(_5gs_deregistration_type_t& ty
}
//------------------------------------------------------------------------------
uint8_t
DeregistrationRequest
::
getngKSI
(
)
{
void
DeregistrationRequest
::
getngKSI
(
uint8_t
&
ng_ksi
)
{
if
(
ie_ngKSI
)
{
uint8_t
a
=
0
;
a
=
(
ie_ngKSI
->
getTypeOfSecurityContext
())
|
ie_ngKSI
->
getasKeyIdentifier
();
return
a
;
ng_ksi
=
(
ie_ngKSI
->
getTypeOfSecurityContext
())
|
ie_ngKSI
->
getasKeyIdentifier
();
}
else
{
return
-
1
;
ng_ksi
=
0
;
}
}
...
...
@@ -97,11 +96,11 @@ void DeregistrationRequest::setSUCI_SUPI_format_IMSI(const string mcc, const str
}
//------------------------------------------------------------------------------
uint8_t
DeregistrationRequest
::
getMobilityIdentityType
(
)
{
void
DeregistrationRequest
::
getMobilityIdentityType
(
uint8_t
&
type
)
{
if
(
ie_5gs_mobility_id
)
{
return
ie_5gs_mobility_id
->
gettypeOfIdentity
();
type
=
ie_5gs_mobility_id
->
gettypeOfIdentity
();
}
else
{
return
-
1
;
type
=
0
;
}
}
...
...
@@ -120,7 +119,8 @@ std::string DeregistrationRequest::get_5g_guti() {
if
(
ie_5gs_mobility_id
)
{
nas
::
_5G_GUTI_t
guti
;
ie_5gs_mobility_id
->
get5GGUTI
(
guti
);
return
guti
.
toString
();
std
::
string
str
;
//= guti.toString();
return
str
;
}
else
{
return
"error"
;
}
...
...
src/nas/msgs/DeregistrationRequest.hpp
View file @
7b5b106a
...
...
@@ -54,8 +54,8 @@ class DeregistrationRequest {
void
getDeregistrationType
(
uint8_t
&
dereg_type
);
void
getDeregistrationType
(
_5gs_deregistration_type_t
&
type
);
uint8_t
getngKSI
(
);
uint8_t
getMobilityIdentityType
(
);
void
getngKSI
(
uint8_t
&
ng_ksi
);
void
getMobilityIdentityType
(
uint8_t
&
type
);
std
::
string
get_5g_guti
();
bool
getSuciSupiFormatImsi
(
nas
::
SUCI_imsi_t
&
imsi
);
...
...
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