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
caebfeeb
Commit
caebfeeb
authored
Jan 11, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ABBA
parent
aed18962
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
87 deletions
+84
-87
src/nas/common/Ie_Const.hpp
src/nas/common/Ie_Const.hpp
+2
-0
src/nas/ies/ABBA.cpp
src/nas/ies/ABBA.cpp
+69
-70
src/nas/ies/ABBA.hpp
src/nas/ies/ABBA.hpp
+12
-16
src/nas/msgs/AuthenticationRequest.cpp
src/nas/msgs/AuthenticationRequest.cpp
+1
-1
No files found.
src/nas/common/Ie_Const.hpp
View file @
caebfeeb
...
...
@@ -99,6 +99,8 @@ constexpr uint8_t kIeiUeStatus = 0x2b;
constexpr
uint8_t
kIeiUeSecurityCapability
=
0x2e
;
constexpr
uint8_t
kIeiUeNetworkCapability
=
0x17
;
constexpr
uint8_t
kIeiAbba
=
0x38
;
constexpr
uint8_t
kIeiUplinkDataStatus
=
0x40
;
constexpr
uint8_t
kT3502Value
=
0x16
;
...
...
src/nas/ies/ABBA.cpp
View file @
caebfeeb
...
...
@@ -18,107 +18,106 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "ABBA.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
ABBA
::
ABBA
(
uint8_t
iei
)
:
_value
()
{
_iei
=
iei
;
_length
=
0
;
ABBA
::
ABBA
()
:
Type4NasIe
(),
value_
()
{
SetLengthIndicator
(
0
);
SetIeName
(
kAbbaIeName
);
}
//------------------------------------------------------------------------------
ABBA
::
ABBA
(
uint8_t
iei
)
:
Type4NasIe
(
iei
),
value_
()
{
SetLengthIndicator
(
0
);
SetIeName
(
kAbbaIeName
);
}
//------------------------------------------------------------------------------
ABBA
::
ABBA
(
const
uint8_t
iei
,
uint8_t
length
,
uint8_t
*
value
)
{
_iei
=
iei
;
ABBA
::
ABBA
(
uint8_t
length
,
uint8_t
*
value
)
:
Type4NasIe
()
{
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
this
->
_value
[
i
]
=
value
[
i
];
this
->
value_
[
i
]
=
value
[
i
];
}
_length
=
length
;
SetLengthIndicator
(
length
);
SetIeName
(
kAbbaIeName
);
}
//------------------------------------------------------------------------------
ABBA
::
ABBA
()
:
_value
(),
_length
(),
_iei
()
{}
ABBA
::
ABBA
(
uint8_t
iei
,
uint8_t
length
,
uint8_t
*
value
)
:
Type4NasIe
(
iei
)
{
for
(
int
i
=
0
;
i
<
length
;
i
++
)
{
this
->
value_
[
i
]
=
value
[
i
];
}
SetLengthIndicator
(
length
);
SetIeName
(
kAbbaIeName
);
}
//------------------------------------------------------------------------------
ABBA
::~
ABBA
()
{}
//------------------------------------------------------------------------------
uint8_t
ABBA
::
getValue
()
{
for
(
int
j
=
0
;
j
<
_length
;
j
++
)
{
Logger
::
nas_mm
().
debug
(
"Decoded ABBA value (0x%2x)"
,
_value
[
j
]);
}
return
1
;
}
//------------------------------------------------------------------------------
int
ABBA
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding ABBA IEI (0x%x)"
,
_iei
);
if
(
len
<
_length
)
{
Logger
::
nas_mm
().
error
(
"len is less than %d"
,
_length
);
return
0
;
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
)
{
// option
*
(
buf
+
encoded_size
)
=
_iei
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
_length
-
2
;
encoded_size
++
;
int
i
=
0
;
while
((
_length
-
2
)
!=
0
)
{
*
(
buf
+
encoded_size
)
=
_value
[
i
];
encoded_size
++
;
_length
--
;
i
++
;
}
}
else
{
Logger
::
nas_mm
().
debug
(
"length(%d)"
,
_length
);
*
(
buf
+
encoded_size
)
=
_length
;
encoded_size
++
;
int
i
=
0
;
while
(
_length
!=
0
)
{
*
(
buf
+
encoded_size
)
=
_value
[
i
];
encoded_size
++
;
_length
--
;
i
++
;
}
// 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
;
int
length
=
GetLengthIndicator
();
int
i
=
0
;
while
(
length
!=
0
)
{
ENCODE_U8
(
buf
+
encoded_size
,
value_
[
i
],
encoded_size
);
length
--
;
i
++
;
}
Logger
::
nas_mm
().
debug
(
"Encoded ABBA len (%d)"
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"Encoded %s, len (%d)"
,
GetIeName
().
c_str
(),
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
ABBA
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Encoding ABBA IEI (0x%x)"
,
*
buf
);
int
decoded_size
=
0
;
if
(
is_option
)
{
decoded_size
++
;
int
ABBA
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
if
(
len
<
kAbbaMinimumLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kAbbaMinimumLength
);
return
KEncodeDecodeError
;
}
_length
=
0x00
;
_value
[
255
]
=
{};
_length
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
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
;
int
i
=
0
;
uint8_t
Length
=
_length
;
while
(
Length
!=
0
)
{
_value
[
i
]
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
Length
--
;
uint8_t
length
=
GetLengthIndicator
();
while
(
length
!=
0
)
{
DECODE_U8
(
buf
+
decoded_size
,
value_
[
i
],
decoded_size
);
length
--
;
i
++
;
}
for
(
int
j
=
0
;
j
<
_length
;
j
++
)
{
Logger
::
nas_mm
().
debug
(
"Decoded ABBA value (0x%4x), length (0x%4x)"
,
_value
[
j
],
_length
);
for
(
int
j
=
0
;
j
<
GetLengthIndicator
();
j
++
)
{
Logger
::
nas_mm
().
debug
(
"Decoded ABBA value (0x%4x)"
,
value_
[
j
]
);
}
Logger
::
nas_mm
().
debug
(
"Decoded ABBA len (%d)"
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Decoded %s, len (%d)"
,
GetIeName
().
c_str
(),
decoded_size
);
return
decoded_size
;
}
src/nas/ies/ABBA.hpp
View file @
caebfeeb
...
...
@@ -19,35 +19,31 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __ABBA_H_
#define __ABBA_H_
#ifndef _ABBA_H_
#define _ABBA_H_
#include "Type4NasIe.hpp"
#include <stdint.h>
constexpr
uint8_t
kAbbaMinimumLength
=
4
;
constexpr
auto
kAbbaIeName
=
"ABBA"
;
namespace
nas
{
class
ABBA
{
class
ABBA
:
public
Type4NasIe
{
public:
ABBA
();
ABBA
(
uint8_t
iei
);
ABBA
(
const
uint8_t
iei
,
uint8_t
length
,
uint8_t
*
value
);
ABBA
(
uint8_t
length
,
uint8_t
*
value
);
ABBA
(
uint8_t
iei
,
uint8_t
length
,
uint8_t
*
value
);
~
ABBA
();
// void setValue(uint8_t iei, uint8_t value);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
uint8_t
getValue
()
;
// uint8_t GetValue() const
;
private:
uint8_t
_iei
;
uint8_t
_length
;
uint8_t
_value
[
256
];
uint8_t
value_
[
256
];
// TODO:
};
}
// namespace nas
...
...
src/nas/msgs/AuthenticationRequest.cpp
View file @
caebfeeb
...
...
@@ -52,7 +52,7 @@ void AuthenticationRequest::setngKSI(uint8_t tsc, uint8_t key_set_id) {
//------------------------------------------------------------------------------
void
AuthenticationRequest
::
setABBA
(
uint8_t
length
,
uint8_t
*
value
)
{
ie_abba
=
new
ABBA
(
0x00
,
length
,
value
);
ie_abba
=
new
ABBA
(
length
,
value
);
}
//------------------------------------------------------------------------------
...
...
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