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
d3d1b392
Unverified
Commit
d3d1b392
authored
Dec 07, 2021
by
Ali Güngör
Committed by
GitHub
Dec 07, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #455 from aligungr/ipv6-sctp
Ipv6 sctp
parents
495de8bf
23696053
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
src/gnb.cpp
src/gnb.cpp
+2
-2
src/gnb/types.cpp
src/gnb/types.cpp
+2
-1
src/lib/sctp/internal.cpp
src/lib/sctp/internal.cpp
+8
-2
No files found.
src/gnb.cpp
View file @
d3d1b392
...
@@ -49,7 +49,7 @@ static nr::gnb::GnbConfig *ReadConfigYaml()
...
@@ -49,7 +49,7 @@ static nr::gnb::GnbConfig *ReadConfigYaml()
result
->
tac
=
yaml
::
GetInt32
(
config
,
"tac"
,
0
,
0xFFFFFF
);
result
->
tac
=
yaml
::
GetInt32
(
config
,
"tac"
,
0
,
0xFFFFFF
);
result
->
portalIp
=
yaml
::
GetIp
(
config
,
"linkIp"
);
result
->
portalIp
=
yaml
::
GetIp
(
config
,
"linkIp"
);
result
->
ngapIp
=
yaml
::
GetIp
4
(
config
,
"ngapIp"
);
result
->
ngapIp
=
yaml
::
GetIp
(
config
,
"ngapIp"
);
result
->
gtpIp
=
yaml
::
GetIp4
(
config
,
"gtpIp"
);
result
->
gtpIp
=
yaml
::
GetIp4
(
config
,
"gtpIp"
);
if
(
yaml
::
HasField
(
config
,
"gtpAdvertiseIp"
))
if
(
yaml
::
HasField
(
config
,
"gtpAdvertiseIp"
))
...
@@ -63,7 +63,7 @@ static nr::gnb::GnbConfig *ReadConfigYaml()
...
@@ -63,7 +63,7 @@ static nr::gnb::GnbConfig *ReadConfigYaml()
for
(
auto
&
amfConfig
:
yaml
::
GetSequence
(
config
,
"amfConfigs"
))
for
(
auto
&
amfConfig
:
yaml
::
GetSequence
(
config
,
"amfConfigs"
))
{
{
nr
::
gnb
::
GnbAmfConfig
c
{};
nr
::
gnb
::
GnbAmfConfig
c
{};
c
.
address
=
yaml
::
GetIp
4
(
amfConfig
,
"address"
);
c
.
address
=
yaml
::
GetIp
(
amfConfig
,
"address"
);
c
.
port
=
static_cast
<
uint16_t
>
(
yaml
::
GetInt32
(
amfConfig
,
"port"
,
1024
,
65535
));
c
.
port
=
static_cast
<
uint16_t
>
(
yaml
::
GetInt32
(
amfConfig
,
"port"
,
1024
,
65535
));
result
->
amfConfigs
.
push_back
(
c
);
result
->
amfConfigs
.
push_back
(
c
);
}
}
...
...
src/gnb/types.cpp
View file @
d3d1b392
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include <sstream>
#include <sstream>
#include <gnb/types.hpp>
#include <gnb/types.hpp>
#include <utils/common.hpp>
namespace
nr
::
gnb
namespace
nr
::
gnb
{
{
...
@@ -38,7 +39,7 @@ Json ToJson(const NgapAmfContext &v)
...
@@ -38,7 +39,7 @@ Json ToJson(const NgapAmfContext &v)
return
Json
::
Obj
({
return
Json
::
Obj
({
{
"id"
,
v
.
ctxId
},
{
"id"
,
v
.
ctxId
},
{
"name"
,
v
.
amfName
},
{
"name"
,
v
.
amfName
},
{
"address"
,
v
.
address
+
":"
+
std
::
to_string
(
v
.
port
)},
{
"address"
,
((
utils
::
GetIpVersion
(
v
.
address
)
==
6
)
?
"["
+
v
.
address
+
"]"
:
v
.
address
)
+
":"
+
std
::
to_string
(
v
.
port
)},
{
"state"
,
ToJson
(
v
.
state
).
str
()},
{
"state"
,
ToJson
(
v
.
state
).
str
()},
{
"capacity"
,
v
.
relativeCapacity
},
{
"capacity"
,
v
.
relativeCapacity
},
{
"association"
,
ToJson
(
v
.
association
)},
{
"association"
,
ToJson
(
v
.
association
)},
...
...
src/lib/sctp/internal.cpp
View file @
d3d1b392
...
@@ -63,7 +63,13 @@ void BindSocket(int sd, const std::string &address, uint16_t port)
...
@@ -63,7 +63,13 @@ void BindSocket(int sd, const std::string &address, uint16_t port)
ThrowError
(
"Bad IPv4 address."
);
ThrowError
(
"Bad IPv4 address."
);
}
}
else
if
(
ipVersion
==
6
)
else
if
(
ipVersion
==
6
)
ThrowError
(
"IPv6 for SCTP is not supported yet."
);
{
auto
addr6
=
(
sockaddr_in6
*
)
addr
;
addr6
->
sin6_family
=
AF_INET6
;
addr6
->
sin6_port
=
htons
(
port
);
if
(
inet_pton
(
AF_INET6
,
address
.
c_str
(),
&
(
addr6
->
sin6_addr
))
!=
1
)
ThrowError
(
"Bad IPv6 address."
);
}
else
else
ThrowError
(
"Bad IPv4 or IPv6 address."
);
ThrowError
(
"Bad IPv4 or IPv6 address."
);
...
...
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