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
ed946b11
Commit
ed946b11
authored
Feb 18, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NNSF refactor
parent
b797eb78
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
15 deletions
+39
-15
src/gnb/ngap/management.cpp
src/gnb/ngap/management.cpp
+6
-13
src/gnb/ngap/nas.cpp
src/gnb/ngap/nas.cpp
+1
-1
src/gnb/ngap/nnsf.cpp
src/gnb/ngap/nnsf.cpp
+28
-0
src/gnb/ngap/task.hpp
src/gnb/ngap/task.hpp
+4
-1
No files found.
src/gnb/ngap/management.cpp
View file @
ed946b11
...
...
@@ -40,13 +40,12 @@ void NgapTask::createUeContext(int ueId)
m_ueCtx
[
ctx
->
ctxId
]
=
ctx
;
// Select an AMF for the UE (if any)
for
(
auto
&
amf
:
m_amfCtx
)
{
// todo: an arbitrary AMF is selected for now
ctx
->
associatedAmfId
=
amf
.
second
->
ctxId
;
break
;
}
// Perform AMF selection
auto
*
amf
=
selectAmf
(
ueId
);
if
(
amf
==
nullptr
)
m_logger
->
err
(
"AMF selection for UE[%d] failed. Could not find a suitable AMF."
,
ueId
);
else
ctx
->
associatedAmfId
=
amf
->
ctxId
;
}
NgapUeContext
*
NgapTask
::
findUeContext
(
int
ctxId
)
...
...
@@ -134,12 +133,6 @@ NgapUeContext *NgapTask::findUeByNgapIdPair(int amfCtxId, const NgapIdPair &idPa
return
ue
;
}
NgapAmfContext
*
NgapTask
::
selectNewAmfForReAllocation
(
int
initiatedAmfId
,
int
amfSetId
)
{
// TODO an arbitrary AMF is selected for now
return
findAmfContext
(
initiatedAmfId
);
}
void
NgapTask
::
deleteUeContext
(
int
ueId
)
{
auto
*
ue
=
m_ueCtx
[
ueId
];
...
...
src/gnb/ngap/nas.cpp
View file @
ed946b11
...
...
@@ -174,7 +174,7 @@ void NgapTask::receiveRerouteNasRequest(int amfId, ASN_NGAP_RerouteNASRequest *m
}
}
auto
*
newAmf
=
selectNewAmfForReAllocation
(
amfId
,
asn
::
GetBitStringInt
<
10
>
(
ieAmfSetId
->
AMFSetID
));
auto
*
newAmf
=
selectNewAmfForReAllocation
(
ue
->
ctxId
,
amfId
,
asn
::
GetBitStringInt
<
10
>
(
ieAmfSetId
->
AMFSetID
));
if
(
newAmf
==
nullptr
)
{
m_logger
->
err
(
"AMF selection for re-allocation failed. Could not find a suitable AMF."
);
...
...
src/gnb/ngap/nnsf.cpp
0 → 100644
View file @
ed946b11
//
// This file is a part of UERANSIM open source project.
// Copyright (c) 2021 ALİ GÜNGÖR.
//
// The software and all associated files are licensed under GPL-3.0
// and subject to the terms and conditions defined in LICENSE file.
//
#include "task.hpp"
namespace
nr
::
gnb
{
NgapAmfContext
*
NgapTask
::
selectAmf
(
int
ueId
)
{
// todo:
for
(
auto
&
amf
:
m_amfCtx
)
return
amf
.
second
;
// return the first one
return
nullptr
;
}
NgapAmfContext
*
NgapTask
::
selectNewAmfForReAllocation
(
int
ueId
,
int
initiatedAmfId
,
int
amfSetId
)
{
// TODO an arbitrary AMF is selected for now
return
findAmfContext
(
initiatedAmfId
);
}
}
// namespace nr::gnb
src/gnb/ngap/task.hpp
View file @
ed946b11
...
...
@@ -69,7 +69,6 @@ class NgapTask : public NtsTask
NgapUeContext
*
findUeByRanId
(
long
ranUeNgapId
);
NgapUeContext
*
findUeByAmfId
(
long
amfUeNgapId
);
NgapUeContext
*
findUeByNgapIdPair
(
int
amfCtxId
,
const
NgapIdPair
&
idPair
);
NgapAmfContext
*
selectNewAmfForReAllocation
(
int
initiatedAmfId
,
int
amfSetId
);
void
deleteUeContext
(
int
ueId
);
void
deleteAmfContext
(
int
amfId
);
...
...
@@ -105,6 +104,10 @@ class NgapTask : public NtsTask
void
receiveInitialContextSetup
(
int
amfId
,
ASN_NGAP_InitialContextSetupRequest
*
msg
);
void
receiveContextRelease
(
int
amfId
,
ASN_NGAP_UEContextReleaseCommand
*
msg
);
void
receiveContextModification
(
int
amfId
,
ASN_NGAP_UEContextModificationRequest
*
msg
);
/* NAS Node Selection */
NgapAmfContext
*
selectAmf
(
int
ueId
);
NgapAmfContext
*
selectNewAmfForReAllocation
(
int
ueId
,
int
initiatedAmfId
,
int
amfSetId
);
};
}
// namespace nr::gnb
\ No newline at end of file
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