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
0b5cad7a
Commit
0b5cad7a
authored
Apr 04, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE SRA dev.
parent
2ab318fe
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
117 additions
and
117 deletions
+117
-117
src/gnb/gnb.cpp
src/gnb/gnb.cpp
+5
-5
src/gnb/sra/handler.cpp
src/gnb/sra/handler.cpp
+3
-3
src/gnb/sra/task.cpp
src/gnb/sra/task.cpp
+10
-10
src/gnb/sra/task.hpp
src/gnb/sra/task.hpp
+7
-7
src/gnb/sra/transport.cpp
src/gnb/sra/transport.cpp
+6
-6
src/gnb/types.hpp
src/gnb/types.hpp
+2
-2
src/ue/app/cmd_handler.cpp
src/ue/app/cmd_handler.cpp
+2
-2
src/ue/nts.hpp
src/ue/nts.hpp
+4
-4
src/ue/rrc/task.cpp
src/ue/rrc/task.cpp
+8
-8
src/ue/sra/connection.cpp
src/ue/sra/connection.cpp
+2
-2
src/ue/sra/measurement.cpp
src/ue/sra/measurement.cpp
+7
-7
src/ue/sra/task.cpp
src/ue/sra/task.cpp
+13
-13
src/ue/sra/task.hpp
src/ue/sra/task.hpp
+7
-7
src/ue/sra/transport.cpp
src/ue/sra/transport.cpp
+6
-6
src/ue/types.hpp
src/ue/types.hpp
+2
-2
src/ue/ue.cpp
src/ue/ue.cpp
+5
-5
src/urs/sra_pdu.cpp
src/urs/sra_pdu.cpp
+14
-14
src/urs/sra_pdu.hpp
src/urs/sra_pdu.hpp
+12
-12
src/utils/nts.hpp
src/utils/nts.hpp
+2
-2
No files found.
src/gnb/gnb.cpp
View file @
0b5cad7a
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#include "mr/task.hpp"
#include "mr/task.hpp"
#include "ngap/task.hpp"
#include "ngap/task.hpp"
#include "rrc/task.hpp"
#include "rrc/task.hpp"
#include "s
as
/task.hpp"
#include "s
ra
/task.hpp"
#include "sctp/task.hpp"
#include "sctp/task.hpp"
#include <app/cli_base.hpp>
#include <app/cli_base.hpp>
...
@@ -35,7 +35,7 @@ GNodeB::GNodeB(GnbConfig *config, app::INodeListener *nodeListener, NtsTask *cli
...
@@ -35,7 +35,7 @@ GNodeB::GNodeB(GnbConfig *config, app::INodeListener *nodeListener, NtsTask *cli
base
->
rrcTask
=
new
GnbRrcTask
(
base
);
base
->
rrcTask
=
new
GnbRrcTask
(
base
);
base
->
gtpTask
=
new
GtpTask
(
base
);
base
->
gtpTask
=
new
GtpTask
(
base
);
base
->
mrTask
=
new
GnbMrTask
(
base
);
base
->
mrTask
=
new
GnbMrTask
(
base
);
base
->
s
asTask
=
new
GnbSas
Task
(
base
);
base
->
s
raTask
=
new
GnbSra
Task
(
base
);
taskBase
=
base
;
taskBase
=
base
;
}
}
...
@@ -48,7 +48,7 @@ GNodeB::~GNodeB()
...
@@ -48,7 +48,7 @@ GNodeB::~GNodeB()
taskBase
->
rrcTask
->
quit
();
taskBase
->
rrcTask
->
quit
();
taskBase
->
gtpTask
->
quit
();
taskBase
->
gtpTask
->
quit
();
taskBase
->
mrTask
->
quit
();
taskBase
->
mrTask
->
quit
();
taskBase
->
s
as
Task
->
quit
();
taskBase
->
s
ra
Task
->
quit
();
delete
taskBase
->
appTask
;
delete
taskBase
->
appTask
;
delete
taskBase
->
sctpTask
;
delete
taskBase
->
sctpTask
;
...
@@ -56,7 +56,7 @@ GNodeB::~GNodeB()
...
@@ -56,7 +56,7 @@ GNodeB::~GNodeB()
delete
taskBase
->
rrcTask
;
delete
taskBase
->
rrcTask
;
delete
taskBase
->
gtpTask
;
delete
taskBase
->
gtpTask
;
delete
taskBase
->
mrTask
;
delete
taskBase
->
mrTask
;
delete
taskBase
->
s
as
Task
;
delete
taskBase
->
s
ra
Task
;
delete
taskBase
->
logBase
;
delete
taskBase
->
logBase
;
...
@@ -69,7 +69,7 @@ void GNodeB::start()
...
@@ -69,7 +69,7 @@ void GNodeB::start()
taskBase
->
sctpTask
->
start
();
taskBase
->
sctpTask
->
start
();
taskBase
->
ngapTask
->
start
();
taskBase
->
ngapTask
->
start
();
taskBase
->
rrcTask
->
start
();
taskBase
->
rrcTask
->
start
();
taskBase
->
s
as
Task
->
start
();
taskBase
->
s
ra
Task
->
start
();
taskBase
->
mrTask
->
start
();
taskBase
->
mrTask
->
start
();
taskBase
->
gtpTask
->
start
();
taskBase
->
gtpTask
->
start
();
}
}
...
...
src/gnb/s
as
/handler.cpp
→
src/gnb/s
ra
/handler.cpp
View file @
0b5cad7a
...
@@ -26,7 +26,7 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
...
@@ -26,7 +26,7 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
namespace
nr
::
gnb
namespace
nr
::
gnb
{
{
void
GnbS
asTask
::
handleCellInfoRequest
(
const
InetAddress
&
addr
,
const
sas
::
Sas
CellInfoRequest
&
msg
)
void
GnbS
raTask
::
handleCellInfoRequest
(
const
InetAddress
&
addr
,
const
sra
::
Sra
CellInfoRequest
&
msg
)
{
{
int
dbm
=
EstimateSimulatedDbm
(
m_base
->
config
->
phyLocation
,
msg
.
simPos
);
int
dbm
=
EstimateSimulatedDbm
(
m_base
->
config
->
phyLocation
,
msg
.
simPos
);
if
(
dbm
<
MIN_ALLOWED_DBM
)
if
(
dbm
<
MIN_ALLOWED_DBM
)
...
@@ -35,7 +35,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe
...
@@ -35,7 +35,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe
return
;
return
;
}
}
s
as
::
Sas
CellInfoResponse
resp
{};
s
ra
::
Sra
CellInfoResponse
resp
{};
resp
.
cellId
.
nci
=
m_base
->
config
->
nci
;
resp
.
cellId
.
nci
=
m_base
->
config
->
nci
;
resp
.
cellId
.
plmn
=
m_base
->
config
->
plmn
;
resp
.
cellId
.
plmn
=
m_base
->
config
->
plmn
;
resp
.
tac
=
m_base
->
config
->
tac
;
resp
.
tac
=
m_base
->
config
->
tac
;
...
@@ -43,7 +43,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe
...
@@ -43,7 +43,7 @@ void GnbSasTask::handleCellInfoRequest(const InetAddress &addr, const sas::SasCe
resp
.
gnbName
=
m_base
->
config
->
name
;
resp
.
gnbName
=
m_base
->
config
->
name
;
resp
.
linkIp
=
m_base
->
config
->
portalIp
;
resp
.
linkIp
=
m_base
->
config
->
portalIp
;
sendS
as
Message
(
addr
,
resp
);
sendS
ra
Message
(
addr
,
resp
);
}
}
}
// namespace nr::gnb
}
// namespace nr::gnb
src/gnb/s
as
/task.cpp
→
src/gnb/s
ra
/task.cpp
View file @
0b5cad7a
...
@@ -16,12 +16,12 @@
...
@@ -16,12 +16,12 @@
namespace
nr
::
gnb
namespace
nr
::
gnb
{
{
GnbS
asTask
::
GnbSas
Task
(
TaskBase
*
base
)
:
m_base
{
base
},
m_udpTask
{}
GnbS
raTask
::
GnbSra
Task
(
TaskBase
*
base
)
:
m_base
{
base
},
m_udpTask
{}
{
{
m_logger
=
m_base
->
logBase
->
makeUniqueLogger
(
"s
as
"
);
m_logger
=
m_base
->
logBase
->
makeUniqueLogger
(
"s
ra
"
);
}
}
void
GnbS
as
Task
::
onStart
()
void
GnbS
ra
Task
::
onStart
()
{
{
try
try
{
{
...
@@ -30,13 +30,13 @@ void GnbSasTask::onStart()
...
@@ -30,13 +30,13 @@ void GnbSasTask::onStart()
}
}
catch
(
const
LibError
&
e
)
catch
(
const
LibError
&
e
)
{
{
m_logger
->
err
(
"S
AS
failure [%s]"
,
e
.
what
());
m_logger
->
err
(
"S
RA
failure [%s]"
,
e
.
what
());
quit
();
quit
();
return
;
return
;
}
}
}
}
void
GnbS
as
Task
::
onLoop
()
void
GnbS
ra
Task
::
onLoop
()
{
{
NtsMessage
*
msg
=
take
();
NtsMessage
*
msg
=
take
();
if
(
!
msg
)
if
(
!
msg
)
...
@@ -46,13 +46,13 @@ void GnbSasTask::onLoop()
...
@@ -46,13 +46,13 @@ void GnbSasTask::onLoop()
{
{
case
NtsMessageType
:
:
UDP_SERVER_RECEIVE
:
{
case
NtsMessageType
:
:
UDP_SERVER_RECEIVE
:
{
auto
*
w
=
dynamic_cast
<
udp
::
NwUdpServerReceive
*>
(
msg
);
auto
*
w
=
dynamic_cast
<
udp
::
NwUdpServerReceive
*>
(
msg
);
auto
s
asMsg
=
sas
::
DecodeSas
Message
(
OctetView
{
w
->
packet
});
auto
s
raMsg
=
sra
::
DecodeSra
Message
(
OctetView
{
w
->
packet
});
if
(
s
as
Msg
==
nullptr
)
if
(
s
ra
Msg
==
nullptr
)
{
{
m_logger
->
err
(
"Unable to decode S
AS
message"
);
m_logger
->
err
(
"Unable to decode S
RA
message"
);
break
;
break
;
}
}
receiveS
asMessage
(
w
->
fromAddress
,
*
sas
Msg
);
receiveS
raMessage
(
w
->
fromAddress
,
*
sra
Msg
);
break
;
break
;
}
}
default:
default:
...
@@ -63,7 +63,7 @@ void GnbSasTask::onLoop()
...
@@ -63,7 +63,7 @@ void GnbSasTask::onLoop()
delete
msg
;
delete
msg
;
}
}
void
GnbS
as
Task
::
onQuit
()
void
GnbS
ra
Task
::
onQuit
()
{
{
if
(
m_udpTask
!=
nullptr
)
if
(
m_udpTask
!=
nullptr
)
m_udpTask
->
quit
();
m_udpTask
->
quit
();
...
...
src/gnb/s
as
/task.hpp
→
src/gnb/s
ra
/task.hpp
View file @
0b5cad7a
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include <udp/server_task.hpp>
#include <udp/server_task.hpp>
#include <unordered_map>
#include <unordered_map>
#include <urs/rls/gnb_entity.hpp>
#include <urs/rls/gnb_entity.hpp>
#include <urs/s
as
_pdu.hpp>
#include <urs/s
ra
_pdu.hpp>
#include <utils/logger.hpp>
#include <utils/logger.hpp>
#include <utils/nts.hpp>
#include <utils/nts.hpp>
#include <vector>
#include <vector>
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
namespace
nr
::
gnb
namespace
nr
::
gnb
{
{
class
GnbS
as
Task
:
public
NtsTask
class
GnbS
ra
Task
:
public
NtsTask
{
{
private:
private:
TaskBase
*
m_base
;
TaskBase
*
m_base
;
...
@@ -33,8 +33,8 @@ class GnbSasTask : public NtsTask
...
@@ -33,8 +33,8 @@ class GnbSasTask : public NtsTask
friend
class
GnbCmdHandler
;
friend
class
GnbCmdHandler
;
public:
public:
explicit
GnbS
as
Task
(
TaskBase
*
base
);
explicit
GnbS
ra
Task
(
TaskBase
*
base
);
~
GnbS
as
Task
()
override
=
default
;
~
GnbS
ra
Task
()
override
=
default
;
protected:
protected:
void
onStart
()
override
;
void
onStart
()
override
;
...
@@ -42,11 +42,11 @@ class GnbSasTask : public NtsTask
...
@@ -42,11 +42,11 @@ class GnbSasTask : public NtsTask
void
onQuit
()
override
;
void
onQuit
()
override
;
private:
/* Transport */
private:
/* Transport */
void
receiveS
asMessage
(
const
InetAddress
&
addr
,
const
sas
::
Sas
Message
&
msg
);
void
receiveS
raMessage
(
const
InetAddress
&
addr
,
const
sra
::
Sra
Message
&
msg
);
void
sendS
asMessage
(
const
InetAddress
&
addr
,
const
sas
::
Sas
Message
&
msg
);
void
sendS
raMessage
(
const
InetAddress
&
addr
,
const
sra
::
Sra
Message
&
msg
);
private:
/* Handler */
private:
/* Handler */
void
handleCellInfoRequest
(
const
InetAddress
&
addr
,
const
s
as
::
Sas
CellInfoRequest
&
msg
);
void
handleCellInfoRequest
(
const
InetAddress
&
addr
,
const
s
ra
::
Sra
CellInfoRequest
&
msg
);
};
};
}
// namespace nr::gnb
}
// namespace nr::gnb
\ No newline at end of file
src/gnb/s
as
/transport.cpp
→
src/gnb/s
ra
/transport.cpp
View file @
0b5cad7a
...
@@ -11,23 +11,23 @@
...
@@ -11,23 +11,23 @@
namespace
nr
::
gnb
namespace
nr
::
gnb
{
{
void
GnbS
asTask
::
receiveSasMessage
(
const
InetAddress
&
addr
,
const
sas
::
Sas
Message
&
msg
)
void
GnbS
raTask
::
receiveSraMessage
(
const
InetAddress
&
addr
,
const
sra
::
Sra
Message
&
msg
)
{
{
switch
(
msg
.
msgType
)
switch
(
msg
.
msgType
)
{
{
case
s
as
:
:
Sas
MessageType
::
CELL_INFO_REQUEST
:
case
s
ra
:
:
Sra
MessageType
::
CELL_INFO_REQUEST
:
handleCellInfoRequest
(
addr
,
(
const
s
as
::
Sas
CellInfoRequest
&
)
msg
);
handleCellInfoRequest
(
addr
,
(
const
s
ra
::
Sra
CellInfoRequest
&
)
msg
);
break
;
break
;
default:
default:
m_logger
->
err
(
"Unhandled S
AS
message received with type[%d]"
,
static_cast
<
int
>
(
msg
.
msgType
));
m_logger
->
err
(
"Unhandled S
RA
message received with type[%d]"
,
static_cast
<
int
>
(
msg
.
msgType
));
break
;
break
;
}
}
}
}
void
GnbS
asTask
::
sendSasMessage
(
const
InetAddress
&
addr
,
const
sas
::
Sas
Message
&
msg
)
void
GnbS
raTask
::
sendSraMessage
(
const
InetAddress
&
addr
,
const
sra
::
Sra
Message
&
msg
)
{
{
OctetString
stream
{};
OctetString
stream
{};
s
as
::
EncodeSas
Message
(
msg
,
stream
);
s
ra
::
EncodeSra
Message
(
msg
,
stream
);
m_udpTask
->
send
(
addr
,
stream
);
m_udpTask
->
send
(
addr
,
stream
);
}
}
...
...
src/gnb/types.hpp
View file @
0b5cad7a
...
@@ -26,7 +26,7 @@ class GtpTask;
...
@@ -26,7 +26,7 @@ class GtpTask;
class
GnbMrTask
;
class
GnbMrTask
;
class
NgapTask
;
class
NgapTask
;
class
GnbRrcTask
;
class
GnbRrcTask
;
class
GnbS
as
Task
;
class
GnbS
ra
Task
;
class
SctpTask
;
class
SctpTask
;
enum
class
EAmfState
enum
class
EAmfState
...
@@ -326,7 +326,7 @@ struct TaskBase
...
@@ -326,7 +326,7 @@ struct TaskBase
NgapTask
*
ngapTask
{};
NgapTask
*
ngapTask
{};
GnbRrcTask
*
rrcTask
{};
GnbRrcTask
*
rrcTask
{};
SctpTask
*
sctpTask
{};
SctpTask
*
sctpTask
{};
GnbS
asTask
*
sas
Task
{};
GnbS
raTask
*
sra
Task
{};
};
};
struct
MrUeContext
struct
MrUeContext
...
...
src/ue/app/cmd_handler.cpp
View file @
0b5cad7a
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#include <ue/mr/task.hpp>
#include <ue/mr/task.hpp>
#include <ue/nas/task.hpp>
#include <ue/nas/task.hpp>
#include <ue/rrc/task.hpp>
#include <ue/rrc/task.hpp>
#include <ue/s
as
/task.hpp>
#include <ue/s
ra
/task.hpp>
#include <ue/tun/task.hpp>
#include <ue/tun/task.hpp>
#include <utils/common.hpp>
#include <utils/common.hpp>
#include <utils/printer.hpp>
#include <utils/printer.hpp>
...
@@ -163,7 +163,7 @@ void UeCmdHandler::handleCmdImpl(NwUeCliCommand &msg)
...
@@ -163,7 +163,7 @@ void UeCmdHandler::handleCmdImpl(NwUeCliCommand &msg)
break
;
break
;
}
}
case
app
:
:
UeCliCommand
::
COVERAGE
:
{
case
app
:
:
UeCliCommand
::
COVERAGE
:
{
auto
&
map
=
m_base
->
s
as
Task
->
m_activeMeasurements
;
auto
&
map
=
m_base
->
s
ra
Task
->
m_activeMeasurements
;
if
(
map
.
empty
())
if
(
map
.
empty
())
{
{
sendResult
(
msg
.
address
,
"No cell exists in the range"
);
sendResult
(
msg
.
address
,
"No cell exists in the range"
);
...
...
src/ue/nts.hpp
View file @
0b5cad7a
...
@@ -218,7 +218,7 @@ struct NwUeRrcToMr : NtsMessage
...
@@ -218,7 +218,7 @@ struct NwUeRrcToMr : NtsMessage
}
}
};
};
struct
NwUeRrcToS
as
:
NtsMessage
struct
NwUeRrcToS
ra
:
NtsMessage
{
{
enum
PR
enum
PR
{
{
...
@@ -230,12 +230,12 @@ struct NwUeRrcToSas : NtsMessage
...
@@ -230,12 +230,12 @@ struct NwUeRrcToSas : NtsMessage
GlobalNci
cellId
{};
GlobalNci
cellId
{};
bool
isSuitableCell
{};
// otherwise 'acceptable'
bool
isSuitableCell
{};
// otherwise 'acceptable'
explicit
NwUeRrcToS
as
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_RRC_TO_SAS
),
present
(
present
)
explicit
NwUeRrcToS
ra
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_RRC_TO_SRA
),
present
(
present
)
{
{
}
}
};
};
struct
NwUeS
as
ToRrc
:
NtsMessage
struct
NwUeS
ra
ToRrc
:
NtsMessage
{
{
enum
PR
enum
PR
{
{
...
@@ -249,7 +249,7 @@ struct NwUeSasToRrc : NtsMessage
...
@@ -249,7 +249,7 @@ struct NwUeSasToRrc : NtsMessage
// SERVING_CELL_CHANGE
// SERVING_CELL_CHANGE
UeCellInfo
servingCell
{};
UeCellInfo
servingCell
{};
explicit
NwUeS
asToRrc
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_SAS
_TO_RRC
),
present
(
present
)
explicit
NwUeS
raToRrc
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_SRA
_TO_RRC
),
present
(
present
)
{
{
}
}
};
};
...
...
src/ue/rrc/task.cpp
View file @
0b5cad7a
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include <ue/app/task.hpp>
#include <ue/app/task.hpp>
#include <ue/mr/task.hpp>
#include <ue/mr/task.hpp>
#include <ue/nas/task.hpp>
#include <ue/nas/task.hpp>
#include <ue/s
as
/task.hpp>
#include <ue/s
ra
/task.hpp>
#include <utils/common.hpp>
#include <utils/common.hpp>
namespace
nr
::
ue
namespace
nr
::
ue
...
@@ -65,7 +65,7 @@ void UeRrcTask::onLoop()
...
@@ -65,7 +65,7 @@ void UeRrcTask::onLoop()
switch
(
w
->
present
)
switch
(
w
->
present
)
{
{
case
NwUeNasToRrc
:
:
PLMN_SEARCH_REQUEST
:
{
case
NwUeNasToRrc
:
:
PLMN_SEARCH_REQUEST
:
{
m_base
->
s
asTask
->
push
(
new
NwUeRrcToSas
(
NwUeRrcToSas
::
PLMN_SEARCH_REQUEST
));
m_base
->
s
raTask
->
push
(
new
NwUeRrcToSra
(
NwUeRrcToSra
::
PLMN_SEARCH_REQUEST
));
break
;
break
;
}
}
case
NwUeNasToRrc
:
:
INITIAL_NAS_DELIVERY
:
{
case
NwUeNasToRrc
:
:
INITIAL_NAS_DELIVERY
:
{
...
@@ -87,26 +87,26 @@ void UeRrcTask::onLoop()
...
@@ -87,26 +87,26 @@ void UeRrcTask::onLoop()
break
;
break
;
}
}
case
NwUeNasToRrc
:
:
CELL_SELECTION_COMMAND
:
{
case
NwUeNasToRrc
:
:
CELL_SELECTION_COMMAND
:
{
auto
*
wr
=
new
NwUeRrcToS
as
(
NwUeRrcToSas
::
CELL_SELECTION_COMMAND
);
auto
*
wr
=
new
NwUeRrcToS
ra
(
NwUeRrcToSra
::
CELL_SELECTION_COMMAND
);
wr
->
cellId
=
w
->
cellId
;
wr
->
cellId
=
w
->
cellId
;
wr
->
isSuitableCell
=
w
->
isSuitableCell
;
wr
->
isSuitableCell
=
w
->
isSuitableCell
;
m_base
->
s
as
Task
->
push
(
wr
);
m_base
->
s
ra
Task
->
push
(
wr
);
break
;
break
;
}
}
}
}
break
;
break
;
}
}
case
NtsMessageType
:
:
UE_S
AS
_TO_RRC
:
{
case
NtsMessageType
:
:
UE_S
RA
_TO_RRC
:
{
auto
*
w
=
dynamic_cast
<
NwUeS
as
ToRrc
*>
(
msg
);
auto
*
w
=
dynamic_cast
<
NwUeS
ra
ToRrc
*>
(
msg
);
switch
(
w
->
present
)
switch
(
w
->
present
)
{
{
case
NwUeS
as
ToRrc
:
:
PLMN_SEARCH_RESPONSE
:
{
case
NwUeS
ra
ToRrc
:
:
PLMN_SEARCH_RESPONSE
:
{
auto
*
wr
=
new
NwUeRrcToNas
(
NwUeRrcToNas
::
PLMN_SEARCH_RESPONSE
);
auto
*
wr
=
new
NwUeRrcToNas
(
NwUeRrcToNas
::
PLMN_SEARCH_RESPONSE
);
wr
->
measurements
=
std
::
move
(
w
->
measurements
);
wr
->
measurements
=
std
::
move
(
w
->
measurements
);
m_base
->
nasTask
->
push
(
wr
);
m_base
->
nasTask
->
push
(
wr
);
break
;
break
;
}
}
case
NwUeS
as
ToRrc
:
:
SERVING_CELL_CHANGE
:
{
case
NwUeS
ra
ToRrc
:
:
SERVING_CELL_CHANGE
:
{
auto
*
wr
=
new
NwUeRrcToNas
(
NwUeRrcToNas
::
SERVING_CELL_CHANGE
);
auto
*
wr
=
new
NwUeRrcToNas
(
NwUeRrcToNas
::
SERVING_CELL_CHANGE
);
wr
->
servingCell
=
w
->
servingCell
;
wr
->
servingCell
=
w
->
servingCell
;
m_base
->
nasTask
->
push
(
wr
);
m_base
->
nasTask
->
push
(
wr
);
...
...
src/ue/s
as
/connection.cpp
→
src/ue/s
ra
/connection.cpp
View file @
0b5cad7a
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
namespace
nr
::
ue
namespace
nr
::
ue
{
{
void
UeS
as
Task
::
handleCellSelectionCommand
(
const
GlobalNci
&
cellId
,
bool
isSuitable
)
void
UeS
ra
Task
::
handleCellSelectionCommand
(
const
GlobalNci
&
cellId
,
bool
isSuitable
)
{
{
if
(
!
m_activeMeasurements
.
count
(
cellId
))
if
(
!
m_activeMeasurements
.
count
(
cellId
))
{
{
...
@@ -31,7 +31,7 @@ void UeSasTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuita
...
@@ -31,7 +31,7 @@ void UeSasTask::handleCellSelectionCommand(const GlobalNci &cellId, bool isSuita
m_servingCell
->
linkIp
=
measurement
.
linkIp
;
m_servingCell
->
linkIp
=
measurement
.
linkIp
;
m_servingCell
->
cellCategory
=
isSuitable
?
ECellCategory
::
SUITABLE_CELL
:
ECellCategory
::
ACCEPTABLE_CELL
;
m_servingCell
->
cellCategory
=
isSuitable
?
ECellCategory
::
SUITABLE_CELL
:
ECellCategory
::
ACCEPTABLE_CELL
;
auto
*
w
=
new
NwUeS
asToRrc
(
NwUeSas
ToRrc
::
SERVING_CELL_CHANGE
);
auto
*
w
=
new
NwUeS
raToRrc
(
NwUeSra
ToRrc
::
SERVING_CELL_CHANGE
);
w
->
servingCell
=
*
m_servingCell
;
w
->
servingCell
=
*
m_servingCell
;
m_base
->
rrcTask
->
push
(
w
);
m_base
->
rrcTask
->
push
(
w
);
}
}
...
...
src/ue/s
as
/measurement.cpp
→
src/ue/s
ra
/measurement.cpp
View file @
0b5cad7a
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
namespace
nr
::
ue
namespace
nr
::
ue
{
{
void
UeS
as
Task
::
onMeasurement
()
void
UeS
ra
Task
::
onMeasurement
()
{
{
std
::
vector
<
GlobalNci
>
entered
{};
std
::
vector
<
GlobalNci
>
entered
{};
std
::
vector
<
GlobalNci
>
exited
{};
std
::
vector
<
GlobalNci
>
exited
{};
...
@@ -41,12 +41,12 @@ void UeSasTask::onMeasurement()
...
@@ -41,12 +41,12 @@ void UeSasTask::onMeasurement()
// Issue another cell info request for each address in the search space
// Issue another cell info request for each address in the search space
for
(
auto
&
ip
:
m_cellSearchSpace
)
for
(
auto
&
ip
:
m_cellSearchSpace
)
{
{
s
as
::
Sas
CellInfoRequest
req
{};
s
ra
::
Sra
CellInfoRequest
req
{};
sendS
as
Message
(
ip
,
req
);
sendS
ra
Message
(
ip
,
req
);
}
}
}
}
void
UeS
asTask
::
receiveCellInfoResponse
(
const
sas
::
Sas
CellInfoResponse
&
msg
)
void
UeS
raTask
::
receiveCellInfoResponse
(
const
sra
::
Sra
CellInfoResponse
&
msg
)
{
{
UeCellMeasurement
meas
{};
UeCellMeasurement
meas
{};
meas
.
cellId
=
msg
.
cellId
;
meas
.
cellId
=
msg
.
cellId
;
...
@@ -58,19 +58,19 @@ void UeSasTask::receiveCellInfoResponse(const sas::SasCellInfoResponse &msg)
...
@@ -58,19 +58,19 @@ void UeSasTask::receiveCellInfoResponse(const sas::SasCellInfoResponse &msg)
m_pendingMeasurements
[
meas
.
cellId
]
=
meas
;
m_pendingMeasurements
[
meas
.
cellId
]
=
meas
;
}
}
void
UeS
as
Task
::
onCoverageChange
(
const
std
::
vector
<
GlobalNci
>
&
entered
,
const
std
::
vector
<
GlobalNci
>
&
exited
)
void
UeS
ra
Task
::
onCoverageChange
(
const
std
::
vector
<
GlobalNci
>
&
entered
,
const
std
::
vector
<
GlobalNci
>
&
exited
)
{
{
m_logger
->
debug
(
"Coverage change detected. [%d] cell entered, [%d] cell exited"
,
static_cast
<
int
>
(
entered
.
size
()),
m_logger
->
debug
(
"Coverage change detected. [%d] cell entered, [%d] cell exited"
,
static_cast
<
int
>
(
entered
.
size
()),
static_cast
<
int
>
(
exited
.
size
()));
static_cast
<
int
>
(
exited
.
size
()));
}
}
void
UeS
as
Task
::
plmnSearchRequested
()
void
UeS
ra
Task
::
plmnSearchRequested
()
{
{
std
::
vector
<
UeCellMeasurement
>
measurements
{};
std
::
vector
<
UeCellMeasurement
>
measurements
{};
for
(
auto
&
m
:
m_activeMeasurements
)
for
(
auto
&
m
:
m_activeMeasurements
)
measurements
.
push_back
(
m
.
second
);
measurements
.
push_back
(
m
.
second
);
auto
*
w
=
new
NwUeS
asToRrc
(
NwUeSas
ToRrc
::
PLMN_SEARCH_RESPONSE
);
auto
*
w
=
new
NwUeS
raToRrc
(
NwUeSra
ToRrc
::
PLMN_SEARCH_RESPONSE
);
w
->
measurements
=
std
::
move
(
measurements
);
w
->
measurements
=
std
::
move
(
measurements
);
m_base
->
rrcTask
->
push
(
w
);
m_base
->
rrcTask
->
push
(
w
);
}
}
...
...
src/ue/s
as
/task.cpp
→
src/ue/s
ra
/task.cpp
View file @
0b5cad7a
...
@@ -16,16 +16,16 @@ static const int TIMER_PERIOD_MEASUREMENT = 2000;
...
@@ -16,16 +16,16 @@ static const int TIMER_PERIOD_MEASUREMENT = 2000;
namespace
nr
::
ue
namespace
nr
::
ue
{
{
UeS
asTask
::
UeSas
Task
(
TaskBase
*
base
)
UeS
raTask
::
UeSra
Task
(
TaskBase
*
base
)
:
m_base
{
base
},
m_udpTask
{},
m_cellSearchSpace
{},
m_pendingMeasurements
{},
m_activeMeasurements
{},
m_servingCell
{}
:
m_base
{
base
},
m_udpTask
{},
m_cellSearchSpace
{},
m_pendingMeasurements
{},
m_activeMeasurements
{},
m_servingCell
{}
{
{
m_logger
=
m_base
->
logBase
->
makeUniqueLogger
(
m_base
->
config
->
getLoggerPrefix
()
+
"s
as
"
);
m_logger
=
m_base
->
logBase
->
makeUniqueLogger
(
m_base
->
config
->
getLoggerPrefix
()
+
"s
ra
"
);
for
(
auto
&
addr
:
m_base
->
config
->
gnbSearchList
)
for
(
auto
&
addr
:
m_base
->
config
->
gnbSearchList
)
m_cellSearchSpace
.
emplace_back
(
addr
,
cons
::
PortalPort
);
m_cellSearchSpace
.
emplace_back
(
addr
,
cons
::
PortalPort
);
}
}
void
UeS
as
Task
::
onStart
()
void
UeS
ra
Task
::
onStart
()
{
{
m_udpTask
=
new
udp
::
UdpServerTask
(
this
);
m_udpTask
=
new
udp
::
UdpServerTask
(
this
);
...
@@ -39,7 +39,7 @@ void UeSasTask::onStart()
...
@@ -39,7 +39,7 @@ void UeSasTask::onStart()
onMeasurement
();
onMeasurement
();
}
}
void
UeS
as
Task
::
onLoop
()
void
UeS
ra
Task
::
onLoop
()
{
{
NtsMessage
*
msg
=
take
();
NtsMessage
*
msg
=
take
();
if
(
!
msg
)
if
(
!
msg
)
...
@@ -47,11 +47,11 @@ void UeSasTask::onLoop()
...
@@ -47,11 +47,11 @@ void UeSasTask::onLoop()
switch
(
msg
->
msgType
)
switch
(
msg
->
msgType
)
{
{
case
NtsMessageType
:
:
UE_RRC_TO_S
AS
:
{
case
NtsMessageType
:
:
UE_RRC_TO_S
RA
:
{
auto
*
w
=
dynamic_cast
<
NwUeRrcToS
as
*>
(
msg
);
auto
*
w
=
dynamic_cast
<
NwUeRrcToS
ra
*>
(
msg
);
if
(
w
->
present
==
NwUeRrcToS
as
::
PLMN_SEARCH_REQUEST
)
if
(
w
->
present
==
NwUeRrcToS
ra
::
PLMN_SEARCH_REQUEST
)
plmnSearchRequested
();
plmnSearchRequested
();
else
if
(
w
->
present
==
NwUeRrcToS
as
::
CELL_SELECTION_COMMAND
)
else
if
(
w
->
present
==
NwUeRrcToS
ra
::
CELL_SELECTION_COMMAND
)
handleCellSelectionCommand
(
w
->
cellId
,
w
->
isSuitableCell
);
handleCellSelectionCommand
(
w
->
cellId
,
w
->
isSuitableCell
);
break
;
break
;
}
}
...
@@ -66,13 +66,13 @@ void UeSasTask::onLoop()
...
@@ -66,13 +66,13 @@ void UeSasTask::onLoop()
}
}
case
NtsMessageType
:
:
UDP_SERVER_RECEIVE
:
{
case
NtsMessageType
:
:
UDP_SERVER_RECEIVE
:
{
auto
*
w
=
dynamic_cast
<
udp
::
NwUdpServerReceive
*>
(
msg
);
auto
*
w
=
dynamic_cast
<
udp
::
NwUdpServerReceive
*>
(
msg
);
auto
s
asMsg
=
sas
::
DecodeSas
Message
(
OctetView
{
w
->
packet
});
auto
s
raMsg
=
sra
::
DecodeSra
Message
(
OctetView
{
w
->
packet
});
if
(
s
as
Msg
==
nullptr
)
if
(
s
ra
Msg
==
nullptr
)
{
{
m_logger
->
err
(
"Unable to decode S
AS
message"
);
m_logger
->
err
(
"Unable to decode S
RA
message"
);
break
;
break
;
}
}
receiveS
asMessage
(
w
->
fromAddress
,
*
sas
Msg
);
receiveS
raMessage
(
w
->
fromAddress
,
*
sra
Msg
);
break
;
break
;
}
}
default:
default:
...
@@ -83,7 +83,7 @@ void UeSasTask::onLoop()
...
@@ -83,7 +83,7 @@ void UeSasTask::onLoop()
delete
msg
;
delete
msg
;
}
}
void
UeS
as
Task
::
onQuit
()
void
UeS
ra
Task
::
onQuit
()
{
{
m_udpTask
->
quit
();
m_udpTask
->
quit
();
delete
m_udpTask
;
delete
m_udpTask
;
...
...
src/ue/s
as
/task.hpp
→
src/ue/s
ra
/task.hpp
View file @
0b5cad7a
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#include <udp/server_task.hpp>
#include <udp/server_task.hpp>
#include <ue/types.hpp>
#include <ue/types.hpp>
#include <unordered_map>
#include <unordered_map>
#include <urs/s
as
_pdu.hpp>
#include <urs/s
ra
_pdu.hpp>
#include <utils/common_types.hpp>
#include <utils/common_types.hpp>
#include <utils/logger.hpp>
#include <utils/logger.hpp>
#include <utils/nts.hpp>
#include <utils/nts.hpp>
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
namespace
nr
::
ue
namespace
nr
::
ue
{
{
class
UeS
as
Task
:
public
NtsTask
class
UeS
ra
Task
:
public
NtsTask
{
{
private:
private:
TaskBase
*
m_base
;
TaskBase
*
m_base
;
...
@@ -39,8 +39,8 @@ class UeSasTask : public NtsTask
...
@@ -39,8 +39,8 @@ class UeSasTask : public NtsTask
friend
class
UeCmdHandler
;
friend
class
UeCmdHandler
;
public:
public:
explicit
UeS
as
Task
(
TaskBase
*
base
);
explicit
UeS
ra
Task
(
TaskBase
*
base
);
~
UeS
as
Task
()
override
=
default
;
~
UeS
ra
Task
()
override
=
default
;
protected:
protected:
void
onStart
()
override
;
void
onStart
()
override
;
...
@@ -48,12 +48,12 @@ class UeSasTask : public NtsTask
...
@@ -48,12 +48,12 @@ class UeSasTask : public NtsTask
void
onQuit
()
override
;
void
onQuit
()
override
;
private:
/* Transport */
private:
/* Transport */
void
receiveS
asMessage
(
const
InetAddress
&
address
,
const
sas
::
Sas
Message
&
msg
);
void
receiveS
raMessage
(
const
InetAddress
&
address
,
const
sra
::
Sra
Message
&
msg
);
void
sendS
asMessage
(
const
InetAddress
&
address
,
const
sas
::
Sas
Message
&
msg
);
void
sendS
raMessage
(
const
InetAddress
&
address
,
const
sra
::
Sra
Message
&
msg
);
private:
/* Measurement */
private:
/* Measurement */
void
onMeasurement
();
void
onMeasurement
();
void
receiveCellInfoResponse
(
const
s
as
::
Sas
CellInfoResponse
&
msg
);
void
receiveCellInfoResponse
(
const
s
ra
::
Sra
CellInfoResponse
&
msg
);
void
onCoverageChange
(
const
std
::
vector
<
GlobalNci
>
&
entered
,
const
std
::
vector
<
GlobalNci
>
&
exited
);
void
onCoverageChange
(
const
std
::
vector
<
GlobalNci
>
&
entered
,
const
std
::
vector
<
GlobalNci
>
&
exited
);
void
plmnSearchRequested
();
void
plmnSearchRequested
();
...
...
src/ue/s
as
/transport.cpp
→
src/ue/s
ra
/transport.cpp
View file @
0b5cad7a
...
@@ -11,24 +11,24 @@
...
@@ -11,24 +11,24 @@
namespace
nr
::
ue
namespace
nr
::
ue
{
{
void
UeS
asTask
::
receiveSasMessage
(
const
InetAddress
&
address
,
const
sas
::
Sas
Message
&
msg
)
void
UeS
raTask
::
receiveSraMessage
(
const
InetAddress
&
address
,
const
sra
::
Sra
Message
&
msg
)
{
{
switch
(
msg
.
msgType
)
switch
(
msg
.
msgType
)
{
{
case
s
as
:
:
Sas
MessageType
::
CELL_INFO_RESPONSE
:
{
case
s
ra
:
:
Sra
MessageType
::
CELL_INFO_RESPONSE
:
{
receiveCellInfoResponse
((
const
s
as
::
Sas
CellInfoResponse
&
)
msg
);
receiveCellInfoResponse
((
const
s
ra
::
Sra
CellInfoResponse
&
)
msg
);
break
;
break
;
default:
default:
m_logger
->
err
(
"Unhandled S
AS
message type[%d]"
,
static_cast
<
int
>
(
msg
.
msgType
));
m_logger
->
err
(
"Unhandled S
RA
message type[%d]"
,
static_cast
<
int
>
(
msg
.
msgType
));
break
;
break
;
}
}
}
}
}
}
void
UeS
asTask
::
sendSasMessage
(
const
InetAddress
&
address
,
const
sas
::
Sas
Message
&
msg
)
void
UeS
raTask
::
sendSraMessage
(
const
InetAddress
&
address
,
const
sra
::
Sra
Message
&
msg
)
{
{
OctetString
stream
{};
OctetString
stream
{};
s
as
::
EncodeSas
Message
(
msg
,
stream
);
s
ra
::
EncodeSra
Message
(
msg
,
stream
);
m_udpTask
->
send
(
address
,
stream
);
m_udpTask
->
send
(
address
,
stream
);
}
}
...
...
src/ue/types.hpp
View file @
0b5cad7a
...
@@ -27,7 +27,7 @@ class UeAppTask;
...
@@ -27,7 +27,7 @@ class UeAppTask;
class
UeMrTask
;
class
UeMrTask
;
class
NasTask
;
class
NasTask
;
class
UeRrcTask
;
class
UeRrcTask
;
class
UeS
as
Task
;
class
UeS
ra
Task
;
class
UserEquipment
;
class
UserEquipment
;
struct
SupportedAlgs
struct
SupportedAlgs
...
@@ -126,7 +126,7 @@ struct TaskBase
...
@@ -126,7 +126,7 @@ struct TaskBase
UeMrTask
*
mrTask
{};
UeMrTask
*
mrTask
{};
NasTask
*
nasTask
{};
NasTask
*
nasTask
{};
UeRrcTask
*
rrcTask
{};
UeRrcTask
*
rrcTask
{};
UeS
asTask
*
sas
Task
{};
UeS
raTask
*
sra
Task
{};
};
};
struct
UeTimers
struct
UeTimers
...
...
src/ue/ue.cpp
View file @
0b5cad7a
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#include "mr/task.hpp"
#include "mr/task.hpp"
#include "nas/task.hpp"
#include "nas/task.hpp"
#include "rrc/task.hpp"
#include "rrc/task.hpp"
#include "s
as
/task.hpp"
#include "s
ra
/task.hpp"
namespace
nr
::
ue
namespace
nr
::
ue
{
{
...
@@ -32,7 +32,7 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController,
...
@@ -32,7 +32,7 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController,
base
->
rrcTask
=
new
UeRrcTask
(
base
);
base
->
rrcTask
=
new
UeRrcTask
(
base
);
base
->
mrTask
=
new
UeMrTask
(
base
);
base
->
mrTask
=
new
UeMrTask
(
base
);
base
->
appTask
=
new
UeAppTask
(
base
);
base
->
appTask
=
new
UeAppTask
(
base
);
base
->
s
asTask
=
new
UeSas
Task
(
base
);
base
->
s
raTask
=
new
UeSra
Task
(
base
);
taskBase
=
base
;
taskBase
=
base
;
}
}
...
@@ -42,13 +42,13 @@ UserEquipment::~UserEquipment()
...
@@ -42,13 +42,13 @@ UserEquipment::~UserEquipment()
taskBase
->
nasTask
->
quit
();
taskBase
->
nasTask
->
quit
();
taskBase
->
rrcTask
->
quit
();
taskBase
->
rrcTask
->
quit
();
taskBase
->
mrTask
->
quit
();
taskBase
->
mrTask
->
quit
();
taskBase
->
s
as
Task
->
quit
();
taskBase
->
s
ra
Task
->
quit
();
taskBase
->
appTask
->
quit
();
taskBase
->
appTask
->
quit
();
delete
taskBase
->
nasTask
;
delete
taskBase
->
nasTask
;
delete
taskBase
->
rrcTask
;
delete
taskBase
->
rrcTask
;
delete
taskBase
->
mrTask
;
delete
taskBase
->
mrTask
;
delete
taskBase
->
s
as
Task
;
delete
taskBase
->
s
ra
Task
;
delete
taskBase
->
appTask
;
delete
taskBase
->
appTask
;
delete
taskBase
->
logBase
;
delete
taskBase
->
logBase
;
...
@@ -61,7 +61,7 @@ void UserEquipment::start()
...
@@ -61,7 +61,7 @@ void UserEquipment::start()
taskBase
->
nasTask
->
start
();
taskBase
->
nasTask
->
start
();
taskBase
->
rrcTask
->
start
();
taskBase
->
rrcTask
->
start
();
taskBase
->
mrTask
->
start
();
taskBase
->
mrTask
->
start
();
taskBase
->
s
as
Task
->
start
();
taskBase
->
s
ra
Task
->
start
();
taskBase
->
appTask
->
start
();
taskBase
->
appTask
->
start
();
}
}
...
...
src/urs/s
as
_pdu.cpp
→
src/urs/s
ra
_pdu.cpp
View file @
0b5cad7a
...
@@ -6,10 +6,10 @@
...
@@ -6,10 +6,10 @@
// and subject to the terms and conditions defined in LICENSE file.
// and subject to the terms and conditions defined in LICENSE file.
//
//
#include "s
as
_pdu.hpp"
#include "s
ra
_pdu.hpp"
#include <utils/constants.hpp>
#include <utils/constants.hpp>
namespace
s
as
namespace
s
ra
{
{
static
void
AppendPlmn
(
const
Plmn
&
plmn
,
OctetString
&
stream
)
static
void
AppendPlmn
(
const
Plmn
&
plmn
,
OctetString
&
stream
)
...
@@ -42,7 +42,7 @@ static GlobalNci DecodeGlobalNci(const OctetView &stream)
...
@@ -42,7 +42,7 @@ static GlobalNci DecodeGlobalNci(const OctetView &stream)
return
res
;
return
res
;
}
}
void
EncodeS
asMessage
(
const
Sas
Message
&
msg
,
OctetString
&
stream
)
void
EncodeS
raMessage
(
const
Sra
Message
&
msg
,
OctetString
&
stream
)
{
{
stream
.
appendOctet
(
0x03
);
// (Just for old RLS compatibility)
stream
.
appendOctet
(
0x03
);
// (Just for old RLS compatibility)
...
@@ -50,16 +50,16 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream)
...
@@ -50,16 +50,16 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream)
stream
.
appendOctet
(
cons
::
Minor
);
stream
.
appendOctet
(
cons
::
Minor
);
stream
.
appendOctet
(
cons
::
Patch
);
stream
.
appendOctet
(
cons
::
Patch
);
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
msg
.
msgType
));
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
msg
.
msgType
));
if
(
msg
.
msgType
==
S
as
MessageType
::
CELL_INFO_REQUEST
)
if
(
msg
.
msgType
==
S
ra
MessageType
::
CELL_INFO_REQUEST
)
{
{
auto
m
=
(
const
S
as
CellInfoRequest
&
)
msg
;
auto
m
=
(
const
S
ra
CellInfoRequest
&
)
msg
;
stream
.
appendOctet4
(
m
.
simPos
.
x
);
stream
.
appendOctet4
(
m
.
simPos
.
x
);
stream
.
appendOctet4
(
m
.
simPos
.
y
);
stream
.
appendOctet4
(
m
.
simPos
.
y
);
stream
.
appendOctet4
(
m
.
simPos
.
z
);
stream
.
appendOctet4
(
m
.
simPos
.
z
);
}
}
else
if
(
msg
.
msgType
==
S
as
MessageType
::
CELL_INFO_RESPONSE
)
else
if
(
msg
.
msgType
==
S
ra
MessageType
::
CELL_INFO_RESPONSE
)
{
{
auto
m
=
(
const
S
as
CellInfoResponse
&
)
msg
;
auto
m
=
(
const
S
ra
CellInfoResponse
&
)
msg
;
AppendGlobalNci
(
m
.
cellId
,
stream
);
AppendGlobalNci
(
m
.
cellId
,
stream
);
stream
.
appendOctet4
(
m
.
tac
);
stream
.
appendOctet4
(
m
.
tac
);
stream
.
appendOctet4
(
m
.
dbm
);
stream
.
appendOctet4
(
m
.
dbm
);
...
@@ -70,7 +70,7 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream)
...
@@ -70,7 +70,7 @@ void EncodeSasMessage(const SasMessage &msg, OctetString &stream)
}
}
}
}
std
::
unique_ptr
<
S
asMessage
>
DecodeSas
Message
(
const
OctetView
&
stream
)
std
::
unique_ptr
<
S
raMessage
>
DecodeSra
Message
(
const
OctetView
&
stream
)
{
{
auto
first
=
stream
.
readI
();
// (Just for old RLS compatibility)
auto
first
=
stream
.
readI
();
// (Just for old RLS compatibility)
if
(
first
!=
3
)
if
(
first
!=
3
)
...
@@ -83,18 +83,18 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream)
...
@@ -83,18 +83,18 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream)
if
(
stream
.
read
()
!=
cons
::
Patch
)
if
(
stream
.
read
()
!=
cons
::
Patch
)
return
nullptr
;
return
nullptr
;
auto
msgType
=
static_cast
<
S
as
MessageType
>
(
stream
.
readI
());
auto
msgType
=
static_cast
<
S
ra
MessageType
>
(
stream
.
readI
());
if
(
msgType
==
S
as
MessageType
::
CELL_INFO_REQUEST
)
if
(
msgType
==
S
ra
MessageType
::
CELL_INFO_REQUEST
)
{
{
auto
res
=
std
::
make_unique
<
S
as
CellInfoRequest
>
();
auto
res
=
std
::
make_unique
<
S
ra
CellInfoRequest
>
();
res
->
simPos
.
x
=
stream
.
read4I
();
res
->
simPos
.
x
=
stream
.
read4I
();
res
->
simPos
.
y
=
stream
.
read4I
();
res
->
simPos
.
y
=
stream
.
read4I
();
res
->
simPos
.
z
=
stream
.
read4I
();
res
->
simPos
.
z
=
stream
.
read4I
();
return
res
;
return
res
;
}
}
else
if
(
msgType
==
S
as
MessageType
::
CELL_INFO_RESPONSE
)
else
if
(
msgType
==
S
ra
MessageType
::
CELL_INFO_RESPONSE
)
{
{
auto
res
=
std
::
make_unique
<
S
as
CellInfoResponse
>
();
auto
res
=
std
::
make_unique
<
S
ra
CellInfoResponse
>
();
res
->
cellId
=
DecodeGlobalNci
(
stream
);
res
->
cellId
=
DecodeGlobalNci
(
stream
);
res
->
tac
=
stream
.
read4I
();
res
->
tac
=
stream
.
read4I
();
res
->
dbm
=
stream
.
read4I
();
res
->
dbm
=
stream
.
read4I
();
...
@@ -106,4 +106,4 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream)
...
@@ -106,4 +106,4 @@ std::unique_ptr<SasMessage> DecodeSasMessage(const OctetView &stream)
return
nullptr
;
return
nullptr
;
}
}
}
// namespace s
as
}
// namespace s
ra
src/urs/s
as
_pdu.hpp
→
src/urs/s
ra
_pdu.hpp
View file @
0b5cad7a
...
@@ -14,35 +14,35 @@
...
@@ -14,35 +14,35 @@
#include <utils/octet_string.hpp>
#include <utils/octet_string.hpp>
#include <utils/octet_view.hpp>
#include <utils/octet_view.hpp>
namespace
s
as
namespace
s
ra
{
{
enum
class
S
as
MessageType
:
uint8_t
enum
class
S
ra
MessageType
:
uint8_t
{
{
RESERVED
=
0
,
RESERVED
=
0
,
CELL_INFO_REQUEST
,
CELL_INFO_REQUEST
,
CELL_INFO_RESPONSE
,
CELL_INFO_RESPONSE
,
};
};
struct
S
as
Message
struct
S
ra
Message
{
{
const
S
as
MessageType
msgType
;
const
S
ra
MessageType
msgType
;
explicit
S
asMessage
(
Sas
MessageType
msgType
)
:
msgType
(
msgType
)
explicit
S
raMessage
(
Sra
MessageType
msgType
)
:
msgType
(
msgType
)
{
{
}
}
};
};
struct
S
asCellInfoRequest
:
Sas
Message
struct
S
raCellInfoRequest
:
Sra
Message
{
{
Vector3
simPos
{};
Vector3
simPos
{};
S
asCellInfoRequest
()
:
SasMessage
(
Sas
MessageType
::
CELL_INFO_REQUEST
)
S
raCellInfoRequest
()
:
SraMessage
(
Sra
MessageType
::
CELL_INFO_REQUEST
)
{
{
}
}
};
};
struct
S
asCellInfoResponse
:
Sas
Message
struct
S
raCellInfoResponse
:
Sra
Message
{
{
GlobalNci
cellId
{};
GlobalNci
cellId
{};
int
tac
{};
int
tac
{};
...
@@ -50,12 +50,12 @@ struct SasCellInfoResponse : SasMessage
...
@@ -50,12 +50,12 @@ struct SasCellInfoResponse : SasMessage
std
::
string
gnbName
{};
std
::
string
gnbName
{};
std
::
string
linkIp
{};
std
::
string
linkIp
{};
S
asCellInfoResponse
()
:
SasMessage
(
Sas
MessageType
::
CELL_INFO_RESPONSE
)
S
raCellInfoResponse
()
:
SraMessage
(
Sra
MessageType
::
CELL_INFO_RESPONSE
)
{
{
}
}
};
};
void
EncodeS
asMessage
(
const
Sas
Message
&
msg
,
OctetString
&
stream
);
void
EncodeS
raMessage
(
const
Sra
Message
&
msg
,
OctetString
&
stream
);
std
::
unique_ptr
<
S
asMessage
>
DecodeSas
Message
(
const
OctetView
&
stream
);
std
::
unique_ptr
<
S
raMessage
>
DecodeSra
Message
(
const
OctetView
&
stream
);
}
// namespace sas
}
// namespace sra
\ No newline at end of file
\ No newline at end of file
src/utils/nts.hpp
View file @
0b5cad7a
...
@@ -53,9 +53,9 @@ enum class NtsMessageType
...
@@ -53,9 +53,9 @@ enum class NtsMessageType
UE_RRC_TO_NAS
,
UE_RRC_TO_NAS
,
UE_NAS_TO_RRC
,
UE_NAS_TO_RRC
,
UE_RRC_TO_MR
,
UE_RRC_TO_MR
,
UE_RRC_TO_S
AS
,
UE_RRC_TO_S
RA
,
UE_NAS_TO_NAS
,
UE_NAS_TO_NAS
,
UE_S
AS
_TO_RRC
,
UE_S
RA
_TO_RRC
,
UE_NAS_TO_APP
,
UE_NAS_TO_APP
,
};
};
...
...
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