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
564e4d9b
Commit
564e4d9b
authored
Oct 17, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code refactor for RegistrationRequest
parent
f70921a9
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
261 additions
and
283 deletions
+261
-283
src/nas/common/Ie_Const.hpp
src/nas/common/Ie_Const.hpp
+6
-1
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-1
src/nas/ies/EPS_Bearer_Context_Status.cpp
src/nas/ies/EPS_Bearer_Context_Status.cpp
+26
-35
src/nas/ies/EPS_Bearer_Context_Status.hpp
src/nas/ies/EPS_Bearer_Context_Status.hpp
+4
-9
src/nas/ies/LADN_Indication.cpp
src/nas/ies/LADN_Indication.cpp
+1
-1
src/nas/ies/NAS_Message_Container.cpp
src/nas/ies/NAS_Message_Container.cpp
+22
-32
src/nas/ies/NAS_Message_Container.hpp
src/nas/ies/NAS_Message_Container.hpp
+5
-10
src/nas/ies/NetworkSlicingIndication.cpp
src/nas/ies/NetworkSlicingIndication.cpp
+57
-56
src/nas/ies/NetworkSlicingIndication.hpp
src/nas/ies/NetworkSlicingIndication.hpp
+14
-16
src/nas/ies/Payload_Container.cpp
src/nas/ies/Payload_Container.cpp
+11
-4
src/nas/ies/Payload_Container.hpp
src/nas/ies/Payload_Container.hpp
+2
-2
src/nas/ies/_5GS_Update_Type.cpp
src/nas/ies/_5GS_Update_Type.cpp
+32
-44
src/nas/ies/_5GS_Update_Type.hpp
src/nas/ies/_5GS_Update_Type.hpp
+7
-13
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
+62
-49
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+8
-7
No files found.
src/nas/common/Ie_Const.hpp
View file @
564e4d9b
...
...
@@ -34,7 +34,7 @@ constexpr uint8_t kIei5gsMobileIdentityNonImeiSvPei = 0x78;
constexpr
uint8_t
kIei5gsRegistrationResult
=
0x44
;
constexpr
uint8_t
kIei5gsTrackingAreaIdentity
=
0x52
;
constexpr
uint8_t
kIei5gsTrackingAreaIdentityList
=
0x54
;
constexpr
uint8_t
kIei5gsUpdateType
=
0x53
;
constexpr
uint8_t
kIei5gsUpdateType
=
0x53
;
// OK
constexpr
uint8_t
kIeiAdditionalInformation
=
0x24
;
constexpr
uint8_t
kIeiAllowedSscMode
=
0x0f
;
constexpr
uint8_t
kIeiAlwaysOnPduSessionIndication
=
0x08
;
...
...
@@ -84,4 +84,9 @@ constexpr uint8_t kIeiSuggestedInterfaceIdentifier = 0x29;
constexpr
uint8_t
kIeiUeDsTtResidenceTime
=
0x6f
;
constexpr
uint8_t
kIeiEpsNasMessageContainer
=
0x70
;
// OK
constexpr
uint8_t
kIeiNasMessageContainer
=
0x71
;
// OK
constexpr
uint8_t
kIeiPayloadContainerType
=
0x08
;
// Should be verified
constexpr
uint8_t
kIeiPayloadContainer
=
0x7b
;
// Should be verified (kIeiExtendedProtocolConfigurationOptions)
constexpr
uint8_t
kIeiNetworkSlicingIndication
=
0x09
;
// 9-(4 higher bits)
constexpr
uint8_t
kIeiEpsBearerContextStatus
=
0x60
;
src/nas/common/NasIeHeader.hpp
View file @
564e4d9b
...
...
@@ -21,6 +21,7 @@
#include "../ies/5GSMobileIdentity.hpp"
#include "../ies/MICOIndication.hpp"
#include "../ies/NetworkSlicingIndication.hpp"
#include "../ies/PDUSessionStatus.hpp"
#include "../ies/UEStatus.hpp"
#include "NasMmPlainHeader.hpp"
...
...
@@ -50,7 +51,6 @@
#include "NSSAI.hpp"
#include "NSSAI_Inclusion_Mode.hpp"
#include "NasKeySetIdentifier.hpp"
#include "Network_Slicing_Indication.hpp"
#include "Non_3GPP_NW_Provided_Policies.hpp"
#include "PDU_Session_Identity_2.hpp"
#include "PDU_Session_Reactivation_Result.hpp"
...
...
src/nas/ies/EPS_Bearer_Context_Status.cpp
View file @
564e4d9b
...
...
@@ -19,15 +19,10 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "EPS_Bearer_Context_Status.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "logger.hpp"
using
namespace
nas
;
...
...
@@ -43,7 +38,7 @@ EPS_Bearer_Context_Status::EPS_Bearer_Context_Status(
const
uint8_t
iei
,
uint16_t
value
)
{
_iei
=
iei
;
_value
=
value
;
length
=
4
;
length
=
kEpsBearerContextStatusLength
;
}
//------------------------------------------------------------------------------
...
...
@@ -66,48 +61,44 @@ uint16_t EPS_Bearer_Context_Status::getValue() {
//------------------------------------------------------------------------------
int
EPS_Bearer_Context_Status
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding EPS_Bearer_Context_Status iei(0x%x)"
,
_iei
);
if
(
len
<
length
)
{
Logger
::
nas_mm
().
error
(
"len is less than %d"
,
length
);
return
0
;
Logger
::
nas_mm
().
debug
(
"Encoding EPS_Bearer_Context_Status"
);
if
(
len
<
kEpsBearerContextStatusLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kEpsBearerContextStatusLength
);
return
KEncodeDecodeError
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
*
(
buf
+
encoded_size
)
=
_iei
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
length
-
2
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
(
_value
&
0x00ff
);
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
(
_value
&
0xff00
)
>>
8
;
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
);
}
// Length
ENCODE_U8
(
buf
+
encoded_size
,
length
,
encoded_size
);
// Value
ENCODE_U16
(
buf
+
encoded_size
,
_value
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"encoded EPS_Bearer_Context_Status
len(
%d)"
,
encoded_size
);
"encoded EPS_Bearer_Context_Status
(len
%d)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
EPS_Bearer_Context_Status
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"
decoding EPS_Bearer_Context_Status iei(0x%x)"
,
*
buf
);
Logger
::
nas_mm
().
debug
(
"
Decoding EPS_Bearer_Context_Status"
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
DECODE_U8
(
buf
+
decoded_size
,
_iei
,
decoded_size
);
// for IE
}
_value
=
0x0000
;
length
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
_value
|=
*
(
buf
+
decoded_size
);
decoded_size
++
;
_value
|=
(
*
(
buf
+
decoded_size
))
<<
8
;
decoded_size
++
;
// Length
DECODE_U8
(
buf
+
decoded_size
,
length
,
decoded_size
);
// for IE
// Value
DECODE_U16
(
buf
+
decoded_size
,
_value
,
decoded_size
);
// for IE
Logger
::
nas_mm
().
debug
(
"decoded EPS_Bearer_Context_Status
value(0x%4x)
"
,
_value
);
"decoded EPS_Bearer_Context_Status
, value 0x%4x
"
,
_value
);
Logger
::
nas_mm
().
debug
(
"decoded EPS_Bearer_Context_Status
len(
%d)"
,
decoded_size
);
"decoded EPS_Bearer_Context_Status
(len
%d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/EPS_Bearer_Context_Status.hpp
View file @
564e4d9b
...
...
@@ -19,18 +19,13 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __EPS_Bearer_Context_Status_H_
#define __EPS_Bearer_Context_Status_H_
#ifndef _EPS_Bearer_Context_Status_H_
#define _EPS_Bearer_Context_Status_H_
#include <stdint.h>
constexpr
uint8_t
kEpsBearerContextStatusLength
=
4
;
namespace
nas
{
class
EPS_Bearer_Context_Status
{
...
...
src/nas/ies/LADN_Indication.cpp
View file @
564e4d9b
...
...
@@ -90,7 +90,7 @@ int LADN_Indication::decodeFromBuffer(uint8_t* buf, int len, bool is_option) {
Logger
::
nas_mm
().
debug
(
"Decoding LADN_Indication"
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
DECODE_U8
(
buf
+
decoded_size
,
_iei
,
decoded_size
)
;
}
length
=
0
;
DECODE_U16
(
buf
+
decoded_size
,
length
,
decoded_size
);
...
...
src/nas/ies/NAS_Message_Container.cpp
View file @
564e4d9b
...
...
@@ -19,15 +19,10 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "NAS_Message_Container.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "logger.hpp"
using
namespace
nas
;
...
...
@@ -41,7 +36,7 @@ NAS_Message_Container::NAS_Message_Container(uint8_t iei) : _value() {
NAS_Message_Container
::
NAS_Message_Container
(
const
uint8_t
iei
,
bstring
value
)
{
_iei
=
iei
;
_value
=
bstrcpy
(
value
);
length
=
blength
(
value
)
+
3
;
length
=
blength
(
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -63,26 +58,24 @@ void NAS_Message_Container::getValue(bstring& value) {
//------------------------------------------------------------------------------
int
NAS_Message_Container
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding NAS_Message_Container IEI 0x%x"
,
_iei
);
if
(
len
<
length
)
{
Logger
::
nas_mm
().
error
(
"Len is less than %d"
,
length
);
return
0
;
Logger
::
nas_mm
().
debug
(
"Encoding NAS_Message_Container IEI"
);
if
(
len
<
kNasMessageContainerMinimumLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kNasMessageContainerMinimumLength
);
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
);
}
// Length
ENCODE_U16
(
buf
+
encoded_size
,
length
,
encoded_size
);
// Value
int
size
=
encode_bstring
(
_value
,
(
buf
+
encoded_size
),
len
-
encoded_size
);
encoded_size
+=
size
;
Logger
::
nas_mm
().
debug
(
"Encoded NAS_Message_Container (len %d)"
,
encoded_size
);
return
encoded_size
;
...
...
@@ -91,17 +84,14 @@ int NAS_Message_Container::encode2Buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
int
NAS_Message_Container
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Decoding NAS_Message_Container
iei (0x%x)"
,
*
buf
);
Logger
::
nas_mm
().
debug
(
"Decoding NAS_Message_Container
"
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
// for IE
DECODE_U8
(
buf
+
decoded_size
,
_iei
,
decoded_size
)
;
// for IE
}
length
=
0
;
length
|=
(
*
(
buf
+
decoded_size
))
<<
8
;
decoded_size
++
;
length
|=
*
(
buf
+
decoded_size
);
decoded_size
++
;
// Length
DECODE_U16
(
buf
+
decoded_size
,
length
,
decoded_size
);
// Value
decode_bstring
(
&
_value
,
length
,
(
buf
+
decoded_size
),
len
-
decoded_size
);
decoded_size
+=
length
;
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
...
...
src/nas/ies/NAS_Message_Container.hpp
View file @
564e4d9b
...
...
@@ -19,24 +19,19 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __NAS_Message_Container_H_
#define __NAS_Message_Container_H_
#ifndef _NAS_Message_Container_H_
#define _NAS_Message_Container_H_
#include <stdint.h>
#include <iostream>
extern
"C"
{
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
constexpr
uint8_t
kNasMessageContainerMinimumLength
=
3
;
constexpr
uint32_t
kNasMessageContainerMaximumLength
=
65535
;
namespace
nas
{
class
NAS_Message_Container
{
...
...
src/nas/ies/Network
_Slicing_
Indication.cpp
→
src/nas/ies/Network
Slicing
Indication.cpp
View file @
564e4d9b
...
...
@@ -19,27 +19,23 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Network_Slicing_Indication.hpp"
#include "NetworkSlicingIndication.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
Network
_Slicing_Indication
::
Network_Slicing_
Indication
(
uint8_t
iei
)
{
Network
SlicingIndication
::
NetworkSlicing
Indication
(
uint8_t
iei
)
{
_iei
=
iei
;
DCNI
=
false
;
NSSCI
=
false
;
}
//------------------------------------------------------------------------------
Network
_Slicing_Indication
::
Network_Slicing_
Indication
(
Network
SlicingIndication
::
NetworkSlicing
Indication
(
const
uint8_t
iei
,
bool
dcni
,
bool
nssci
)
{
_iei
=
iei
;
DCNI
=
dcni
;
...
...
@@ -47,79 +43,84 @@ Network_Slicing_Indication::Network_Slicing_Indication(
}
//------------------------------------------------------------------------------
Network
_Slicing_Indication
::
Network_Slicing_
Indication
()
Network
SlicingIndication
::
NetworkSlicing
Indication
()
:
_iei
(),
DCNI
(),
NSSCI
()
{}
//------------------------------------------------------------------------------
Network
_Slicing_Indication
::~
Network_Slicing_
Indication
()
{}
Network
SlicingIndication
::~
NetworkSlicing
Indication
()
{}
//------------------------------------------------------------------------------
void
Network
_Slicing_
Indication
::
setDCNI
(
bool
value
)
{
void
Network
Slicing
Indication
::
setDCNI
(
bool
value
)
{
DCNI
=
value
;
}
//------------------------------------------------------------------------------
void
Network
_Slicing_
Indication
::
setNSSCI
(
bool
value
)
{
void
Network
Slicing
Indication
::
setNSSCI
(
bool
value
)
{
NSSCI
=
value
;
}
//------------------------------------------------------------------------------
bool
Network
_Slicing_
Indication
::
getDCNI
()
{
bool
Network
Slicing
Indication
::
getDCNI
()
{
return
DCNI
;
}
//------------------------------------------------------------------------------
bool
Network
_Slicing_
Indication
::
getNSSCI
()
{
bool
Network
Slicing
Indication
::
getNSSCI
()
{
return
NSSCI
;
}
//------------------------------------------------------------------------------
int
Network_Slicing_Indication
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding Network_Slicing_Indication iei (0x%x)"
,
_iei
);
if
(
len
<
1
)
{
// Logger::nas_mm().error("len is less than %d", length);
return
0
;
int
NetworkSlicingIndication
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding Network Slicing Indication"
);
if
(
len
<
kNetworkSlicingIndicationLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kNetworkSlicingIndicationLength
);
return
KEncodeDecodeError
;
}
uint8_t
octet
=
0
;
if
(
!
(
_iei
&
0x0f
))
{
// octet = (0x0f) & ((tsc << 3) | key_id);
//*buf = octet;
// Logger::nas_mm().debug("encoded Payload_Container_Type IE(len(1/2
// octet))"); return 0;
}
else
{
int
encoded_size
=
0
;
uint8_t
octet
=
0
;
if
(
_iei
)
{
octet
=
(
_iei
<<
4
)
|
(
DCNI
<<
1
)
|
NSSCI
;
Logger
::
nas_mm
().
debug
(
"Decoded Network_Slicing_Indication DCNI (0x%x) NSSCI (0x%x)"
,
octet
,
NSSCI
);
*
buf
=
octet
;
Logger
::
nas_mm
().
debug
(
"Encoded Network_Slicing_Indication IE (len, 1 octet)"
);
return
1
;
}
else
{
octet
=
0x0f
&
((
DCNI
<<
1
)
|
NSSCI
);
}
return
1
;
ENCODE_U8
(
buf
+
encoded_size
,
octet
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"Encoded NetworkSlicingIndication DCNI (0x%x) NSSCI (0x%x)"
,
DCNI
,
NSSCI
);
Logger
::
nas_mm
().
debug
(
"Encoded NetworkSlicingIndication IE (len, %d octet)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
Network
_Slicing_
Indication
::
decodeFromBuffer
(
int
Network
Slicing
Indication
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
if
(
len
<
1
)
{
Logger
::
nas_mm
().
error
(
"Len is less than one"
);
return
0
;
}
else
{
uint8_t
octet
=
(
*
buf
);
if
(
is_option
)
{
_iei
=
(
octet
&
0xf0
)
>>
4
;
}
else
{
_iei
=
0
;
}
DCNI
=
0
;
NSSCI
=
0
;
DCNI
=
octet
&
0x02
;
NSSCI
=
octet
&
0x01
;
Logger
::
nas_mm
().
debug
(
"Decoded Network_Slicing_Indication DCNI (0x%x) NSSCI (0x%x)"
,
DCNI
,
NSSCI
);
return
1
;
Logger
::
nas_mm
().
debug
(
"Decoding Network Slicing Indication"
);
if
(
len
<
kNetworkSlicingIndicationLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kNetworkSlicingIndicationLength
);
return
KEncodeDecodeError
;
}
int
decoded_size
=
0
;
uint8_t
octet
=
0
;
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
if
(
is_option
)
{
_iei
=
(
octet
&
0xf0
)
>>
4
;
}
DCNI
=
octet
&
0x02
;
NSSCI
=
octet
&
0x01
;
Logger
::
nas_mm
().
debug
(
"Decoded NetworkSlicingIndication DCNI (0x%x) NSSCI (0x%x)"
,
DCNI
,
NSSCI
);
return
decoded_size
;
}
src/nas/ies/Network
_Slicing_
Indication.hpp
→
src/nas/ies/Network
Slicing
Indication.hpp
View file @
564e4d9b
...
...
@@ -19,37 +19,35 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __Network_Slicing_Indication_H_
#define __Network_Slicing_Indication_H_
#ifndef _Network_Slicing_Indication_H_
#define _Network_Slicing_Indication_H_
#include <stdint.h>
constexpr
uint8_t
kNetworkSlicingIndicationLength
=
1
;
namespace
nas
{
class
Network
_Slicing_
Indication
{
class
Network
Slicing
Indication
{
public:
Network_Slicing_Indication
();
Network_Slicing_Indication
(
uint8_t
iei
);
Network_Slicing_Indication
(
const
uint8_t
iei
,
bool
dcni
,
bool
nssci
);
~
Network_Slicing_Indication
();
NetworkSlicingIndication
();
NetworkSlicingIndication
(
uint8_t
iei
);
NetworkSlicingIndication
(
const
uint8_t
iei
,
bool
dcni
,
bool
nssci
);
~
NetworkSlicingIndication
();
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
void
setDCNI
(
bool
value
);
void
setNSSCI
(
bool
value
);
bool
getDCNI
();
void
setNSSCI
(
bool
value
);
bool
getNSSCI
();
private:
uint8_t
_iei
;
bool
NSSCI
;
bool
DCNI
;
bool
NSSCI
;
};
}
// namespace nas
...
...
src/nas/ies/Payload_Container.cpp
View file @
564e4d9b
...
...
@@ -77,14 +77,21 @@ void Payload_Container::setValue(uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
void
Payload_Container
::
getValue
(
std
::
vector
<
PayloadContainerEntry
>&
content
)
{
if
(
CONTENT
.
has_value
())
bool
Payload_Container
::
getValue
(
std
::
vector
<
PayloadContainerEntry
>&
content
)
{
if
(
CONTENT
.
has_value
())
{
content
.
assign
(
CONTENT
.
value
().
begin
(),
CONTENT
.
value
().
end
());
return
true
;
}
return
false
;
}
//------------------------------------------------------------------------------
void
Payload_Container
::
getValue
(
bstring
&
cnt
)
{
if
(
content
.
has_value
())
cnt
=
content
.
value
();
bool
Payload_Container
::
getValue
(
bstring
&
cnt
)
{
if
(
content
.
has_value
())
{
cnt
=
content
.
value
();
return
true
;
}
return
false
;
}
//------------------------------------------------------------------------------
...
...
src/nas/ies/Payload_Container.hpp
View file @
564e4d9b
...
...
@@ -48,8 +48,8 @@ class Payload_Container {
void
setValue
(
uint8_t
iei
,
uint8_t
value
);
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
,
uint8_t
type
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
,
uint8_t
type
);
void
getValue
(
std
::
vector
<
PayloadContainerEntry
>&
content
);
void
getValue
(
bstring
&
cnt
);
bool
getValue
(
std
::
vector
<
PayloadContainerEntry
>&
content
);
bool
getValue
(
bstring
&
cnt
);
private:
uint8_t
_iei
;
...
...
src/nas/ies/_5GS_Update_Type.cpp
View file @
564e4d9b
...
...
@@ -19,20 +19,12 @@
* contact@openairinterface.org
*/
/*! \file _5GS_Update_Type.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "_5GS_Update_Type.hpp"
#include
<iostream>
#include
"3gpp_24.501.hpp"
#include "common_defs.h"
#include "logger.hpp"
using
namespace
nas
;
using
namespace
std
;
//------------------------------------------------------------------------------
_5GS_Update_Type
::
_5GS_Update_Type
(
uint8_t
iei
)
{
...
...
@@ -66,27 +58,27 @@ _5GS_Update_Type::_5GS_Update_Type(
_5GS_PNB_CIoT
=
_5gs_PNB_CIoT
;
NG_RAN
=
ng_RAN
;
SMS
=
sms
;
length
=
3
;
length
=
k5gsUpdateTypeLength
;
}
//------------------------------------------------------------------------------
void
_5GS_Update_Type
::
setEPS_PNB_CIoT
(
uint8_t
value
)
{
EPS_PNB_CIoT
=
value
;
EPS_PNB_CIoT
=
value
&
0x03
;
// 2 bits
}
//------------------------------------------------------------------------------
void
_5GS_Update_Type
::
set_5GS_PNB_CIoT
(
uint8_t
value
)
{
_5GS_PNB_CIoT
=
value
;
_5GS_PNB_CIoT
=
value
&
0x03
;
// 2 bits
}
//------------------------------------------------------------------------------
void
_5GS_Update_Type
::
setNG_RAN
(
uint8_t
value
)
{
NG_RAN
=
value
;
NG_RAN
=
value
&
0x01
;
// 1 bit
}
//------------------------------------------------------------------------------
void
_5GS_Update_Type
::
setSMS
(
uint8_t
value
)
{
SMS
=
value
;
SMS
=
value
&
0x01
;
// 1 bit
}
//------------------------------------------------------------------------------
...
...
@@ -111,53 +103,49 @@ bool _5GS_Update_Type::getSMS() {
//------------------------------------------------------------------------------
int
_5GS_Update_Type
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding _5GS_Update_Type iei(0x%x)"
,
_iei
);
if
(
len
<
length
)
{
Logger
::
nas_mm
().
error
(
"len is less than %d"
,
length
);
return
0
;
Logger
::
nas_mm
().
debug
(
"Encoding _5GS_Update_Type"
);
if
(
len
<
k5gsUpdateTypeLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
k5gsUpdateTypeLength
);
return
KEncodeDecodeError
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
uint8_t
octet
=
0
;
octet
=
(
EPS_PNB_CIoT
<<
4
)
|
(
_5GS_PNB_CIoT
<<
2
)
|
(
NG_RAN
<<
1
)
|
SMS
;
*
(
buf
+
encoded_size
)
=
_iei
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
length
-
2
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
octet
;
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_Update_Type len(%d)"
,
encoded_size
);
ENCODE_U8
(
buf
+
encoded_size
,
length
,
encoded_size
);
uint8_t
octet
=
0
;
octet
=
(
EPS_PNB_CIoT
<<
4
)
|
(
_5GS_PNB_CIoT
<<
2
)
|
(
NG_RAN
<<
1
)
|
SMS
;
ENCODE_U8
(
buf
+
encoded_size
,
octet
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"encoded _5GS_Update_Type (len %d)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
_5GS_Update_Type
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"decoding _5GS_Update_Type iei(0x%x)"
,
*
buf
);
Logger
::
nas_mm
().
debug
(
"Decoding _5GS_Update_Type"
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
DECODE_U8
(
buf
+
decoded_size
,
_iei
,
decoded_size
)
;
}
// Length
DECODE_U8
(
buf
+
decoded_size
,
length
,
decoded_size
);
uint8_t
octet
=
0
;
EPS_PNB_CIoT
=
0x00
;
_5GS_PNB_CIoT
=
0x00
;
NG_RAN
=
0
;
SMS
=
0
;
length
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
octet
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
EPS_PNB_CIoT
=
(
octet
&
0x30
)
>>
4
;
_5GS_PNB_CIoT
=
(
octet
&
0x0c
)
>>
2
;
NG_RAN
=
(
octet
&
0x02
)
>>
1
;
SMS
=
(
octet
&
0x01
);
Logger
::
nas_mm
().
debug
(
"decoded _5GS_Update_Type "
"EPS_PNB_CIoT
(0x%x),_5GS_PNB_CIoT(0x%x),NG_RAN(0x%x),SMS(0x%x)
"
,
"decoded _5GS_Update_Type
,
"
"EPS_PNB_CIoT
0x%x, _5GS_PNB_CIoT 0x%x, NG_RAN 0x%x, SMS 0x%x
"
,
EPS_PNB_CIoT
,
_5GS_PNB_CIoT
,
NG_RAN
,
SMS
);
Logger
::
nas_mm
().
debug
(
"
decoded _5GS_Update_Type len(
%d)"
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"
Decoded _5GS_Update_Type (len
%d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/_5GS_Update_Type.hpp
View file @
564e4d9b
...
...
@@ -19,18 +19,12 @@
* contact@openairinterface.org
*/
/*! \file _5GS_Update_Type.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef ___5GS_Update_Type_H
#define ___5GS_Update_Type_H
#ifndef _5GS_Update_Type_H
#define _5GS_Update_Type_H
#include <stdint.h>
constexpr
uint8_t
k5gsUpdateTypeLength
=
3
;
namespace
nas
{
class
_5GS_Update_Type
{
...
...
@@ -55,10 +49,10 @@ class _5GS_Update_Type {
private:
uint8_t
_iei
;
uint8_t
length
;
uint8_t
EPS_PNB_CIoT
;
uint8_t
_5GS_PNB_CIoT
;
bool
NG_RAN
;
bool
SMS
;
uint8_t
EPS_PNB_CIoT
;
// bit 4,5
uint8_t
_5GS_PNB_CIoT
;
// bit 2,3
bool
NG_RAN
;
// bit 1
bool
SMS
;
// bit 0
};
}
// namespace nas
...
...
src/nas/msgs/RegistrationAccept.cpp
View file @
564e4d9b
...
...
@@ -180,7 +180,7 @@ void RegistrationAccept::setMICO_Indication(bool sprti, bool raai) {
//------------------------------------------------------------------------------
void
RegistrationAccept
::
setNetwork_Slicing_Indication
(
bool
dcni
,
bool
nssci
)
{
ie_network_slicing_indication
=
new
Network
_Slicing_
Indication
(
0x09
,
dcni
,
nssci
);
new
Network
Slicing
Indication
(
0x09
,
dcni
,
nssci
);
}
//------------------------------------------------------------------------------
...
...
@@ -636,7 +636,7 @@ int RegistrationAccept::decodeFromBuffer(
}
break
;
case
0x9
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x9)"
);
ie_network_slicing_indication
=
new
Network
_Slicing_
Indication
();
ie_network_slicing_indication
=
new
Network
Slicing
Indication
();
decoded_size
+=
ie_network_slicing_indication
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/RegistrationAccept.hpp
View file @
564e4d9b
...
...
@@ -98,7 +98,7 @@ class RegistrationAccept {
PDU_Session_Reactivation_Result_Error_Cause
*
ie_pdu_session_reactivation_result_error_cause
;
MICOIndication
*
ie_MICO_indicationl
;
Network
_Slicing_
Indication
*
ie_network_slicing_indication
;
Network
Slicing
Indication
*
ie_network_slicing_indication
;
GPRS_Timer_3
*
ie_T3512_value
;
GPRS_Timer_2
*
ie_Non_3GPP_de_registration_timer_value
;
GPRS_Timer_2
*
ie_T3502_value
;
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
564e4d9b
...
...
@@ -47,11 +47,11 @@ RegistrationRequest::RegistrationRequest()
ie_eps_nas_message_container
=
std
::
nullopt
;
ie_ladn_indication
=
std
::
nullopt
;
ie_payload_container_type
=
std
::
nullopt
;
ie_payload_container
=
nullptr
;
ie_network_slicing_indication
=
nullptr
;
ie_5gs_update_type
=
nullptr
;
ie_nas_message_container
=
nullptr
;
ie_eps_bearer_context_status
=
nullptr
;
ie_payload_container
=
std
::
nullopt
;
ie_network_slicing_indication
=
std
::
nullopt
;
ie_5gs_update_type
=
std
::
nullopt
;
ie_nas_message_container
=
std
::
nullopt
;
ie_eps_bearer_context_status
=
std
::
nullopt
;
}
//------------------------------------------------------------------------------
...
...
@@ -444,15 +444,15 @@ uint8_t RegistrationRequest::getPayloadContainerType() {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
)
{
ie_payload_container
=
new
Payload_Container
(
0x7B
,
content
);
ie_payload_container
=
std
::
make_optional
<
Payload_Container
>
(
kIeiPayloadContainer
,
content
);
}
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
getPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>&
content
)
{
if
(
ie_payload_container
)
{
ie_payload_container
->
getValue
(
content
);
return
true
;
if
(
ie_payload_container
.
has_value
())
{
return
ie_payload_container
.
value
().
getValue
(
content
);
}
else
{
return
false
;
}
...
...
@@ -460,16 +460,16 @@ bool RegistrationRequest::getPayloadContainer(
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setNetwork_Slicing_Indication
(
bool
dcni
,
bool
nssci
)
{
ie_network_slicing_indication
=
new
Network_Slicing_Indication
(
0x09
,
dcni
,
nssci
);
ie_network_slicing_indication
=
std
::
make_optional
<
NetworkSlicingIndication
>
(
kIeiNetworkSlicingIndication
,
dcni
,
nssci
);
}
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
getNetworkSlicingIndication
(
uint8_t
&
dcni
,
uint8_t
&
nssci
)
{
if
(
ie_network_slicing_indication
)
{
dcni
=
ie_network_slicing_indication
->
getDCNI
();
nssci
=
ie_network_slicing_indication
->
getNSSCI
();
if
(
ie_network_slicing_indication
.
has_value
()
)
{
dcni
=
ie_network_slicing_indication
.
value
().
getDCNI
();
nssci
=
ie_network_slicing_indication
.
value
().
getNSSCI
();
return
true
;
}
else
{
return
false
;
...
...
@@ -479,19 +479,19 @@ bool RegistrationRequest::getNetworkSlicingIndication(
//------------------------------------------------------------------------------
void
RegistrationRequest
::
set_5GS_Update_Type
(
uint8_t
eps_pnb_ciot
,
uint8_t
_5gs_pnb_ciot
,
bool
ng_ran
,
bool
sms
)
{
ie_5gs_update_type
=
new
_5GS_Update_Type
(
0x53
,
eps_pnb_ciot
,
_5gs_pnb_ciot
,
ng_ran
,
sms
);
ie_5gs_update_type
=
std
::
make_optional
<
_5GS_Update_Type
>
(
kIei5gsUpdateType
,
eps_pnb_ciot
,
_5gs_pnb_ciot
,
ng_ran
,
sms
);
}
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
get5GSUpdateType
(
uint8_t
&
eps_pnb_ciot
,
uint8_t
&
_5gs_pnb_ciot
,
bool
&
ng_ran_rcu
,
bool
&
sms_requested
)
{
if
(
ie_5gs_update_type
)
{
eps_pnb_ciot
=
ie_5gs_update_type
->
getEPS_PNB_CIoT
();
_5gs_pnb_ciot
=
ie_5gs_update_type
->
get_5GS_PNB_CIoT
();
ng_ran_rcu
=
ie_5gs_update_type
->
getNG_RAN
();
sms_requested
=
ie_5gs_update_type
->
getSMS
();
if
(
ie_5gs_update_type
.
has_value
()
)
{
eps_pnb_ciot
=
ie_5gs_update_type
.
value
().
getEPS_PNB_CIoT
();
_5gs_pnb_ciot
=
ie_5gs_update_type
.
value
().
get_5GS_PNB_CIoT
();
ng_ran_rcu
=
ie_5gs_update_type
.
value
().
getNG_RAN
();
sms_requested
=
ie_5gs_update_type
.
value
().
getSMS
();
return
true
;
}
else
{
return
false
;
...
...
@@ -500,13 +500,14 @@ bool RegistrationRequest::get5GSUpdateType(
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setNAS_Message_Container
(
bstring
value
)
{
ie_nas_message_container
=
new
NAS_Message_Container
(
0x71
,
value
);
ie_nas_message_container
=
std
::
make_optional
<
NAS_Message_Container
>
(
kIeiNasMessageContainer
,
value
);
}
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
getNasMessageContainer
(
bstring
&
nas
)
{
if
(
ie_nas_message_container
)
{
ie_nas_message_container
->
getValue
(
nas
);
if
(
ie_nas_message_container
.
has_value
()
)
{
ie_nas_message_container
.
value
().
getValue
(
nas
);
return
true
;
}
else
{
return
false
;
...
...
@@ -515,15 +516,17 @@ bool RegistrationRequest::getNasMessageContainer(bstring& nas) {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setEPS_Bearer_Context_Status
(
uint16_t
value
)
{
ie_eps_bearer_context_status
=
new
EPS_Bearer_Context_Status
(
0x60
,
value
);
ie_eps_bearer_context_status
=
std
::
make_optional
<
EPS_Bearer_Context_Status
>
(
kIeiEpsBearerContextStatus
,
value
);
}
//------------------------------------------------------------------------------
uint16_t
RegistrationRequest
::
getEpsBearerContextStatus
()
{
if
(
ie_eps_bearer_context_status
)
{
return
ie_eps_bearer_context_status
->
getValue
();
bool
RegistrationRequest
::
getEpsBearerContextStatus
(
uint16_t
&
value
)
{
if
(
ie_eps_bearer_context_status
.
has_value
())
{
value
=
ie_eps_bearer_context_status
.
value
().
getValue
();
return
true
;
}
else
{
return
0
;
return
false
;
}
}
...
...
@@ -782,10 +785,10 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
return
0
;
}
}
if
(
!
ie_network_slicing_indication
)
{
if
(
!
ie_network_slicing_indication
.
has_value
()
)
{
Logger
::
nas_mm
().
warn
(
"IE ie_network_slicing_indication is not available"
);
}
else
{
if
(
int
size
=
ie_network_slicing_indication
->
encode2Buffer
(
if
(
int
size
=
ie_network_slicing_indication
.
value
().
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
...
...
@@ -793,10 +796,10 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
return
0
;
}
}
if
(
!
ie_5gs_update_type
)
{
if
(
!
ie_5gs_update_type
.
has_value
()
)
{
Logger
::
nas_mm
().
warn
(
"IE ie_5gs_update_type is not available"
);
}
else
{
if
(
int
size
=
ie_5gs_update_type
->
encode2Buffer
(
if
(
int
size
=
ie_5gs_update_type
.
value
().
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
...
...
@@ -805,10 +808,10 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
}
}
if
(
!
ie_nas_message_container
)
{
if
(
!
ie_nas_message_container
.
has_value
()
)
{
Logger
::
nas_mm
().
warn
(
"IE ie_nas_message_container is not available"
);
}
else
{
if
(
int
size
=
ie_nas_message_container
->
encode2Buffer
(
if
(
int
size
=
ie_nas_message_container
.
value
().
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
...
...
@@ -816,10 +819,10 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
return
0
;
}
}
if
(
!
ie_eps_bearer_context_status
)
{
if
(
!
ie_eps_bearer_context_status
.
has_value
()
)
{
Logger
::
nas_mm
().
warn
(
"IE ie_eps_bearer_context_status is not available"
);
}
else
{
if
(
int
size
=
ie_eps_bearer_context_status
->
encode2Buffer
(
if
(
int
size
=
ie_eps_bearer_context_status
.
value
().
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
...
...
@@ -887,9 +890,11 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
}
break
;
case
0x9
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x9)"
);
ie_network_slicing_indication
=
new
Network_Slicing_Indication
()
;
decoded_size
+=
ie_network_slicing_indication
->
decodeFromBuffer
(
NetworkSlicingIndication
ie_network_slicing_indication_tmp
=
{}
;
decoded_size
+=
ie_network_slicing_indication
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_network_slicing_indication
=
std
::
optional
<
NetworkSlicingIndication
>
(
ie_network_slicing_indication_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
...
...
@@ -1046,36 +1051,44 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
case
0x7B
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI
(0x7B)
"
);
ie_payload_container
=
new
Payload_Container
()
;
decoded_size
+=
ie_payload_container
->
decodeFromBuffer
(
case
kIeiPayloadContainer
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI
0x7B: Payload Container
"
);
Payload_Container
ie_payload_container_tmp
=
{}
;
decoded_size
+=
ie_payload_container
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
,
N1_SM_INFORMATION
);
// TODO: verified type of Payload container
ie_payload_container
=
std
::
optional
<
Payload_Container
>
(
ie_payload_container_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
case
0x53
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0x53)"
);
ie_5gs_update_type
=
new
_5GS_Update_Type
()
;
decoded_size
+=
ie_5gs_update_type
->
decodeFromBuffer
(
_5GS_Update_Type
ie_5gs_update_type_tmp
=
{}
;
decoded_size
+=
ie_5gs_update_type
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_5gs_update_type
=
std
::
optional
<
_5GS_Update_Type
>
(
ie_5gs_update_type_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
case
0x71
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0x71)"
);
ie_nas_message_container
=
new
NAS_Message_Container
()
;
decoded_size
+=
ie_nas_message_container
->
decodeFromBuffer
(
NAS_Message_Container
ie_nas_message_container_tmp
=
{}
;
decoded_size
+=
ie_nas_message_container
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_nas_message_container
=
std
::
optional
<
NAS_Message_Container
>
(
ie_nas_message_container_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
case
0x60
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0x71)"
);
ie_eps_bearer_context_status
=
new
EPS_Bearer_Context_Status
()
;
decoded_size
+=
ie_eps_bearer_context_status
->
decodeFromBuffer
(
EPS_Bearer_Context_Status
ie_eps_bearer_context_status_tmp
=
{}
;
decoded_size
+=
ie_eps_bearer_context_status
_tmp
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_eps_bearer_context_status
=
std
::
optional
<
EPS_Bearer_Context_Status
>
(
ie_eps_bearer_context_status_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
564e4d9b
...
...
@@ -145,7 +145,7 @@ class RegistrationRequest : public NasMmPlainHeader {
// bool getEpsNasMessageContainer(bstring& epsNas);
void
setEPS_Bearer_Context_Status
(
uint16_t
value
);
uint16_t
getEpsBearerContextStatus
(
);
bool
getEpsBearerContextStatus
(
uint16_t
&
value
);
public:
// NasMmPlainHeader* plain_header;
...
...
@@ -173,14 +173,15 @@ class RegistrationRequest : public NasMmPlainHeader {
ie_eps_nas_message_container
;
// Optional
std
::
optional
<
LADN_Indication
>
ie_ladn_indication
;
// Optional
std
::
optional
<
Payload_Container_Type
>
ie_payload_container_type
;
// Optional
Payload_Container
*
ie_payload_container
;
// Optional
Network_Slicing_Indication
*
ie_network_slicing_indication
;
// Optional
_5GS_Update_Type
*
ie_5gs_update_type
;
// Optional
std
::
optional
<
Payload_Container
>
ie_payload_container
;
// Optional
std
::
optional
<
NetworkSlicingIndication
>
ie_network_slicing_indication
;
// Optional
std
::
optional
<
_5GS_Update_Type
>
ie_5gs_update_type
;
// Optional
// TODO: Mobile station classmark 2
// TODO: Supported codecs
NAS_Message_Container
*
ie_nas_message_container
;
// Optional
EPS_Bearer_Context_Status
*
ie_eps_bearer_context_status
;
// Optional
std
::
optional
<
NAS_Message_Container
>
ie_nas_message_container
;
// Optional
std
::
optional
<
EPS_Bearer_Context_Status
>
ie_eps_bearer_context_status
;
// Optional
// TODO: Requested extended DRX parameters
// TODO: T3324 value
};
...
...
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