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
7bc0d097
Commit
7bc0d097
authored
Dec 24, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NTS memory leak fix
parent
1a4e2296
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
19 deletions
+19
-19
src/gnb/rrc/broadcast.cpp
src/gnb/rrc/broadcast.cpp
+2
-2
src/gnb/rrc/channel.cpp
src/gnb/rrc/channel.cpp
+5
-5
src/gnb/rrc/connection.cpp
src/gnb/rrc/connection.cpp
+1
-1
src/gnb/rrc/handler.cpp
src/gnb/rrc/handler.cpp
+3
-3
src/gnb/rrc/task.hpp
src/gnb/rrc/task.hpp
+5
-5
src/lib/rrc/encode.hpp
src/lib/rrc/encode.hpp
+3
-3
No files found.
src/gnb/rrc/broadcast.cpp
View file @
7bc0d097
...
@@ -112,8 +112,8 @@ void GnbRrcTask::triggerSysInfoBroadcast()
...
@@ -112,8 +112,8 @@ void GnbRrcTask::triggerSysInfoBroadcast()
auto
*
mib
=
ConstructMibMessage
(
m_isBarred
,
m_intraFreqReselectAllowed
);
auto
*
mib
=
ConstructMibMessage
(
m_isBarred
,
m_intraFreqReselectAllowed
);
auto
*
sib1
=
ConstructSib1Message
(
m_cellReserved
,
m_config
->
tac
,
m_config
->
nci
,
m_config
->
plmn
,
m_aiBarringSet
);
auto
*
sib1
=
ConstructSib1Message
(
m_cellReserved
,
m_config
->
tac
,
m_config
->
nci
,
m_config
->
plmn
,
m_aiBarringSet
);
sendRrcMessage
(
*
mib
);
sendRrcMessage
(
mib
);
sendRrcMessage
(
*
sib1
);
sendRrcMessage
(
sib1
);
asn
::
Free
(
asn_DEF_ASN_RRC_BCCH_BCH_Message
,
mib
);
asn
::
Free
(
asn_DEF_ASN_RRC_BCCH_BCH_Message
,
mib
);
asn
::
Free
(
asn_DEF_ASN_RRC_BCCH_DL_SCH_Message
,
sib1
);
asn
::
Free
(
asn_DEF_ASN_RRC_BCCH_DL_SCH_Message
,
sib1
);
...
...
src/gnb/rrc/channel.cpp
View file @
7bc0d097
...
@@ -65,7 +65,7 @@ void GnbRrcTask::handleUplinkRrc(int ueId, rrc::RrcChannel channel, const OctetS
...
@@ -65,7 +65,7 @@ void GnbRrcTask::handleUplinkRrc(int ueId, rrc::RrcChannel channel, const OctetS
}
}
}
}
void
GnbRrcTask
::
sendRrcMessage
(
const
ASN_RRC_BCCH_BCH_Message
&
msg
)
void
GnbRrcTask
::
sendRrcMessage
(
ASN_RRC_BCCH_BCH_Message
*
msg
)
{
{
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_BCCH_BCH_Message
,
msg
);
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_BCCH_BCH_Message
,
msg
);
if
(
pdu
.
length
()
==
0
)
if
(
pdu
.
length
()
==
0
)
...
@@ -81,7 +81,7 @@ void GnbRrcTask::sendRrcMessage(const ASN_RRC_BCCH_BCH_Message &msg)
...
@@ -81,7 +81,7 @@ void GnbRrcTask::sendRrcMessage(const ASN_RRC_BCCH_BCH_Message &msg)
m_base
->
rlsTask
->
push
(
std
::
move
(
w
));
m_base
->
rlsTask
->
push
(
std
::
move
(
w
));
}
}
void
GnbRrcTask
::
sendRrcMessage
(
const
ASN_RRC_BCCH_DL_SCH_Message
&
msg
)
void
GnbRrcTask
::
sendRrcMessage
(
ASN_RRC_BCCH_DL_SCH_Message
*
msg
)
{
{
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_BCCH_DL_SCH_Message
,
msg
);
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_BCCH_DL_SCH_Message
,
msg
);
if
(
pdu
.
length
()
==
0
)
if
(
pdu
.
length
()
==
0
)
...
@@ -97,7 +97,7 @@ void GnbRrcTask::sendRrcMessage(const ASN_RRC_BCCH_DL_SCH_Message &msg)
...
@@ -97,7 +97,7 @@ void GnbRrcTask::sendRrcMessage(const ASN_RRC_BCCH_DL_SCH_Message &msg)
m_base
->
rlsTask
->
push
(
std
::
move
(
w
));
m_base
->
rlsTask
->
push
(
std
::
move
(
w
));
}
}
void
GnbRrcTask
::
sendRrcMessage
(
int
ueId
,
const
ASN_RRC_DL_CCCH_Message
&
msg
)
void
GnbRrcTask
::
sendRrcMessage
(
int
ueId
,
ASN_RRC_DL_CCCH_Message
*
msg
)
{
{
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_DL_CCCH_Message
,
msg
);
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_DL_CCCH_Message
,
msg
);
if
(
pdu
.
length
()
==
0
)
if
(
pdu
.
length
()
==
0
)
...
@@ -113,7 +113,7 @@ void GnbRrcTask::sendRrcMessage(int ueId, const ASN_RRC_DL_CCCH_Message &msg)
...
@@ -113,7 +113,7 @@ void GnbRrcTask::sendRrcMessage(int ueId, const ASN_RRC_DL_CCCH_Message &msg)
m_base
->
rlsTask
->
push
(
std
::
move
(
w
));
m_base
->
rlsTask
->
push
(
std
::
move
(
w
));
}
}
void
GnbRrcTask
::
sendRrcMessage
(
int
ueId
,
const
ASN_RRC_DL_DCCH_Message
&
msg
)
void
GnbRrcTask
::
sendRrcMessage
(
int
ueId
,
ASN_RRC_DL_DCCH_Message
*
msg
)
{
{
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_DL_DCCH_Message
,
msg
);
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_DL_DCCH_Message
,
msg
);
if
(
pdu
.
length
()
==
0
)
if
(
pdu
.
length
()
==
0
)
...
@@ -129,7 +129,7 @@ void GnbRrcTask::sendRrcMessage(int ueId, const ASN_RRC_DL_DCCH_Message &msg)
...
@@ -129,7 +129,7 @@ void GnbRrcTask::sendRrcMessage(int ueId, const ASN_RRC_DL_DCCH_Message &msg)
m_base
->
rlsTask
->
push
(
std
::
move
(
w
));
m_base
->
rlsTask
->
push
(
std
::
move
(
w
));
}
}
void
GnbRrcTask
::
sendRrcMessage
(
const
ASN_RRC_PCCH_Message
&
msg
)
void
GnbRrcTask
::
sendRrcMessage
(
ASN_RRC_PCCH_Message
*
msg
)
{
{
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_PCCH_Message
,
msg
);
OctetString
pdu
=
rrc
::
encode
::
EncodeS
(
asn_DEF_ASN_RRC_PCCH_Message
,
msg
);
if
(
pdu
.
length
()
==
0
)
if
(
pdu
.
length
()
==
0
)
...
...
src/gnb/rrc/connection.cpp
View file @
7bc0d097
...
@@ -88,7 +88,7 @@ void GnbRrcTask::receiveRrcSetupRequest(int ueId, const ASN_RRC_RRCSetupRequest
...
@@ -88,7 +88,7 @@ void GnbRrcTask::receiveRrcSetupRequest(int ueId, const ASN_RRC_RRCSetupRequest
m_logger
->
info
(
"RRC Setup for UE[%d]"
,
ueId
);
m_logger
->
info
(
"RRC Setup for UE[%d]"
,
ueId
);
sendRrcMessage
(
ueId
,
*
pdu
);
sendRrcMessage
(
ueId
,
pdu
);
asn
::
Free
(
asn_DEF_ASN_RRC_DL_CCCH_Message
,
pdu
);
asn
::
Free
(
asn_DEF_ASN_RRC_DL_CCCH_Message
,
pdu
);
}
}
...
...
src/gnb/rrc/handler.cpp
View file @
7bc0d097
...
@@ -54,7 +54,7 @@ void GnbRrcTask::handleDownlinkNasDelivery(int ueId, const OctetString &nasPdu)
...
@@ -54,7 +54,7 @@ void GnbRrcTask::handleDownlinkNasDelivery(int ueId, const OctetString &nasPdu)
c1
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
=
asn
::
New
<
ASN_RRC_DedicatedNAS_Message_t
>
();
c1
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
=
asn
::
New
<
ASN_RRC_DedicatedNAS_Message_t
>
();
asn
::
SetOctetString
(
*
c1
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
,
nasPdu
);
asn
::
SetOctetString
(
*
c1
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
,
nasPdu
);
sendRrcMessage
(
ueId
,
*
pdu
);
sendRrcMessage
(
ueId
,
pdu
);
asn
::
Free
(
asn_DEF_ASN_RRC_DL_DCCH_Message
,
pdu
);
asn
::
Free
(
asn_DEF_ASN_RRC_DL_DCCH_Message
,
pdu
);
}
}
...
@@ -87,7 +87,7 @@ void GnbRrcTask::releaseConnection(int ueId)
...
@@ -87,7 +87,7 @@ void GnbRrcTask::releaseConnection(int ueId)
rrcRelease
->
criticalExtensions
.
present
=
ASN_RRC_RRCRelease__criticalExtensions_PR_rrcRelease
;
rrcRelease
->
criticalExtensions
.
present
=
ASN_RRC_RRCRelease__criticalExtensions_PR_rrcRelease
;
rrcRelease
->
criticalExtensions
.
choice
.
rrcRelease
=
asn
::
New
<
ASN_RRC_RRCRelease_IEs
>
();
rrcRelease
->
criticalExtensions
.
choice
.
rrcRelease
=
asn
::
New
<
ASN_RRC_RRCRelease_IEs
>
();
sendRrcMessage
(
ueId
,
*
pdu
);
sendRrcMessage
(
ueId
,
pdu
);
asn
::
Free
(
asn_DEF_ASN_RRC_DL_DCCH_Message
,
pdu
);
asn
::
Free
(
asn_DEF_ASN_RRC_DL_DCCH_Message
,
pdu
);
// Delete UE RRC context
// Delete UE RRC context
...
@@ -130,7 +130,7 @@ void GnbRrcTask::handlePaging(const asn::Unique<ASN_NGAP_FiveG_S_TMSI> &tmsi,
...
@@ -130,7 +130,7 @@ void GnbRrcTask::handlePaging(const asn::Unique<ASN_NGAP_FiveG_S_TMSI> &tmsi,
paging
->
pagingRecordList
=
asn
::
NewFor
(
paging
->
pagingRecordList
);
paging
->
pagingRecordList
=
asn
::
NewFor
(
paging
->
pagingRecordList
);
asn
::
SequenceAdd
(
*
paging
->
pagingRecordList
,
record
);
asn
::
SequenceAdd
(
*
paging
->
pagingRecordList
,
record
);
sendRrcMessage
(
*
pdu
);
sendRrcMessage
(
pdu
);
asn
::
Free
(
asn_DEF_ASN_RRC_PCCH_Message
,
pdu
);
asn
::
Free
(
asn_DEF_ASN_RRC_PCCH_Message
,
pdu
);
}
}
...
...
src/gnb/rrc/task.hpp
View file @
7bc0d097
...
@@ -80,11 +80,11 @@ class GnbRrcTask : public NtsTask
...
@@ -80,11 +80,11 @@ class GnbRrcTask : public NtsTask
void
receiveUplinkInformationTransfer
(
int
ueId
,
const
ASN_RRC_ULInformationTransfer
&
msg
);
void
receiveUplinkInformationTransfer
(
int
ueId
,
const
ASN_RRC_ULInformationTransfer
&
msg
);
/* RRC channel send message */
/* RRC channel send message */
void
sendRrcMessage
(
const
ASN_RRC_BCCH_BCH_Message
&
msg
);
void
sendRrcMessage
(
ASN_RRC_BCCH_BCH_Message
*
msg
);
void
sendRrcMessage
(
const
ASN_RRC_BCCH_DL_SCH_Message
&
msg
);
void
sendRrcMessage
(
ASN_RRC_BCCH_DL_SCH_Message
*
msg
);
void
sendRrcMessage
(
int
ueId
,
const
ASN_RRC_DL_CCCH_Message
&
msg
);
void
sendRrcMessage
(
int
ueId
,
ASN_RRC_DL_CCCH_Message
*
msg
);
void
sendRrcMessage
(
int
ueId
,
const
ASN_RRC_DL_DCCH_Message
&
msg
);
void
sendRrcMessage
(
int
ueId
,
ASN_RRC_DL_DCCH_Message
*
msg
);
void
sendRrcMessage
(
const
ASN_RRC_PCCH_Message
&
msg
);
void
sendRrcMessage
(
ASN_RRC_PCCH_Message
*
msg
);
/* RRC channel receive message */
/* RRC channel receive message */
void
receiveRrcMessage
(
int
ueId
,
ASN_RRC_BCCH_BCH_Message
*
msg
);
void
receiveRrcMessage
(
int
ueId
,
ASN_RRC_BCCH_BCH_Message
*
msg
);
...
...
src/lib/rrc/encode.hpp
View file @
7bc0d097
...
@@ -24,9 +24,9 @@ namespace rrc::encode
...
@@ -24,9 +24,9 @@ namespace rrc::encode
{
{
template
<
typename
T
>
template
<
typename
T
>
inline
bool
Encode
(
const
asn_TYPE_descriptor_t
&
desc
,
const
T
&
pdu
,
ssize_t
&
encoded
,
uint8_t
*&
buffer
)
inline
bool
Encode
(
const
asn_TYPE_descriptor_t
&
desc
,
T
*
pdu
,
ssize_t
&
encoded
,
uint8_t
*&
buffer
)
{
{
auto
res
=
asn_encode_to_new_buffer
(
nullptr
,
ATS_UNALIGNED_CANONICAL_PER
,
&
desc
,
&
pdu
);
auto
res
=
asn_encode_to_new_buffer
(
nullptr
,
ATS_UNALIGNED_CANONICAL_PER
,
&
desc
,
pdu
);
if
(
res
.
buffer
==
nullptr
||
res
.
result
.
encoded
<
0
)
if
(
res
.
buffer
==
nullptr
||
res
.
result
.
encoded
<
0
)
return
false
;
return
false
;
...
@@ -38,7 +38,7 @@ inline bool Encode(const asn_TYPE_descriptor_t &desc, const T &pdu, ssize_t &enc
...
@@ -38,7 +38,7 @@ inline bool Encode(const asn_TYPE_descriptor_t &desc, const T &pdu, ssize_t &enc
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
OctetString
EncodeS
(
const
asn_TYPE_descriptor_t
&
desc
,
const
T
&
pdu
)
inline
OctetString
EncodeS
(
const
asn_TYPE_descriptor_t
&
desc
,
T
*
pdu
)
{
{
uint8_t
*
buffer
;
uint8_t
*
buffer
;
ssize_t
encoded
;
ssize_t
encoded
;
...
...
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