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
74a81963
Commit
74a81963
authored
Jan 15, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Additional Information
parent
414f19d6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
141 additions
and
38 deletions
+141
-38
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-1
src/nas/ies/AdditionalInformation.cpp
src/nas/ies/AdditionalInformation.cpp
+108
-0
src/nas/ies/AdditionalInformation.hpp
src/nas/ies/AdditionalInformation.hpp
+16
-20
src/nas/ies/DNN.hpp
src/nas/ies/DNN.hpp
+1
-1
src/nas/msgs/DLNASTransport.cpp
src/nas/msgs/DLNASTransport.cpp
+3
-3
src/nas/msgs/DLNASTransport.hpp
src/nas/msgs/DLNASTransport.hpp
+2
-2
src/nas/msgs/ULNASTransport.cpp
src/nas/msgs/ULNASTransport.cpp
+8
-9
src/nas/msgs/ULNASTransport.hpp
src/nas/msgs/ULNASTransport.hpp
+2
-2
No files found.
src/nas/common/NasIeHeader.hpp
View file @
74a81963
...
...
@@ -29,7 +29,7 @@
#include "5GSRegistrationType.hpp"
#include "ABBA.hpp"
#include "Additional5gSecurityInformation.hpp"
#include "Additional
_
Information.hpp"
#include "AdditionalInformation.hpp"
#include "AllowedPDUSessionStatus.hpp"
#include "Authentication_Failure_Parameter.hpp"
#include "Authentication_Parameter_AUTN.hpp"
...
...
src/nas/ies/Additional
_
Information.cpp
→
src/nas/ies/AdditionalInformation.cpp
View file @
74a81963
...
...
@@ -19,91 +19,90 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Additional_Information.hpp"
#include "AdditionalInformation.hpp"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
Additional
_Information
::
Additional_Information
(
uint8_t
iei
)
{
_iei
=
iei
;
length
=
0
;
_value
=
0
;
Additional
Information
::
AdditionalInformation
()
:
Type4NasIe
(
kIeiAdditionalInformation
),
value_
()
{
SetLengthIndicator
(
1
);
// Minimum 3 octets (-2 for header)
SetIeName
(
kAdditionalInformationIeName
)
;
}
//------------------------------------------------------------------------------
Additional_Information
::
Additional_Information
(
const
uint8_t
iei
,
uint8_t
_length
,
uint8_t
value
)
{
_iei
=
iei
;
_value
=
value
;
length
=
_length
;
AdditionalInformation
::
AdditionalInformation
(
const
bstring
&
value
)
{
value_
=
bstrcpy
(
value
);
SetLengthIndicator
(
blength
(
value
));
SetIeName
(
kAdditionalInformationIeName
);
}
//------------------------------------------------------------------------------
Additional_Information
::
Additional_Information
()
:
_iei
(),
length
(),
_value
()
{}
//------------------------------------------------------------------------------
Additional_Information
::~
Additional_Information
()
{}
AdditionalInformation
::~
AdditionalInformation
()
{}
//------------------------------------------------------------------------------
void
Additional_Information
::
setValue
(
uint8_t
iei
,
uint8_t
value
)
{
_iei
=
iei
;
_value
=
value
;
void
AdditionalInformation
::
SetValue
(
const
bstring
&
value
)
{
value_
=
bstrcpy
(
value
);
}
//------------------------------------------------------------------------------
uint8_t
Additional_Information
::
getValue
()
{
return
_value
;
void
AdditionalInformation
::
GetValue
(
bstring
&
value
)
const
{
value
=
bstrcpy
(
value_
)
;
}
//------------------------------------------------------------------------------
int
Additional_Information
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding Additional_Information iei(0x%x)"
,
_iei
);
if
(
len
<
length
)
{
Logger
::
nas_mm
().
error
(
"len is less than %d"
,
length
);
return
0
;
int
AdditionalInformation
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding %s"
,
GetIeName
().
c_str
());
int
ie_len
=
GetIeLength
();
if
(
len
<
ie_len
)
{
Logger
::
nas_mm
().
error
(
"Len is less than %d"
,
ie_len
);
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
;
encoded_size
++
;
}
else
{
*
(
buf
+
encoded_size
)
=
(
length
-
1
);
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
_value
;
encoded_size
++
;
}
// IEI and Length
int
encoded_header_size
=
Type4NasIe
::
Encode
(
buf
+
encoded_size
,
len
);
if
(
encoded_header_size
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
encoded_size
+=
encoded_header_size
;
// Value
int
size
=
encode_bstring
(
value_
,
(
buf
+
encoded_size
),
len
-
encoded_size
);
encoded_size
+=
size
;
Logger
::
nas_mm
().
debug
(
"
encoded Additional_Information len(%d)"
,
encoded_size
);
"
Encoded %s, len (%d)"
,
GetIeName
().
c_str
()
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
Additional_Information
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"decoding Additional_Information iei(0x%x)"
,
*
buf
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
int
AdditionalInformation
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
if
(
len
<
kAdditionalInformationMinimumLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kAdditionalInformationMinimumLength
);
return
KEncodeDecodeError
;
}
_value
=
0x00
;
length
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
_value
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
Logger
::
nas_mm
().
debug
(
"decoded Additional_Information value(0x%x)"
,
_value
);
uint8_t
decoded_size
=
0
;
uint8_t
octet
=
0
;
Logger
::
nas_mm
().
debug
(
"Decoding %s"
,
GetIeName
().
c_str
());
// IEI and Length
int
decoded_header_size
=
Type4NasIe
::
Decode
(
buf
+
decoded_size
,
len
,
is_iei
);
if
(
decoded_header_size
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
decoded_size
+=
decoded_header_size
;
// Value
uint8_t
ie_len
=
GetLengthIndicator
();
decode_bstring
(
&
value_
,
ie_len
,
(
buf
+
decoded_size
),
len
-
decoded_size
);
decoded_size
+=
ie_len
;
for
(
int
i
=
0
;
i
<
ie_len
;
i
++
)
{
Logger
::
nas_mm
().
debug
(
"Decoded value 0x%x"
,
(
uint8_t
)
value_
->
data
[
i
]);
}
Logger
::
nas_mm
().
debug
(
"
decoded Additional_Information len(%d)"
,
decoded_size
);
"
Decoded %s, len (%d)"
,
GetIeName
().
c_str
()
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/Additional
_
Information.hpp
→
src/nas/ies/AdditionalInformation.hpp
View file @
74a81963
...
...
@@ -19,35 +19,31 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _ADDITIONAL_INFORMATION_H_
#define _ADDITIONAL_INFORMATION_H_
#ifndef __Additional_Information_H_
#define __Additional_Information_H_
#include "Type4NasIe.hpp"
#include <stdint.h>
constexpr
uint8_t
kAdditionalInformationMinimumLength
=
3
;
constexpr
uint16_t
kAdditionalInformationMaximumLength
=
257
;
constexpr
auto
kAdditionalInformationIeName
=
"Additional Information"
;
namespace
nas
{
class
Additional
_Information
{
class
Additional
Information
:
public
Type4NasIe
{
public:
Additional_Information
();
Additional_Information
(
uint8_t
iei
);
Additional_Information
(
const
uint8_t
iei
,
uint8_t
_length
,
uint8_t
value
);
~
Additional_Information
();
void
setValue
(
uint8_t
iei
,
uint8_t
value
);
AdditionalInformation
();
AdditionalInformation
(
const
bstring
&
value
);
~
AdditionalInformation
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
uint8_t
getValue
();
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
);
void
SetValue
(
const
bstring
&
dnn
);
void
GetValue
(
bstring
&
dnn
)
const
;
private:
uint8_t
_iei
;
uint8_t
length
;
uint8_t
_value
;
bstring
value_
;
};
}
// namespace nas
...
...
src/nas/ies/DNN.hpp
View file @
74a81963
...
...
@@ -37,7 +37,7 @@ class DNN : public Type4NasIe {
~
DNN
();
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_
iei
);
void
SetValue
(
const
bstring
&
dnn
);
void
GetValue
(
bstring
&
dnn
)
const
;
...
...
src/nas/msgs/DLNASTransport.cpp
View file @
74a81963
...
...
@@ -71,8 +71,8 @@ void DLNASTransport::SetPduSessionId(uint8_t value) {
}
//------------------------------------------------------------------------------
void
DLNASTransport
::
SetAdditionalInformation
(
uint8_t
_length
,
uint8_t
value
)
{
ie_additional_information
=
new
Additional
_Information
(
0x24
,
_length
,
value
);
void
DLNASTransport
::
SetAdditionalInformation
(
const
bstring
&
value
)
{
ie_additional_information
=
new
Additional
Information
(
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -196,7 +196,7 @@ int DLNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
}
break
;
case
0x24
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x24)"
);
ie_additional_information
=
new
Additional
_
Information
();
ie_additional_information
=
new
AdditionalInformation
();
decoded_size
+=
ie_additional_information
->
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/DLNASTransport.hpp
View file @
74a81963
...
...
@@ -42,7 +42,7 @@ class DLNASTransport {
void
SetPayloadContainer
(
uint8_t
*
buf
,
int
len
);
void
SetPduSessionId
(
uint8_t
value
);
void
SetAdditionalInformation
(
uint8_t
_length
,
uint8_t
value
);
void
SetAdditionalInformation
(
const
bstring
&
value
);
void
Set5gmmCause
(
uint8_t
value
);
void
SetBackOffTimerValue
(
uint8_t
unit
,
uint8_t
value
);
...
...
@@ -51,7 +51,7 @@ class DLNASTransport {
PayloadContainerType
*
ie_payload_container_type
;
Payload_Container
*
ie_payload_container
;
PduSessionIdentity2
*
ie_pdu_session_identity_2
;
Additional
_
Information
*
ie_additional_information
;
AdditionalInformation
*
ie_additional_information
;
_5GMM_Cause
*
ie_5gmm_cause
;
GprsTimer3
*
ie_back_off_timer_value
;
};
...
...
src/nas/msgs/ULNASTransport.cpp
View file @
74a81963
...
...
@@ -152,9 +152,8 @@ bool ULNASTransport::getDnn(bstring& dnn) {
}
//------------------------------------------------------------------------------
void
ULNASTransport
::
SetAdditionalInformation
(
uint8_t
_length
,
uint8_t
value
)
{
ie_additional_information
=
std
::
make_optional
<
Additional_Information
>
(
0x24
,
_length
,
value
);
void
ULNASTransport
::
SetAdditionalInformation
(
const
bstring
&
value
)
{
ie_additional_information
=
std
::
make_optional
<
AdditionalInformation
>
(
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -435,7 +434,7 @@ int ULNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
}
break
;
case
0x25
:
{
case
kIeiDnn
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x25)"
);
DNN
ie_dnn_tmp
=
{};
if
((
decoded_result
=
ie_dnn_tmp
.
Decode
(
...
...
@@ -448,16 +447,16 @@ int ULNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
}
break
;
case
0x24
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI
(0x24)"
);
Additional
_
Information
ie_additional_information_tmp
=
{};
case
kIeiAdditionalInformation
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI
0x%x"
,
kIeiAdditionalInformation
);
AdditionalInformation
ie_additional_information_tmp
=
{};
if
((
decoded_result
=
ie_additional_information_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
KEncodeDecodeError
)
return
decoded_result
;
decoded_size
+=
decoded_result
;
ie_additional_information
=
std
::
optional
<
Additional_Information
>
(
ie_additional_information_tmp
);
ie_additional_information
=
std
::
optional
<
AdditionalInformation
>
(
ie_additional_information_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
}
break
;
...
...
src/nas/msgs/ULNASTransport.hpp
View file @
74a81963
...
...
@@ -58,7 +58,7 @@ class ULNASTransport : public NasMmPlainHeader {
void
setDNN
(
bstring
dnn
);
bool
getDnn
(
bstring
&
dnn
);
void
SetAdditionalInformation
(
uint8_t
_length
,
uint8_t
value
);
void
SetAdditionalInformation
(
const
bstring
&
value
);
void
SetMaPduSessionInformation
(
uint8_t
value
);
...
...
@@ -73,7 +73,7 @@ class ULNASTransport : public NasMmPlainHeader {
std
::
optional
<
RequestType
>
ie_request_type
;
// Optional
std
::
optional
<
S_NSSAI
>
ie_s_nssai
;
// 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
>
ie_ma_pdu_session_information
;
// Optional
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