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
28bf3fa1
Commit
28bf3fa1
authored
Mar 29, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add LADN Information
parent
15fdf156
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
341 additions
and
4 deletions
+341
-4
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-0
src/nas/ies/DNN.cpp
src/nas/ies/DNN.cpp
+6
-0
src/nas/ies/DNN.hpp
src/nas/ies/DNN.hpp
+1
-0
src/nas/ies/LADN_Indication.hpp
src/nas/ies/LADN_Indication.hpp
+3
-3
src/nas/ies/Ladn.cpp
src/nas/ies/Ladn.cpp
+88
-0
src/nas/ies/Ladn.hpp
src/nas/ies/Ladn.hpp
+50
-0
src/nas/ies/LadnInformation.cpp
src/nas/ies/LadnInformation.cpp
+123
-0
src/nas/ies/LadnInformation.hpp
src/nas/ies/LadnInformation.hpp
+55
-0
src/nas/ies/_5GSTrackingAreaIdList.cpp
src/nas/ies/_5GSTrackingAreaIdList.cpp
+12
-0
src/nas/ies/_5GSTrackingAreaIdList.hpp
src/nas/ies/_5GSTrackingAreaIdList.hpp
+1
-0
src/nas/msgs/RegistrationAccept.hpp
src/nas/msgs/RegistrationAccept.hpp
+1
-1
No files found.
src/nas/common/NasIeHeader.hpp
View file @
28bf3fa1
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include "GprsTimer3.hpp"
#include "GprsTimer3.hpp"
#include "ImeisvRequest.hpp"
#include "ImeisvRequest.hpp"
#include "LADN_Indication.hpp"
#include "LADN_Indication.hpp"
#include "LadnInformation.hpp"
#include "MaPduSessionInformation.hpp"
#include "MaPduSessionInformation.hpp"
#include "NasMessageContainer.hpp"
#include "NasMessageContainer.hpp"
#include "NasSecurityAlgorithms.hpp"
#include "NasSecurityAlgorithms.hpp"
...
...
src/nas/ies/DNN.cpp
View file @
28bf3fa1
...
@@ -35,6 +35,12 @@ DNN::DNN(bstring dnn) : Type4NasIe(kIeiDnn) {
...
@@ -35,6 +35,12 @@ DNN::DNN(bstring dnn) : Type4NasIe(kIeiDnn) {
SetLengthIndicator
(
blength
(
dnn
));
SetLengthIndicator
(
blength
(
dnn
));
}
}
//------------------------------------------------------------------------------
DNN
::
DNN
(
bool
iei
)
:
Type4NasIe
(),
_DNN
()
{
if
(
iei
)
SetIei
(
kIeiDnn
);
SetLengthIndicator
(
1
);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
DNN
::~
DNN
()
{}
DNN
::~
DNN
()
{}
...
...
src/nas/ies/DNN.hpp
View file @
28bf3fa1
...
@@ -34,6 +34,7 @@ class DNN : public Type4NasIe {
...
@@ -34,6 +34,7 @@ class DNN : public Type4NasIe {
public:
public:
DNN
();
DNN
();
DNN
(
bstring
dnn
);
DNN
(
bstring
dnn
);
DNN
(
bool
iei
);
~
DNN
();
~
DNN
();
static
std
::
string
GetIeName
()
{
return
kDnnIeName
;
}
static
std
::
string
GetIeName
()
{
return
kDnnIeName
;
}
...
...
src/nas/ies/LADN_Indication.hpp
View file @
28bf3fa1
...
@@ -19,13 +19,13 @@
...
@@ -19,13 +19,13 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
#ifndef _LADN_I
ndication
_H_
#ifndef _LADN_I
NDICATION
_H_
#define _LADN_I
ndication
_H_
#define _LADN_I
NDICATION
_H_
#include "Type6NasIe.hpp"
#include "Type6NasIe.hpp"
constexpr
uint8_t
kLadnIndicationMinimumLength
=
3
;
constexpr
uint8_t
kLadnIndicationMinimumLength
=
3
;
constexpr
uint16_t
kLadnIndicationMaximumLength
=
1715
;
constexpr
uint16_t
kLadnIndicationMaximumLength
=
811
;
constexpr
auto
kLadnIndicationIeName
=
"LADN Indication"
;
constexpr
auto
kLadnIndicationIeName
=
"LADN Indication"
;
namespace
nas
{
namespace
nas
{
...
...
src/nas/ies/Ladn.cpp
0 → 100644
View file @
28bf3fa1
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "Ladn.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "Ie_Const.hpp"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
ladn
::
ladn
()
:
dnn
(
false
),
ta_list
(
false
)
{}
//------------------------------------------------------------------------------
ladn
::~
ladn
()
{}
//------------------------------------------------------------------------------
void
ladn
::
Set
(
const
DNN
&
value
)
{
dnn
=
value
;
}
//------------------------------------------------------------------------------
void
ladn
::
Set
(
const
_5GSTrackingAreaIdList
&
value
)
{
ta_list
=
value
;
}
//------------------------------------------------------------------------------
uint32_t
ladn
::
GetLength
()
const
{
return
(
dnn
.
GetIeLength
()
+
ta_list
.
GetIeLength
());
}
//------------------------------------------------------------------------------
int
ladn
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding LADN"
);
int
ie_len
=
dnn
.
GetIeLength
();
ie_len
+=
ta_list
.
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
;
}
int
encoded_size
=
0
;
int
encoded_ie_size
=
0
;
encoded_ie_size
=
dnn
.
Encode
(
buf
+
encoded_size
,
len
);
if
(
encoded_ie_size
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
encoded_size
+=
encoded_ie_size
;
encoded_ie_size
=
ta_list
.
Encode
(
buf
+
encoded_size
,
len
);
if
(
encoded_ie_size
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
encoded_size
+=
encoded_ie_size
;
Logger
::
nas_mm
().
debug
(
"Encoded LADN, len (%d)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
ladn
::
Decode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Decoding LADN"
);
int
decoded_size
=
0
;
// TODO:
Logger
::
nas_mm
().
debug
(
"Decoded LADN (len %d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/Ladn.hpp
0 → 100644
View file @
28bf3fa1
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _LADN_H_
#define _LADN_H_
#include "DNN.hpp"
#include "_5GSTrackingAreaIdList.hpp"
#include "Type6NasIe.hpp"
namespace
nas
{
class
ladn
{
public:
ladn
();
~
ladn
();
void
Set
(
const
DNN
&
value
);
void
Set
(
const
_5GSTrackingAreaIdList
&
value
);
uint32_t
GetLength
()
const
;
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
);
private:
DNN
dnn
;
_5GSTrackingAreaIdList
ta_list
;
};
}
// namespace nas
#endif
src/nas/ies/LadnInformation.cpp
0 → 100644
View file @
28bf3fa1
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "LadnInformation.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "Ie_Const.hpp"
#include "logger.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
LadnInformation
::
LadnInformation
()
:
Type6NasIe
(
kIeiLadnInformation
)
{
SetLengthIndicator
(
0
);
}
//------------------------------------------------------------------------------
LadnInformation
::~
LadnInformation
()
{}
//------------------------------------------------------------------------------
void
LadnInformation
::
Set
(
const
vector
<
ladn
>&
value
)
{
ladn_list
.
assign
(
value
.
begin
(),
value
.
end
());
}
//------------------------------------------------------------------------------
void
LadnInformation
::
Add
(
const
ladn
&
value
)
{
// TODO: Check maximum items - 8
ladn_list
.
push_back
(
value
);
int
ie_len
=
GetIeLength
();
ie_len
+=
value
.
GetLength
();
}
//------------------------------------------------------------------------------
int
LadnInformation
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding %s"
,
GetIeName
().
c_str
());
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
;
}
int
encoded_size
=
0
;
/*
// 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);
}
// 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
LadnInformation
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
Logger
::
nas_mm
().
debug
(
"Decoding EPS_NAS_Message_Container"
);
int
decoded_size
=
0
;
// 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);
}
for (int i = 0; i < LADN.size(); i++) {
for (int j = 0; j < blength(LADN.at(i)); j++) {
Logger::nas_mm().debug(
"Decoded LadnInformation value (0x%x)",
(uint8_t) LADN.at(i)->data[j]);
}
}
*/
Logger
::
nas_mm
().
debug
(
"Decoded EPS_NAS_Message_Container (len %d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/LadnInformation.hpp
0 → 100644
View file @
28bf3fa1
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _LADN_INFORMATION_H_
#define _LADN_INFORMATION_H_
#include "DNN.hpp"
#include "_5GSTrackingAreaIdList.hpp"
#include "Ladn.hpp"
#include "Type6NasIe.hpp"
constexpr
uint8_t
kLadnInformationMinimumLength
=
3
;
constexpr
uint16_t
kLadnInformationMaximumLength
=
1715
;
constexpr
auto
kLadnInformationIeName
=
"LADN Information"
;
namespace
nas
{
class
LadnInformation
:
Type6NasIe
{
public:
LadnInformation
();
~
LadnInformation
();
static
std
::
string
GetIeName
()
{
return
kLadnInformationIeName
;
}
void
Set
(
const
vector
<
ladn
>&
value
);
void
Add
(
const
ladn
&
value
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
private:
std
::
vector
<
ladn
>
ladn_list
;
};
}
// namespace nas
#endif
src/nas/ies/_5GSTrackingAreaIdList.cpp
View file @
28bf3fa1
...
@@ -36,6 +36,18 @@ _5GSTrackingAreaIdList::_5GSTrackingAreaIdList()
...
@@ -36,6 +36,18 @@ _5GSTrackingAreaIdList::_5GSTrackingAreaIdList()
k5gsTrackingAreaIdListMinimumLength
-
k5gsTrackingAreaIdListMinimumLength
-
2
);
// Minimim length - 2 bytes for header
2
);
// Minimim length - 2 bytes for header
}
}
//------------------------------------------------------------------------------
_5GSTrackingAreaIdList
::
_5GSTrackingAreaIdList
(
bool
iei
)
:
Type4NasIe
(),
m_tai_list
()
{
if
(
iei
)
{
SetIei
(
kIei5gsTrackingAreaIdentityList
);
}
SetLengthIndicator
(
k5gsTrackingAreaIdListMinimumLength
-
2
);
// Minimim length - 2 bytes for header
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
_5GSTrackingAreaIdList
::
_5GSTrackingAreaIdList
(
_5GSTrackingAreaIdList
::
_5GSTrackingAreaIdList
(
const
std
::
vector
<
p_tai_t
>&
tai_list
)
const
std
::
vector
<
p_tai_t
>&
tai_list
)
...
...
src/nas/ies/_5GSTrackingAreaIdList.hpp
View file @
28bf3fa1
...
@@ -36,6 +36,7 @@ namespace nas {
...
@@ -36,6 +36,7 @@ namespace nas {
class
_5GSTrackingAreaIdList
:
public
Type4NasIe
{
class
_5GSTrackingAreaIdList
:
public
Type4NasIe
{
public:
public:
_5GSTrackingAreaIdList
();
_5GSTrackingAreaIdList
();
_5GSTrackingAreaIdList
(
bool
iei
);
_5GSTrackingAreaIdList
(
const
std
::
vector
<
p_tai_t
>&
tai_list
);
_5GSTrackingAreaIdList
(
const
std
::
vector
<
p_tai_t
>&
tai_list
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
...
...
src/nas/msgs/RegistrationAccept.hpp
View file @
28bf3fa1
...
@@ -164,7 +164,7 @@ class RegistrationAccept : public NasMmPlainHeader {
...
@@ -164,7 +164,7 @@ class RegistrationAccept : public NasMmPlainHeader {
ie_pdu_session_reactivation_result
;
// Optional
ie_pdu_session_reactivation_result
;
// Optional
std
::
optional
<
PDU_Session_Reactivation_Result_Error_Cause
>
std
::
optional
<
PDU_Session_Reactivation_Result_Error_Cause
>
ie_pdu_session_reactivation_result_error_cause
;
// Optional
ie_pdu_session_reactivation_result_error_cause
;
// Optional
// TODO: std::optional<LadnInformation> ie_ladn_information;
//
std
::
optional
<
LadnInformation
>
ie_ladn_information
;
//
// Optional
// Optional
std
::
optional
<
MicoIndication
>
ie_mico_indication
;
// Optional
std
::
optional
<
MicoIndication
>
ie_mico_indication
;
// Optional
std
::
optional
<
NetworkSlicingIndication
>
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