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
33fd7fe9
Commit
33fd7fe9
authored
Dec 24, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance improvements
parent
83f7c740
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
23 deletions
+7
-23
src/ue/app/task.cpp
src/ue/app/task.cpp
+0
-4
src/ue/nts.hpp
src/ue/nts.hpp
+0
-4
src/ue/tun/task.cpp
src/ue/tun/task.cpp
+7
-15
No files found.
src/ue/app/task.cpp
View file @
33fd7fe9
...
@@ -62,10 +62,6 @@ void UeAppTask::onLoop()
...
@@ -62,10 +62,6 @@ void UeAppTask::onLoop()
m_base
->
nasTask
->
push
(
std
::
move
(
m
));
m_base
->
nasTask
->
push
(
std
::
move
(
m
));
break
;
break
;
}
}
case
NmUeTunToApp
:
:
TUN_ERROR
:
{
m_logger
->
err
(
"TUN failure [%s]"
,
w
.
error
.
c_str
());
break
;
}
}
}
break
;
break
;
}
}
...
...
src/ue/nts.hpp
View file @
33fd7fe9
...
@@ -45,16 +45,12 @@ struct NmUeTunToApp : NtsMessage
...
@@ -45,16 +45,12 @@ struct NmUeTunToApp : NtsMessage
enum
PR
enum
PR
{
{
DATA_PDU_DELIVERY
,
DATA_PDU_DELIVERY
,
TUN_ERROR
}
present
;
}
present
;
// DATA_PDU_DELIVERY
// DATA_PDU_DELIVERY
int
psi
{};
int
psi
{};
OctetString
data
{};
OctetString
data
{};
// TUN_ERROR
std
::
string
error
{};
explicit
NmUeTunToApp
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_TUN_TO_APP
),
present
(
present
)
explicit
NmUeTunToApp
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_TUN_TO_APP
),
present
(
present
)
{
{
}
}
...
...
src/ue/tun/task.cpp
View file @
33fd7fe9
...
@@ -7,10 +7,12 @@
...
@@ -7,10 +7,12 @@
//
//
#include "task.hpp"
#include "task.hpp"
#include <cstring>
#include <cstring>
#include <unistd.h>
#include <ue/app/task.hpp>
#include <ue/app/task.hpp>
#include <ue/nts.hpp>
#include <ue/nts.hpp>
#include <unistd.h>
#include <utils/libc_error.hpp>
#include <utils/libc_error.hpp>
#include <utils/scoped_thread.hpp>
#include <utils/scoped_thread.hpp>
...
@@ -35,13 +37,6 @@ static std::string GetErrorMessage(const std::string &cause)
...
@@ -35,13 +37,6 @@ static std::string GetErrorMessage(const std::string &cause)
return
what
;
return
what
;
}
}
static
std
::
unique_ptr
<
nr
::
ue
::
NmUeTunToApp
>
NmError
(
std
::
string
&&
error
)
{
auto
m
=
std
::
make_unique
<
nr
::
ue
::
NmUeTunToApp
>
(
nr
::
ue
::
NmUeTunToApp
::
TUN_ERROR
);
m
->
error
=
std
::
move
(
error
);
return
m
;
}
static
void
ReceiverThread
(
ReceiverArgs
*
args
)
static
void
ReceiverThread
(
ReceiverArgs
*
args
)
{
{
int
fd
=
args
->
fd
;
int
fd
=
args
->
fd
;
...
@@ -56,10 +51,7 @@ static void ReceiverThread(ReceiverArgs *args)
...
@@ -56,10 +51,7 @@ static void ReceiverThread(ReceiverArgs *args)
{
{
ssize_t
n
=
::
read
(
fd
,
buffer
,
RECEIVER_BUFFER_SIZE
);
ssize_t
n
=
::
read
(
fd
,
buffer
,
RECEIVER_BUFFER_SIZE
);
if
(
n
<
0
)
if
(
n
<
0
)
{
throw
std
::
runtime_error
(
GetErrorMessage
(
"TUN device could not read"
));
targetTask
->
push
(
NmError
(
GetErrorMessage
(
"TUN device could not read"
)));
return
;
// Abort receiver thread
}
if
(
n
>
0
)
if
(
n
>
0
)
{
{
...
@@ -106,9 +98,9 @@ void TunTask::onLoop()
...
@@ -106,9 +98,9 @@ void TunTask::onLoop()
auto
&
w
=
dynamic_cast
<
NmAppToTun
&>
(
*
msg
);
auto
&
w
=
dynamic_cast
<
NmAppToTun
&>
(
*
msg
);
ssize_t
res
=
::
write
(
m_fd
,
w
.
data
.
data
(),
w
.
data
.
length
());
ssize_t
res
=
::
write
(
m_fd
,
w
.
data
.
data
(),
w
.
data
.
length
());
if
(
res
<
0
)
if
(
res
<
0
)
push
(
NmError
(
GetErrorMessage
(
"TUN device could not write"
)
));
throw
std
::
runtime_error
(
GetErrorMessage
(
"TUN device could not write"
));
else
if
(
res
!=
w
.
data
.
length
())
if
(
res
!=
w
.
data
.
length
())
push
(
NmError
(
GetErrorMessage
(
"TUN device partially written"
)
));
throw
std
::
runtime_error
(
GetErrorMessage
(
"TUN device partially written"
));
break
;
break
;
}
}
default:
default:
...
...
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