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
1f43ee67
Commit
1f43ee67
authored
Jan 09, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update LADN Indication
parent
ca60fb3d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
58 deletions
+68
-58
src/nas/common/Ie_Const.hpp
src/nas/common/Ie_Const.hpp
+1
-0
src/nas/ies/LADN_Indication.cpp
src/nas/ies/LADN_Indication.cpp
+51
-44
src/nas/ies/LADN_Indication.hpp
src/nas/ies/LADN_Indication.hpp
+11
-9
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+4
-4
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+1
-1
No files found.
src/nas/common/Ie_Const.hpp
View file @
1f43ee67
...
...
@@ -113,6 +113,7 @@ constexpr uint8_t kIeiRejectedNssaiRr = 0x69;
constexpr
uint8_t
kIeiEpsNasMessageContainer
=
0x70
;
constexpr
uint8_t
kIeiNasMessageContainer
=
0x71
;
constexpr
uint8_t
kIeiLadnIndication
=
0x74
;
constexpr
uint8_t
kIei5gGuti
=
0x77
;
constexpr
uint8_t
kIeiImeisv
=
0x77
;
constexpr
uint8_t
kIeiNonImeisvPei
=
0x78
;
...
...
src/nas/ies/LADN_Indication.cpp
View file @
1f43ee67
...
...
@@ -23,87 +23,93 @@
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "Ie_Const.hpp"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
LADN_Indication
::
LADN_Indication
(
uint8_t
iei
)
{
_iei
=
iei
;
length
=
0
;
LADN
=
{};
LadnIndication
::
LadnIndication
()
:
Type6NasIe
(
kIeiLadnIndication
)
{
LADN
=
{};
SetIeName
(
kLadnIndicationIeName
);
}
//------------------------------------------------------------------------------
L
ADN_Indication
::
LADN_Indication
(
const
uint8_t
iei
,
std
::
vector
<
bstring
>
ladn
)
{
_iei
=
iei
;
length
=
3
;
L
adnIndication
::
LadnIndication
(
const
std
::
vector
<
bstring
>&
ladn
)
:
Type6NasIe
(
kIeiLadnIndication
)
{
int
length
=
0
;
LADN
.
assign
(
ladn
.
begin
(),
ladn
.
end
());
for
(
int
i
=
0
;
i
<
ladn
.
size
();
i
++
)
{
length
=
length
+
blength
(
ladn
.
at
(
i
));
}
SetLengthIndicator
(
length
);
}
//------------------------------------------------------------------------------
LADN_Indication
::
LADN_Indication
()
:
_iei
(),
length
(),
LADN
()
{}
//------------------------------------------------------------------------------
LADN_Indication
::~
LADN_Indication
()
{}
//------------------------------------------------------------------------------
void
LADN_Indication
::
setValue
(
uint8_t
iei
)
{
_iei
=
iei
;
}
LadnIndication
::~
LadnIndication
()
{}
//------------------------------------------------------------------------------
void
L
ADN_Indication
::
g
etValue
(
std
::
vector
<
bstring
>&
ladn
)
{
void
L
adnIndication
::
G
etValue
(
std
::
vector
<
bstring
>&
ladn
)
{
ladn
.
assign
(
LADN
.
begin
(),
LADN
.
end
());
}
//------------------------------------------------------------------------------
int
L
ADN_
Indication
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding
LADN_Indication (IEI 0x%x)"
,
_iei
);
int
L
adn
Indication
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding
%s"
,
GetIeName
().
c_str
()
);
if
((
len
<
length
+
3
)
or
(
len
<
kLadnIndicationMinimumLength
))
{
int
ie_len
=
GetIeLength
();
if
(
len
<
ie_len
)
{
// Length of the content + IEI/Len
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE"
);
"Size of the buffer is not enough to store this IE (IE len %d)"
,
ie_len
);
return
KEncodeDecodeError
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
ENCODE_U8
(
buf
+
encoded_size
,
_iei
,
encoded_size
);
}
ENCODE_U16
(
buf
+
encoded_size
,
length
,
encoded_size
);
// IEI and Length (later)
int
len_pos
=
0
;
int
encoded_header_size
=
Type6NasIe
::
Encode
(
buf
+
encoded_size
,
len
,
len_pos
);
if
(
encoded_header_size
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
encoded_size
+=
encoded_header_size
;
for
(
int
i
=
0
;
i
<
LADN
.
size
();
i
++
)
{
ENCODE_U8
(
buf
+
encoded_size
,
blength
(
LADN
.
at
(
i
)),
encoded_size
);
encoded_size
+=
encode_bstring
(
LADN
.
at
(
i
),
(
buf
+
encoded_size
),
len
-
encoded_size
);
}
Logger
::
nas_mm
().
debug
(
"Encoded LADN_Indication (len %d)"
,
encoded_size
);
// Encode length
int
encoded_len_ie
=
0
;
ENCODE_U16
(
buf
+
len_pos
,
encoded_size
-
GetHeaderLength
(),
encoded_len_ie
);
Logger
::
nas_mm
().
debug
(
"Encoded %s, len (%d)"
,
GetIeName
().
c_str
(),
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
L
ADN_Indication
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Decoding
LADN_Indication
"
);
int
L
adnIndication
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
Logger
::
nas_mm
().
debug
(
"Decoding
EPS_NAS_Message_Container
"
);
int
decoded_size
=
0
;
if
(
is_option
)
{
DECODE_U8
(
buf
+
decoded_size
,
_iei
,
decoded_size
);
}
length
=
0
;
DECODE_U16
(
buf
+
decoded_size
,
length
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Decoded LADN_Indication (len %d)"
,
length
);
int
len_ie
=
length
;
uint8_t
len_dnn
=
0
;
bstring
dnn
;
while
(
len_ie
)
{
DECODE_U8
(
buf
+
decoded_size
,
len_dnn
,
decoded_size
);
len_ie
--
;
decode_bstring
(
&
dnn
,
len_dnn
,
(
buf
+
decoded_size
),
len
-
decoded_size
);
decoded_size
+=
len_dnn
;
len_ie
-=
len_dnn
;
// IEI and Length
uint16_t
ie_len
=
0
;
int
decoded_header_size
=
Type6NasIe
::
Decode
(
buf
+
decoded_size
,
len
,
is_iei
);
if
(
decoded_header_size
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
decoded_size
+=
decoded_header_size
;
ie_len
=
GetLengthIndicator
();
uint8_t
dnn_len
=
0
;
bstring
dnn
=
{};
while
(
ie_len
)
{
DECODE_U8
(
buf
+
decoded_size
,
dnn_len
,
decoded_size
);
ie_len
--
;
decode_bstring
(
&
dnn
,
dnn_len
,
(
buf
+
decoded_size
),
len
-
decoded_size
);
decoded_size
+=
dnn_len
;
ie_len
-=
dnn_len
;
LADN
.
insert
(
LADN
.
end
(),
dnn
);
}
...
...
@@ -115,6 +121,7 @@ int LADN_Indication::Decode(uint8_t* buf, int len, bool is_option) {
}
}
Logger
::
nas_mm
().
debug
(
"Decoded LADN_Indication (len %d)"
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Decoded EPS_NAS_Message_Container (len %d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/LADN_Indication.hpp
View file @
1f43ee67
...
...
@@ -22,6 +22,8 @@
#ifndef _LADN_Indication_H_
#define _LADN_Indication_H_
#include "Type6NasIe.hpp"
#include <stdint.h>
#include <iostream>
#include <vector>
...
...
@@ -35,23 +37,23 @@ using namespace std;
constexpr
uint8_t
kLadnIndicationMinimumLength
=
3
;
constexpr
uint16_t
kLadnIndicationMaximumLength
=
1715
;
constexpr
auto
kLadnIndicationIeName
=
"LADN Indication"
;
namespace
nas
{
class
L
ADN_Indication
{
class
L
adnIndication
:
Type6NasIe
{
public:
LADN_Indication
();
LADN_Indication
(
uint8_t
iei
);
LADN_Indication
(
const
uint8_t
iei
,
std
::
vector
<
bstring
>
ladn
);
~
LADN_Indication
();
void
setValue
(
uint8_t
iei
);
LadnIndication
();
LadnIndication
(
const
std
::
vector
<
bstring
>&
ladn
);
~
LadnIndication
();
// void SetValue(const std::vector<bstring>& ladn);
void
GetValue
(
std
::
vector
<
bstring
>&
ladn
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
void
getValue
(
std
::
vector
<
bstring
>&
ladn
);
private:
uint8_t
_iei
;
uint16_t
length
;
std
::
vector
<
bstring
>
LADN
;
};
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
1f43ee67
...
...
@@ -411,13 +411,13 @@ bool RegistrationRequest::getEpsNasMessageContainer(bstring& epsNas) {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setLADN_Indication
(
std
::
vector
<
bstring
>
ladnValue
)
{
ie_ladn_indication
=
std
::
make_optional
<
L
ADN_Indication
>
(
0x74
,
ladnValue
);
ie_ladn_indication
=
std
::
make_optional
<
L
adnIndication
>
(
ladnValue
);
}
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
getLadnIndication
(
std
::
vector
<
bstring
>&
ladnValue
)
{
if
(
ie_ladn_indication
.
has_value
())
{
ie_ladn_indication
.
value
().
g
etValue
(
ladnValue
);
ie_ladn_indication
.
value
().
G
etValue
(
ladnValue
);
return
true
;
}
else
{
return
false
;
...
...
@@ -1036,11 +1036,11 @@ int RegistrationRequest::Decode(uint8_t* buf, int len) {
}
break
;
case
0x74
:
{
// TODO: verify IEI value (spec Ox79)
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0x74)"
);
L
ADN_
Indication
ie_ladn_indication_tmp
=
{};
L
adn
Indication
ie_ladn_indication_tmp
=
{};
decoded_size
+=
ie_ladn_indication_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_ladn_indication
=
std
::
optional
<
L
ADN_
Indication
>
(
ie_ladn_indication_tmp
);
std
::
optional
<
L
adn
Indication
>
(
ie_ladn_indication_tmp
);
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
1f43ee67
...
...
@@ -168,7 +168,7 @@ class RegistrationRequest : public NasMmPlainHeader {
std
::
optional
<
_5GS_DRX_Parameters
>
ie_5gs_drx_parameters
;
// Optional
std
::
optional
<
EPS_NAS_Message_Container
>
ie_eps_nas_message_container
;
// Optional
std
::
optional
<
L
ADN_Indication
>
ie_ladn_indication
;
// Optional
std
::
optional
<
L
adnIndication
>
ie_ladn_indication
;
// Optional
std
::
optional
<
Payload_Container_Type
>
ie_payload_container_type
;
// Optional
std
::
optional
<
Payload_Container
>
ie_payload_container
;
// Optional
std
::
optional
<
NetworkSlicingIndication
>
...
...
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