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
1a8eb820
Commit
1a8eb820
authored
Oct 17, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Registration Request IEs
parent
b617d09f
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
166 additions
and
182 deletions
+166
-182
src/nas/common/Ie_Const.hpp
src/nas/common/Ie_Const.hpp
+3
-1
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-1
src/nas/ies/EPS_NAS_Message_Container.cpp
src/nas/ies/EPS_NAS_Message_Container.cpp
+21
-28
src/nas/ies/EPS_NAS_Message_Container.hpp
src/nas/ies/EPS_NAS_Message_Container.hpp
+5
-10
src/nas/ies/LADN_Indication.cpp
src/nas/ies/LADN_Indication.cpp
+24
-30
src/nas/ies/LADN_Indication.hpp
src/nas/ies/LADN_Indication.hpp
+9
-11
src/nas/ies/Payload_Container_Type.hpp
src/nas/ies/Payload_Container_Type.hpp
+0
-7
src/nas/ies/_5GS_DRX_Parameters.cpp
src/nas/ies/_5GS_DRX_Parameters.cpp
+38
-38
src/nas/ies/_5GS_DRX_Parameters.hpp
src/nas/ies/_5GS_DRX_Parameters.hpp
+10
-14
src/nas/msgs/RegistrationAccept.cpp
src/nas/msgs/RegistrationAccept.cpp
+2
-2
src/nas/msgs/RegistrationAccept.hpp
src/nas/msgs/RegistrationAccept.hpp
+1
-1
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+46
-34
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+6
-5
No files found.
src/nas/common/Ie_Const.hpp
View file @
1a8eb820
...
...
@@ -26,7 +26,7 @@ constexpr uint8_t kIeIsNotOptional = false;
constexpr
uint8_t
kIei5gmmCause
=
0x58
;
constexpr
uint8_t
kIei5gsmCapability
=
0x28
;
constexpr
uint8_t
kIei5gsDrxParameters
=
0x51
;
constexpr
uint8_t
kIei5gsDrxParameters
=
0x51
;
// OK
constexpr
uint8_t
kIei5gsmCongestionReAttemptIndicator
=
0x61
;
constexpr
uint8_t
kIei5gsmNetworkFeatureSupport
=
0x17
;
constexpr
uint8_t
kIei5gsMobileIdentityImeiSv
=
0x77
;
...
...
@@ -82,3 +82,5 @@ constexpr uint8_t kIeiSNssai = 0x22;
constexpr
uint8_t
kIeiSscMode
=
0x0a
;
constexpr
uint8_t
kIeiSuggestedInterfaceIdentifier
=
0x29
;
constexpr
uint8_t
kIeiUeDsTtResidenceTime
=
0x6f
;
constexpr
uint8_t
kIeiEpsNasMessageContainer
=
0x70
;
src/nas/common/NasIeHeader.hpp
View file @
1a8eb820
...
...
@@ -73,7 +73,7 @@
#include "_5GMM_Cause.hpp"
#include "_5GSDeregistrationType.hpp"
#include "_5GSTrackingAreaIdList.hpp"
#include "_5GS_DRX_arameters.hpp"
#include "_5GS_DRX_
P
arameters.hpp"
#include "_5GS_Identity_Type.hpp"
#include "_5GS_Network_Feature_Support.hpp"
#include "_5GS_Registration_Result.hpp"
...
...
src/nas/ies/EPS_NAS_Message_Container.cpp
View file @
1a8eb820
...
...
@@ -19,14 +19,10 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "EPS_NAS_Message_Container.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "logger.hpp"
using
namespace
nas
;
...
...
@@ -41,7 +37,7 @@ EPS_NAS_Message_Container::EPS_NAS_Message_Container(
const
uint8_t
iei
,
bstring
value
)
{
_iei
=
iei
;
_value
=
bstrcpy
(
value
);
length
=
blength
(
value
)
+
3
;
length
=
blength
(
value
)
+
3
;
// 1 for IEI, 2 for length
}
//------------------------------------------------------------------------------
...
...
@@ -52,9 +48,8 @@ EPS_NAS_Message_Container::EPS_NAS_Message_Container()
EPS_NAS_Message_Container
::~
EPS_NAS_Message_Container
()
{}
//------------------------------------------------------------------------------
void
EPS_NAS_Message_Container
::
setValue
(
uint8_t
iei
,
uint8_t
value
)
{
void
EPS_NAS_Message_Container
::
setValue
(
uint8_t
iei
)
{
_iei
=
iei
;
//_value = value;
}
//------------------------------------------------------------------------------
...
...
@@ -65,34 +60,32 @@ void EPS_NAS_Message_Container::getValue(bstring& value) {
//------------------------------------------------------------------------------
int
EPS_NAS_Message_Container
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding EPS_NAS_Message_Container iei (0x%x)"
,
_iei
);
if
(
len
<
length
)
{
Logger
::
nas_mm
().
error
(
"Len is less than %d"
,
length
);
return
0
;
if
(
len
<
(
length
+
3
))
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the length of this IE (%d octet)"
,
length
+
3
);
return
KEncodeDecodeError
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
*
(
buf
+
encoded_size
)
=
_iei
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
(
length
-
3
)
&
0x00ff
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
((
length
-
3
)
&
0xff000
)
>>
8
;
encoded_size
++
;
int
size
=
encode_bstring
(
_value
,
(
buf
+
encoded_size
),
len
-
encoded_size
);
encoded_size
+=
size
;
}
else
{
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
ENCODE_U8
(
buf
+
encoded_size
,
_iei
,
encoded_size
);
}
ENCODE_U16
(
buf
+
encoded_size
,
length
,
encoded_size
);
int
size
=
encode_bstring
(
_value
,
(
buf
+
encoded_size
),
len
-
encoded_size
);
encoded_size
+=
size
;
Logger
::
nas_mm
().
debug
(
"Encoded EPS_NAS_Message_Container
len (
%d)"
,
encoded_size
);
"Encoded EPS_NAS_Message_Container
(len
%d)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
EPS_NAS_Message_Container
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Decoding EPS_NAS_Message_Container
iei (0x%x)"
,
*
buf
);
Logger
::
nas_mm
().
debug
(
"Decoding EPS_NAS_Message_Container
"
);
int
decoded_size
=
0
;
int
result
=
0
;
if
(
is_option
)
{
...
...
@@ -106,12 +99,12 @@ int EPS_NAS_Message_Container::decodeFromBuffer(
if
(
result
==
length
)
{
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
Logger
::
nas_mm
().
debug
(
"Decoded EPS_NAS_Message_Container value
(0x%x)
"
,
"Decoded EPS_NAS_Message_Container value
0x%x
"
,
(
uint8_t
)
_value
->
data
[
i
]);
}
}
Logger
::
nas_mm
().
debug
(
"Decoded EPS_NAS_Message_Container
Length (
%d)"
,
decoded_size
);
"Decoded EPS_NAS_Message_Container
(Length
%d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/EPS_NAS_Message_Container.hpp
View file @
1a8eb820
...
...
@@ -19,17 +19,12 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __EPS_NAS_Message_Container_H_
#define __EPS_NAS_Message_Container_H_
#include <stdint.h>
#ifndef _EPS_NAS_Message_Container_H_
#define _EPS_NAS_Message_Container_H_
#include <stdint.h>
#include <iostream>
extern
"C"
{
#include "TLVDecoder.h"
#include "TLVEncoder.h"
...
...
@@ -43,7 +38,7 @@ class EPS_NAS_Message_Container {
EPS_NAS_Message_Container
(
uint8_t
iei
);
EPS_NAS_Message_Container
(
const
uint8_t
iei
,
bstring
value
);
~
EPS_NAS_Message_Container
();
void
setValue
(
uint8_t
iei
,
uint8_t
value
);
void
setValue
(
uint8_t
iei
);
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
void
getValue
(
bstring
&
value
);
...
...
src/nas/ies/LADN_Indication.cpp
View file @
1a8eb820
...
...
@@ -19,15 +19,10 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "LADN_Indication.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "logger.hpp"
using
namespace
nas
;
...
...
@@ -44,7 +39,7 @@ LADN_Indication::LADN_Indication(const uint8_t iei, std::vector<bstring> ladn) {
length
=
3
;
LADN
.
assign
(
ladn
.
begin
(),
ladn
.
end
());
for
(
int
i
=
0
;
i
<
ladn
.
size
();
i
++
)
{
length
=
length
+
1
+
blength
(
ladn
.
at
(
i
));
length
=
length
+
blength
(
ladn
.
at
(
i
));
}
}
...
...
@@ -55,52 +50,51 @@ LADN_Indication::LADN_Indication() : _iei(), length(), LADN() {}
LADN_Indication
::~
LADN_Indication
()
{}
//------------------------------------------------------------------------------
void
LADN_Indication
::
setValue
(
uint8_t
iei
,
uint8_t
value
)
{
void
LADN_Indication
::
setValue
(
uint8_t
iei
)
{
_iei
=
iei
;
}
//------------------------------------------------------------------------------
bool
LADN_Indication
::
getValue
(
std
::
vector
<
bstring
>&
ladn
)
{
void
LADN_Indication
::
getValue
(
std
::
vector
<
bstring
>&
ladn
)
{
ladn
.
assign
(
LADN
.
begin
(),
LADN
.
end
());
return
0
;
}
//------------------------------------------------------------------------------
int
LADN_Indication
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding LADN_Indication IEI (0x%x)"
,
_iei
);
if
(
len
<
length
)
{
Logger
::
nas_mm
().
error
(
"Len is less than %d"
,
length
);
return
0
;
Logger
::
nas_mm
().
debug
(
"Encoding LADN_Indication (IEI 0x%x)"
,
_iei
);
if
((
len
<
length
+
3
)
or
(
len
<
kLadnIndicationMinimumLength
))
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE"
);
return
KEncodeDecodeError
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
ENCODE_U8
(
buf
+
encoded_size
,
_iei
,
encoded_size
);
ENCODE_U16
(
buf
+
encoded_size
,
length
-
3
,
encoded_size
);
for
(
int
i
=
0
;
i
<
LADN
.
size
();
i
++
)
{
*
(
buf
+
encoded_size
)
=
blength
(
LADN
.
at
(
i
));
encoded_size
++
;
encoded_size
+=
encode_bstring
(
LADN
.
at
(
i
),
(
buf
+
encoded_size
),
len
-
encoded_size
);
}
}
else
{
// TODO:
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger
::
nas_mm
().
debug
(
"Encoded LADN_Indication len (%d)"
,
encoded_size
);
ENCODE_U16
(
buf
+
encoded_size
,
length
,
encoded_size
);
for
(
int
i
=
0
;
i
<
LADN
.
size
();
i
++
)
{
ENCODE_U8
(
buf
+
encoded_size
,
blength
(
LADN
.
at
(
i
)),
encoded_size
);
encoded_size
+=
encode_bstring
(
LADN
.
at
(
i
),
(
buf
+
encoded_size
),
len
-
encoded_size
);
}
Logger
::
nas_mm
().
debug
(
"Encoded LADN_Indication (len %d)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
LADN_Indication
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Decoding LADN_Indication
IEI (0x%x)"
,
*
buf
);
Logger
::
nas_mm
().
debug
(
"Decoding LADN_Indication
"
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
}
length
=
0
;
DECODE_U16
(
buf
+
decoded_size
,
length
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Decoded LADN_Indication
len (
%d)"
,
length
);
Logger
::
nas_mm
().
debug
(
"Decoded LADN_Indication
(len
%d)"
,
length
);
int
len_ie
=
length
;
uint8_t
len_dnn
=
0
;
bstring
dnn
;
...
...
@@ -121,6 +115,6 @@ int LADN_Indication::decodeFromBuffer(uint8_t* buf, int len, bool is_option) {
}
}
Logger
::
nas_mm
().
debug
(
"Decoded LADN_Indication
len (
%d)"
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Decoded LADN_Indication
(len
%d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/LADN_Indication.hpp
View file @
1a8eb820
...
...
@@ -19,25 +19,23 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _LADN_Indication_H_
#define _LADN_Indication_H_
#ifndef __LADN_Indication_H_
#define __LADN_Indication_H_
#include <stdint.h>
#include <iostream>
#include <vector>
extern
"C"
{
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
using
namespace
std
;
constexpr
uint8_t
kLadnIndicationMinimumLength
=
3
;
constexpr
uint16_t
kLadnIndicationMaximumLength
=
1715
;
namespace
nas
{
class
LADN_Indication
{
...
...
@@ -46,10 +44,10 @@ class LADN_Indication {
LADN_Indication
(
uint8_t
iei
);
LADN_Indication
(
const
uint8_t
iei
,
std
::
vector
<
bstring
>
ladn
);
~
LADN_Indication
();
void
setValue
(
uint8_t
iei
,
uint8_t
value
);
void
setValue
(
uint8_t
iei
);
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
bool
getValue
(
std
::
vector
<
bstring
>&
ladn
);
void
getValue
(
std
::
vector
<
bstring
>&
ladn
);
private:
uint8_t
_iei
;
...
...
src/nas/ies/Payload_Container_Type.hpp
View file @
1a8eb820
...
...
@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _Payload_Container_Type_H
#define _Payload_Container_Type_H
...
...
src/nas/ies/_5GS_DRX_arameters.cpp
→
src/nas/ies/_5GS_DRX_
P
arameters.cpp
View file @
1a8eb820
...
...
@@ -19,83 +19,83 @@
* contact@openairinterface.org
*/
/*! \file ___5GS_DRX_arameters.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "_5GS_DRX_arameters.hpp"
#include "_5GS_DRX_Parameters.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
_5GS_DRX_
arameters
::
_5GS_DRX_
arameters
(
uint8_t
iei
)
{
_5GS_DRX_
Parameters
::
_5GS_DRX_P
arameters
(
uint8_t
iei
)
{
_iei
=
iei
;
length
=
1
;
_value
=
0
;
}
//------------------------------------------------------------------------------
_5GS_DRX_
arameters
::
_5GS_DRX_
arameters
(
const
uint8_t
iei
,
uint8_t
value
)
{
_5GS_DRX_
Parameters
::
_5GS_DRX_P
arameters
(
const
uint8_t
iei
,
uint8_t
value
)
{
_iei
=
iei
;
length
=
1
;
_value
=
value
&
0x0F
;
}
//------------------------------------------------------------------------------
_5GS_DRX_
arameters
::
_5GS_DRX_
arameters
()
{
_5GS_DRX_
Parameters
::
_5GS_DRX_P
arameters
()
{
_iei
=
0
;
length
=
1
;
_value
=
0
;
}
_5GS_DRX_
arameters
::~
_5GS_DRX_
arameters
()
{}
_5GS_DRX_
Parameters
::~
_5GS_DRX_P
arameters
()
{}
//------------------------------------------------------------------------------
void
_5GS_DRX_arameters
::
setValue
(
uint8_t
value
)
{
void
_5GS_DRX_
P
arameters
::
setValue
(
uint8_t
value
)
{
_value
=
value
&
0x0F
;
}
//------------------------------------------------------------------------------
uint8_t
_5GS_DRX_arameters
::
getValue
()
{
uint8_t
_5GS_DRX_
P
arameters
::
getValue
()
{
return
_value
;
}
//------------------------------------------------------------------------------
int
_5GS_DRX_arameters
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding _5GS_DRX_arameters iei(0x%x)"
,
_iei
);
if
(
len
<
3
)
{
return
0
;
int
_5GS_DRX_Parameters
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding _5GS_DRX_Parameters iei(0x%x)"
,
_iei
);
if
(
len
<
k5gsDrxParametersLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
k5gsDrxParametersLength
);
return
KEncodeDecodeError
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
*
(
buf
+
encoded_size
)
=
_iei
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
1
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
0x0F
&
_value
;
encoded_size
++
;
}
else
{
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
ENCODE_U8
(
buf
+
encoded_size
,
_iei
,
encoded_size
);
}
Logger
::
nas_mm
().
debug
(
"encoded _5GS_DRX_arameters len(%d)"
,
encoded_size
);
ENCODE_U8
(
buf
+
encoded_size
,
length
,
encoded_size
);
ENCODE_U8
(
buf
+
encoded_size
,
_value
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"Encoded _5GS_DRX_Parameters (len %d)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
_5GS_DRX_arameters
::
decodeFromBuffer
(
int
_5GS_DRX_
P
arameters
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"decoding _5GS_DRX_arameters iei(0x%x)"
,
*
buf
);
Logger
::
nas_mm
().
debug
(
"Decoding _5GS_DRX_Parameters"
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
DECODE_U8
(
buf
+
decoded_size
,
_iei
,
decoded_size
)
;
}
_value
=
0x00
;
// length = *(buf + decoded_size);
decoded_size
++
;
_value
=
*
(
buf
+
decoded_size
)
&
0x0f
;
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"decoded _5GS_DRX_Parameters DRX value(0x%x)"
,
_value
);
Logger
::
nas_mm
().
debug
(
"decoded _5GS_DRX_Parameters len(%d)"
,
decoded_size
);
DECODE_U8
(
buf
+
decoded_size
,
length
,
decoded_size
);
uint8_t
octet
=
0
;
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
_value
=
octet
&
0x0f
;
Logger
::
nas_mm
().
debug
(
"Decoded _5GS_DRX_Parameters DRX (value 0x%x)"
,
_value
);
Logger
::
nas_mm
().
debug
(
"Decoded _5GS_DRX_Parameters (len %d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/_5GS_DRX_arameters.hpp
→
src/nas/ies/_5GS_DRX_
P
arameters.hpp
View file @
1a8eb820
...
...
@@ -19,26 +19,21 @@
* contact@openairinterface.org
*/
/*! \file ___5GS_DRX_arameters.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef ___5GS_DRX_arameters_H_
#define ___5GS_DRX_arameters_H_
#ifndef _5GS_DRX_Parameters_H_
#define _5GS_DRX_Parameters_H_
#include <stdint.h>
constexpr
uint8_t
k5gsDrxParametersLength
=
3
;
namespace
nas
{
class
_5GS_DRX_arameters
{
class
_5GS_DRX_
P
arameters
{
public:
_5GS_DRX_arameters
();
_5GS_DRX_arameters
(
uint8_t
iei
);
_5GS_DRX_arameters
(
const
uint8_t
iei
,
uint8_t
value
);
~
_5GS_DRX_arameters
();
_5GS_DRX_
P
arameters
();
_5GS_DRX_
P
arameters
(
uint8_t
iei
);
_5GS_DRX_
P
arameters
(
const
uint8_t
iei
,
uint8_t
value
);
~
_5GS_DRX_
P
arameters
();
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
void
setValue
(
uint8_t
value
);
...
...
@@ -46,6 +41,7 @@ class _5GS_DRX_arameters {
private:
uint8_t
_iei
;
uint8_t
length
;
uint8_t
_value
;
};
}
// namespace nas
...
...
src/nas/msgs/RegistrationAccept.cpp
View file @
1a8eb820
...
...
@@ -218,7 +218,7 @@ void RegistrationAccept::setNSSAI_Inclusion_Mode(uint8_t value) {
//------------------------------------------------------------------------------
void
RegistrationAccept
::
set_5GS_DRX_arameters
(
uint8_t
value
)
{
ie_negotiated_drx_parameters
=
new
_5GS_DRX_arameters
(
0x51
,
value
);
ie_negotiated_drx_parameters
=
new
_5GS_DRX_
P
arameters
(
0x51
,
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -770,7 +770,7 @@ int RegistrationAccept::decodeFromBuffer(
}
break
;
case
0x51
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x51)"
);
ie_negotiated_drx_parameters
=
new
_5GS_DRX_arameters
();
ie_negotiated_drx_parameters
=
new
_5GS_DRX_
P
arameters
();
decoded_size
+=
ie_negotiated_drx_parameters
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/RegistrationAccept.hpp
View file @
1a8eb820
...
...
@@ -105,7 +105,7 @@ class RegistrationAccept {
SOR_Transparent_Container
*
ie_sor_transparent_container
;
EAP_Message
*
ie_eap_message
;
NSSAI_Inclusion_Mode
*
ie_nssai_inclusion_mode
;
_5GS_DRX_arameters
*
ie_negotiated_drx_parameters
;
_5GS_DRX_
P
arameters
*
ie_negotiated_drx_parameters
;
Non_3GPP_NW_Provided_Policies
*
ie_non_3gpp_nw_policies
;
EPS_Bearer_Context_Status
*
ie_eps_bearer_context_status
;
Extended_DRX_Parameters
*
ie_extended_drx_parameters
;
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
1a8eb820
...
...
@@ -42,10 +42,10 @@ RegistrationRequest::RegistrationRequest()
ie_ue_status
=
std
::
nullopt
;
ie_additional_guti
=
std
::
nullopt
;
ie_allowed_PDU_session_status
=
std
::
nullopt
;
ie_ues_usage_setting
=
nullptr
;
ie_5gs_drx_parameters
=
nullptr
;
ie_eps_nas_message_container
=
nullptr
;
ie_ladn_indication
=
nullptr
;
ie_ues_usage_setting
=
std
::
nullopt
;
ie_5gs_drx_parameters
=
std
::
nullopt
;
ie_eps_nas_message_container
=
std
::
nullopt
;
ie_ladn_indication
=
std
::
nullopt
;
ie_payload_container_type
=
nullptr
;
ie_payload_container
=
nullptr
;
ie_network_slicing_indication
=
nullptr
;
...
...
@@ -367,13 +367,14 @@ uint16_t RegistrationRequest::getAllowedPduSessionStatus() {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setUES_Usage_Setting
(
bool
ues_usage_setting
)
{
ie_ues_usage_setting
=
new
UEUsageSetting
(
0x18
,
ues_usage_setting
);
ie_ues_usage_setting
=
std
::
make_optional
<
UEUsageSetting
>
(
0x18
,
ues_usage_setting
);
}
//------------------------------------------------------------------------------
uint8_t
RegistrationRequest
::
getUEsUsageSetting
()
{
if
(
ie_ues_usage_setting
)
{
return
ie_ues_usage_setting
->
getValue
();
if
(
ie_ues_usage_setting
.
has_value
()
)
{
return
ie_ues_usage_setting
.
value
().
getValue
();
}
else
{
return
0
;
}
...
...
@@ -381,13 +382,14 @@ uint8_t RegistrationRequest::getUEsUsageSetting() {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
set_5GS_DRX_arameters
(
uint8_t
value
)
{
ie_5gs_drx_parameters
=
new
_5GS_DRX_arameters
(
0x51
,
value
);
ie_5gs_drx_parameters
=
std
::
make_optional
<
_5GS_DRX_Parameters
>
(
kIei5gsDrxParameters
,
value
);
}
//------------------------------------------------------------------------------
uint8_t
RegistrationRequest
::
get5GSDrxParameters
()
{
if
(
ie_5gs_drx_parameters
)
{
return
ie_5gs_drx_parameters
->
getValue
();
if
(
ie_5gs_drx_parameters
.
has_value
()
)
{
return
ie_5gs_drx_parameters
.
value
().
getValue
();
}
else
{
return
0
;
}
...
...
@@ -395,7 +397,8 @@ uint8_t RegistrationRequest::get5GSDrxParameters() {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setEPS_NAS_Message_Container
(
bstring
value
)
{
ie_eps_nas_message_container
=
new
EPS_NAS_Message_Container
(
0x70
,
value
);
ie_eps_nas_message_container
=
std
::
make_optional
<
EPS_NAS_Message_Container
>
(
kIeiEpsNasMessageContainer
,
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -410,15 +413,16 @@ bool RegistrationRequest::getEpsNasMessageContainer(bstring& epsNas) {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setLADN_Indication
(
std
::
vector
<
bstring
>
ladnValue
)
{
ie_ladn_indication
=
new
LADN_Indication
(
0x74
,
ladnValue
);
ie_ladn_indication
=
std
::
make_optional
<
LADN_Indication
>
(
0x74
,
ladnValue
);
}
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
getLadnIndication
(
std
::
vector
<
bstring
>&
ladnValue
)
{
if
(
ie_ladn_indication
)
{
return
ie_ladn_indication
->
getValue
(
ladnValue
);
if
(
ie_ladn_indication
.
has_value
())
{
ie_ladn_indication
.
value
().
getValue
(
ladnValue
);
return
true
;
}
else
{
return
0
;
return
false
;
}
}
...
...
@@ -710,10 +714,10 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
return
0
;
}
}
if
(
!
ie_ues_usage_setting
)
{
if
(
!
ie_ues_usage_setting
.
has_value
()
)
{
Logger
::
nas_mm
().
warn
(
"IE ie_ues_usage_setting is not available"
);
}
else
{
if
(
int
size
=
ie_ues_usage_setting
->
encode2Buffer
(
if
(
int
size
=
ie_ues_usage_setting
.
value
().
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
...
...
@@ -721,10 +725,10 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
return
0
;
}
}
if
(
!
ie_5gs_drx_parameters
)
{
if
(
!
ie_5gs_drx_parameters
.
has_value
()
)
{
Logger
::
nas_mm
().
warn
(
"IE ie_5gs_drx_parameters is not available"
);
}
else
{
if
(
int
size
=
ie_5gs_drx_parameters
->
encode2Buffer
(
if
(
int
size
=
ie_5gs_drx_parameters
.
value
().
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
...
...
@@ -743,10 +747,10 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
return
0
;
}
}
if
(
!
ie_ladn_indication
)
{
if
(
!
ie_ladn_indication
.
has_value
()
)
{
Logger
::
nas_mm
().
warn
(
"IE ie_ladn_indication is not available"
);
}
else
{
if
(
int
size
=
ie_ladn_indication
->
encode2Buffer
(
if
(
int
size
=
ie_ladn_indication
.
value
().
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
...
...
@@ -1000,33 +1004,41 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
}
break
;
case
0x18
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0x18)"
);
ie_ues_usage_setting
=
new
UEUsageSetting
()
;
decoded_size
+=
ie_ues_usage_setting
->
decodeFromBuffer
(
UEUsageSetting
ie_ues_usage_setting_tmp
=
{}
;
decoded_size
+=
ie_ues_usage_setting
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_ues_usage_setting
=
std
::
optional
<
UEUsageSetting
>
(
ie_ues_usage_setting_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
case
0x51
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI
(0x51)
"
);
ie_5gs_drx_parameters
=
new
_5GS_DRX_arameters
()
;
decoded_size
+=
ie_5gs_drx_parameters
->
decodeFromBuffer
(
case
kIei5gsDrxParameters
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI
0x51: 5GS DRX Parameters
"
);
_5GS_DRX_Parameters
ie_5gs_drx_parameters_tmp
=
{}
;
decoded_size
+=
ie_5gs_drx_parameters
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_5gs_drx_parameters
=
std
::
optional
<
_5GS_DRX_Parameters
>
(
ie_5gs_drx_parameters_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
case
0x70
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI
(0x70)
"
);
ie_eps_nas_message_container
=
new
EPS_NAS_Message_Container
()
;
decoded_size
+=
ie_eps_nas_message_container
->
decodeFromBuffer
(
case
kIeiEpsNasMessageContainer
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI
0x70: EPS NAS Message Container
"
);
EPS_NAS_Message_Container
ie_eps_nas_message_container_tmp
=
{}
;
decoded_size
+=
ie_eps_nas_message_container
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_eps_nas_message_container
=
std
::
optional
<
EPS_NAS_Message_Container
>
(
ie_eps_nas_message_container_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
case
0x74
:
{
case
0x74
:
{
// TODO: verify IEI value (spec Ox79)
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0x74)"
);
ie_ladn_indication
=
new
LADN_Indication
()
;
decoded_size
+=
ie_ladn_indication
->
decodeFromBuffer
(
LADN_Indication
ie_ladn_indication_tmp
=
{}
;
decoded_size
+=
ie_ladn_indication
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_ladn_indication
=
std
::
optional
<
LADN_Indication
>
(
ie_ladn_indication_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
1a8eb820
...
...
@@ -166,12 +166,13 @@ class RegistrationRequest : public NasMmPlainHeader {
std
::
optional
<
UEStatus
>
ie_ue_status
;
// Optional
std
::
optional
<
_5GSMobileIdentity
>
ie_additional_guti
;
// Optional
std
::
optional
<
AllowedPDUSessionStatus
>
ie_allowed_PDU_session_status
;
// Optional
ie_allowed_PDU_session_status
;
// Optional
std
::
optional
<
UEUsageSetting
>
ie_ues_usage_setting
;
// Optional
std
::
optional
<
_5GS_DRX_Parameters
>
ie_5gs_drx_parameters
;
// Optional
std
::
optional
<
EPS_NAS_Message_Container
>
ie_eps_nas_message_container
;
// Optional
std
::
optional
<
LADN_Indication
>
ie_ladn_indication
;
// Optional
UEUsageSetting
*
ie_ues_usage_setting
;
// Optional
_5GS_DRX_arameters
*
ie_5gs_drx_parameters
;
// Optional
EPS_NAS_Message_Container
*
ie_eps_nas_message_container
;
// Optional
LADN_Indication
*
ie_ladn_indication
;
// Optional
Payload_Container_Type
*
ie_payload_container_type
;
// Optional
Payload_Container
*
ie_payload_container
;
// Optional
Network_Slicing_Indication
*
ie_network_slicing_indication
;
// Optional
...
...
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