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
f9d806bd
Commit
f9d806bd
authored
Jan 06, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
316bb23e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
23 deletions
+3
-23
src/nas/ies/UESecurityCapability.cpp
src/nas/ies/UESecurityCapability.cpp
+3
-18
src/nas/ies/UESecurityCapability.hpp
src/nas/ies/UESecurityCapability.hpp
+0
-5
No files found.
src/nas/ies/UESecurityCapability.cpp
View file @
f9d806bd
...
@@ -160,13 +160,6 @@ int UESecurityCapability::encode2Buffer(uint8_t* buf, int len) {
...
@@ -160,13 +160,6 @@ int UESecurityCapability::encode2Buffer(uint8_t* buf, int len) {
int
encoded_size
=
0
;
int
encoded_size
=
0
;
// IEI and Length
// IEI and Length
encoded_size
+=
Type4NasIe
::
Encode
(
buf
+
encoded_size
,
len
);
encoded_size
+=
Type4NasIe
::
Encode
(
buf
+
encoded_size
,
len
);
/*
if (_iei) {
ENCODE_U8(buf + encoded_size, _iei, encoded_size);
}
// Length
ENCODE_U8(buf + encoded_size, length, encoded_size);
*/
// EA
// EA
ENCODE_U8
(
buf
+
encoded_size
,
_5g_ea_
,
encoded_size
);
ENCODE_U8
(
buf
+
encoded_size
,
_5g_ea_
,
encoded_size
);
...
@@ -204,27 +197,19 @@ int UESecurityCapability::decodeFromBuffer(
...
@@ -204,27 +197,19 @@ int UESecurityCapability::decodeFromBuffer(
// IEI and Length
// IEI and Length
decoded_size
+=
Type4NasIe
::
Decode
(
buf
+
decoded_size
,
len
,
is_option
);
decoded_size
+=
Type4NasIe
::
Decode
(
buf
+
decoded_size
,
len
,
is_option
);
/*
if (is_option) {
DECODE_U8(buf + decoded_size, _iei, decoded_size);
}
// Length
DECODE_U8(buf + decoded_size, length, decoded_size);
*/
// EA
// EA
DECODE_U8
(
buf
+
decoded_size
,
_5g_ea_
,
decoded_size
);
DECODE_U8
(
buf
+
decoded_size
,
_5g_ea_
,
decoded_size
);
// IA
// IA
DECODE_U8
(
buf
+
decoded_size
,
_5g_ia_
,
decoded_size
);
DECODE_U8
(
buf
+
decoded_size
,
_5g_ia_
,
decoded_size
);
int
ie_len
=
GetIeLength
();
int
ie_len
=
GetIeLength
();
if
(
ie_len
>
=
3
)
{
if
(
ie_len
>
decoded_size
)
{
// EEA
// EEA
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
eea_
=
std
::
make_optional
<
uint8_t
>
(
octet
);
eea_
=
std
::
make_optional
<
uint8_t
>
(
octet
);
}
}
if
(
ie_len
>
=
4
)
{
if
(
ie_len
>
decoded_size
)
{
// EIA
// EIA
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
eia_
=
std
::
make_optional
<
uint8_t
>
(
octet
);
eia_
=
std
::
make_optional
<
uint8_t
>
(
octet
);
...
@@ -239,7 +224,7 @@ int UESecurityCapability::decodeFromBuffer(
...
@@ -239,7 +224,7 @@ int UESecurityCapability::decodeFromBuffer(
Logger
::
nas_mm
().
debug
(
Logger
::
nas_mm
().
debug
(
"Decoded %s, len (%d)"
,
GetIeName
().
c_str
(),
decoded_size
);
"Decoded %s, len (%d)"
,
GetIeName
().
c_str
(),
decoded_size
);
Logger
::
nas_mm
().
debug
(
"
EA 0x%x,
IA 0x%x"
,
_5g_ea_
,
_5g_ia_
);
Logger
::
nas_mm
().
debug
(
"
5G EA 0x%x, 5G
IA 0x%x"
,
_5g_ea_
,
_5g_ia_
);
if
(
eea_
.
has_value
())
{
if
(
eea_
.
has_value
())
{
Logger
::
nas_mm
().
debug
(
"EEA 0x%x"
,
eea_
.
value
());
Logger
::
nas_mm
().
debug
(
"EEA 0x%x"
,
eea_
.
value
());
}
}
...
...
src/nas/ies/UESecurityCapability.hpp
View file @
f9d806bd
...
@@ -57,15 +57,10 @@ class UESecurityCapability : public Type4NasIe {
...
@@ -57,15 +57,10 @@ class UESecurityCapability : public Type4NasIe {
void
SetEia
(
uint8_t
value
);
void
SetEia
(
uint8_t
value
);
bool
GetEia
(
uint8_t
&
value
)
const
;
bool
GetEia
(
uint8_t
&
value
)
const
;
// void setLength(uint8_t len);
// uint8_t getLength();
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
private:
private:
// uint8_t _iei;
// uint8_t length; // Length of UE security capability contents
uint8_t
_5g_ea_
;
// 3rd octet, Mandatory
uint8_t
_5g_ea_
;
// 3rd octet, Mandatory
uint8_t
_5g_ia_
;
// 4th octet, Mandatory
uint8_t
_5g_ia_
;
// 4th octet, Mandatory
std
::
optional
<
uint8_t
>
eea_
;
// 5th octet, Optional
std
::
optional
<
uint8_t
>
eea_
;
// 5th octet, Optional
...
...
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