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
b44eeafd
Commit
b44eeafd
authored
Apr 04, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE SRA dev.
parent
505bc9cf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
3 deletions
+58
-3
src/gnb/sra/management.cpp
src/gnb/sra/management.cpp
+36
-0
src/gnb/sra/task.cpp
src/gnb/sra/task.cpp
+1
-1
src/gnb/sra/task.hpp
src/gnb/sra/task.hpp
+5
-0
src/gnb/sra/transport.cpp
src/gnb/sra/transport.cpp
+2
-0
src/gnb/types.hpp
src/gnb/types.hpp
+12
-0
src/utils/common.cpp
src/utils/common.cpp
+2
-2
No files found.
src/gnb/sra/management.cpp
0 → 100644
View file @
b44eeafd
//
// 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"
#include <utils/common.hpp>
namespace
nr
::
gnb
{
void
GnbSraTask
::
updateUeInfo
(
const
InetAddress
&
addr
,
uint64_t
sti
)
{
if
(
m_stiToUeId
.
count
(
sti
))
{
int
ueId
=
m_stiToUeId
[
sti
];
auto
&
ctx
=
m_ueCtx
[
ueId
];
ctx
->
addr
=
addr
;
}
else
{
int
ueId
=
utils
::
NextId
();
m_stiToUeId
[
sti
]
=
ueId
;
auto
ctx
=
std
::
make_unique
<
SraUeContext
>
(
ueId
);
ctx
->
sti
=
sti
;
ctx
->
addr
=
addr
;
m_ueCtx
[
ueId
]
=
std
::
move
(
ctx
);
m_logger
->
debug
(
"New UE signal detected, UE[%d]"
,
ueId
);
}
}
}
// namespace nr::gnb
src/gnb/sra/task.cpp
View file @
b44eeafd
...
...
@@ -17,7 +17,7 @@
namespace
nr
::
gnb
{
GnbSraTask
::
GnbSraTask
(
TaskBase
*
base
)
:
m_base
{
base
},
m_udpTask
{}
GnbSraTask
::
GnbSraTask
(
TaskBase
*
base
)
:
m_base
{
base
},
m_udpTask
{}
,
m_ueCtx
{},
m_stiToUeId
{}
{
m_logger
=
m_base
->
logBase
->
makeUniqueLogger
(
"sra"
);
m_sti
=
utils
::
Random64
();
...
...
src/gnb/sra/task.hpp
View file @
b44eeafd
...
...
@@ -31,6 +31,8 @@ class GnbSraTask : public NtsTask
udp
::
UdpServerTask
*
m_udpTask
;
uint64_t
m_sti
;
std
::
unordered_map
<
int
,
std
::
unique_ptr
<
SraUeContext
>>
m_ueCtx
;
std
::
unordered_map
<
uint64_t
,
int
>
m_stiToUeId
;
friend
class
GnbCmdHandler
;
...
...
@@ -49,6 +51,9 @@ class GnbSraTask : public NtsTask
private:
/* Handler */
void
handleCellInfoRequest
(
const
InetAddress
&
addr
,
const
sra
::
SraCellInfoRequest
&
msg
);
private:
/* UE Management */
void
updateUeInfo
(
const
InetAddress
&
addr
,
uint64_t
sti
);
};
}
// namespace nr::gnb
\ No newline at end of file
src/gnb/sra/transport.cpp
View file @
b44eeafd
...
...
@@ -13,6 +13,8 @@ namespace nr::gnb
void
GnbSraTask
::
receiveSraMessage
(
const
InetAddress
&
addr
,
const
sra
::
SraMessage
&
msg
)
{
updateUeInfo
(
addr
,
msg
.
sti
);
switch
(
msg
.
msgType
)
{
case
sra
:
:
EMessageType
::
CELL_INFO_REQUEST
:
...
...
src/gnb/types.hpp
View file @
b44eeafd
...
...
@@ -15,6 +15,7 @@
#include <string>
#include <utils/common_types.hpp>
#include <utils/logger.hpp>
#include <utils/network.hpp>
#include <utils/nts.hpp>
#include <utils/octet_string.hpp>
...
...
@@ -104,6 +105,17 @@ struct NgapAmfContext
std
::
vector
<
PlmnSupport
*>
plmnSupportList
{};
};
struct
SraUeContext
{
const
int
ueId
;
uint64_t
sti
{};
InetAddress
addr
{};
explicit
SraUeContext
(
int
ueId
)
:
ueId
(
ueId
)
{
}
};
struct
AggregateMaximumBitRate
{
uint64_t
dlAmbr
{};
...
...
src/utils/common.cpp
View file @
b44eeafd
...
...
@@ -26,7 +26,7 @@ static_assert(sizeof(float) == sizeof(uint32_t));
static_assert
(
sizeof
(
double
)
==
sizeof
(
uint64_t
));
static_assert
(
sizeof
(
long
long
)
==
sizeof
(
uint64_t
));
static
std
::
atomic
<
int
>
I
dCounter
=
1
;
static
std
::
atomic
<
int
>
g_i
dCounter
=
1
;
static
bool
IPv6FromString
(
const
char
*
szAddress
,
uint8_t
*
address
)
{
...
...
@@ -135,7 +135,7 @@ std::vector<uint8_t> utils::HexStringToVector(const std::string &hex)
int
utils
::
NextId
()
{
int
res
=
++
I
dCounter
;
int
res
=
++
g_i
dCounter
;
if
(
res
==
0
)
{
// ID counter overflows.
...
...
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