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
af00930c
Commit
af00930c
authored
Oct 03, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code refactor for 5GS Tracking Area Identity
parent
a3860561
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
70 deletions
+47
-70
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-1
src/nas/ies/_5GSTrackingAreaIdentity.cpp
src/nas/ies/_5GSTrackingAreaIdentity.cpp
+19
-21
src/nas/ies/_5GSTrackingAreaIdentity.hpp
src/nas/ies/_5GSTrackingAreaIdentity.hpp
+5
-25
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+4
-6
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+17
-17
src/utils/NasUtils.cpp
src/utils/NasUtils.cpp
+1
-0
No files found.
src/nas/common/NasIeHeader.hpp
View file @
af00930c
...
...
@@ -77,7 +77,7 @@
#include "_5GS_Identity_Type.hpp"
#include "_5GS_Network_Feature_Support.hpp"
#include "_5GS_Registration_Result.hpp"
#include "_5GS
_Tracking_Area_
Identity.hpp"
#include "_5GS
TrackingArea
Identity.hpp"
#include "_5GS_Update_Type.hpp"
#include "struct.hpp"
#include "Ie_Const.hpp"
src/nas/ies/_5GS
_Tracking_Area_
Identity.cpp
→
src/nas/ies/_5GS
TrackingArea
Identity.cpp
View file @
af00930c
...
...
@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
#include "_5GS
_Tracking_Area_
Identity.hpp"
#include "_5GS
TrackingArea
Identity.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
...
...
@@ -29,7 +29,7 @@
using
namespace
nas
;
//------------------------------------------------------------------------------
_5GS
_Tracking_Area_Identity
::
_5GS_Tracking_Area_
Identity
(
uint8_t
iei
)
{
_5GS
TrackingAreaIdentity
::
_5GSTrackingArea
Identity
(
uint8_t
iei
)
{
_iei
=
iei
;
mcc_
=
{};
mnc_
=
{};
...
...
@@ -37,7 +37,7 @@ _5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity(uint8_t iei) {
}
//------------------------------------------------------------------------------
_5GS
_Tracking_Area_Identity
::
_5GS_Tracking_Area_
Identity
(
_5GS
TrackingAreaIdentity
::
_5GSTrackingArea
Identity
(
const
uint8_t
iei
,
const
std
::
string
&
mcc
,
const
std
::
string
&
mnc
,
const
uint32_t
&
tac
)
{
_iei
=
iei
;
...
...
@@ -47,7 +47,7 @@ _5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity(
}
//------------------------------------------------------------------------------
_5GS
_Tracking_Area_Identity
::
_5GS_Tracking_Area_
Identity
()
{
_5GS
TrackingAreaIdentity
::
_5GSTrackingArea
Identity
()
{
_iei
=
0
;
mcc_
=
{};
mnc_
=
{};
...
...
@@ -55,46 +55,45 @@ _5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity() {
}
//------------------------------------------------------------------------------
_5GS
_Tracking_Area_Identity
::~
_5GS_Tracking_Area_
Identity
()
{}
_5GS
TrackingAreaIdentity
::~
_5GSTrackingArea
Identity
()
{}
//------------------------------------------------------------------------------
void
_5GS
_Tracking_Area_
Identity
::
setTAC
(
const
uint32_t
&
value
)
{
void
_5GS
TrackingArea
Identity
::
setTAC
(
const
uint32_t
&
value
)
{
tac_
=
value
&
0x0fff
;
}
//------------------------------------------------------------------------------
uint32_t
_5GS
_Tracking_Area_
Identity
::
getTAC
()
const
{
uint32_t
_5GS
TrackingArea
Identity
::
getTAC
()
const
{
return
tac_
;
}
//------------------------------------------------------------------------------
void
_5GS
_Tracking_Area_
Identity
::
getTAC
(
uint32_t
&
value
)
const
{
void
_5GS
TrackingArea
Identity
::
getTAC
(
uint32_t
&
value
)
const
{
value
=
tac_
;
}
//------------------------------------------------------------------------------
void
_5GS
_Tracking_Area_
Identity
::
setMcc
(
const
std
::
string
&
mcc
)
{
void
_5GS
TrackingArea
Identity
::
setMcc
(
const
std
::
string
&
mcc
)
{
mcc_
=
mcc
;
}
//------------------------------------------------------------------------------
void
_5GS
_Tracking_Area_
Identity
::
getMcc
(
std
::
string
&
mcc
)
const
{
void
_5GS
TrackingArea
Identity
::
getMcc
(
std
::
string
&
mcc
)
const
{
mcc
=
mcc_
;
}
//------------------------------------------------------------------------------
void
_5GS
_Tracking_Area_
Identity
::
setMnc
(
const
std
::
string
&
mnc
)
{
void
_5GS
TrackingArea
Identity
::
setMnc
(
const
std
::
string
&
mnc
)
{
mnc_
=
mnc
;
}
//------------------------------------------------------------------------------
void
_5GS
_Tracking_Area_
Identity
::
getMnc
(
std
::
string
&
mnc
)
const
{
void
_5GS
TrackingArea
Identity
::
getMnc
(
std
::
string
&
mnc
)
const
{
mnc
=
mnc_
;
}
//------------------------------------------------------------------------------
int
_5GS_Tracking_Area_Identity
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding _5GS_Tracking_Area_Identity (IEI 0x%x)"
,
_iei
);
int
_5GSTrackingAreaIdentity
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding _5GSTrackingAreaIdentity (IEI 0x%x)"
,
_iei
);
if
(
len
<
k5gsTrackingAreaIdentityLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
...
...
@@ -104,7 +103,6 @@ int _5GS_Tracking_Area_Identity::encode2Buffer(uint8_t* buf, int len) {
int
encoded_size
=
0
;
if
(
_iei
)
{
//*(buf + encoded_size) = _iei;
ENCODE_U8
(
buf
+
encoded_size
,
_iei
,
encoded_size
);
}
...
...
@@ -114,19 +112,19 @@ int _5GS_Tracking_Area_Identity::encode2Buffer(uint8_t* buf, int len) {
ENCODE_U24
(
buf
+
encoded_size
,
tac_
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"
encoded _5GS_Tracking_Area_
Identity len(%d)"
,
encoded_size
);
"
Encoded _5GSTrackingArea
Identity len(%d)"
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
_5GS
_Tracking_Area_
Identity
::
decodeFromBuffer
(
int
_5GS
TrackingArea
Identity
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Decoding _5GS
_Tracking_Area_
Identity"
);
Logger
::
nas_mm
().
debug
(
"Decoding _5GS
TrackingArea
Identity"
);
int
decoded_size
=
0
;
if
(
is_option
)
{
DECODE_U8
(
buf
+
decoded_size
,
_iei
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Decoding _5GS
_Tracking_Area_
Identity IEI (0x%x)"
,
_iei
);
"Decoding _5GS
TrackingArea
Identity IEI (0x%x)"
,
_iei
);
}
decoded_size
+=
NasUtils
::
decodeMccMncFromBuffer
(
mcc_
,
mnc_
,
buf
+
decoded_size
,
len
-
decoded_size
);
...
...
@@ -135,6 +133,6 @@ int _5GS_Tracking_Area_Identity::decodeFromBuffer(
Logger
::
nas_mm
().
debug
(
"Decoded TAC 0x%x"
,
tac_
);
Logger
::
nas_mm
().
debug
(
"Decoded _5GS
_Tracking_Area_
Identity len(%d)"
,
decoded_size
);
"Decoded _5GS
TrackingArea
Identity len(%d)"
,
decoded_size
);
return
decoded_size
;
}
src/nas/ies/_5GS
_Tracking_Area_
Identity.hpp
→
src/nas/ies/_5GS
TrackingArea
Identity.hpp
View file @
af00930c
...
...
@@ -29,15 +29,15 @@ constexpr uint8_t k5gsTrackingAreaIdentityLength = 7;
namespace
nas
{
class
_5GS
_Tracking_Area_
Identity
{
class
_5GS
TrackingArea
Identity
{
public:
_5GS
_Tracking_Area_
Identity
();
_5GS
_Tracking_Area_
Identity
(
uint8_t
iei
);
_5GS
_Tracking_Area_
Identity
(
_5GS
TrackingArea
Identity
();
_5GS
TrackingArea
Identity
(
uint8_t
iei
);
_5GS
TrackingArea
Identity
(
const
uint8_t
iei
,
const
std
::
string
&
mcc
,
const
std
::
string
&
mnc
,
const
uint32_t
&
tac
);
~
_5GS
_Tracking_Area_
Identity
();
~
_5GS
TrackingArea
Identity
();
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
...
...
@@ -52,28 +52,8 @@ class _5GS_Tracking_Area_Identity {
void
setMnc
(
const
std
::
string
&
mnc
);
void
getMnc
(
std
::
string
&
mnc
)
const
;
/*
//TODO: to be removed
void setMNC_MCC1(uint8_t iei, uint8_t value);
uint8_t getMNC_MCC1();
void setMNC_MCC2(uint8_t iei, uint8_t value);
uint8_t getMNC_MCC2();
void setMNC_MCC3(uint8_t iei, uint8_t value);
uint8_t getMNC_MCC3();
*/
private:
uint8_t
_iei
;
/*uint8_t _MNC_MCC1;
uint8_t _MNC_MCC2;
uint8_t _MNC_MCC3;
uint8_t _TAC1;
uint8_t _TAC2;
uint8_t _TAC3;
*/
std
::
string
mcc_
;
std
::
string
mnc_
;
uint32_t
tac_
;
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
af00930c
...
...
@@ -270,11 +270,9 @@ bool RegistrationRequest::getRequestedNssai(
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setLast_Visited_Registered_TAI
(
uint8_t
MNC_MCC1
,
uint8_t
MNC_MCC2
,
uint8_t
MNC_MCC3
,
uint32_t
TAC
)
{
// ie_last_visited_registered_TAI =
// new _5GS_Tracking_Area_Identity(0x52, MNC_MCC1, MNC_MCC2, MNC_MCC3,
// TAC);
// TODO:
const
std
::
string
&
mcc
,
const
std
::
string
mnc
,
const
uint32_t
&
tac
)
{
// TODO: ie_last_visited_registered_TAI =
// new _5GSTrackingAreaIdentity(mcc, mnc, tac);
}
//------------------------------------------------------------------------------
...
...
@@ -929,7 +927,7 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
}
break
;
case
0x52
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI(0x52)"
);
ie_last_visited_registered_TAI
=
new
_5GS
_Tracking_Area_
Identity
();
ie_last_visited_registered_TAI
=
new
_5GS
TrackingArea
Identity
();
decoded_size
+=
ie_last_visited_registered_TAI
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
af00930c
...
...
@@ -95,7 +95,7 @@ class RegistrationRequest : public NasMmPlainHeader {
uint16_t
getUplinkDataStatus
();
void
setLast_Visited_Registered_TAI
(
uint8_t
MNC_MCC1
,
uint8_t
MNC_MCC2
,
uint8_t
MNC_MCC3
,
uint32_t
TAC
);
const
std
::
string
&
mcc
,
const
std
::
string
mnc
,
const
uint32_t
&
tac
);
void
setPDU_session_status
(
uint16_t
value
);
uint16_t
getPduSessionStatus
();
...
...
@@ -157,22 +157,22 @@ class RegistrationRequest : public NasMmPlainHeader {
std
::
optional
<
UESecurityCapability
>
ie_ue_security_capability
;
// Optional
std
::
optional
<
NSSAI
>
ie_requested_NSSAI
;
// Optional
_5GS
_Tracking_Area_Identity
*
ie_last_visited_registered_TAI
;
// Optional
UENetworkCapability
*
ie_s1_ue_network_capability
;
// Optional
UplinkDataStatus
*
ie_uplink_data_status
;
// Optional
PDU_Session_Status
*
ie_PDU_session_status
;
// Optional
MICO_Indication
*
ie_MICO_indicationl
;
// Optional
UE_Status
*
ie_ue_status
;
// Optional
_5GSMobileIdentity
*
ie_additional_guti
;
// Optional
Allowed_PDU_Session_Status
*
ie_allowed_PDU_session_status
;
// Optional
UES_Usage_Setting
*
ie_ues_usage_setting
;
// Optional
_5GS_DRX_arameters
*
ie_5gs_drx_parameters
;
// Optional
EPS_NAS_Message_Container
*
ie_eps_nas_message_container
;
// Optional
LADN_Indication
*
ie_ladn_indication
;
// Optional
Payload_Container_Type
*
ie_payload_container_type
;
// Optional
Payload_Container
*
ie_payload_container
;
// Optional
Network_Slicing_Indication
*
ie_network_slicing_indication
;
// Optional
_5GS_Update_Type
*
ie_5gs_update_type
;
// Optional
_5GS
TrackingAreaIdentity
*
ie_last_visited_registered_TAI
;
// Optional
UENetworkCapability
*
ie_s1_ue_network_capability
;
// Optional
UplinkDataStatus
*
ie_uplink_data_status
;
// Optional
PDU_Session_Status
*
ie_PDU_session_status
;
// Optional
MICO_Indication
*
ie_MICO_indicationl
;
// Optional
UE_Status
*
ie_ue_status
;
// Optional
_5GSMobileIdentity
*
ie_additional_guti
;
// Optional
Allowed_PDU_Session_Status
*
ie_allowed_PDU_session_status
;
// Optional
UES_Usage_Setting
*
ie_ues_usage_setting
;
// Optional
_5GS_DRX_arameters
*
ie_5gs_drx_parameters
;
// Optional
EPS_NAS_Message_Container
*
ie_eps_nas_message_container
;
// Optional
LADN_Indication
*
ie_ladn_indication
;
// Optional
Payload_Container_Type
*
ie_payload_container_type
;
// Optional
Payload_Container
*
ie_payload_container
;
// Optional
Network_Slicing_Indication
*
ie_network_slicing_indication
;
// Optional
_5GS_Update_Type
*
ie_5gs_update_type
;
// Optional
// TODO: Mobile station classmark 2
// TODO: Supported codecs
NAS_Message_Container
*
ie_nas_message_container
;
// Optional
...
...
src/utils/NasUtils.cpp
View file @
af00930c
...
...
@@ -21,6 +21,7 @@
#include "NasUtils.hpp"
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "String2Value.hpp"
#include "logger.hpp"
...
...
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