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
48cc6605
Commit
48cc6605
authored
Aug 30, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code refactoring for DownlinkNasTransport
parent
69030eef
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
4 deletions
+106
-4
src/ngap/ngapIEs/MobilityRestrictionList.cpp
src/ngap/ngapIEs/MobilityRestrictionList.cpp
+11
-2
src/ngap/ngapIEs/MobilityRestrictionList.hpp
src/ngap/ngapIEs/MobilityRestrictionList.hpp
+1
-1
src/ngap/ngapMsgs/DownlinkNasTransport.cpp
src/ngap/ngapMsgs/DownlinkNasTransport.cpp
+86
-0
src/ngap/ngapMsgs/DownlinkNasTransport.hpp
src/ngap/ngapMsgs/DownlinkNasTransport.hpp
+8
-1
No files found.
src/ngap/ngapIEs/MobilityRestrictionList.cpp
View file @
48cc6605
...
...
@@ -42,8 +42,17 @@ void MobilityRestrictionList::getPLMN(PlmnId& sPLMN) {
//------------------------------------------------------------------------------
bool
MobilityRestrictionList
::
encode
(
Ngap_MobilityRestrictionList_t
*
mobilityrestrictionlist
)
{
if
(
!
servingPLMN
.
encode
(
mobilityrestrictionlist
->
servingPLMN
))
{
Ngap_MobilityRestrictionList_t
*
mobility_restriction_list
)
{
if
(
!
servingPLMN
.
encode
(
mobility_restriction_list
->
servingPLMN
))
{
return
false
;
}
return
true
;
}
//------------------------------------------------------------------------------
bool
MobilityRestrictionList
::
decode
(
Ngap_MobilityRestrictionList_t
*
mobility_restriction_list
)
{
if
(
!
servingPLMN
.
decode
(
mobility_restriction_list
->
servingPLMN
))
{
return
false
;
}
return
true
;
...
...
src/ngap/ngapIEs/MobilityRestrictionList.hpp
View file @
48cc6605
...
...
@@ -36,7 +36,7 @@ class MobilityRestrictionList {
void
getPLMN
(
PlmnId
&
sPlmn
);
bool
encode
(
Ngap_MobilityRestrictionList_t
*
mobilityrestrictionlist
);
// TODO: Decode
bool
decode
(
Ngap_MobilityRestrictionList_t
*
mobilityrestrictionlist
);
private:
PlmnId
servingPLMN
;
// Mandatory
...
...
src/ngap/ngapMsgs/DownlinkNasTransport.cpp
View file @
48cc6605
...
...
@@ -204,6 +204,20 @@ bool DownLinkNasTransportMsg::getMobilityRestrictionList(
return
true
;
}
//------------------------------------------------------------------------------
void
DownLinkNasTransportMsg
::
setUEAggregateMaxBitRate
(
const
UEAggregateMaxBitRate
&
bit_rate
)
{
uEAggregateMaxBitRate
=
std
::
make_optional
<
UEAggregateMaxBitRate
>
(
bit_rate
);
};
//------------------------------------------------------------------------------
bool
DownLinkNasTransportMsg
::
getUEAggregateMaxBitRate
(
UEAggregateMaxBitRate
&
bit_rate
)
{
if
(
!
uEAggregateMaxBitRate
.
has_value
())
return
false
;
bit_rate
=
uEAggregateMaxBitRate
.
value
();
return
true
;
}
//------------------------------------------------------------------------------
void
DownLinkNasTransportMsg
::
setIndex2Rat_FrequencySelectionPriority
(
const
uint32_t
&
value
)
{
...
...
@@ -236,6 +250,20 @@ bool DownLinkNasTransportMsg::getIndex2Rat_FrequencySelectionPriority(
return
true
;
}
//------------------------------------------------------------------------------
void
DownLinkNasTransportMsg
::
setAllowedNssai
(
const
AllowedNSSAI
&
allowed_nssai
)
{
allowedNssai
=
std
::
make_optional
<
AllowedNSSAI
>
(
allowed_nssai
);
}
//------------------------------------------------------------------------------
bool
DownLinkNasTransportMsg
::
getAllowedNssai
(
AllowedNSSAI
&
allowed_nssai
)
const
{
if
(
!
allowedNssai
.
has_value
())
return
false
;
allowed_nssai
=
allowedNssai
.
value
();
return
true
;
}
//------------------------------------------------------------------------------
bool
DownLinkNasTransportMsg
::
decodeFromPdu
(
Ngap_NGAP_PDU_t
*
ngapMsgPdu
)
{
ngapPdu
=
ngapMsgPdu
;
...
...
@@ -341,6 +369,26 @@ bool DownLinkNasTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_MobilityRestrictionList
:
{
if
(
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_DownlinkNASTransport_IEs__value_PR_MobilityRestrictionList
)
{
MobilityRestrictionList
tmp
=
{};
if
(
!
tmp
.
decode
(
&
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
MobilityRestrictionList
))
{
Logger
::
ngap
().
error
(
"Decode NGAP MobilityRestrictionList IE error"
);
return
false
;
}
mobilityRestrictionList
=
std
::
optional
<
MobilityRestrictionList
>
(
tmp
);
}
else
{
Logger
::
ngap
().
error
(
"Decode NGAP MobilityRestrictionList IE error"
);
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_IndexToRFSP
:
{
if
(
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
...
...
@@ -359,6 +407,44 @@ bool DownLinkNasTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
}
}
break
;
case
Ngap_ProtocolIE_ID_id_UEAggregateMaximumBitRate
:
{
if
(
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_DownlinkNASTransport_IEs__value_PR_UEAggregateMaximumBitRate
)
{
UEAggregateMaxBitRate
tmp
=
{};
if
(
!
tmp
.
decode
(
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UEAggregateMaximumBitRate
))
{
Logger
::
ngap
().
error
(
"Decode NGAP UEAggregateMaximumBitRate IE error"
);
return
false
;
}
uEAggregateMaxBitRate
=
std
::
optional
<
UEAggregateMaxBitRate
>
(
tmp
);
}
else
{
Logger
::
ngap
().
error
(
"Decode NGAP UEAggregateMaximumBitRate IE error"
);
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_AllowedNSSAI
:
{
if
(
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_DownlinkNASTransport_IEs__value_PR_AllowedNSSAI
)
{
AllowedNSSAI
tmp
=
{};
if
(
!
tmp
.
decode
(
&
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AllowedNSSAI
))
{
Logger
::
ngap
().
error
(
"Decode NGAP AllowedNSSAI IE error"
);
return
false
;
}
allowedNssai
=
std
::
optional
<
AllowedNSSAI
>
(
tmp
);
}
else
{
Logger
::
ngap
().
error
(
"Decode NGAP AllowedNSSAI IE error"
);
return
false
;
}
}
break
;
default:
{
Logger
::
ngap
().
error
(
"Decode NGAP message PDU error"
);
return
false
;
...
...
src/ngap/ngapMsgs/DownlinkNasTransport.hpp
View file @
48cc6605
...
...
@@ -22,6 +22,7 @@
#ifndef _DOWNLINK_NAS_TRANSPORT_H_
#define _DOWNLINK_NAS_TRANSPORT_H_
#include "AllowedNssai.hpp"
#include "AMFName.hpp"
#include "IndexToRFSP.hpp"
#include "NAS-PDU.hpp"
...
...
@@ -57,9 +58,15 @@ class DownLinkNasTransportMsg : public NgapUEMessage {
void
setMobilityRestrictionList
(
const
MobilityRestrictionList
&
);
bool
getMobilityRestrictionList
(
MobilityRestrictionList
&
)
const
;
void
setUEAggregateMaxBitRate
(
const
UEAggregateMaxBitRate
&
bit_rate
);
bool
getUEAggregateMaxBitRate
(
UEAggregateMaxBitRate
&
bit_rate
);
void
setIndex2Rat_FrequencySelectionPriority
(
const
uint32_t
&
value
);
// 1~256
bool
getIndex2Rat_FrequencySelectionPriority
(
uint32_t
&
)
const
;
void
setAllowedNssai
(
const
AllowedNSSAI
&
allowed_nssai
);
bool
getAllowedNssai
(
AllowedNSSAI
&
allowed_nssai
)
const
;
private:
Ngap_DownlinkNASTransport_t
*
downLinkNasTransportIEs
;
...
...
@@ -71,7 +78,7 @@ class DownLinkNasTransportMsg : public NgapUEMessage {
std
::
optional
<
MobilityRestrictionList
>
mobilityRestrictionList
;
// Optional
std
::
optional
<
IndexToRFSP
>
indexToRFSP
;
// Optional
std
::
optional
<
UEAggregateMaxBitRate
>
uEAggregateMaxBitRate
;
// Optional
// TODO: Allowed NSSAI (Optional)
std
::
optional
<
AllowedNSSAI
>
allowedNssai
;
// Optional
};
}
// namespace ngap
...
...
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