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
fe2b5458
Commit
fe2b5458
authored
Jan 13, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update UE Radio Capability Id
parent
151b7e93
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
78 deletions
+94
-78
src/nas/common/Ie_Const.hpp
src/nas/common/Ie_Const.hpp
+1
-0
src/nas/ies/UE_Radio_Capability_ID.cpp
src/nas/ies/UE_Radio_Capability_ID.cpp
+63
-53
src/nas/ies/UE_Radio_Capability_ID.hpp
src/nas/ies/UE_Radio_Capability_ID.hpp
+18
-17
src/nas/msgs/RegistrationAccept.cpp
src/nas/msgs/RegistrationAccept.cpp
+4
-5
src/nas/msgs/RegistrationAccept.hpp
src/nas/msgs/RegistrationAccept.hpp
+8
-3
No files found.
src/nas/common/Ie_Const.hpp
View file @
fe2b5458
...
...
@@ -120,6 +120,7 @@ constexpr uint8_t kIei5gsUpdateType = 0x53;
constexpr
uint8_t
kT3346Value
=
0x5f
;
constexpr
uint8_t
kIeiEpsBearerContextStatus
=
0x60
;
constexpr
uint8_t
kIeiUeRadioCapabilityId
=
0x67
;
constexpr
uint8_t
kIeiRejectedNssaiRr
=
0x69
;
constexpr
uint8_t
kIeiGprsTimer3T3324
=
0x6A
;
constexpr
uint8_t
kIeiGprsTimer3T3348
=
0x6B
;
...
...
src/nas/ies/UE_Radio_Capability_ID.cpp
View file @
fe2b5458
...
...
@@ -19,90 +19,100 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "UE_Radio_Capability_ID.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "Ie_Const.hpp"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
UE_Radio_Capability_ID
::
UE_Radio_Capability_ID
(
uint8_t
iei
)
{
_iei
=
iei
;
_value
=
0
;
}
//------------------------------------------------------------------------------
UE_Radio_Capability_ID
::
UE_Radio_Capability_ID
(
const
uint8_t
iei
,
uint8_t
value
)
{
_iei
=
iei
;
_value
=
value
;
UE_Radio_Capability_ID
::
UE_Radio_Capability_ID
()
:
Type4NasIe
(
kIeiUeRadioCapabilityId
),
value_
()
{
SetLengthIndicator
(
0
);
SetIeName
(
kUeRadioCapabilityIdIeName
);
}
//------------------------------------------------------------------------------
UE_Radio_Capability_ID
::
UE_Radio_Capability_ID
()
{
_iei
=
0
;
_value
=
0
;
UE_Radio_Capability_ID
::
UE_Radio_Capability_ID
(
bstring
value
)
:
Type4NasIe
(
kIeiUeRadioCapabilityId
)
{
value_
=
bstrcpy
(
value
);
SetLengthIndicator
(
blength
(
value_
));
SetIeName
(
kUeRadioCapabilityIdIeName
);
}
//------------------------------------------------------------------------------
UE_Radio_Capability_ID
::~
UE_Radio_Capability_ID
()
{}
//------------------------------------------------------------------------------
void
UE_Radio_Capability_ID
::
setValue
(
uint8_t
value
)
{
_value
=
value
;
void
UE_Radio_Capability_ID
::
setValue
(
bstring
value
)
{
value_
=
bstrcpy
(
value
)
;
}
//------------------------------------------------------------------------------
uint8_t
UE_Radio_Capability_ID
::
getValue
()
{
return
_value
;
void
UE_Radio_Capability_ID
::
getValue
(
bstring
&
value
)
const
{
value
=
bstrcpy
(
value_
)
;
}
//------------------------------------------------------------------------------
int
UE_Radio_Capability_ID
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"encoding UE_Radio_Capability_ID iei(0x%x)"
,
_iei
);
if
(
len
<
3
)
{
Logger
::
nas_mm
().
error
(
"len is less than 3"
);
return
0
;
}
Logger
::
nas_mm
().
debug
(
"Encoding %s"
,
GetIeName
().
c_str
());
int
encoded_size
=
0
;
if
(
_iei
)
{
*
(
buf
+
encoded_size
)
=
_iei
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
1
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
_value
;
encoded_size
++
;
}
else
{
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
int
ie_len
=
GetIeLength
();
if
(
len
<
ie_len
)
{
// Length of the content + IEI/Len
Logger
::
nas_mm
().
error
(
"Size of the buffer is not enough to store this IE (IE len %d)"
,
ie_len
);
return
KEncodeDecodeError
;
}
// IEI and Length (later)
int
len_pos
=
0
;
int
encoded_header_size
=
Type4NasIe
::
Encode
(
buf
+
encoded_size
,
len
,
len_pos
);
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
;
// Encode length
int
encoded_len_ie
=
0
;
ENCODE_U16
(
buf
+
len_pos
,
encoded_size
-
GetHeaderLength
(),
encoded_len_ie
);
Logger
::
nas_mm
().
debug
(
"
encoded UE_Radio_Capability_ID len(%d)"
,
encoded_size
);
"
Encoded %s, len (%d)"
,
GetIeName
().
c_str
()
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
UE_Radio_Capability_ID
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_
option
)
{
Logger
::
nas_mm
().
debug
(
"
decoding UE_Radio_Capability_ID iei(0x%x)"
,
*
buf
);
int
UE_Radio_Capability_ID
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_
iei
)
{
Logger
::
nas_mm
().
debug
(
"
Decoding %s"
,
GetIeName
().
c_str
()
);
int
decoded_size
=
0
;
if
(
is_option
)
{
_iei
=
*
buf
;
decoded_size
++
;
// 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
;
uint16_t
ie_len
=
0
;
ie_len
=
GetLengthIndicator
();
if
(
len
<
GetIeLength
())
{
Logger
::
nas_mm
().
error
(
"Len is less than %d"
,
GetIeLength
());
return
KEncodeDecodeError
;
}
_value
=
0x00
;
//
length = *(buf + decoded_size);
decode
d_size
++
;
_value
=
*
(
buf
+
decoded_size
)
;
decoded_size
++
;
//
Value
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 UE_Radio_Capability_ID _value(0x%x),iei(0x%x)"
,
_value
,
_iei
);
"Decoded NasMessageContainer value 0x%x"
,
(
uint8_t
)
value_
->
data
[
i
]);
}
Logger
::
nas_mm
().
debug
(
"
decoded UE_Radio_Capability_ID len(%d)"
,
decoded_size
);
"
Decoded %s, len (%d)"
,
GetIeName
().
c_str
()
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/UE_Radio_Capability_ID.hpp
View file @
fe2b5458
...
...
@@ -19,34 +19,35 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __UE_Radio_Capability_ID_H_
#define __UE_Radio_Capability_ID_H_
#ifndef _UE_RADIO_CAPABILITY_ID_H_
#define _UE_RADIO_CAPABILITY_ID_H_
#include "Type4NasIe.hpp"
#include <stdint.h>
extern
"C"
{
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
constexpr
auto
kUeRadioCapabilityIdIeName
=
"UE Radio Capability ID"
;
namespace
nas
{
class
UE_Radio_Capability_ID
{
class
UE_Radio_Capability_ID
:
public
Type4NasIe
{
public:
UE_Radio_Capability_ID
();
UE_Radio_Capability_ID
(
uint8_t
iei
);
UE_Radio_Capability_ID
(
const
uint8_t
iei
,
uint8_t
value
);
UE_Radio_Capability_ID
(
bstring
value
);
~
UE_Radio_Capability_ID
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_
option
);
void
setValue
(
uint8_t
value
);
uint8_t
getValue
()
;
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_
iei
);
void
setValue
(
bstring
value
);
void
getValue
(
bstring
&
value
)
const
;
private:
uint8_t
_iei
;
uint8_t
_value
;
bstring
value_
;
};
}
// namespace nas
...
...
src/nas/msgs/RegistrationAccept.cpp
View file @
fe2b5458
...
...
@@ -249,7 +249,7 @@ void RegistrationAccept::set_5GS_DRX_arameters(uint8_t value) {
//------------------------------------------------------------------------------
void
RegistrationAccept
::
setNon_3GPP_NW_Provided_Policies
(
uint8_t
value
)
{
ie_non_3gpp_nw_policies
=
std
::
make_optional
<
Non_3GPP_NW_Provided_Policies
>
(
0x0D
,
value
);
std
::
make_optional
<
Non_3GPP_NW_Provided_Policies
>
(
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -262,7 +262,7 @@ void RegistrationAccept::setEPS_Bearer_Context_Status(uint16_t value) {
void
RegistrationAccept
::
setExtended_DRX_Parameters
(
uint8_t
paging_time
,
uint8_t
value
)
{
ie_extended_drx_parameters
=
std
::
make_optional
<
Extended_DRX_Parameters
>
(
0x6E
,
paging_time
,
value
);
std
::
make_optional
<
Extended_DRX_Parameters
>
(
paging_time
,
value
);
}
//------------------------------------------------------------------------------
...
...
@@ -281,9 +281,8 @@ void RegistrationAccept::setT3324_Value(uint8_t unit, uint8_t value) {
}
//------------------------------------------------------------------------------
void
RegistrationAccept
::
setUE_Radio_Capability_ID
(
uint8_t
value
)
{
ie_ue_radio_capability_id
=
std
::
make_optional
<
UE_Radio_Capability_ID
>
(
0x67
,
value
);
void
RegistrationAccept
::
setUE_Radio_Capability_ID
(
bstring
value
)
{
ie_ue_radio_capability_id
=
std
::
make_optional
<
UE_Radio_Capability_ID
>
(
value
);
}
//------------------------------------------------------------------------------
...
...
src/nas/msgs/RegistrationAccept.hpp
View file @
fe2b5458
...
...
@@ -139,7 +139,7 @@ class RegistrationAccept : public NasMmPlainHeader {
void
setT3324_Value
(
uint8_t
unit
,
uint8_t
value
);
// TODO: Get
void
setUE_Radio_Capability_ID
(
uint8_t
value
);
void
setUE_Radio_Capability_ID
(
bstring
value
);
// TODO: Get
void
setPending_NSSAI
(
std
::
vector
<
struct
SNSSAI_s
>
nssai
);
...
...
@@ -189,8 +189,13 @@ class RegistrationAccept : public NasMmPlainHeader {
std
::
optional
<
GprsTimer3
>
ie_T3448_value
;
// Optional
std
::
optional
<
GprsTimer3
>
ie_T3324_value
;
// Optional
std
::
optional
<
UE_Radio_Capability_ID
>
ie_ue_radio_capability_id
;
// Which Release 16.x.x?
std
::
optional
<
NSSAI
>
ie_pending_nssai
;
// Which Release 16.x.x?
ie_ue_radio_capability_id
;
// Release 16.4.1
// TODO: UE radio capability ID deletion indication
std
::
optional
<
NSSAI
>
ie_pending_nssai
;
// Release 16.4.1
// TODO: Ciphering key data (Release 16.4.1)
// TODO: CAG information list (Release 16.4.1)
// TODO: Truncated 5G-S-TMSI configuration (Release 16.4.1)
// TODO: Negotiated WUS assistance information (Release 16.4.1)
};
}
// namespace nas
...
...
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