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
316e6a9a
Commit
316e6a9a
authored
Feb 08, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup for AuthenticationResult
parent
63cb0677
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
26 deletions
+25
-26
src/nas/msgs/AuthenticationResult.hpp
src/nas/msgs/AuthenticationResult.hpp
+3
-3
src/nas/msgs/NasMmPlainHeader.cpp
src/nas/msgs/NasMmPlainHeader.cpp
+13
-12
src/nas/msgs/NasMmPlainHeader.hpp
src/nas/msgs/NasMmPlainHeader.hpp
+9
-11
No files found.
src/nas/msgs/AuthenticationResult.hpp
View file @
316e6a9a
...
...
@@ -46,7 +46,7 @@ class AuthenticationResult : public NasMmPlainHeader {
// TODO: Get
public:
NasKeySetIdentifier
ie_ng
KSI
;
// Mandatory (1/2 lower octet)
NasKeySetIdentifier
ie_ng
_ksi
;
// Mandatory (1/2 lower octet)
EapMessage
ie_eap_message
;
// Mandatory
std
::
optional
<
ABBA
>
ie_abba
;
// Optional
};
...
...
src/nas/msgs/NasMmPlainHeader.cpp
View file @
316e6a9a
...
...
@@ -27,49 +27,48 @@
using
namespace
nas
;
//------------------------------------------------------------------------------
NasMmPlainHeader
::
NasMmPlainHeader
(
const
uint8_t
&
epd
)
:
epd_
(
epd
)
{}
NasMmPlainHeader
::
NasMmPlainHeader
(
uint8_t
epd
)
:
epd_
(
epd
)
{}
//------------------------------------------------------------------------------
NasMmPlainHeader
::
NasMmPlainHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
msg_type
)
NasMmPlainHeader
::
NasMmPlainHeader
(
uint8_t
epd
,
uint8_t
msg_type
)
:
epd_
(
epd
),
msg_type_
(
msg_type
)
{}
//------------------------------------------------------------------------------
NasMmPlainHeader
::~
NasMmPlainHeader
()
{}
//------------------------------------------------------------------------------
void
NasMmPlainHeader
::
SetEpd
(
const
uint8_t
epd
)
{
void
NasMmPlainHeader
::
SetEpd
(
uint8_t
epd
)
{
epd_
.
Set
(
epd
);
}
//------------------------------------------------------------------------------
uint8_t
NasMmPlainHeader
::
GetEpd
()
{
uint8_t
NasMmPlainHeader
::
GetEpd
()
const
{
return
epd_
.
Get
();
}
//------------------------------------------------------------------------------
void
NasMmPlainHeader
::
SetSecurityHeaderType
(
const
uint8_t
type
)
{
void
NasMmPlainHeader
::
SetSecurityHeaderType
(
uint8_t
type
)
{
secu_header_type_
.
Set
(
type
);
}
//------------------------------------------------------------------------------
uint8_t
NasMmPlainHeader
::
GetSecurityHeaderType
()
{
uint8_t
NasMmPlainHeader
::
GetSecurityHeaderType
()
const
{
return
secu_header_type_
.
Get
();
}
//------------------------------------------------------------------------------
void
NasMmPlainHeader
::
SetMessageType
(
const
uint8_t
type
)
{
void
NasMmPlainHeader
::
SetMessageType
(
uint8_t
type
)
{
msg_type_
.
Set
(
type
);
}
//------------------------------------------------------------------------------
uint8_t
NasMmPlainHeader
::
GetMessageType
()
{
uint8_t
NasMmPlainHeader
::
GetMessageType
()
const
{
return
msg_type_
.
Get
();
}
//------------------------------------------------------------------------------
void
NasMmPlainHeader
::
SetHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
security_header_type
,
const
uint8_t
&
msg_type
)
{
uint8_t
epd
,
uint8_t
security_header_type
,
uint8_t
msg_type
)
{
epd_
.
Set
(
epd
);
secu_header_type_
.
Set
(
security_header_type
);
msg_type_
.
Set
(
msg_type
);
...
...
@@ -94,7 +93,8 @@ void NasMmPlainHeader::GetMessageName(std::string& name) const {
int
NasMmPlainHeader
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding NasMmPlainHeader"
);
if
(
len
<
kNasMmPlainHeaderLength
)
{
Logger
::
nas_mm
().
error
(
"buffer length is less than 3 octets"
);
Logger
::
nas_mm
().
error
(
"Buffer length is less than %d octets"
,
kNasMmPlainHeaderLength
);
return
KEncodeDecodeError
;
}
else
{
uint32_t
encoded_size
=
0
;
...
...
@@ -132,7 +132,8 @@ int NasMmPlainHeader::Decode(const uint8_t* const buf, int len) {
int
decoded_size
=
0
;
if
(
len
<
kNasMmPlainHeaderLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than 3 octets"
);
Logger
::
nas_mm
().
error
(
"Buffer length is less than %d octets"
,
kNasMmPlainHeaderLength
);
return
KEncodeDecodeError
;
}
...
...
src/nas/msgs/NasMmPlainHeader.hpp
View file @
316e6a9a
...
...
@@ -33,13 +33,11 @@ namespace nas {
class
NasMmPlainHeader
{
public:
NasMmPlainHeader
(){};
NasMmPlainHeader
(
const
uint8_t
&
epd
);
NasMmPlainHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
msg_type
);
NasMmPlainHeader
(
uint8_t
epd
);
NasMmPlainHeader
(
uint8_t
epd
,
uint8_t
msg_type
);
virtual
~
NasMmPlainHeader
();
void
SetHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
security_header_type
,
const
uint8_t
&
msg_type
);
void
SetHeader
(
uint8_t
epd
,
uint8_t
security_header_type
,
uint8_t
msg_type
);
void
SetMessageName
(
const
std
::
string
&
name
);
std
::
string
GetMessageName
()
const
;
void
GetMessageName
(
std
::
string
&
name
)
const
;
...
...
@@ -47,14 +45,14 @@ class NasMmPlainHeader {
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
const
uint8_t
*
const
buf
,
int
len
);
void
SetEpd
(
const
uint8_t
epd
);
uint8_t
GetEpd
();
void
SetEpd
(
uint8_t
epd
);
uint8_t
GetEpd
()
const
;
void
SetSecurityHeaderType
(
const
uint8_t
type
);
uint8_t
GetSecurityHeaderType
();
void
SetSecurityHeaderType
(
uint8_t
type
);
uint8_t
GetSecurityHeaderType
()
const
;
void
SetMessageType
(
const
uint8_t
type
);
uint8_t
GetMessageType
();
void
SetMessageType
(
uint8_t
type
);
uint8_t
GetMessageType
()
const
;
private:
ExtendedProtocolDiscriminator
epd_
;
// Mandatory
...
...
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