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
696d8f9b
Commit
696d8f9b
authored
Jan 09, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Payload Container Type
parent
1f43ee67
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
58 additions
and
45 deletions
+58
-45
src/nas/ies/5GSRegistrationType.cpp
src/nas/ies/5GSRegistrationType.cpp
+1
-1
src/nas/ies/Payload_Container_Type.cpp
src/nas/ies/Payload_Container_Type.cpp
+14
-10
src/nas/ies/Payload_Container_Type.hpp
src/nas/ies/Payload_Container_Type.hpp
+15
-12
src/nas/ies/Type1NasIeFormatTv.cpp
src/nas/ies/Type1NasIeFormatTv.cpp
+4
-0
src/nas/ies/Type1NasIeFormatTv.hpp
src/nas/ies/Type1NasIeFormatTv.hpp
+1
-1
src/nas/msgs/DLNASTransport.cpp
src/nas/msgs/DLNASTransport.cpp
+4
-3
src/nas/msgs/DLNASTransport.hpp
src/nas/msgs/DLNASTransport.hpp
+1
-1
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+7
-7
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+4
-4
src/nas/msgs/ULNASTransport.cpp
src/nas/msgs/ULNASTransport.cpp
+6
-5
src/nas/msgs/ULNASTransport.hpp
src/nas/msgs/ULNASTransport.hpp
+1
-1
No files found.
src/nas/ies/5GSRegistrationType.cpp
View file @
696d8f9b
...
...
@@ -29,7 +29,7 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GSRegistrationType
::
_5GSRegistrationType
()
:
Type1NasIeFormatTv
(),
follow_on_req_
(
false
),
reg_type_
(
0
)
{
SetIeName
(
"5GS Registration Type"
);
SetIeName
(
k5gsRegistrationTypeName
);
}
//------------------------------------------------------------------------------
...
...
src/nas/ies/Payload_Container_Type.cpp
View file @
696d8f9b
...
...
@@ -27,30 +27,33 @@
using
namespace
nas
;
//------------------------------------------------------------------------------
Payload
_Container_Type
::
Payload_Container_Type
(
const
uint8_t
iei
,
uint8_t
value
)
{
_iei
=
iei
;
_value
=
value
&
0x0f
;
Payload
ContainerType
::
PayloadContainerType
(
const
uint8_t
iei
,
uint8_t
value
)
:
Type1NasIeFormatTv
(
iei
)
{
SetValue
(
value
&
0x0f
)
;
SetIeName
(
kPayloadContainerTypeIeName
)
;
}
//------------------------------------------------------------------------------
Payload_Container_Type
::
Payload_Container_Type
()
{}
PayloadContainerType
::
PayloadContainerType
()
:
Type1NasIeFormatTv
()
{
SetIeName
(
kPayloadContainerTypeIeName
);
}
//------------------------------------------------------------------------------
Payload
_Container_Type
::~
Payload_Container_
Type
(){};
Payload
ContainerType
::~
PayloadContainer
Type
(){};
/*
//------------------------------------------------------------------------------
void
Payload
_Container_Type
::
s
etValue
(
const
uint8_t
value
)
{
void Payload
ContainerType::S
etValue(const uint8_t value) {
_value = value & 0x0f;
}
//------------------------------------------------------------------------------
uint8_t
Payload
_Container_Type
::
getValue
()
{
uint8_t Payload
ContainerType::GetValue() const
{
return _value;
}
//------------------------------------------------------------------------------
int
Payload
_Container_
Type
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
int Payload
Container
Type::Encode(uint8_t* buf, int len) {
Logger::nas_mm().debug("Encoding Payload_Container_Type IE");
if (len < kPayloadContainerTypeLength) {
...
...
@@ -74,7 +77,7 @@ int Payload_Container_Type::Encode(uint8_t* buf, int len) {
}
//------------------------------------------------------------------------------
int
Payload
_Container_
Type
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
int Payload
Container
Type::Decode(uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding Payload_Container_Type IE");
if (len < kPayloadContainerTypeLength) {
...
...
@@ -97,3 +100,4 @@ int Payload_Container_Type::Decode(uint8_t* buf, int len, bool is_option) {
"Decoded Payload_Container_Type (IEI 0x%x, value 0x%x)", _iei, _value);
return decoded_size;
}
*/
src/nas/ies/Payload_Container_Type.hpp
View file @
696d8f9b
...
...
@@ -19,28 +19,31 @@
* contact@openairinterface.org
*/
#ifndef _Payload_Container_Type_H
#define _Payload_Container_Type_H
#ifndef _PAYLOAD_CONTAINER_TYPE_H
#define _PAYLOAD_CONTAINER_TYPE_H
#include "Type1NasIeFormatTv.hpp"
#include <stdint.h>
constexpr
uint8_t
kPayloadContainerTypeLength
=
1
;
constexpr
auto
kPayloadContainerTypeIeName
=
"Payload Container Type"
;
namespace
nas
{
class
Payload
_Container_Type
{
class
Payload
ContainerType
:
public
Type1NasIeFormatTv
{
public:
Payload_Container_Type
();
Payload_Container_Type
(
const
uint8_t
iei
,
uint8_t
value
);
~
Payload_Container_Type
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
void
setValue
(
const
uint8_t
value
);
PayloadContainerType
();
PayloadContainerType
(
const
uint8_t
iei
,
uint8_t
value
);
~
PayloadContainerType
();
/* void setValue(const uint8_t value);
uint8_t getValue();
int Encode(uint8_t* buf, int len);
int Decode(uint8_t* buf, int len, bool is_option);
*/
private:
uint8_t
_iei
;
uint8_t
_value
;
};
}
// namespace nas
...
...
src/nas/ies/Type1NasIeFormatTv.cpp
View file @
696d8f9b
...
...
@@ -66,6 +66,10 @@ void Type1NasIeFormatTv::SetValue(const uint8_t& value) {
value_
=
value
&
0x0f
;
// 4 lower bits
}
//------------------------------------------------------------------------------
uint8_t
Type1NasIeFormatTv
::
GetValue
()
const
{
return
value_
;
}
//------------------------------------------------------------------------------
int
Type1NasIeFormatTv
::
Encode
(
uint8_t
*
buf
,
const
int
&
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding %s"
,
GetIeName
().
c_str
());
...
...
src/nas/ies/Type1NasIeFormatTv.hpp
View file @
696d8f9b
...
...
@@ -37,7 +37,7 @@ class Type1NasIeFormatTv : public NasIe {
void
SetIei
(
const
uint8_t
&
iei
);
void
SetValue
(
const
uint8_t
&
value
);
void
GetValue
()
;
uint8_t
GetValue
()
const
;
uint8_t
GetIeLength
()
const
;
...
...
src/nas/msgs/DLNASTransport.cpp
View file @
696d8f9b
...
...
@@ -57,7 +57,7 @@ void DLNASTransport::setHeader(uint8_t security_header_type) {
//------------------------------------------------------------------------------
void
DLNASTransport
::
setPayload_Container_Type
(
uint8_t
value
)
{
ie_payload_container_type
=
new
Payload
_Container_
Type
(
0x00
,
value
);
ie_payload_container_type
=
new
Payload
Container
Type
(
0x00
,
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -118,7 +118,7 @@ int DLNASTransport::Encode(uint8_t* buf, int len) {
}
else
{
if
(
int
size
=
ie_payload_container
->
Encode
(
buf
+
encoded_size
,
len
-
encoded_size
,
ie_payload_container_type
->
g
etValue
()))
{
ie_payload_container_type
->
G
etValue
()))
{
encoded_size
+=
size
;
}
else
{
Logger
::
nas_mm
().
error
(
"Encoding ie_payload_container error"
);
...
...
@@ -178,10 +178,11 @@ int DLNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
Logger
::
nas_mm
().
debug
(
"Decoding DLNASTransport message"
);
int
decoded_size
=
3
;
plain_header
=
header
;
ie_payload_container_type
=
new
Payload
_Container_
Type
();
ie_payload_container_type
=
new
Payload
Container
Type
();
decoded_size
+=
ie_payload_container_type
->
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
ie_payload_container
=
new
Payload_Container
();
decoded_size
++
;
// 1/2 octet for PayloadContainerType, 1/2 octet for spare
decoded_size
+=
ie_payload_container
->
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
N1_SM_INFORMATION
);
// TODO: verified Typeb of Payload Container
...
...
src/nas/msgs/DLNASTransport.hpp
View file @
696d8f9b
...
...
@@ -50,7 +50,7 @@ class DLNASTransport {
public:
NasMmPlainHeader
*
plain_header
;
Payload
_Container_
Type
*
ie_payload_container_type
;
Payload
Container
Type
*
ie_payload_container_type
;
Payload_Container
*
ie_payload_container
;
PDU_Session_Identity_2
*
ie_pdu_session_identity_2
;
Additional_Information
*
ie_additional_information
;
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
696d8f9b
...
...
@@ -426,14 +426,14 @@ bool RegistrationRequest::getLadnIndication(std::vector<bstring>& ladnValue) {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setPayload_Container_Type
(
uint8_t
value
)
{
ie_payload_container_type
=
std
::
make_optional
<
Payload_Container_Type
>
(
kIeiPayloadContainerType
,
value
);
ie_payload_container_type
=
std
::
make_optional
<
PayloadContainerType
>
(
kIeiPayloadContainerType
,
value
);
}
//------------------------------------------------------------------------------
uint8_t
RegistrationRequest
::
getPayloadContainerType
()
{
if
(
ie_payload_container_type
.
has_value
())
{
return
ie_payload_container_type
.
value
().
g
etValue
();
return
ie_payload_container_type
.
value
().
G
etValue
();
}
else
{
return
0
;
}
...
...
@@ -770,7 +770,7 @@ int RegistrationRequest::Encode(uint8_t* buf, int len) {
}
else
{
if
(
int
size
=
ie_payload_container
->
Encode
(
buf
+
encoded_size
,
len
-
encoded_size
,
ie_payload_container_type
.
value
().
g
etValue
()))
{
ie_payload_container_type
.
value
().
G
etValue
()))
{
encoded_size
+=
size
;
}
else
{
Logger
::
nas_mm
().
error
(
"encoding ie_payload_container error"
);
...
...
@@ -872,11 +872,11 @@ int RegistrationRequest::Decode(uint8_t* buf, int len) {
}
break
;
case
kIeiPayloadContainerType
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI 0x8: Payload Container Type"
);
Payload
_Container_
Type
ie_payload_container_type_tmp
=
{};
Payload
Container
Type
ie_payload_container_type_tmp
=
{};
decoded_size
+=
ie_payload_container_type_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_payload_container_type
=
std
::
optional
<
Payload_Container_Type
>
(
ie_payload_container_type_tmp
);
ie_payload_container_type
=
std
::
optional
<
PayloadContainerType
>
(
ie_payload_container_type_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
696d8f9b
...
...
@@ -169,7 +169,7 @@ class RegistrationRequest : public NasMmPlainHeader {
std
::
optional
<
EPS_NAS_Message_Container
>
ie_eps_nas_message_container
;
// Optional
std
::
optional
<
LadnIndication
>
ie_ladn_indication
;
// Optional
std
::
optional
<
Payload
_Container_
Type
>
ie_payload_container_type
;
// Optional
std
::
optional
<
Payload
Container
Type
>
ie_payload_container_type
;
// Optional
std
::
optional
<
Payload_Container
>
ie_payload_container
;
// Optional
std
::
optional
<
NetworkSlicingIndication
>
ie_network_slicing_indication
;
// Optional
...
...
src/nas/msgs/ULNASTransport.cpp
View file @
696d8f9b
...
...
@@ -53,13 +53,13 @@ void ULNASTransport::setHeader(uint8_t security_header_type) {
//------------------------------------------------------------------------------
void
ULNASTransport
::
setPayload_Container_Type
(
uint8_t
value
)
{
ie_payload_container_type
=
new
Payload
_Container_
Type
(
0x00
,
value
);
ie_payload_container_type
=
new
Payload
Container
Type
(
0x00
,
value
);
}
//------------------------------------------------------------------------------
uint8_t
ULNASTransport
::
getPayloadContainerType
()
{
if
(
ie_payload_container_type
)
{
return
ie_payload_container_type
->
g
etValue
();
return
ie_payload_container_type
->
G
etValue
();
}
else
{
return
-
1
;
}
...
...
@@ -200,7 +200,7 @@ int ULNASTransport::Encode(uint8_t* buf, int len) {
}
else
{
if
(
int
size
=
ie_payload_container
->
Encode
(
buf
+
encoded_size
,
len
-
encoded_size
,
ie_payload_container_type
->
g
etValue
()))
{
ie_payload_container_type
->
G
etValue
()))
{
encoded_size
+=
size
;
}
else
{
Logger
::
nas_mm
().
error
(
"encoding ie_payload_container error"
);
...
...
@@ -307,13 +307,14 @@ int ULNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
Logger
::
nas_mm
().
debug
(
"Decoding ULNASTransport message"
);
int
decoded_size
=
3
;
plain_header
=
header
;
ie_payload_container_type
=
new
Payload
_Container_
Type
();
ie_payload_container_type
=
new
Payload
Container
Type
();
decoded_size
+=
ie_payload_container_type
->
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
decoded_size
++
;
// 1/2 octet for PayloadContainerType, 1/2 octet for spare
ie_payload_container
=
new
Payload_Container
();
decoded_size
+=
ie_payload_container
->
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
ie_payload_container_type
->
g
etValue
());
ie_payload_container_type
->
G
etValue
());
Logger
::
nas_mm
().
debug
(
"Decoded_size (%d)"
,
decoded_size
);
uint8_t
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"First option IEI (0x%x)"
,
octet
);
...
...
src/nas/msgs/ULNASTransport.hpp
View file @
696d8f9b
...
...
@@ -62,7 +62,7 @@ class ULNASTransport {
public:
NasMmPlainHeader
*
plain_header
;
Payload
_Container_
Type
*
ie_payload_container_type
;
Payload
Container
Type
*
ie_payload_container_type
;
Payload_Container
*
ie_payload_container
;
PDU_Session_Identity_2
*
ie_pdu_session_identity_2
;
PDU_Session_Identity_2
*
ie_old_pdu_session_identity_2
;
...
...
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