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
560c1dfb
Commit
560c1dfb
authored
Jan 16, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Deregistration Request (UE originating)
parent
2db5addf
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
169 additions
and
141 deletions
+169
-141
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+3
-2
src/nas/ies/5GSRegistrationType.hpp
src/nas/ies/5GSRegistrationType.hpp
+0
-1
src/nas/ies/_5GSDeregistrationType.cpp
src/nas/ies/_5GSDeregistrationType.cpp
+37
-11
src/nas/ies/_5GSDeregistrationType.hpp
src/nas/ies/_5GSDeregistrationType.hpp
+19
-15
src/nas/msgs/DeregistrationRequest.cpp
src/nas/msgs/DeregistrationRequest.cpp
+97
-105
src/nas/msgs/DeregistrationRequest.hpp
src/nas/msgs/DeregistrationRequest.hpp
+9
-7
src/nas/msgs/NasMmPlainHeader.cpp
src/nas/msgs/NasMmPlainHeader.cpp
+3
-0
src/nas/msgs/NasMmPlainHeader.hpp
src/nas/msgs/NasMmPlainHeader.hpp
+1
-0
No files found.
src/amf-app/amf_n1.cpp
View file @
560c1dfb
...
@@ -3011,8 +3011,9 @@ void amf_n1::ue_initiate_de_registration_handle(
...
@@ -3011,8 +3011,9 @@ void amf_n1::ue_initiate_de_registration_handle(
}
}
// Decode NAS message
// Decode NAS message
auto
dereg_request
=
std
::
make_unique
<
DeregistrationRequest
>
();
auto
dereg_request
=
std
::
make_unique
<
DeregistrationRequest
>
(
dereg_request
->
Decode
(
NULL
,
(
uint8_t
*
)
bdata
(
nas
),
blength
(
nas
));
true
);
// UE originating de-registration
dereg_request
->
Decode
((
uint8_t
*
)
bdata
(
nas
),
blength
(
nas
));
// TODO: validate 5G Mobile Identity
// TODO: validate 5G Mobile Identity
uint8_t
mobile_id_type
=
0
;
uint8_t
mobile_id_type
=
0
;
...
...
src/nas/ies/5GSRegistrationType.hpp
View file @
560c1dfb
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
#include "Type1NasIeFormatTv.hpp"
#include "Type1NasIeFormatTv.hpp"
#include <stdint.h>
constexpr
auto
k5gsRegistrationTypeName
=
"5GS Registration Type"
;
constexpr
auto
k5gsRegistrationTypeName
=
"5GS Registration Type"
;
namespace
nas
{
namespace
nas
{
...
...
src/nas/ies/_5GSDeregistrationType.cpp
View file @
560c1dfb
...
@@ -18,14 +18,6 @@
...
@@ -18,14 +18,6 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file
\brief
\author
\date 2020
\email: contact@openairinterface.org
*/
#include "_5GSDeregistrationType.hpp"
#include "_5GSDeregistrationType.hpp"
#include "3gpp_24.501.hpp"
#include "3gpp_24.501.hpp"
...
@@ -34,13 +26,23 @@
...
@@ -34,13 +26,23 @@
using
namespace
nas
;
using
namespace
nas
;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
_5GSDeregistrationType
::
_5GSDeregistrationType
()
{
_5GSDeregistrationType
::
_5GSDeregistrationType
()
:
Type1NasIeFormatTv
()
{
u1
.
b
=
0
;
u1
.
b
=
0
;
SetIeName
(
k5gsDeregistrationTypeIeName
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
_5GSDeregistrationType
::
_5GSDeregistrationType
(
uint8_t
type
)
{
_5GSDeregistrationType
::
_5GSDeregistrationType
(
uint8_t
iei
)
u1
.
b
=
type
;
:
Type1NasIeFormatTv
(
iei
)
{
u1
.
bf
.
iei
=
iei
;
SetIeName
(
k5gsDeregistrationTypeIeName
);
}
//------------------------------------------------------------------------------
_5GSDeregistrationType
::
_5GSDeregistrationType
(
uint8_t
iei
,
uint8_t
value
)
{
u1
.
b
=
(
iei
<<
4
)
|
(
value
&&
0x0f
);
SetValue
(
value
&&
0x0f
);
SetIeName
(
k5gsDeregistrationTypeIeName
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
_5GSDeregistrationType
::
_5GSDeregistrationType
(
_5GSDeregistrationType
::
_5GSDeregistrationType
(
...
@@ -50,11 +52,29 @@ _5GSDeregistrationType::_5GSDeregistrationType(
...
@@ -50,11 +52,29 @@ _5GSDeregistrationType::_5GSDeregistrationType(
u1
.
bf
.
re_registration_required
=
type
.
re_registration_required
;
u1
.
bf
.
re_registration_required
=
type
.
re_registration_required
;
u1
.
bf
.
access_type
=
type
.
access_type
;
u1
.
bf
.
access_type
=
type
.
access_type
;
u1
.
bf
.
iei
=
type
.
iei
;
u1
.
bf
.
iei
=
type
.
iei
;
if
(
type
.
iei
!=
0
)
{
SetIei
(
type
.
iei
);
}
SetValue
(
u1
.
b
&&
0x0f
);
SetIeName
(
k5gsDeregistrationTypeIeName
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
_5GSDeregistrationType
::~
_5GSDeregistrationType
()
{}
_5GSDeregistrationType
::~
_5GSDeregistrationType
()
{}
//------------------------------------------------------------------------------
void
_5GSDeregistrationType
::
setValue
()
{
Type1NasIeFormatTv
::
SetValue
(
u1
.
b
&&
0x0f
);
}
//------------------------------------------------------------------------------
void
_5GSDeregistrationType
::
getValue
()
{
u1
.
b
=
Type1NasIeFormatTv
::
GetValue
()
&&
0x0f
;
if
(
iei_
.
has_value
())
{
u1
.
b
|=
iei_
.
value
()
&&
0xf0
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
_5GSDeregistrationType
::
set
(
_5gs_deregistration_type_t
type
)
{
void
_5GSDeregistrationType
::
set
(
_5gs_deregistration_type_t
type
)
{
u1
.
b
=
0
;
u1
.
b
=
0
;
...
@@ -62,6 +82,10 @@ void _5GSDeregistrationType::set(_5gs_deregistration_type_t type) {
...
@@ -62,6 +82,10 @@ void _5GSDeregistrationType::set(_5gs_deregistration_type_t type) {
u1
.
bf
.
re_registration_required
=
type
.
re_registration_required
;
u1
.
bf
.
re_registration_required
=
type
.
re_registration_required
;
u1
.
bf
.
access_type
=
type
.
access_type
;
u1
.
bf
.
access_type
=
type
.
access_type
;
u1
.
bf
.
iei
=
type
.
iei
;
u1
.
bf
.
iei
=
type
.
iei
;
if
(
type
.
iei
!=
0
)
{
SetIei
(
type
.
iei
);
}
SetValue
(
u1
.
b
&&
0x0f
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -82,6 +106,7 @@ void _5GSDeregistrationType::get(uint8_t& type) {
...
@@ -82,6 +106,7 @@ void _5GSDeregistrationType::get(uint8_t& type) {
type
=
u1
.
b
;
type
=
u1
.
b
;
}
}
/*
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int _5GSDeregistrationType::Encode(uint8_t* buf, int len) {
int _5GSDeregistrationType::Encode(uint8_t* buf, int len) {
Logger::nas_mm().error("Encoding 5GSDeregistrationType IE");
Logger::nas_mm().error("Encoding 5GSDeregistrationType IE");
...
@@ -102,3 +127,4 @@ int _5GSDeregistrationType::Decode(uint8_t* buf, int len) {
...
@@ -102,3 +127,4 @@ int _5GSDeregistrationType::Decode(uint8_t* buf, int len) {
Logger::nas_mm().debug("Decoded 5GSDeRegistrationType");
Logger::nas_mm().debug("Decoded 5GSDeRegistrationType");
return 0;
return 0;
}
}
*/
src/nas/ies/_5GSDeregistrationType.hpp
View file @
560c1dfb
...
@@ -19,17 +19,10 @@
...
@@ -19,17 +19,10 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file
\brief
\author
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _5GS_DEREGISTRATION_TYPE_H_
#ifndef _5GS_DEREGISTRATION_TYPE_H_
#define _5GS_DEREGISTRATION_TYPE_H_
#define _5GS_DEREGISTRATION_TYPE_H_
#include
<stdint.h>
#include
"Type1NasIeFormatTv.hpp"
namespace
nas
{
namespace
nas
{
typedef
struct
_5gs_deregistration_type_s
{
typedef
struct
_5gs_deregistration_type_s
{
...
@@ -39,21 +32,32 @@ typedef struct _5gs_deregistration_type_s {
...
@@ -39,21 +32,32 @@ typedef struct _5gs_deregistration_type_s {
uint8_t
access_type
:
2
;
uint8_t
access_type
:
2
;
}
_5gs_deregistration_type_t
;
}
_5gs_deregistration_type_t
;
class
_5GSDeregistrationType
{
constexpr
auto
k5gsDeregistrationTypeIeName
=
"5GS De-registration Type"
;
class
_5GSDeregistrationType
:
public
Type1NasIeFormatTv
{
public:
public:
_5GSDeregistrationType
();
_5GSDeregistrationType
();
_5GSDeregistrationType
(
uint8_t
type
);
_5GSDeregistrationType
(
uint8_t
iei
);
_5GSDeregistrationType
(
uint8_t
iei
,
uint8_t
value
);
_5GSDeregistrationType
(
_5gs_deregistration_type_t
type
);
_5GSDeregistrationType
(
_5gs_deregistration_type_t
type
);
~
_5GSDeregistrationType
();
~
_5GSDeregistrationType
();
int
Decode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
// int Decode(uint8_t* buf, int len);
// int Encode(uint8_t* buf, int len);
void
set
(
_5gs_deregistration_type_t
type
);
void
set
(
_5gs_deregistration_type_t
type
);
void
get
(
_5gs_deregistration_type_t
&
type
);
void
get
(
_5gs_deregistration_type_t
&
type
);
void
set
(
uint8_t
type
);
void
get
(
uint8_t
&
type
);
public:
void
set
(
uint8_t
value
);
void
get
(
uint8_t
&
value
);
void
set
(
uint8_t
iei
,
uint8_t
value
);
void
get
(
uint8_t
&
iei
,
uint8_t
value
);
private:
void
setValue
();
void
getValue
();
union
{
union
{
struct
{
struct
{
uint8_t
iei
:
4
;
uint8_t
iei
:
4
;
...
...
src/nas/msgs/DeregistrationRequest.cpp
View file @
560c1dfb
This diff is collapsed.
Click to expand it.
src/nas/msgs/DeregistrationRequest.hpp
View file @
560c1dfb
...
@@ -27,13 +27,16 @@
...
@@ -27,13 +27,16 @@
using
namespace
std
;
using
namespace
std
;
namespace
nas
{
namespace
nas
{
class
DeregistrationRequest
{
class
DeregistrationRequest
:
public
NasMmPlainHeader
{
public:
public:
DeregistrationRequest
();
DeregistrationRequest
(
bool
is_ue_originating
);
~
DeregistrationRequest
();
~
DeregistrationRequest
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
);
void
SetHeader
(
uint8_t
security_header_type
);
void
SetHeader
(
uint8_t
security_header_type
);
void
setDeregistrationType
(
uint8_t
dereg_type
);
void
setDeregistrationType
(
uint8_t
dereg_type
);
void
setDeregistrationType
(
_5gs_deregistration_type_t
type
);
void
setDeregistrationType
(
_5gs_deregistration_type_t
type
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
...
@@ -57,10 +60,9 @@ class DeregistrationRequest {
...
@@ -57,10 +60,9 @@ class DeregistrationRequest {
bool
getSuciSupiFormatImsi
(
nas
::
SUCI_imsi_t
&
imsi
);
bool
getSuciSupiFormatImsi
(
nas
::
SUCI_imsi_t
&
imsi
);
public:
public:
NasMmPlainHeader
*
plain_header
;
_5GSDeregistrationType
ie_deregistrationtype
;
// Mandatory
_5GSDeregistrationType
*
ie_deregistrationtype
;
NasKeySetIdentifier
ie_ngKSI
;
// Mandatory
NasKeySetIdentifier
*
ie_ngKSI
;
_5GSMobileIdentity
ie_5gs_mobility_id
;
// Mandatory
_5GSMobileIdentity
*
ie_5gs_mobility_id
;
};
};
}
// namespace nas
}
// namespace nas
...
...
src/nas/msgs/NasMmPlainHeader.cpp
View file @
560c1dfb
...
@@ -26,6 +26,9 @@
...
@@ -26,6 +26,9 @@
using
namespace
nas
;
using
namespace
nas
;
//------------------------------------------------------------------------------
NasMmPlainHeader
::
NasMmPlainHeader
(
const
uint8_t
&
epd
)
:
epd_
(
epd
)
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
NasMmPlainHeader
::
NasMmPlainHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
msg_type
)
NasMmPlainHeader
::
NasMmPlainHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
msg_type
)
:
epd_
(
epd
),
msg_type_
(
msg_type
)
{}
:
epd_
(
epd
),
msg_type_
(
msg_type
)
{}
...
...
src/nas/msgs/NasMmPlainHeader.hpp
View file @
560c1dfb
...
@@ -33,6 +33,7 @@ namespace nas {
...
@@ -33,6 +33,7 @@ namespace nas {
class
NasMmPlainHeader
{
class
NasMmPlainHeader
{
public:
public:
NasMmPlainHeader
(){};
NasMmPlainHeader
(){};
NasMmPlainHeader
(
const
uint8_t
&
epd
);
NasMmPlainHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
msg_type
);
NasMmPlainHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
msg_type
);
virtual
~
NasMmPlainHeader
();
virtual
~
NasMmPlainHeader
();
...
...
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