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
73b60f8f
Commit
73b60f8f
authored
Jan 14, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update PDU Session Identity2
parent
51f3308d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
76 deletions
+70
-76
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-1
src/nas/ies/PduSessionIdentity2.cpp
src/nas/ies/PduSessionIdentity2.cpp
+43
-43
src/nas/ies/PduSessionIdentity2.hpp
src/nas/ies/PduSessionIdentity2.hpp
+10
-15
src/nas/msgs/DLNASTransport.cpp
src/nas/msgs/DLNASTransport.cpp
+2
-2
src/nas/msgs/DLNASTransport.hpp
src/nas/msgs/DLNASTransport.hpp
+1
-1
src/nas/msgs/ULNASTransport.cpp
src/nas/msgs/ULNASTransport.cpp
+7
-7
src/nas/msgs/ULNASTransport.hpp
src/nas/msgs/ULNASTransport.hpp
+6
-7
No files found.
src/nas/common/NasIeHeader.hpp
View file @
73b60f8f
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
#include "NssaiInclusionMode.hpp"
#include "NssaiInclusionMode.hpp"
#include "NasKeySetIdentifier.hpp"
#include "NasKeySetIdentifier.hpp"
#include "Non_3GPP_NW_Provided_Policies.hpp"
#include "Non_3GPP_NW_Provided_Policies.hpp"
#include "P
DU_Session_Identity_
2.hpp"
#include "P
duSessionIdentity
2.hpp"
#include "PDU_Session_Reactivation_Result.hpp"
#include "PDU_Session_Reactivation_Result.hpp"
#include "PDU_Session_Reactivation_Result_Error_Cause.hpp"
#include "PDU_Session_Reactivation_Result_Error_Cause.hpp"
#include "PLMN_List.hpp"
#include "PLMN_List.hpp"
...
...
src/nas/ies/P
DU_Session_Identity_
2.cpp
→
src/nas/ies/P
duSessionIdentity
2.cpp
View file @
73b60f8f
...
@@ -19,84 +19,84 @@
...
@@ -19,84 +19,84 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file
#include "PduSessionIdentity2.hpp"
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDU_Session_Identity_2.hpp"
#include "logger.hpp"
#include "logger.hpp"
using
namespace
nas
;
using
namespace
nas
;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
PDU_Session_Identity_2
::
PDU_Session_Identity_2
(
uint8_t
iei
)
{
PduSessionIdentity2
::
PduSessionIdentity2
(
uint8_t
iei
)
:
Type3NasIe
(
iei
)
{
_iei
=
iei
;
_value
=
0
;
_value
=
0
;
SetIeName
(
kPduSessionIdentity2IeName
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
PDU_Session_Identity_2
::
PDU_Session_Identity_2
(
PduSessionIdentity2
::
PduSessionIdentity2
(
const
uint8_t
iei
,
uint8_t
value
)
const
uint8_t
iei
,
uint8_t
value
)
{
:
Type3NasIe
(
iei
)
{
_iei
=
iei
;
_value
=
value
;
_value
=
value
;
SetIeName
(
kPduSessionIdentity2IeName
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
PDU_Session_Identity_2
::
PDU_Session_Identity_2
()
{
PduSessionIdentity2
::
PduSessionIdentity2
()
:
Type3NasIe
()
{
_iei
=
0
;
_value
=
0
;
_value
=
0
;
SetIeName
(
kPduSessionIdentity2IeName
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
P
DU_Session_Identity_2
::~
PDU_Session_Identity_
2
()
{}
P
duSessionIdentity2
::~
PduSessionIdentity
2
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
P
DU_Session_Identity_
2
::
SetValue
(
uint8_t
value
)
{
void
P
duSessionIdentity
2
::
SetValue
(
uint8_t
value
)
{
_value
=
value
;
_value
=
value
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
uint8_t
P
DU_Session_Identity_
2
::
GetValue
()
{
uint8_t
P
duSessionIdentity
2
::
GetValue
()
{
return
_value
;
return
_value
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
PDU_Session_Identity_2
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
int
PduSessionIdentity2
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding PDU_Session_Identity_2 iei(0x%x)"
,
_iei
);
Logger
::
nas_mm
().
debug
(
"Encoding %s"
,
GetIeName
().
c_str
());
if
(
len
<
2
)
{
Logger
::
nas_mm
().
error
(
"len is less than 2"
);
if
(
len
<
kPduSessionIdentity2Length
)
{
return
0
;
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kPduSessionIdentity2Length
);
return
KEncodeDecodeError
;
}
}
int
encoded_size
=
0
;
int
encoded_size
=
0
;
if
(
_iei
)
{
*
(
buf
+
encoded_size
)
=
_iei
;
// IEI
encoded_size
++
;
encoded_size
+=
Type3NasIe
::
Encode
(
buf
+
encoded_size
,
len
);
*
(
buf
+
encoded_size
)
=
_value
;
// Value
encoded_size
++
;
ENCODE_U8
(
buf
+
encoded_size
,
_value
,
encoded_size
);
}
else
{
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger
::
nas_mm
().
debug
(
Logger
::
nas_mm
().
debug
(
"
encoded PDU_Session_Identity_2 len(%d)"
,
encoded_size
);
"
Encoded %s, len (%d)"
,
GetIeName
().
c_str
()
,
encoded_size
);
return
encoded_size
;
return
encoded_size
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
PDU_Session_Identity_2
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
int
PduSessionIdentity2
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
Logger
::
nas_mm
().
debug
(
"decoding PDU_Session_Identity_2 iei(0x%x)"
,
*
buf
);
Logger
::
nas_mm
().
debug
(
"Decoding %s"
,
GetIeName
().
c_str
());
int
decoded_size
=
0
;
if
(
is_option
)
{
if
(
len
<
kPduSessionIdentity2Length
)
{
decoded_size
++
;
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kPduSessionIdentity2Length
);
return
KEncodeDecodeError
;
}
}
_value
=
0x00
;
_value
=
*
(
buf
+
decoded_size
);
int
decoded_size
=
0
;
decoded_size
++
;
// IEI and Length
Logger
::
nas_mm
().
debug
(
"decoded PDU_Session_Identity_2 value(0x%x)"
,
_value
);
decoded_size
+=
Type3NasIe
::
Decode
(
buf
+
decoded_size
,
len
,
true
);
DECODE_U8
(
buf
+
decoded_size
,
_value
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Decoded value 0x%x"
,
_value
);
Logger
::
nas_mm
().
debug
(
Logger
::
nas_mm
().
debug
(
"
decoded PDU_Session_Identity_2 len(%d)"
,
decoded_size
);
"
Decoded %s, len (%d)"
,
GetIeName
().
c_str
()
,
decoded_size
);
return
decoded_size
;
return
decoded_size
;
}
}
src/nas/ies/P
DU_Session_Identity_
2.hpp
→
src/nas/ies/P
duSessionIdentity
2.hpp
View file @
73b60f8f
...
@@ -19,33 +19,28 @@
...
@@ -19,33 +19,28 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file
#ifndef _PDU_SESSION_IDENTITY_2_H_
\brief
#define _PDU_SESSION_IDENTITY_2_H_
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef ___PDU_Session_Identity_2_H_
#include "Type3NasIe.hpp"
#define ___PDU_Session_Identity_2_H_
#include <stdint.h>
constexpr
uint8_t
kPduSessionIdentity2Length
=
2
;
constexpr
auto
kPduSessionIdentity2IeName
=
"PDU Session Identity 2"
;
namespace
nas
{
namespace
nas
{
class
P
DU_Session_Identity_2
{
class
P
duSessionIdentity2
:
public
Type3NasIe
{
public:
public:
P
DU_Session_Identity_
2
();
P
duSessionIdentity
2
();
P
DU_Session_Identity_
2
(
uint8_t
iei
);
P
duSessionIdentity
2
(
uint8_t
iei
);
P
DU_Session_Identity_
2
(
const
uint8_t
iei
,
uint8_t
value
);
P
duSessionIdentity
2
(
const
uint8_t
iei
,
uint8_t
value
);
~
P
DU_Session_Identity_
2
();
~
P
duSessionIdentity
2
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
void
SetValue
(
uint8_t
value
);
void
SetValue
(
uint8_t
value
);
uint8_t
GetValue
();
uint8_t
GetValue
();
private:
private:
uint8_t
_iei
;
uint8_t
_value
;
uint8_t
_value
;
};
};
}
// namespace nas
}
// namespace nas
...
...
src/nas/msgs/DLNASTransport.cpp
View file @
73b60f8f
...
@@ -74,7 +74,7 @@ void DLNASTransport::SetPayloadContainer(uint8_t* buf, int len) {
...
@@ -74,7 +74,7 @@ void DLNASTransport::SetPayloadContainer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DLNASTransport
::
SetPduSessionId
(
uint8_t
value
)
{
void
DLNASTransport
::
SetPduSessionId
(
uint8_t
value
)
{
ie_pdu_session_identity_2
=
new
P
DU_Session_Identity_
2
(
0x12
,
value
);
ie_pdu_session_identity_2
=
new
P
duSessionIdentity
2
(
0x12
,
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -195,7 +195,7 @@ int DLNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
...
@@ -195,7 +195,7 @@ int DLNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
switch
(
octet
)
{
switch
(
octet
)
{
case
0x12
:
{
case
0x12
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x12)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x12)"
);
ie_pdu_session_identity_2
=
new
P
DU_Session_Identity_
2
();
ie_pdu_session_identity_2
=
new
P
duSessionIdentity
2
();
decoded_size
+=
ie_pdu_session_identity_2
->
Decode
(
decoded_size
+=
ie_pdu_session_identity_2
->
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
octet
=
*
(
buf
+
decoded_size
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/DLNASTransport.hpp
View file @
73b60f8f
...
@@ -50,7 +50,7 @@ class DLNASTransport {
...
@@ -50,7 +50,7 @@ class DLNASTransport {
NasMmPlainHeader
*
plain_header
;
NasMmPlainHeader
*
plain_header
;
PayloadContainerType
*
ie_payload_container_type
;
PayloadContainerType
*
ie_payload_container_type
;
Payload_Container
*
ie_payload_container
;
Payload_Container
*
ie_payload_container
;
P
DU_Session_Identity_
2
*
ie_pdu_session_identity_2
;
P
duSessionIdentity
2
*
ie_pdu_session_identity_2
;
Additional_Information
*
ie_additional_information
;
Additional_Information
*
ie_additional_information
;
_5GMM_Cause
*
ie_5gmm_cause
;
_5GMM_Cause
*
ie_5gmm_cause
;
GprsTimer3
*
ie_back_off_timer_value
;
GprsTimer3
*
ie_back_off_timer_value
;
...
...
src/nas/msgs/ULNASTransport.cpp
View file @
73b60f8f
...
@@ -77,7 +77,7 @@ void ULNASTransport::GetPayloadContainer(
...
@@ -77,7 +77,7 @@ void ULNASTransport::GetPayloadContainer(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ULNASTransport
::
SetPduSessionIdentity2
(
uint8_t
value
)
{
void
ULNASTransport
::
SetPduSessionIdentity2
(
uint8_t
value
)
{
ie_pdu_session_identity_2
=
ie_pdu_session_identity_2
=
std
::
make_optional
<
P
DU_Session_Identity_
2
>
(
0x12
,
value
);
std
::
make_optional
<
P
duSessionIdentity
2
>
(
0x12
,
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -92,7 +92,7 @@ uint8_t ULNASTransport::GetPduSessionId() {
...
@@ -92,7 +92,7 @@ uint8_t ULNASTransport::GetPduSessionId() {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ULNASTransport
::
SetOldPduSessionIdentity2
(
uint8_t
value
)
{
void
ULNASTransport
::
SetOldPduSessionIdentity2
(
uint8_t
value
)
{
ie_old_pdu_session_identity_2
=
ie_old_pdu_session_identity_2
=
std
::
make_optional
<
P
DU_Session_Identity_
2
>
(
0x59
,
value
);
std
::
make_optional
<
P
duSessionIdentity
2
>
(
0x59
,
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -398,26 +398,26 @@ int ULNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
...
@@ -398,26 +398,26 @@ int ULNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
switch
(
octet
)
{
switch
(
octet
)
{
case
0x12
:
{
case
0x12
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x12)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x12)"
);
P
DU_Session_Identity_
2
ie_pdu_session_identity_2_tmp
=
{};
P
duSessionIdentity
2
ie_pdu_session_identity_2_tmp
=
{};
if
((
decoded_result
=
ie_pdu_session_identity_2_tmp
.
Decode
(
if
((
decoded_result
=
ie_pdu_session_identity_2_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
KEncodeDecodeError
)
KEncodeDecodeError
)
return
decoded_result
;
return
decoded_result
;
decoded_size
+=
decoded_result
;
decoded_size
+=
decoded_result
;
ie_pdu_session_identity_2
=
std
::
optional
<
PDU_Session_Identity_2
>
(
ie_pdu_session_identity_2
=
ie_pdu_session_identity_2_tmp
);
std
::
optional
<
PduSessionIdentity2
>
(
ie_pdu_session_identity_2_tmp
);
octet
=
*
(
buf
+
decoded_size
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
}
break
;
}
break
;
case
0x59
:
{
case
0x59
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x59)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x59)"
);
P
DU_Session_Identity_
2
ie_old_pdu_session_identity_2_tmp
=
{};
P
duSessionIdentity
2
ie_old_pdu_session_identity_2_tmp
=
{};
if
((
decoded_result
=
ie_old_pdu_session_identity_2_tmp
.
Decode
(
if
((
decoded_result
=
ie_old_pdu_session_identity_2_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
KEncodeDecodeError
)
KEncodeDecodeError
)
return
decoded_result
;
return
decoded_result
;
decoded_size
+=
decoded_result
;
decoded_size
+=
decoded_result
;
ie_old_pdu_session_identity_2
=
std
::
optional
<
P
DU_Session_Identity_
2
>
(
ie_old_pdu_session_identity_2
=
std
::
optional
<
P
duSessionIdentity
2
>
(
ie_old_pdu_session_identity_2_tmp
);
ie_old_pdu_session_identity_2_tmp
);
octet
=
*
(
buf
+
decoded_size
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
...
...
src/nas/msgs/ULNASTransport.hpp
View file @
73b60f8f
...
@@ -68,13 +68,12 @@ class ULNASTransport : public NasMmPlainHeader {
...
@@ -68,13 +68,12 @@ class ULNASTransport : public NasMmPlainHeader {
PayloadContainerType
ie_payload_container_type
;
// Mandatory
PayloadContainerType
ie_payload_container_type
;
// Mandatory
Payload_Container
ie_payload_container
;
// Mandatory
Payload_Container
ie_payload_container
;
// Mandatory
std
::
optional
<
PDU_Session_Identity_2
>
ie_pdu_session_identity_2
;
// Optional
std
::
optional
<
PduSessionIdentity2
>
ie_pdu_session_identity_2
;
// Optional
std
::
optional
<
PDU_Session_Identity_2
>
std
::
optional
<
PduSessionIdentity2
>
ie_old_pdu_session_identity_2
;
// Optional
ie_old_pdu_session_identity_2
;
// Optional
std
::
optional
<
Request_Type
>
ie_request_type
;
// Optional
std
::
optional
<
Request_Type
>
ie_request_type
;
// Optional
std
::
optional
<
S_NSSAI
>
ie_s_nssai
;
// Optional
std
::
optional
<
S_NSSAI
>
ie_s_nssai
;
// Optional
std
::
optional
<
DNN
>
ie_dnn
;
// Optional
std
::
optional
<
DNN
>
ie_dnn
;
// Optional
std
::
optional
<
Additional_Information
>
ie_additional_information
;
// Optional
std
::
optional
<
Additional_Information
>
ie_additional_information
;
// Optional
std
::
optional
<
MA_PDU_Session_Information
>
std
::
optional
<
MA_PDU_Session_Information
>
ie_ma_pdu_session_information
;
// Optional
ie_ma_pdu_session_information
;
// Optional
std
::
optional
<
Release_Assistance_Indication
>
std
::
optional
<
Release_Assistance_Indication
>
...
...
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