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
667b6c1f
Commit
667b6c1f
authored
Jun 06, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UAC implementation
parent
b4ef5a13
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
4 deletions
+99
-4
src/ue/nas/mm/mm.hpp
src/ue/nas/mm/mm.hpp
+1
-1
src/ue/nas/mm/register.cpp
src/ue/nas/mm/register.cpp
+12
-0
src/ue/nas/mm/service.cpp
src/ue/nas/mm/service.cpp
+6
-0
src/ue/nas/mm/transport.cpp
src/ue/nas/mm/transport.cpp
+10
-1
src/ue/nas/sm/transport.cpp
src/ue/nas/sm/transport.cpp
+46
-2
src/ue/types.hpp
src/ue/types.hpp
+24
-0
No files found.
src/ue/nas/mm/mm.hpp
View file @
667b6c1f
...
...
@@ -101,7 +101,7 @@ class NasMm
private:
/* Transport */
void
receiveDlNasTransport
(
const
nas
::
DlNasTransport
&
msg
);
EProcRc
deliverUlTransport
(
const
nas
::
UlNasTransport
&
msg
);
EProcRc
deliverUlTransport
(
const
nas
::
UlNasTransport
&
msg
,
ENasTransportHint
hint
);
private:
/* Registration */
EProcRc
sendInitialRegistration
(
EInitialRegCause
regCause
);
...
...
src/ue/nas/mm/register.cpp
View file @
667b6c1f
...
...
@@ -48,6 +48,12 @@ EProcRc NasMm::sendInitialRegistration(EInitialRegCause regCause)
}
}
// Perform Unified Access Control
if
(
m_cmState
==
ECmState
::
CM_IDLE
&&
performUac
()
!=
EUacResult
::
ALLOWED
)
{
return
EProcRc
::
STAY
;
}
m_logger
->
debug
(
"Sending %s"
,
nas
::
utils
::
EnumToString
(
isEmergencyReg
?
nas
::
ERegistrationType
::
EMERGENCY_REGISTRATION
:
nas
::
ERegistrationType
::
INITIAL_REGISTRATION
));
...
...
@@ -158,6 +164,12 @@ EProcRc NasMm::sendMobilityRegistration(ERegUpdateCause updateCause)
m_timers
->
t3517
.
stop
();
}
// Perform Unified Access Control
if
(
m_cmState
==
ECmState
::
CM_IDLE
&&
performUac
()
!=
EUacResult
::
ALLOWED
)
{
return
EProcRc
::
STAY
;
}
m_logger
->
debug
(
"Sending %s with update cause [%s]"
,
nas
::
utils
::
EnumToString
(
updateCause
==
ERegUpdateCause
::
T3512_EXPIRY
?
nas
::
ERegistrationType
::
PERIODIC_REGISTRATION_UPDATING
...
...
src/ue/nas/mm/service.cpp
View file @
667b6c1f
...
...
@@ -91,6 +91,12 @@ EProcRc NasMm::sendServiceRequest(EServiceReqCause reqCause)
}
}
// Perform Unified Access Control
if
(
performUac
()
!=
EUacResult
::
ALLOWED
)
{
return
EProcRc
::
STAY
;
}
m_logger
->
debug
(
"Sending Service Request due to [%s]"
,
ToJson
(
reqCause
).
str
().
c_str
());
updateProvidedGuti
();
...
...
src/ue/nas/mm/transport.cpp
View file @
667b6c1f
...
...
@@ -107,7 +107,7 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg)
}
}
EProcRc
NasMm
::
deliverUlTransport
(
const
nas
::
UlNasTransport
&
msg
)
EProcRc
NasMm
::
deliverUlTransport
(
const
nas
::
UlNasTransport
&
msg
,
ENasTransportHint
hint
)
{
// 5.4.5.2.6 Abnormal cases in the UE
// "The UE shall not send the UL NAS TRANSPORT message when the UE is in non-allowed area or
...
...
@@ -130,6 +130,15 @@ EProcRc NasMm::deliverUlTransport(const nas::UlNasTransport &msg)
}
}
// Perform UAC for PDU session establishment and modification
if
(
hint
==
ENasTransportHint
::
PDU_SESSION_ESTABLISHMENT_REQUEST
||
hint
==
ENasTransportHint
::
PDU_SESSION_MODIFICATION_REQUEST
)
{
if
(
performUac
()
!=
EUacResult
::
ALLOWED
)
{
return
EProcRc
::
STAY
;
}
}
// Send the UL NAS Transport Message
auto
rc
=
sendNasMessage
(
msg
);
if
(
rc
!=
EProcRc
::
OK
)
...
...
src/ue/nas/sm/transport.cpp
View file @
667b6c1f
...
...
@@ -7,12 +7,56 @@
//
#include "sm.hpp"
#include <stdexcept>
#include <lib/nas/utils.hpp>
#include <ue/nas/mm/mm.hpp>
namespace
nr
::
ue
{
static
ENasTransportHint
MapMsgTypeToHint
(
nas
::
EMessageType
msgType
)
{
switch
(
msgType
)
{
case
nas
:
:
EMessageType
::
PDU_SESSION_ESTABLISHMENT_REQUEST
:
return
ENasTransportHint
::
PDU_SESSION_ESTABLISHMENT_REQUEST
;
case
nas
:
:
EMessageType
::
PDU_SESSION_ESTABLISHMENT_ACCEPT
:
return
ENasTransportHint
::
PDU_SESSION_ESTABLISHMENT_ACCEPT
;
case
nas
:
:
EMessageType
::
PDU_SESSION_ESTABLISHMENT_REJECT
:
return
ENasTransportHint
::
PDU_SESSION_ESTABLISHMENT_REJECT
;
case
nas
:
:
EMessageType
::
PDU_SESSION_AUTHENTICATION_COMMAND
:
return
ENasTransportHint
::
PDU_SESSION_AUTHENTICATION_COMMAND
;
case
nas
:
:
EMessageType
::
PDU_SESSION_AUTHENTICATION_COMPLETE
:
return
ENasTransportHint
::
PDU_SESSION_AUTHENTICATION_COMPLETE
;
case
nas
:
:
EMessageType
::
PDU_SESSION_AUTHENTICATION_RESULT
:
return
ENasTransportHint
::
PDU_SESSION_AUTHENTICATION_RESULT
;
case
nas
:
:
EMessageType
::
PDU_SESSION_MODIFICATION_REQUEST
:
return
ENasTransportHint
::
PDU_SESSION_MODIFICATION_REQUEST
;
case
nas
:
:
EMessageType
::
PDU_SESSION_MODIFICATION_REJECT
:
return
ENasTransportHint
::
PDU_SESSION_MODIFICATION_REJECT
;
case
nas
:
:
EMessageType
::
PDU_SESSION_MODIFICATION_COMMAND
:
return
ENasTransportHint
::
PDU_SESSION_MODIFICATION_COMMAND
;
case
nas
:
:
EMessageType
::
PDU_SESSION_MODIFICATION_COMPLETE
:
return
ENasTransportHint
::
PDU_SESSION_MODIFICATION_COMPLETE
;
case
nas
:
:
EMessageType
::
PDU_SESSION_MODIFICATION_COMMAND_REJECT
:
return
ENasTransportHint
::
PDU_SESSION_MODIFICATION_COMMAND_REJECT
;
case
nas
:
:
EMessageType
::
PDU_SESSION_RELEASE_REQUEST
:
return
ENasTransportHint
::
PDU_SESSION_RELEASE_REQUEST
;
case
nas
:
:
EMessageType
::
PDU_SESSION_RELEASE_REJECT
:
return
ENasTransportHint
::
PDU_SESSION_RELEASE_REJECT
;
case
nas
:
:
EMessageType
::
PDU_SESSION_RELEASE_COMMAND
:
return
ENasTransportHint
::
PDU_SESSION_RELEASE_COMMAND
;
case
nas
:
:
EMessageType
::
PDU_SESSION_RELEASE_COMPLETE
:
return
ENasTransportHint
::
PDU_SESSION_RELEASE_COMPLETE
;
case
nas
:
:
EMessageType
::
FIVEG_SM_STATUS
:
return
ENasTransportHint
::
FIVEG_SM_STATUS
;
default:
throw
std
::
runtime_error
(
"failure in MapMsgTypeToHint"
);
}
}
void
NasSm
::
sendSmMessage
(
int
psi
,
const
nas
::
SmMessage
&
msg
)
{
auto
&
session
=
m_pduSessions
[
psi
];
...
...
@@ -35,7 +79,7 @@ void NasSm::sendSmMessage(int psi, const nas::SmMessage &msg)
m
.
dnn
=
nas
::
utils
::
DnnFromApn
(
*
session
->
apn
);
}
m_mm
->
deliverUlTransport
(
m
);
m_mm
->
deliverUlTransport
(
m
,
MapMsgTypeToHint
(
msg
.
messageType
)
);
}
void
NasSm
::
receiveSmMessage
(
const
nas
::
SmMessage
&
msg
)
...
...
@@ -95,7 +139,7 @@ void NasSm::sendSmCause(const nas::ESmCause &cause, int pti, int psi)
ulTransport
.
pduSessionId
=
nas
::
IEPduSessionIdentity2
{};
ulTransport
.
pduSessionId
->
value
=
psi
;
m_mm
->
deliverUlTransport
(
ulTransport
);
m_mm
->
deliverUlTransport
(
ulTransport
,
ENasTransportHint
::
FIVEG_SM_STATUS
);
}
void
NasSm
::
receiveForwardingFailure
(
const
nas
::
SmMessage
&
msg
,
nas
::
EMmCause
cause
,
...
...
src/ue/types.hpp
View file @
667b6c1f
...
...
@@ -592,6 +592,30 @@ struct UacOutput
EUacResult
res
{};
};
enum
class
ENasTransportHint
{
PDU_SESSION_ESTABLISHMENT_REQUEST
,
PDU_SESSION_ESTABLISHMENT_ACCEPT
,
PDU_SESSION_ESTABLISHMENT_REJECT
,
PDU_SESSION_AUTHENTICATION_COMMAND
,
PDU_SESSION_AUTHENTICATION_COMPLETE
,
PDU_SESSION_AUTHENTICATION_RESULT
,
PDU_SESSION_MODIFICATION_REQUEST
,
PDU_SESSION_MODIFICATION_REJECT
,
PDU_SESSION_MODIFICATION_COMMAND
,
PDU_SESSION_MODIFICATION_COMPLETE
,
PDU_SESSION_MODIFICATION_COMMAND_REJECT
,
PDU_SESSION_RELEASE_REQUEST
,
PDU_SESSION_RELEASE_REJECT
,
PDU_SESSION_RELEASE_COMMAND
,
PDU_SESSION_RELEASE_COMPLETE
,
FIVEG_SM_STATUS
};
Json
ToJson
(
const
ECmState
&
state
);
Json
ToJson
(
const
ERmState
&
state
);
Json
ToJson
(
const
EMmState
&
state
);
...
...
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