Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Libraries
UERANSIM
Commits
5c795ae5
Commit
5c795ae5
authored
Jun 06, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UAC implementation
parent
884965d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
5 deletions
+81
-5
src/ue/nas/mm/access.cpp
src/ue/nas/mm/access.cpp
+79
-2
src/ue/nas/mm/mm.hpp
src/ue/nas/mm/mm.hpp
+1
-1
src/ue/types.hpp
src/ue/types.hpp
+1
-2
No files found.
src/ue/nas/mm/access.cpp
View file @
5c795ae5
...
...
@@ -8,6 +8,8 @@
#include "mm.hpp"
#include <sstream>
#include <lib/nas/utils.hpp>
#include <ue/nas/sm/sm.hpp>
#include <ue/rrc/task.hpp>
...
...
@@ -17,6 +19,51 @@
namespace
nr
::
ue
{
static
std
::
string
AccessIdentitiesToString
(
const
std
::
bitset
<
16
>
&
ais
)
{
bool
first
=
true
;
std
::
stringstream
ss
;
for
(
size_t
i
=
0
;
i
<
ais
.
size
();
i
++
)
{
if
(
ais
[
i
])
{
if
(
!
first
)
ss
<<
", "
;
ss
<<
i
;
first
=
false
;
}
}
return
ss
.
str
();
}
static
std
::
string
AccessCategoryToString
(
int
n
)
{
if
(
n
>=
32
&&
n
<=
63
)
return
"operator defined["
+
std
::
to_string
(
n
)
+
"]"
;
switch
(
n
)
{
case
0
:
return
"MT_acc"
;
case
1
:
return
"delay tolerant"
;
case
2
:
return
"emergency"
;
case
3
:
return
"MO_sig"
;
case
4
:
return
"MO MMTel voice"
;
case
5
:
return
"MO MMTel video"
;
case
6
:
return
"MO SMS and SMSoIP"
;
case
7
:
return
"MO_data"
;
default:
return
"?"
;
}
}
bool
NasMm
::
hasEmergency
()
{
// Indicates emergency services are required (even if registered for normal initial registration)
...
...
@@ -76,7 +123,7 @@ bool NasMm::isInNonAllowedArea()
return
false
;
}
void
NasMm
::
performUac
()
EUacResult
NasMm
::
performUac
()
{
auto
accessIdentities
=
[
this
]()
{
std
::
bitset
<
16
>
ais
;
...
...
@@ -221,7 +268,37 @@ void NasMm::performUac()
auto
uacOutput
=
uacCtl
->
waitForProcess
();
// TODO: use uacOutput
if
(
uacOutput
==
nullptr
)
{
m_logger
->
err
(
"No response from RRC from UAC checks, considering access attempt is barred"
);
return
EUacResult
::
BARRED
;
}
auto
res
=
uacOutput
->
res
;
switch
(
res
)
{
case
EUacResult
:
:
ALLOWED
:
m_logger
->
debug
(
"UAC access attempt is allowed for identity[%s], category[%s]"
,
AccessIdentitiesToString
(
accessIdentities
).
c_str
(),
AccessCategoryToString
(
accessCategory
).
c_str
());
return
EUacResult
::
ALLOWED
;
case
EUacResult
:
:
BARRED
:
m_logger
->
err
(
"UAC access attempt is barred for identity[%s], category[%s]"
,
AccessIdentitiesToString
(
accessIdentities
).
c_str
(),
AccessCategoryToString
(
accessCategory
).
c_str
());
return
EUacResult
::
BARRED
;
case
EUacResult
:
:
BARRING_APPLICABLE_EXCEPT_0_2
:
if
(
accessCategory
!=
0
&&
accessCategory
!=
2
)
{
m_logger
->
err
(
"UAC access barred is applicable except category [0] and [2]"
);
return
EUacResult
::
BARRING_APPLICABLE_EXCEPT_0_2
;
}
return
EUacResult
::
ALLOWED
;
default:
// Should never reach here
return
EUacResult
::
BARRED
;
}
}
}
// namespace nr::ue
src/ue/nas/mm/mm.hpp
View file @
5c795ae5
...
...
@@ -174,7 +174,7 @@ class NasMm
bool
hasEmergency
();
void
setN1Capability
(
bool
enabled
);
bool
isInNonAllowedArea
();
void
performUac
();
EUacResult
performUac
();
private:
/* eCall */
bool
startECallInactivityIfNeeded
();
...
...
src/ue/types.hpp
View file @
5c795ae5
...
...
@@ -584,8 +584,7 @@ enum class EUacResult
{
ALLOWED
,
BARRED
,
BARRING_APPLICABLE_EXCEPT_0
,
BARRING_APPLICABLE_EXCEPT_0_2
BARRING_APPLICABLE_EXCEPT_0_2
,
};
struct
UacOutput
...
...
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