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
86b77209
Commit
86b77209
authored
Jan 17, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
339ac227
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
58 additions
and
47 deletions
+58
-47
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+5
-5
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-1
src/nas/ies/SorTransparentContainer.cpp
src/nas/ies/SorTransparentContainer.cpp
+7
-7
src/nas/ies/SorTransparentContainer.hpp
src/nas/ies/SorTransparentContainer.hpp
+4
-4
src/nas/msgs/AuthenticationResult.hpp
src/nas/msgs/AuthenticationResult.hpp
+6
-0
src/nas/msgs/DeregistrationRequest.cpp
src/nas/msgs/DeregistrationRequest.cpp
+1
-1
src/nas/msgs/DeregistrationRequest.hpp
src/nas/msgs/DeregistrationRequest.hpp
+14
-7
src/nas/msgs/IdentityResponse.hpp
src/nas/msgs/IdentityResponse.hpp
+1
-0
src/nas/msgs/RegistrationAccept.cpp
src/nas/msgs/RegistrationAccept.cpp
+4
-4
src/nas/msgs/RegistrationAccept.hpp
src/nas/msgs/RegistrationAccept.hpp
+2
-2
src/nas/msgs/RegistrationComplete.cpp
src/nas/msgs/RegistrationComplete.cpp
+3
-3
src/nas/msgs/RegistrationComplete.hpp
src/nas/msgs/RegistrationComplete.hpp
+8
-11
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+1
-1
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+1
-1
No files found.
src/amf-app/amf_n1.cpp
View file @
86b77209
...
...
@@ -1130,7 +1130,7 @@ void amf_n1::registration_request_handle(
}
break
;
case
_5G_GUTI
:
{
guti
=
registration_request
->
get_5g_g
uti
();
guti
=
registration_request
->
Get5gG
uti
();
Logger
::
amf_n1
().
debug
(
"Decoded GUTI from registration request message %s"
,
guti
.
c_str
());
if
(
guti
.
empty
())
{
...
...
@@ -3022,7 +3022,7 @@ void amf_n1::ue_initiate_de_registration_handle(
switch
(
mobile_id_type
)
{
case
_5G_GUTI
:
{
Logger
::
amf_n1
().
debug
(
"5G Mobile Identity, GUTI %s"
,
dereg_request
->
get_5g_g
uti
().
c_str
());
"5G Mobile Identity, GUTI %s"
,
dereg_request
->
Get5gG
uti
().
c_str
());
}
break
;
default:
{
}
...
...
@@ -3174,14 +3174,14 @@ void amf_n1::ue_initiate_de_registration_handle(
"Could not delete nas_context associated SUPI %s "
,
supi
.
c_str
());
}
if
(
remove_guti_2_nas_context
(
dereg_request
->
get_5g_g
uti
()))
{
if
(
remove_guti_2_nas_context
(
dereg_request
->
Get5gG
uti
()))
{
Logger
::
amf_n1
().
debug
(
"Deleted nas_context associated GUTI %s "
,
dereg_request
->
get_5g_g
uti
().
c_str
());
dereg_request
->
Get5gG
uti
().
c_str
());
}
else
{
Logger
::
amf_n1
().
debug
(
"Could not delete nas_context associated GUTI %s "
,
dereg_request
->
get_5g_g
uti
().
c_str
());
dereg_request
->
Get5gG
uti
().
c_str
());
}
// TODO: AMF to AN: N2 UE Context Release Request
...
...
src/nas/common/NasIeHeader.hpp
View file @
86b77209
...
...
@@ -62,7 +62,7 @@
#include "ReleaseAssistanceIndication.hpp"
#include "RequestType.hpp"
#include "S1UeSecurityCapability.hpp"
#include "S
OR_Transparent_
Container.hpp"
#include "S
orTransparent
Container.hpp"
#include "S_NSSAI.hpp"
#include "ServiceType.hpp"
#include "UENetworkCapability.hpp"
...
...
src/nas/ies/S
OR_Transparent_
Container.cpp
→
src/nas/ies/S
orTransparent
Container.cpp
View file @
86b77209
...
...
@@ -19,20 +19,20 @@
* contact@openairinterface.org
*/
#include "S
OR_Transparent_
Container.hpp"
#include "S
orTransparent
Container.hpp"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
S
OR_Transparent_Container
::
SOR_Transparent_
Container
()
S
orTransparentContainer
::
SorTransparent
Container
()
:
Type6NasIe
(
kIeiSorTransparentContainer
),
header_
(),
sor_mac_i_
()
{
SetLengthIndicator
(
kSorTransparentContainerIeMinimumLength
);
SetIeName
(
kSorTransparentContainerIeName
);
}
//------------------------------------------------------------------------------
S
OR_Transparent_Container
::
SOR_Transparent_
Container
(
S
orTransparentContainer
::
SorTransparent
Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
])
{
header_
=
header
;
for
(
int
i
=
0
;
i
<
16
;
i
++
)
{
...
...
@@ -43,17 +43,17 @@ SOR_Transparent_Container::SOR_Transparent_Container(
}
//------------------------------------------------------------------------------
S
OR_Transparent_Container
::~
SOR_Transparent_
Container
()
{}
S
orTransparentContainer
::~
SorTransparent
Container
()
{}
//------------------------------------------------------------------------------
void
S
OR_Transparent_
Container
::
getValue
(
uint8_t
(
&
value
)[
16
])
const
{
void
S
orTransparent
Container
::
getValue
(
uint8_t
(
&
value
)[
16
])
const
{
for
(
int
i
=
0
;
i
<
16
;
i
++
)
{
value
[
i
]
=
sor_mac_i_
[
i
];
}
}
//------------------------------------------------------------------------------
int
S
OR_Transparent_
Container
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
int
S
orTransparent
Container
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding %s"
,
GetIeName
().
c_str
());
int
ie_len
=
GetIeLength
();
...
...
@@ -97,7 +97,7 @@ int SOR_Transparent_Container::Encode(uint8_t* buf, int len) {
}
//------------------------------------------------------------------------------
int
S
OR_Transparent_
Container
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
int
S
orTransparent
Container
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
if
(
len
<
kSorTransparentContainerMinimumLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
...
...
src/nas/ies/S
OR_Transparent_
Container.hpp
→
src/nas/ies/S
orTransparent
Container.hpp
View file @
86b77209
...
...
@@ -29,11 +29,11 @@ constexpr auto kSorTransparentContainerIeName = "SOR Transparent Container";
namespace
nas
{
class
S
OR_Transparent_
Container
:
Type6NasIe
{
class
S
orTransparent
Container
:
Type6NasIe
{
public:
S
OR_Transparent_
Container
();
S
OR_Transparent_
Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
]);
~
S
OR_Transparent_
Container
();
S
orTransparent
Container
();
S
orTransparent
Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
]);
~
S
orTransparent
Container
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
);
...
...
src/nas/msgs/AuthenticationResult.hpp
View file @
86b77209
...
...
@@ -35,9 +35,15 @@ class AuthenticationResult : public NasMmPlainHeader {
int
Decode
(
uint8_t
*
buf
,
int
len
);
void
SetHeader
(
uint8_t
security_header_type
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
// TODO: Get
void
SetEapMessage
(
bstring
eap
);
// TODO: Get
void
SetAbba
(
uint8_t
length
,
uint8_t
*
value
);
// TODO: Get
public:
NasKeySetIdentifier
ie_ngKSI
;
// Mandatory (1/2 lower octet)
...
...
src/nas/msgs/DeregistrationRequest.cpp
View file @
86b77209
...
...
@@ -111,7 +111,7 @@ bool DeregistrationRequest::getSuciSupiFormatImsi(nas::SUCI_imsi_t& imsi) {
}
//------------------------------------------------------------------------------
std
::
string
DeregistrationRequest
::
get_5g_g
uti
()
{
std
::
string
DeregistrationRequest
::
Get5gG
uti
()
{
std
::
optional
<
nas
::
_5G_GUTI_t
>
guti
=
std
::
nullopt
;
ie_5gs_mobility_id
.
Get5gGuti
(
guti
);
if
(
!
guti
.
has_value
())
return
{};
...
...
src/nas/msgs/DeregistrationRequest.hpp
View file @
86b77209
...
...
@@ -38,26 +38,33 @@ class DeregistrationRequest : public NasMmPlainHeader {
void
SetHeader
(
uint8_t
security_header_type
);
void
setDeregistrationType
(
uint8_t
dereg_type
);
void
getDeregistrationType
(
uint8_t
&
dereg_type
);
void
setDeregistrationType
(
_5gs_deregistration_type_t
type
);
void
getDeregistrationType
(
_5gs_deregistration_type_t
&
type
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
bool
getngKSI
(
uint8_t
&
ng_ksi
);
void
setMobilityIdentityType
(
uint8_t
type
);
void
getMobilityIdentityType
(
uint8_t
&
type
);
void
SetSuciSupiFormatImsi
(
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
uint8_t
protection_sch_id
,
const
string
msin
);
void
SetSuciSupiFormatImsi
(
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
uint8_t
protection_sch_id
,
uint8_t
hnpki
,
const
string
msin
);
bool
getSuciSupiFormatImsi
(
nas
::
SUCI_imsi_t
&
imsi
);
void
Set5gGuti
();
std
::
string
Get5gGuti
();
void
SetImeiImeisv
();
void
Set5gSTmsi
();
// TODO: Get
void
getDeregistrationType
(
uint8_t
&
dereg_type
);
void
getDeregistrationType
(
_5gs_deregistration_type_t
&
type
);
bool
getngKSI
(
uint8_t
&
ng_ksi
);
void
getMobilityIdentityType
(
uint8_t
&
type
);
std
::
string
get_5g_guti
();
bool
getSuciSupiFormatImsi
(
nas
::
SUCI_imsi_t
&
imsi
);
void
Set5gSTmsi
();
// TODO: Get
public:
_5GSDeregistrationType
ie_deregistrationtype
;
// Mandatory
...
...
src/nas/msgs/IdentityResponse.hpp
View file @
86b77209
...
...
@@ -44,6 +44,7 @@ class IdentityResponse : public NasMmPlainHeader {
void
SetSuciSupiFormatImsi
(
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
uint8_t
protection_sch_id
,
uint8_t
hnpki
,
const
string
msin
);
void
Set5gGuti
();
void
SetImeiImeisv
();
void
Set5gSTmsi
();
...
...
src/nas/msgs/RegistrationAccept.cpp
View file @
86b77209
...
...
@@ -218,10 +218,10 @@ void RegistrationAccept::setT3502_value(uint8_t value) {
}
//------------------------------------------------------------------------------
void
RegistrationAccept
::
setSOR_Transparent_
Container
(
void
RegistrationAccept
::
SetSorTransparent
Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
])
{
ie_sor_transparent_container
=
std
::
make_optional
<
S
OR_Transparent_
Container
>
(
header
,
value
);
std
::
make_optional
<
S
orTransparent
Container
>
(
header
,
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -860,10 +860,10 @@ int RegistrationAccept::Decode(uint8_t* buf, int len) {
case
0x73
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x73)"
);
S
OR_Transparent_
Container
ie_sor_transparent_container_tmp
=
{};
S
orTransparent
Container
ie_sor_transparent_container_tmp
=
{};
decoded_size
+=
ie_sor_transparent_container_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_sor_transparent_container
=
std
::
optional
<
S
OR_Transparent_
Container
>
(
ie_sor_transparent_container
=
std
::
optional
<
S
orTransparent
Container
>
(
ie_sor_transparent_container_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
...
...
src/nas/msgs/RegistrationAccept.hpp
View file @
86b77209
...
...
@@ -107,7 +107,7 @@ class RegistrationAccept : public NasMmPlainHeader {
// TODO: Emergency number list
// TODO: Extended emergency number list
void
setSOR_Transparent_
Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
]);
void
SetSorTransparent
Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
]);
// TODO: Get
void
SetEapMessage
(
bstring
eap
);
...
...
@@ -173,7 +173,7 @@ class RegistrationAccept : public NasMmPlainHeader {
std
::
optional
<
GprsTimer2
>
ie_T3502_value
;
// Optional
// TODO: Emergency number list
// TODO: Extended emergency number list
std
::
optional
<
S
OR_Transparent_
Container
>
std
::
optional
<
S
orTransparent
Container
>
ie_sor_transparent_container
;
// Optional
std
::
optional
<
EapMessage
>
ie_eap_message
;
// Optional
std
::
optional
<
NssaiInclusionMode
>
ie_nssai_inclusion_mode
;
// Optional
...
...
src/nas/msgs/RegistrationComplete.cpp
View file @
86b77209
...
...
@@ -44,9 +44,9 @@ void RegistrationComplete::SetHeader(uint8_t security_header_type) {
}
//------------------------------------------------------------------------------
void
RegistrationComplete
::
setSOR_Transparent_
Container
(
void
RegistrationComplete
::
SetSorTransparent
Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
])
{
ie_sor_transparent_container
=
new
S
OR_Transparent_
Container
(
header
,
value
);
ie_sor_transparent_container
=
new
S
orTransparent
Container
(
header
,
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -88,7 +88,7 @@ int RegistrationComplete::Decode(
switch
(
octet
)
{
case
0x73
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x73)"
);
ie_sor_transparent_container
=
new
S
OR_Transparent_
Container
();
ie_sor_transparent_container
=
new
S
orTransparent
Container
();
decoded_size
+=
ie_sor_transparent_container
->
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/RegistrationComplete.hpp
View file @
86b77209
...
...
@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _RegistrationComplete_H_
#define _RegistrationComplete_H_
#ifndef _REGISTRATION_COMPLETE_H_
#define _REGISTRATION_COMPLETE_H_
#include "NasIeHeader.hpp"
...
...
@@ -37,14 +30,18 @@ class RegistrationComplete {
public:
RegistrationComplete
();
~
RegistrationComplete
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
SetHeader
(
uint8_t
security_header_type
);
void
setSOR_Transparent_Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
]);
void
SetSorTransparentContainer
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
]);
// TODO: Get
public:
NasMmPlainHeader
*
plain_header
;
S
OR_Transparent_
Container
*
ie_sor_transparent_container
;
S
orTransparent
Container
*
ie_sor_transparent_container
;
};
}
// namespace nas
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
86b77209
...
...
@@ -116,7 +116,7 @@ bool RegistrationRequest::getSuciSupiFormatImsi(nas::SUCI_imsi_t& imsi) {
}
//------------------------------------------------------------------------------
std
::
string
RegistrationRequest
::
get_5g_g
uti
()
{
std
::
string
RegistrationRequest
::
Get5gG
uti
()
{
std
::
optional
<
nas
::
_5G_GUTI_t
>
guti
=
std
::
nullopt
;
ie_5gs_mobile_identity
.
Get5gGuti
(
guti
);
if
(
!
guti
.
has_value
())
return
{};
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
86b77209
...
...
@@ -62,7 +62,7 @@ class RegistrationRequest : public NasMmPlainHeader {
bool
getSuciSupiFormatImsi
(
nas
::
SUCI_imsi_t
&
imsi
);
void
Set5gGuti
();
std
::
string
get_5g_g
uti
();
std
::
string
Get5gG
uti
();
void
SetImeiImeisv
();
void
Set5gSTmsi
();
...
...
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