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
9d6b4b0c
Commit
9d6b4b0c
authored
Apr 04, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
name refactor: SRA -> RLS
parent
de9a3790
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
60 additions
and
60 deletions
+60
-60
src/gnb/rls/handler.cpp
src/gnb/rls/handler.cpp
+6
-6
src/gnb/rls/management.cpp
src/gnb/rls/management.cpp
+1
-1
src/gnb/rls/task.cpp
src/gnb/rls/task.cpp
+4
-4
src/gnb/rls/task.hpp
src/gnb/rls/task.hpp
+5
-5
src/gnb/rls/transport.cpp
src/gnb/rls/transport.cpp
+7
-7
src/gnb/types.hpp
src/gnb/types.hpp
+2
-2
src/ue/rls/measurement.cpp
src/ue/rls/measurement.cpp
+2
-2
src/ue/rls/task.cpp
src/ue/rls/task.cpp
+1
-1
src/ue/rls/task.hpp
src/ue/rls/task.hpp
+4
-4
src/ue/rls/transport.cpp
src/ue/rls/transport.cpp
+8
-8
src/urs/rls_pdu.cpp
src/urs/rls_pdu.cpp
+9
-9
src/urs/rls_pdu.hpp
src/urs/rls_pdu.hpp
+11
-11
No files found.
src/gnb/rls/handler.cpp
View file @
9d6b4b0c
...
@@ -28,7 +28,7 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
...
@@ -28,7 +28,7 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
namespace
nr
::
gnb
namespace
nr
::
gnb
{
{
void
GnbRlsTask
::
handleCellInfoRequest
(
int
ueId
,
const
rls
::
Sra
CellInfoRequest
&
msg
)
void
GnbRlsTask
::
handleCellInfoRequest
(
int
ueId
,
const
rls
::
Rls
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
)
...
@@ -37,7 +37,7 @@ void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &
...
@@ -37,7 +37,7 @@ void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &
return
;
return
;
}
}
rls
::
Sra
CellInfoResponse
resp
{
m_sti
};
rls
::
Rls
CellInfoResponse
resp
{
m_sti
};
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
;
...
@@ -45,10 +45,10 @@ void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &
...
@@ -45,10 +45,10 @@ void GnbRlsTask::handleCellInfoRequest(int ueId, const rls::SraCellInfoRequest &
resp
.
gnbName
=
m_base
->
config
->
name
;
resp
.
gnbName
=
m_base
->
config
->
name
;
resp
.
linkIp
=
m_base
->
config
->
portalIp
;
resp
.
linkIp
=
m_base
->
config
->
portalIp
;
send
Sra
Message
(
ueId
,
resp
);
send
Rls
Message
(
ueId
,
resp
);
}
}
void
GnbRlsTask
::
handleUplinkPduDelivery
(
int
ueId
,
rls
::
Sra
PduDelivery
&
msg
)
void
GnbRlsTask
::
handleUplinkPduDelivery
(
int
ueId
,
rls
::
Rls
PduDelivery
&
msg
)
{
{
if
(
msg
.
pduType
==
rls
::
EPduType
::
RRC
)
if
(
msg
.
pduType
==
rls
::
EPduType
::
RRC
)
{
{
...
@@ -70,11 +70,11 @@ void GnbRlsTask::handleUplinkPduDelivery(int ueId, rls::SraPduDelivery &msg)
...
@@ -70,11 +70,11 @@ void GnbRlsTask::handleUplinkPduDelivery(int ueId, rls::SraPduDelivery &msg)
void
GnbRlsTask
::
handleDownlinkDelivery
(
int
ueId
,
rls
::
EPduType
pduType
,
OctetString
&&
pdu
,
OctetString
&&
payload
)
void
GnbRlsTask
::
handleDownlinkDelivery
(
int
ueId
,
rls
::
EPduType
pduType
,
OctetString
&&
pdu
,
OctetString
&&
payload
)
{
{
rls
::
Sra
PduDelivery
resp
{
m_sti
};
rls
::
Rls
PduDelivery
resp
{
m_sti
};
resp
.
pduType
=
pduType
;
resp
.
pduType
=
pduType
;
resp
.
pdu
=
std
::
move
(
pdu
);
resp
.
pdu
=
std
::
move
(
pdu
);
resp
.
payload
=
std
::
move
(
payload
);
resp
.
payload
=
std
::
move
(
payload
);
send
Sra
Message
(
ueId
,
resp
);
send
Rls
Message
(
ueId
,
resp
);
}
}
}
// namespace nr::gnb
}
// namespace nr::gnb
src/gnb/rls/management.cpp
View file @
9d6b4b0c
...
@@ -30,7 +30,7 @@ int GnbRlsTask::updateUeInfo(const InetAddress &addr, uint64_t sti)
...
@@ -30,7 +30,7 @@ int GnbRlsTask::updateUeInfo(const InetAddress &addr, uint64_t sti)
{
{
int
ueId
=
++
m_ueIdCounter
;
int
ueId
=
++
m_ueIdCounter
;
m_stiToUeId
[
sti
]
=
ueId
;
m_stiToUeId
[
sti
]
=
ueId
;
auto
ctx
=
std
::
make_unique
<
Sra
UeContext
>
(
ueId
);
auto
ctx
=
std
::
make_unique
<
Rls
UeContext
>
(
ueId
);
ctx
->
sti
=
sti
;
ctx
->
sti
=
sti
;
ctx
->
addr
=
addr
;
ctx
->
addr
=
addr
;
ctx
->
lastSeen
=
utils
::
CurrentTimeMillis
();
ctx
->
lastSeen
=
utils
::
CurrentTimeMillis
();
...
...
src/gnb/rls/task.cpp
View file @
9d6b4b0c
...
@@ -82,13 +82,13 @@ void GnbRlsTask::onLoop()
...
@@ -82,13 +82,13 @@ void GnbRlsTask::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
sra
Msg
=
rls
::
DecodeRlsMessage
(
OctetView
{
w
->
packet
});
auto
rls
Msg
=
rls
::
DecodeRlsMessage
(
OctetView
{
w
->
packet
});
if
(
sra
Msg
==
nullptr
)
if
(
rls
Msg
==
nullptr
)
{
{
m_logger
->
err
(
"Unable to decode
SRA
message"
);
m_logger
->
err
(
"Unable to decode
RLS
message"
);
break
;
break
;
}
}
receive
SraMessage
(
w
->
fromAddress
,
*
sra
Msg
);
receive
RlsMessage
(
w
->
fromAddress
,
*
rls
Msg
);
break
;
break
;
}
}
case
NtsMessageType
:
:
TIMER_EXPIRED
:
{
case
NtsMessageType
:
:
TIMER_EXPIRED
:
{
...
...
src/gnb/rls/task.hpp
View file @
9d6b4b0c
...
@@ -31,7 +31,7 @@ class GnbRlsTask : public NtsTask
...
@@ -31,7 +31,7 @@ class GnbRlsTask : public NtsTask
bool
m_powerOn
;
bool
m_powerOn
;
uint64_t
m_sti
;
uint64_t
m_sti
;
std
::
unordered_map
<
int
,
std
::
unique_ptr
<
Sra
UeContext
>>
m_ueCtx
;
std
::
unordered_map
<
int
,
std
::
unique_ptr
<
Rls
UeContext
>>
m_ueCtx
;
std
::
unordered_map
<
uint64_t
,
int
>
m_stiToUeId
;
std
::
unordered_map
<
uint64_t
,
int
>
m_stiToUeId
;
int
m_ueIdCounter
;
int
m_ueIdCounter
;
...
@@ -47,12 +47,12 @@ class GnbRlsTask : public NtsTask
...
@@ -47,12 +47,12 @@ class GnbRlsTask : public NtsTask
void
onQuit
()
override
;
void
onQuit
()
override
;
private:
/* Transport */
private:
/* Transport */
void
receive
SraMessage
(
const
InetAddress
&
addr
,
rls
::
Sra
Message
&
msg
);
void
receive
RlsMessage
(
const
InetAddress
&
addr
,
rls
::
Rls
Message
&
msg
);
void
send
SraMessage
(
int
ueId
,
const
rls
::
Sra
Message
&
msg
);
void
send
RlsMessage
(
int
ueId
,
const
rls
::
Rls
Message
&
msg
);
private:
/* Handler */
private:
/* Handler */
void
handleCellInfoRequest
(
int
ueId
,
const
rls
::
Sra
CellInfoRequest
&
msg
);
void
handleCellInfoRequest
(
int
ueId
,
const
rls
::
Rls
CellInfoRequest
&
msg
);
void
handleUplinkPduDelivery
(
int
ueId
,
rls
::
Sra
PduDelivery
&
msg
);
void
handleUplinkPduDelivery
(
int
ueId
,
rls
::
Rls
PduDelivery
&
msg
);
void
handleDownlinkDelivery
(
int
ueId
,
rls
::
EPduType
pduType
,
OctetString
&&
pdu
,
OctetString
&&
payload
);
void
handleDownlinkDelivery
(
int
ueId
,
rls
::
EPduType
pduType
,
OctetString
&&
pdu
,
OctetString
&&
payload
);
private:
/* UE Management */
private:
/* UE Management */
...
...
src/gnb/rls/transport.cpp
View file @
9d6b4b0c
...
@@ -11,11 +11,11 @@
...
@@ -11,11 +11,11 @@
namespace
nr
::
gnb
namespace
nr
::
gnb
{
{
void
GnbRlsTask
::
receive
SraMessage
(
const
InetAddress
&
addr
,
rls
::
Sra
Message
&
msg
)
void
GnbRlsTask
::
receive
RlsMessage
(
const
InetAddress
&
addr
,
rls
::
Rls
Message
&
msg
)
{
{
if
(
!
m_powerOn
)
if
(
!
m_powerOn
)
{
{
// ignore received
SRA
message
// ignore received
RLS
message
return
;
return
;
}
}
...
@@ -24,24 +24,24 @@ void GnbRlsTask::receiveSraMessage(const InetAddress &addr, rls::SraMessage &msg
...
@@ -24,24 +24,24 @@ void GnbRlsTask::receiveSraMessage(const InetAddress &addr, rls::SraMessage &msg
switch
(
msg
.
msgType
)
switch
(
msg
.
msgType
)
{
{
case
rls
:
:
EMessageType
::
CELL_INFO_REQUEST
:
{
case
rls
:
:
EMessageType
::
CELL_INFO_REQUEST
:
{
handleCellInfoRequest
(
ueId
,
(
const
rls
::
Sra
CellInfoRequest
&
)
msg
);
handleCellInfoRequest
(
ueId
,
(
const
rls
::
Rls
CellInfoRequest
&
)
msg
);
break
;
break
;
}
}
case
rls
:
:
EMessageType
::
PDU_DELIVERY
:
{
case
rls
:
:
EMessageType
::
PDU_DELIVERY
:
{
handleUplinkPduDelivery
(
ueId
,
(
rls
::
Sra
PduDelivery
&
)
msg
);
handleUplinkPduDelivery
(
ueId
,
(
rls
::
Rls
PduDelivery
&
)
msg
);
break
;
break
;
}
}
default:
default:
m_logger
->
err
(
"Unhandled
SRA
message received with type[%d]"
,
static_cast
<
int
>
(
msg
.
msgType
));
m_logger
->
err
(
"Unhandled
RLS
message received with type[%d]"
,
static_cast
<
int
>
(
msg
.
msgType
));
break
;
break
;
}
}
}
}
void
GnbRlsTask
::
send
SraMessage
(
int
ueId
,
const
rls
::
Sra
Message
&
msg
)
void
GnbRlsTask
::
send
RlsMessage
(
int
ueId
,
const
rls
::
Rls
Message
&
msg
)
{
{
if
(
!
m_ueCtx
.
count
(
ueId
))
if
(
!
m_ueCtx
.
count
(
ueId
))
{
{
m_logger
->
err
(
"
SRA
message sending failure, UE[%d] not exists"
,
ueId
);
m_logger
->
err
(
"
RLS
message sending failure, UE[%d] not exists"
,
ueId
);
return
;
return
;
}
}
...
...
src/gnb/types.hpp
View file @
9d6b4b0c
...
@@ -104,14 +104,14 @@ struct NgapAmfContext
...
@@ -104,14 +104,14 @@ struct NgapAmfContext
std
::
vector
<
PlmnSupport
*>
plmnSupportList
{};
std
::
vector
<
PlmnSupport
*>
plmnSupportList
{};
};
};
struct
Sra
UeContext
struct
Rls
UeContext
{
{
const
int
ueId
;
const
int
ueId
;
uint64_t
sti
{};
uint64_t
sti
{};
InetAddress
addr
{};
InetAddress
addr
{};
int64_t
lastSeen
{};
int64_t
lastSeen
{};
explicit
Sra
UeContext
(
int
ueId
)
:
ueId
(
ueId
)
explicit
Rls
UeContext
(
int
ueId
)
:
ueId
(
ueId
)
{
{
}
}
};
};
...
...
src/ue/rls/measurement.cpp
View file @
9d6b4b0c
...
@@ -41,12 +41,12 @@ void UeRlsTask::onMeasurement()
...
@@ -41,12 +41,12 @@ void UeRlsTask::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
)
{
{
rls
::
Sra
CellInfoRequest
req
{
m_sti
};
rls
::
Rls
CellInfoRequest
req
{
m_sti
};
sendRlsMessage
(
ip
,
req
);
sendRlsMessage
(
ip
,
req
);
}
}
}
}
void
UeRlsTask
::
receiveCellInfoResponse
(
const
rls
::
Sra
CellInfoResponse
&
msg
)
void
UeRlsTask
::
receiveCellInfoResponse
(
const
rls
::
Rls
CellInfoResponse
&
msg
)
{
{
UeCellMeasurement
meas
{};
UeCellMeasurement
meas
{};
meas
.
sti
=
msg
.
sti
;
meas
.
sti
=
msg
.
sti
;
...
...
src/ue/rls/task.cpp
View file @
9d6b4b0c
...
@@ -20,7 +20,7 @@ namespace nr::ue
...
@@ -20,7 +20,7 @@ namespace nr::ue
UeRlsTask
::
UeRlsTask
(
TaskBase
*
base
)
UeRlsTask
::
UeRlsTask
(
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
()
+
"
sra
"
);
m_logger
=
m_base
->
logBase
->
makeUniqueLogger
(
m_base
->
config
->
getLoggerPrefix
()
+
"
rls
"
);
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
);
...
...
src/ue/rls/task.hpp
View file @
9d6b4b0c
...
@@ -50,14 +50,14 @@ class UeRlsTask : public NtsTask
...
@@ -50,14 +50,14 @@ class UeRlsTask : public NtsTask
void
onQuit
()
override
;
void
onQuit
()
override
;
private:
/* Transport */
private:
/* Transport */
void
receiveRlsMessage
(
const
InetAddress
&
address
,
rls
::
Sra
Message
&
msg
);
void
receiveRlsMessage
(
const
InetAddress
&
address
,
rls
::
Rls
Message
&
msg
);
void
sendRlsMessage
(
const
InetAddress
&
address
,
const
rls
::
Sra
Message
&
msg
);
void
sendRlsMessage
(
const
InetAddress
&
address
,
const
rls
::
Rls
Message
&
msg
);
void
deliverUplinkPdu
(
rls
::
EPduType
pduType
,
OctetString
&&
pdu
,
OctetString
&&
payload
);
void
deliverUplinkPdu
(
rls
::
EPduType
pduType
,
OctetString
&&
pdu
,
OctetString
&&
payload
);
void
deliverDownlinkPdu
(
rls
::
Sra
PduDelivery
&
msg
);
void
deliverDownlinkPdu
(
rls
::
Rls
PduDelivery
&
msg
);
private:
/* Measurement */
private:
/* Measurement */
void
onMeasurement
();
void
onMeasurement
();
void
receiveCellInfoResponse
(
const
rls
::
Sra
CellInfoResponse
&
msg
);
void
receiveCellInfoResponse
(
const
rls
::
Rls
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
();
void
handleCellSelectionCommand
(
const
GlobalNci
&
cellId
,
bool
isSuitable
);
void
handleCellSelectionCommand
(
const
GlobalNci
&
cellId
,
bool
isSuitable
);
...
...
src/ue/rls/transport.cpp
View file @
9d6b4b0c
...
@@ -15,25 +15,25 @@
...
@@ -15,25 +15,25 @@
namespace
nr
::
ue
namespace
nr
::
ue
{
{
void
UeRlsTask
::
receiveRlsMessage
(
const
InetAddress
&
address
,
rls
::
Sra
Message
&
msg
)
void
UeRlsTask
::
receiveRlsMessage
(
const
InetAddress
&
address
,
rls
::
Rls
Message
&
msg
)
{
{
switch
(
msg
.
msgType
)
switch
(
msg
.
msgType
)
{
{
case
rls
:
:
EMessageType
::
CELL_INFO_RESPONSE
:
{
case
rls
:
:
EMessageType
::
CELL_INFO_RESPONSE
:
{
receiveCellInfoResponse
((
const
rls
::
Sra
CellInfoResponse
&
)
msg
);
receiveCellInfoResponse
((
const
rls
::
Rls
CellInfoResponse
&
)
msg
);
break
;
break
;
case
rls
:
:
EMessageType
::
PDU_DELIVERY
:
{
case
rls
:
:
EMessageType
::
PDU_DELIVERY
:
{
deliverDownlinkPdu
((
rls
::
Sra
PduDelivery
&
)
msg
);
deliverDownlinkPdu
((
rls
::
Rls
PduDelivery
&
)
msg
);
break
;
break
;
}
}
default:
default:
m_logger
->
err
(
"Unhandled
SRA
message type[%d]"
,
static_cast
<
int
>
(
msg
.
msgType
));
m_logger
->
err
(
"Unhandled
RLS
message type[%d]"
,
static_cast
<
int
>
(
msg
.
msgType
));
break
;
break
;
}
}
}
}
}
}
void
UeRlsTask
::
sendRlsMessage
(
const
InetAddress
&
address
,
const
rls
::
Sra
Message
&
msg
)
void
UeRlsTask
::
sendRlsMessage
(
const
InetAddress
&
address
,
const
rls
::
Rls
Message
&
msg
)
{
{
OctetString
stream
{};
OctetString
stream
{};
rls
::
EncodeRlsMessage
(
msg
,
stream
);
rls
::
EncodeRlsMessage
(
msg
,
stream
);
...
@@ -44,18 +44,18 @@ void UeRlsTask::deliverUplinkPdu(rls::EPduType pduType, OctetString &&pdu, Octet
...
@@ -44,18 +44,18 @@ void UeRlsTask::deliverUplinkPdu(rls::EPduType pduType, OctetString &&pdu, Octet
{
{
if
(
!
m_servingCell
.
has_value
())
if
(
!
m_servingCell
.
has_value
())
{
{
m_logger
->
warn
(
"
SRA
uplink delivery requested without a serving cell"
);
m_logger
->
warn
(
"
RLS
uplink delivery requested without a serving cell"
);
return
;
return
;
}
}
rls
::
Sra
PduDelivery
msg
{
m_sti
};
rls
::
Rls
PduDelivery
msg
{
m_sti
};
msg
.
pduType
=
pduType
;
msg
.
pduType
=
pduType
;
msg
.
pdu
=
std
::
move
(
pdu
);
msg
.
pdu
=
std
::
move
(
pdu
);
msg
.
payload
=
std
::
move
(
payload
);
msg
.
payload
=
std
::
move
(
payload
);
sendRlsMessage
(
InetAddress
{
m_servingCell
->
linkIp
,
cons
::
PortalPort
},
msg
);
sendRlsMessage
(
InetAddress
{
m_servingCell
->
linkIp
,
cons
::
PortalPort
},
msg
);
}
}
void
UeRlsTask
::
deliverDownlinkPdu
(
rls
::
Sra
PduDelivery
&
msg
)
void
UeRlsTask
::
deliverDownlinkPdu
(
rls
::
Rls
PduDelivery
&
msg
)
{
{
if
(
msg
.
pduType
==
rls
::
EPduType
::
RRC
)
if
(
msg
.
pduType
==
rls
::
EPduType
::
RRC
)
{
{
...
...
src/urs/rls_pdu.cpp
View file @
9d6b4b0c
...
@@ -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
EncodeRlsMessage
(
const
Sra
Message
&
msg
,
OctetString
&
stream
)
void
EncodeRlsMessage
(
const
Rls
Message
&
msg
,
OctetString
&
stream
)
{
{
stream
.
appendOctet
(
0x03
);
// (Just for old RLS compatibility)
stream
.
appendOctet
(
0x03
);
// (Just for old RLS compatibility)
...
@@ -53,14 +53,14 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
...
@@ -53,14 +53,14 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
stream
.
appendOctet8
(
msg
.
sti
);
stream
.
appendOctet8
(
msg
.
sti
);
if
(
msg
.
msgType
==
EMessageType
::
CELL_INFO_REQUEST
)
if
(
msg
.
msgType
==
EMessageType
::
CELL_INFO_REQUEST
)
{
{
auto
&
m
=
(
const
Sra
CellInfoRequest
&
)
msg
;
auto
&
m
=
(
const
Rls
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
==
EMessageType
::
CELL_INFO_RESPONSE
)
else
if
(
msg
.
msgType
==
EMessageType
::
CELL_INFO_RESPONSE
)
{
{
auto
&
m
=
(
const
Sra
CellInfoResponse
&
)
msg
;
auto
&
m
=
(
const
Rls
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
);
...
@@ -71,7 +71,7 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
...
@@ -71,7 +71,7 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
}
}
else
if
(
msg
.
msgType
==
EMessageType
::
PDU_DELIVERY
)
else
if
(
msg
.
msgType
==
EMessageType
::
PDU_DELIVERY
)
{
{
auto
&
m
=
(
const
Sra
PduDelivery
&
)
msg
;
auto
&
m
=
(
const
Rls
PduDelivery
&
)
msg
;
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
m
.
pduType
));
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
m
.
pduType
));
stream
.
appendOctet4
(
m
.
pdu
.
length
());
stream
.
appendOctet4
(
m
.
pdu
.
length
());
stream
.
append
(
m
.
pdu
);
stream
.
append
(
m
.
pdu
);
...
@@ -80,7 +80,7 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
...
@@ -80,7 +80,7 @@ void EncodeRlsMessage(const SraMessage &msg, OctetString &stream)
}
}
}
}
std
::
unique_ptr
<
Sra
Message
>
DecodeRlsMessage
(
const
OctetView
&
stream
)
std
::
unique_ptr
<
Rls
Message
>
DecodeRlsMessage
(
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
)
...
@@ -98,7 +98,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
...
@@ -98,7 +98,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
if
(
msgType
==
EMessageType
::
CELL_INFO_REQUEST
)
if
(
msgType
==
EMessageType
::
CELL_INFO_REQUEST
)
{
{
auto
res
=
std
::
make_unique
<
Sra
CellInfoRequest
>
(
sti
);
auto
res
=
std
::
make_unique
<
Rls
CellInfoRequest
>
(
sti
);
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
();
...
@@ -106,7 +106,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
...
@@ -106,7 +106,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
}
}
else
if
(
msgType
==
EMessageType
::
CELL_INFO_RESPONSE
)
else
if
(
msgType
==
EMessageType
::
CELL_INFO_RESPONSE
)
{
{
auto
res
=
std
::
make_unique
<
Sra
CellInfoResponse
>
(
sti
);
auto
res
=
std
::
make_unique
<
Rls
CellInfoResponse
>
(
sti
);
res
->
cellId
=
DecodeGlobalNci
(
stream
);
res
->
cellId
=
DecodeGlobalNci
(
stream
);
res
->
tac
=
stream
.
read4I
();
res
->
tac
=
stream
.
read4I
();
res
->
dbm
=
stream
.
read4I
();
res
->
dbm
=
stream
.
read4I
();
...
@@ -116,7 +116,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
...
@@ -116,7 +116,7 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
}
}
else
if
(
msgType
==
EMessageType
::
PDU_DELIVERY
)
else
if
(
msgType
==
EMessageType
::
PDU_DELIVERY
)
{
{
auto
res
=
std
::
make_unique
<
Sra
PduDelivery
>
(
sti
);
auto
res
=
std
::
make_unique
<
Rls
PduDelivery
>
(
sti
);
res
->
pduType
=
static_cast
<
EPduType
>
(
stream
.
readI
());
res
->
pduType
=
static_cast
<
EPduType
>
(
stream
.
readI
());
res
->
pdu
=
stream
.
readOctetString
(
stream
.
read4I
());
res
->
pdu
=
stream
.
readOctetString
(
stream
.
read4I
());
res
->
payload
=
stream
.
readOctetString
(
stream
.
read4I
());
res
->
payload
=
stream
.
readOctetString
(
stream
.
read4I
());
...
@@ -126,4 +126,4 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
...
@@ -126,4 +126,4 @@ std::unique_ptr<SraMessage> DecodeRlsMessage(const OctetView &stream)
return
nullptr
;
return
nullptr
;
}
}
}
// namespace
sra
}
// namespace
rls
src/urs/rls_pdu.hpp
View file @
9d6b4b0c
...
@@ -32,26 +32,26 @@ enum class EPduType : uint8_t
...
@@ -32,26 +32,26 @@ enum class EPduType : uint8_t
DATA
DATA
};
};
struct
Sra
Message
struct
Rls
Message
{
{
const
EMessageType
msgType
;
const
EMessageType
msgType
;
const
uint64_t
sti
{};
const
uint64_t
sti
{};
explicit
Sra
Message
(
EMessageType
msgType
,
uint64_t
sti
)
:
msgType
(
msgType
),
sti
(
sti
)
explicit
Rls
Message
(
EMessageType
msgType
,
uint64_t
sti
)
:
msgType
(
msgType
),
sti
(
sti
)
{
{
}
}
};
};
struct
SraCellInfoRequest
:
Sra
Message
struct
RlsCellInfoRequest
:
Rls
Message
{
{
Vector3
simPos
{};
Vector3
simPos
{};
explicit
SraCellInfoRequest
(
uint64_t
sti
)
:
Sra
Message
(
EMessageType
::
CELL_INFO_REQUEST
,
sti
)
explicit
RlsCellInfoRequest
(
uint64_t
sti
)
:
Rls
Message
(
EMessageType
::
CELL_INFO_REQUEST
,
sti
)
{
{
}
}
};
};
struct
SraCellInfoResponse
:
Sra
Message
struct
RlsCellInfoResponse
:
Rls
Message
{
{
GlobalNci
cellId
{};
GlobalNci
cellId
{};
int
tac
{};
int
tac
{};
...
@@ -59,23 +59,23 @@ struct SraCellInfoResponse : SraMessage
...
@@ -59,23 +59,23 @@ struct SraCellInfoResponse : SraMessage
std
::
string
gnbName
{};
std
::
string
gnbName
{};
std
::
string
linkIp
{};
std
::
string
linkIp
{};
explicit
SraCellInfoResponse
(
uint64_t
sti
)
:
Sra
Message
(
EMessageType
::
CELL_INFO_RESPONSE
,
sti
)
explicit
RlsCellInfoResponse
(
uint64_t
sti
)
:
Rls
Message
(
EMessageType
::
CELL_INFO_RESPONSE
,
sti
)
{
{
}
}
};
};
struct
SraPduDelivery
:
Sra
Message
struct
RlsPduDelivery
:
Rls
Message
{
{
EPduType
pduType
{};
EPduType
pduType
{};
OctetString
pdu
{};
OctetString
pdu
{};
OctetString
payload
{};
OctetString
payload
{};
explicit
SraPduDelivery
(
uint64_t
sti
)
:
Sra
Message
(
EMessageType
::
PDU_DELIVERY
,
sti
)
explicit
RlsPduDelivery
(
uint64_t
sti
)
:
Rls
Message
(
EMessageType
::
PDU_DELIVERY
,
sti
)
{
{
}
}
};
};
void
EncodeRlsMessage
(
const
Sra
Message
&
msg
,
OctetString
&
stream
);
void
EncodeRlsMessage
(
const
Rls
Message
&
msg
,
OctetString
&
stream
);
std
::
unique_ptr
<
Sra
Message
>
DecodeRlsMessage
(
const
OctetView
&
stream
);
std
::
unique_ptr
<
Rls
Message
>
DecodeRlsMessage
(
const
OctetView
&
stream
);
}
// namespace sra
}
// namespace rls
\ No newline at end of file
\ 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