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
7ff3ec37
Commit
7ff3ec37
authored
May 01, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Narrowing conversion fixes
parent
d5546ecd
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
11 deletions
+29
-11
src/gnb/gtp/proto.cpp
src/gnb/gtp/proto.cpp
+1
-1
src/gnb/gtp/task.cpp
src/gnb/gtp/task.cpp
+4
-4
src/gnb/gtp/utils.hpp
src/gnb/gtp/utils.hpp
+4
-4
src/lib/app/cli_base.cpp
src/lib/app/cli_base.cpp
+2
-2
src/utils/octet_string.cpp
src/utils/octet_string.cpp
+5
-0
src/utils/octet_string.hpp
src/utils/octet_string.hpp
+1
-0
src/utils/octet_view.cpp
src/utils/octet_view.cpp
+10
-0
src/utils/octet_view.hpp
src/utils/octet_view.hpp
+2
-0
No files found.
src/gnb/gtp/proto.cpp
View file @
7ff3ec37
...
@@ -243,7 +243,7 @@ GtpMessage *DecodeGtpMessage(const OctetView &stream)
...
@@ -243,7 +243,7 @@ GtpMessage *DecodeGtpMessage(const OctetView &stream)
std
::
unique_ptr
<
PduSessionInformation
>
PduSessionInformation
::
Decode
(
const
OctetView
&
stream
)
std
::
unique_ptr
<
PduSessionInformation
>
PduSessionInformation
::
Decode
(
const
OctetView
&
stream
)
{
{
in
t
startIndex
=
stream
.
currentIndex
();
size_
t
startIndex
=
stream
.
currentIndex
();
uint8_t
octet
=
stream
.
read
();
uint8_t
octet
=
stream
.
read
();
...
...
src/gnb/gtp/task.cpp
View file @
7ff3ec37
...
@@ -139,10 +139,10 @@ void GtpTask::handleSessionRelease(int ueId, int psi)
...
@@ -139,10 +139,10 @@ void GtpTask::handleSessionRelease(int ueId, int psi)
// Remove all session information from rate limiter
// Remove all session information from rate limiter
m_rateLimiter
->
updateSessionUplinkLimit
(
sessionInd
,
0
);
m_rateLimiter
->
updateSessionUplinkLimit
(
sessionInd
,
0
);
m_rateLimiter
->
updateUeDownlinkLimit
(
sessionIn
d
,
0
);
m_rateLimiter
->
updateUeDownlinkLimit
(
ueI
d
,
0
);
// And remove from PDU session table
// And remove from PDU session table
in
t
teid
=
m_pduSessions
[
sessionInd
]
->
downTunnel
.
teid
;
uint32_
t
teid
=
m_pduSessions
[
sessionInd
]
->
downTunnel
.
teid
;
m_pduSessions
.
erase
(
sessionInd
);
m_pduSessions
.
erase
(
sessionInd
);
// And remove from the tree
// And remove from the tree
...
@@ -159,10 +159,10 @@ void GtpTask::handleUeContextDelete(int ueId)
...
@@ -159,10 +159,10 @@ void GtpTask::handleUeContextDelete(int ueId)
{
{
// Remove all session information from rate limiter
// Remove all session information from rate limiter
m_rateLimiter
->
updateSessionUplinkLimit
(
session
,
0
);
m_rateLimiter
->
updateSessionUplinkLimit
(
session
,
0
);
m_rateLimiter
->
updateUeDownlinkLimit
(
session
,
0
);
m_rateLimiter
->
updateUeDownlinkLimit
(
ueId
,
0
);
// And remove from PDU session table
// And remove from PDU session table
in
t
teid
=
m_pduSessions
[
session
]
->
downTunnel
.
teid
;
uint32_
t
teid
=
m_pduSessions
[
session
]
->
downTunnel
.
teid
;
m_pduSessions
.
erase
(
session
);
m_pduSessions
.
erase
(
session
);
// And remove from the tree
// And remove from the tree
...
...
src/gnb/gtp/utils.hpp
View file @
7ff3ec37
...
@@ -22,14 +22,14 @@ inline uint64_t MakeSessionResInd(int ueId, int psi)
...
@@ -22,14 +22,14 @@ inline uint64_t MakeSessionResInd(int ueId, int psi)
return
(
static_cast
<
int64_t
>
(
ueId
)
<<
32LL
)
|
static_cast
<
int64_t
>
(
psi
);
return
(
static_cast
<
int64_t
>
(
ueId
)
<<
32LL
)
|
static_cast
<
int64_t
>
(
psi
);
}
}
inline
int
GetUeId
(
int64_t
sessionResInd
)
inline
int
GetUeId
(
u
int64_t
sessionResInd
)
{
{
return
static_cast
<
int
>
((
sessionResInd
>>
32
LL
)
&
0xFFFFFFFF
LL
);
return
static_cast
<
int
>
((
sessionResInd
>>
32
uLL
)
&
0xFFFFFFFFu
LL
);
}
}
inline
int
GetPsi
(
int64_t
sessionResInd
)
inline
int
GetPsi
(
u
int64_t
sessionResInd
)
{
{
return
static_cast
<
int
>
(
sessionResInd
&
0xFFFFFFFFLL
);
return
static_cast
<
int
>
(
sessionResInd
&
0xFFFFFFFF
u
LL
);
}
}
class
IRateLimiter
class
IRateLimiter
...
...
src/lib/app/cli_base.cpp
View file @
7ff3ec37
...
@@ -57,10 +57,10 @@ void CliServer::sendMessage(const CliMessage &msg)
...
@@ -57,10 +57,10 @@ void CliServer::sendMessage(const CliMessage &msg)
stream
.
appendOctet
(
cons
::
Minor
);
stream
.
appendOctet
(
cons
::
Minor
);
stream
.
appendOctet
(
cons
::
Patch
);
stream
.
appendOctet
(
cons
::
Patch
);
stream
.
appendOctet
(
static_cast
<
int
>
(
msg
.
type
));
stream
.
appendOctet
(
static_cast
<
int
>
(
msg
.
type
));
stream
.
appendOctet4
(
static_cast
<
size_
t
>
(
msg
.
nodeName
.
size
()));
stream
.
appendOctet4
(
static_cast
<
in
t
>
(
msg
.
nodeName
.
size
()));
for
(
char
c
:
msg
.
nodeName
)
for
(
char
c
:
msg
.
nodeName
)
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
c
));
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
c
));
stream
.
appendOctet4
(
static_cast
<
size_
t
>
(
msg
.
value
.
size
()));
stream
.
appendOctet4
(
static_cast
<
in
t
>
(
msg
.
value
.
size
()));
for
(
char
c
:
msg
.
value
)
for
(
char
c
:
msg
.
value
)
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
c
));
stream
.
appendOctet
(
static_cast
<
uint8_t
>
(
c
));
...
...
src/utils/octet_string.cpp
View file @
7ff3ec37
...
@@ -95,6 +95,11 @@ void OctetString::appendOctet4(int v)
...
@@ -95,6 +95,11 @@ void OctetString::appendOctet4(int v)
appendOctet4
(
octet4
{
v
});
appendOctet4
(
octet4
{
v
});
}
}
void
OctetString
::
appendOctet4
(
uint32_t
v
)
{
appendOctet4
(
octet4
{
v
});
}
int
OctetString
::
length
()
const
int
OctetString
::
length
()
const
{
{
return
static_cast
<
int
>
(
m_data
.
size
());
return
static_cast
<
int
>
(
m_data
.
size
());
...
...
src/utils/octet_string.hpp
View file @
7ff3ec37
...
@@ -47,6 +47,7 @@ class OctetString
...
@@ -47,6 +47,7 @@ class OctetString
void
appendOctet3
(
int
v
);
void
appendOctet3
(
int
v
);
void
appendOctet4
(
octet4
v
);
void
appendOctet4
(
octet4
v
);
void
appendOctet4
(
int
v
);
void
appendOctet4
(
int
v
);
void
appendOctet4
(
uint32_t
v
);
void
appendOctet8
(
octet8
v
);
void
appendOctet8
(
octet8
v
);
void
appendOctet8
(
int64_t
v
);
void
appendOctet8
(
int64_t
v
);
void
appendOctet8
(
uint64_t
v
);
void
appendOctet8
(
uint64_t
v
);
...
...
src/utils/octet_view.cpp
View file @
7ff3ec37
...
@@ -24,6 +24,11 @@ OctetString OctetView::readOctetString(int length) const
...
@@ -24,6 +24,11 @@ OctetString OctetView::readOctetString(int length) const
return
OctetString
(
std
::
move
(
v
));
return
OctetString
(
std
::
move
(
v
));
}
}
OctetString
OctetView
::
readOctetString
(
size_t
length
)
const
{
return
readOctetString
(
static_cast
<
int
>
(
length
));
}
OctetString
OctetView
::
readOctetString
()
const
OctetString
OctetView
::
readOctetString
()
const
{
{
return
readOctetString
(
static_cast
<
int
>
(
size
-
index
));
return
readOctetString
(
static_cast
<
int
>
(
size
-
index
));
...
@@ -35,3 +40,8 @@ std::string OctetView::readUtf8String(int length) const
...
@@ -35,3 +40,8 @@ std::string OctetView::readUtf8String(int length) const
index
+=
length
;
index
+=
length
;
return
res
;
return
res
;
}
}
std
::
string
OctetView
::
readUtf8String
(
size_t
length
)
const
{
return
readUtf8String
(
static_cast
<
int
>
(
length
));
}
src/utils/octet_view.hpp
View file @
7ff3ec37
...
@@ -124,6 +124,8 @@ class OctetView
...
@@ -124,6 +124,8 @@ class OctetView
}
}
OctetString
readOctetString
(
int
length
)
const
;
OctetString
readOctetString
(
int
length
)
const
;
OctetString
readOctetString
(
size_t
length
)
const
;
OctetString
readOctetString
()
const
;
OctetString
readOctetString
()
const
;
std
::
string
readUtf8String
(
int
length
)
const
;
std
::
string
readUtf8String
(
int
length
)
const
;
std
::
string
readUtf8String
(
size_t
length
)
const
;
};
};
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