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
30c34599
Commit
30c34599
authored
Jan 15, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Identity Request
parent
2581c2eb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
130 additions
and
79 deletions
+130
-79
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+1
-1
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-1
src/nas/ies/_5gsIdentityType.cpp
src/nas/ies/_5gsIdentityType.cpp
+55
-0
src/nas/ies/_5gsIdentityType.hpp
src/nas/ies/_5gsIdentityType.hpp
+12
-20
src/nas/msgs/ConfigurationUpdateCommand.hpp
src/nas/msgs/ConfigurationUpdateCommand.hpp
+5
-0
src/nas/msgs/IdentityRequest.cpp
src/nas/msgs/IdentityRequest.cpp
+48
-43
src/nas/msgs/IdentityRequest.hpp
src/nas/msgs/IdentityRequest.hpp
+8
-14
No files found.
src/amf-app/amf_n1.cpp
View file @
30c34599
...
...
@@ -1678,7 +1678,7 @@ void amf_n1::run_registration_procedure(std::shared_ptr<nas_context>& nc) {
std
::
unique_ptr
<
IdentityRequest
>
identity_request
=
std
::
make_unique
<
IdentityRequest
>
();
identity_request
->
SetHeader
(
PLAIN_5GS_MSG
);
identity_request
->
set_5GS_Identity_
Type
(
SUCI
);
identity_request
->
Set5gsIdentity
Type
(
SUCI
);
uint8_t
buffer
[
BUFFER_SIZE_256
];
int
encoded_size
=
identity_request
->
Encode
(
buffer
,
BUFFER_SIZE_256
);
...
...
src/nas/common/NasIeHeader.hpp
View file @
30c34599
...
...
@@ -74,7 +74,7 @@
#include "_5GSDeregistrationType.hpp"
#include "_5GSTrackingAreaIdList.hpp"
#include "_5GS_DRX_Parameters.hpp"
#include "_5
GS_Identity_
Type.hpp"
#include "_5
gsIdentity
Type.hpp"
#include "_5GS_Network_Feature_Support.hpp"
#include "_5GS_Registration_Result.hpp"
#include "_5GSTrackingAreaIdentity.hpp"
...
...
src/nas/ies/_5
GS_Identity_
Type.cpp
→
src/nas/ies/_5
gsIdentity
Type.cpp
View file @
30c34599
...
...
@@ -19,82 +19,37 @@
* contact@openairinterface.org
*/
/*! \file ___5GS_Identity_Type.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "_5GS_Identity_Type.hpp"
#include "_5gsIdentityType.hpp"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
_5GS_Identity_Type
::
_5GS_Identity_Type
(
uint8_t
iei
)
{
_iei
=
iei
;
_value
=
0
;
}
//------------------------------------------------------------------------------
_5GS_Identity_Type
::
_5GS_Identity_Type
(
const
uint8_t
iei
,
uint8_t
value
)
{
_iei
=
iei
;
_value
=
value
;
_5gsIdentityType
::
_5gsIdentityType
()
:
Type1NasIeFormatTv
()
{
SetIeName
(
k5gsIdentityTypeIeName
);
}
//------------------------------------------------------------------------------
_5GS_Identity_Type
::
_5GS_Identity_Type
()
{
_iei
=
0
;
_value
=
0
;
_5gsIdentityType
::
_5gsIdentityType
(
uint8_t
iei
)
:
Type1NasIeFormatTv
(
iei
)
{
SetIeName
(
k5gsIdentityTypeIeName
);
}
//------------------------------------------------------------------------------
_5GS_Identity_Type
::~
_5GS_Identity_Type
()
{}
//------------------------------------------------------------------------------
void
_5GS_Identity_Type
::
setValue
(
uint8_t
value
)
{
_value
=
value
;
_5gsIdentityType
::
_5gsIdentityType
(
uint8_t
iei
,
uint8_t
value
)
:
Type1NasIeFormatTv
(
iei
)
{
Type1NasIeFormatTv
::
SetValue
(
value
&
0x07
);
SetIeName
(
k5gsIdentityTypeIeName
);
}
//------------------------------------------------------------------------------
uint8_t
_5GS_Identity_Type
::
getValue
()
{
return
_value
;
}
_5gsIdentityType
::~
_5gsIdentityType
()
{}
//------------------------------------------------------------------------------
int
_5GS_Identity_Type
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding _5GS_Identity_Type iei(0x%x)"
,
_iei
);
if
(
len
<
1
)
{
Logger
::
nas_mm
().
error
(
"len is less than 1"
);
return
0
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
*
(
buf
+
encoded_size
)
=
_value
&
0x07
;
encoded_size
++
;
}
else
{
*
(
buf
+
encoded_size
)
=
_value
&
0x07
;
encoded_size
++
;
}
Logger
::
nas_mm
().
debug
(
"encoded _5GS_Identity_Type len(%d)"
,
encoded_size
);
return
encoded_size
;
void
_5gsIdentityType
::
SetValue
(
uint8_t
value
)
{
Type1NasIeFormatTv
::
SetValue
(
value
&
0x07
);
}
//------------------------------------------------------------------------------
int
_5GS_Identity_Type
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"decoding _5GS_Identity_Type iei(0x%x)"
,
*
buf
);
int
decoded_size
=
0
;
if
(
is_option
)
{
_iei
=
*
buf
;
decoded_size
++
;
}
_value
=
0x00
;
// length = *(buf + decoded_size);
_value
=
*
(
buf
+
decoded_size
)
&
0x07
;
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"decoded _5GS_Identity_Type _value(0x%x),iei(0x%x)"
,
_value
,
_iei
);
Logger
::
nas_mm
().
debug
(
"decoded _5GS_Identity_Type len(%d)"
,
decoded_size
);
return
decoded_size
;
uint8_t
_5gsIdentityType
::
GetValue
()
const
{
return
Type1NasIeFormatTv
::
GetValue
()
&
0x07
;
}
src/nas/ies/_5
GS_Identity_
Type.hpp
→
src/nas/ies/_5
gsIdentity
Type.hpp
View file @
30c34599
...
...
@@ -19,34 +19,26 @@
* contact@openairinterface.org
*/
/*! \file ___5GS_Identity_Type.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _5GS_IDENTITY_TYPE_H_
#define _5GS_IDENTITY_TYPE_H_
#ifndef ___5GS_Identity_Type_H_
#define ___5GS_Identity_Type_H_
#include "Type1NasIeFormatTv.hpp"
#include <stdint.h>
constexpr
auto
k5gsIdentityTypeIeName
=
"5GS Identity Type"
;
namespace
nas
{
class
_5
GS_Identity_Type
{
class
_5
gsIdentityType
:
public
Type1NasIeFormatTv
{
public:
_5GS_Identity_Type
();
_5GS_Identity_Type
(
uint8_t
iei
);
_5GS_Identity_Type
(
const
uint8_t
iei
,
uint8_t
value
);
~
_5GS_Identity_Type
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
void
setValue
(
uint8_t
value
);
uint8_t
getValue
();
_5gsIdentityType
();
_5gsIdentityType
(
uint8_t
iei
);
_5gsIdentityType
(
uint8_t
iei
,
uint8_t
value
);
~
_5gsIdentityType
();
void
SetValue
(
uint8_t
value
);
uint8_t
GetValue
()
const
;
private:
uint8_t
_iei
;
uint8_t
_value
;
};
}
// namespace nas
...
...
src/nas/msgs/ConfigurationUpdateCommand.hpp
View file @
30c34599
...
...
@@ -71,6 +71,11 @@ class ConfigurationUpdateCommand : public NasMmPlainHeader {
// TODO: Operator-defined access category definitions
// TODO: SMS indication
// TODO: T3447 value
// TODO: CAG information list (Rel 16.4.1)
// TODO: UE radio capability ID (Rel 16.4.1)
// TODO: UE radio capability ID deletion indication (Rel 16.4.1)
// TODO: 5GS registration result (Rel 16.4.1)
// TODO: Truncated 5G-S-TMSI configuration (Rel 16.4.1)
};
}
// namespace nas
...
...
src/nas/msgs/IdentityRequest.cpp
View file @
30c34599
...
...
@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "IdentityRequest.hpp"
#include "3gpp_24.501.hpp"
...
...
@@ -34,63 +27,75 @@
using
namespace
nas
;
//------------------------------------------------------------------------------
IdentityRequest
::
IdentityRequest
()
{
Logger
::
nas_mm
().
debug
(
"initiating class IdentityRequest"
);
plain_header
=
NULL
;
_5gs_identity_type
=
NULL
;
}
IdentityRequest
::
IdentityRequest
()
:
NasMmPlainHeader
(
EPD_5GS_MM_MSG
,
IDENTITY_REQUEST
)
{}
//------------------------------------------------------------------------------
IdentityRequest
::~
IdentityRequest
()
{}
//------------------------------------------------------------------------------
void
IdentityRequest
::
SetHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
SetHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
IDENTITY_REQUEST
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
//------------------------------------------------------------------------------
void
IdentityRequest
::
set_5GS_Identity_
Type
(
uint8_t
value
)
{
_5gs_identity_type
=
new
_5GS_Identity_Type
(
0x00
,
value
);
void
IdentityRequest
::
Set5gsIdentity
Type
(
uint8_t
value
)
{
_5gs_identity_type
_
.
SetValue
(
value
);
}
//------------------------------------------------------------------------------
int
IdentityRequest
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding IdentityRequest message"
);
int
encoded_size
=
0
;
if
(
!
plain_header
)
{
Logger
::
nas_mm
().
error
(
"Mandatory IE missing Header"
);
return
0
;
int
encoded_size
=
0
;
int
encoded_ie_size
=
0
;
// Header
if
((
encoded_ie_size
=
NasMmPlainHeader
::
Encode
(
buf
,
len
))
==
KEncodeDecodeError
)
{
Logger
::
nas_mm
().
error
(
"Encoding NAS Header error"
);
return
KEncodeDecodeError
;
}
if
(
!
(
plain_header
->
Encode
(
buf
,
len
)))
return
0
;
encoded_size
+=
3
;
if
(
!
_5gs_identity_type
)
{
Logger
::
nas_mm
().
warn
(
"IE _5gs_identity_type is not available"
);
encoded_size
+=
encoded_ie_size
;
int
size
=
_5gs_identity_type_
.
Encode
(
buf
+
encoded_size
,
len
-
encoded_size
);
if
(
size
!=
KEncodeDecodeError
)
{
encoded_size
+=
size
;
}
else
{
if
(
int
size
=
_5gs_identity_type
->
Encode
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
Logger
::
nas_mm
().
error
(
"encoding _5gs_identity_type error"
);
return
0
;
}
Logger
::
nas_mm
().
error
(
"Encoding _5gs_identity_type error"
);
return
KEncodeDecodeError
;
}
Logger
::
nas_mm
().
debug
(
"
encoded IdentityRequest message len
(%d)"
,
encoded_size
);
"
Encoded IdentityRequest message len
(%d)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
IdentityRequest
::
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"decoding IdentityRequest message"
);
int
decoded_size
=
3
;
plain_header
=
header
;
_5gs_identity_type
=
new
_5GS_Identity_Type
();
decoded_size
+=
_5gs_identity_type
->
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
Logger
::
nas_mm
().
debug
(
"decoded_size(%d)"
,
decoded_size
);
int
IdentityRequest
::
Decode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Decoding IdentityRequest message"
);
int
decoded_size
=
0
;
int
decoded_result
=
0
;
// Header
decoded_result
=
NasMmPlainHeader
::
Decode
(
buf
,
len
);
if
(
decoded_result
==
KEncodeDecodeError
)
{
Logger
::
nas_mm
().
error
(
"Decoding NAS Header error"
);
return
KEncodeDecodeError
;
}
decoded_size
+=
decoded_result
;
decoded_result
=
_5gs_identity_type_
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
if
(
decoded_result
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
if
(
decoded_result
==
0
)
{
decoded_result
=
1
;
// including 1/2 octet for Spare
}
decoded_size
+=
decoded_result
;
Logger
::
nas_mm
().
debug
(
"
decoded IdentityRequest message len
(%d)"
,
decoded_size
);
return
1
;
"
Decoded IdentityRequest message len
(%d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/msgs/IdentityRequest.hpp
View file @
30c34599
...
...
@@ -19,32 +19,26 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _IdentityRequest_H_
#define _IdentityRequest_H_
#ifndef _IDENTITY_REQUEST_H_
#define _IDENTITY_REQUEST_H_
#include "NasIeHeader.hpp"
namespace
nas
{
class
IdentityRequest
{
class
IdentityRequest
:
public
NasMmPlainHeader
{
public:
IdentityRequest
();
~
IdentityRequest
();
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
set_5GS_Identity_
Type
(
uint8_t
value
);
void
Set5gsIdentity
Type
(
uint8_t
value
);
public:
NasMmPlainHeader
*
plain_header
;
_5GS_Identity_Type
*
_5gs_identity_type
;
_5gsIdentityType
_5gs_identity_type_
;
// Mandatory
};
}
// namespace nas
...
...
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