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
97aaab0e
Commit
97aaab0e
authored
Nov 29, 2021
by
Louis Royer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable IPv6 for n2 link (amf)
parent
003d7e9d
Changes
3
Hide 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 @
97aaab0e
...
...
@@ -49,7 +49,7 @@ static nr::gnb::GnbConfig *ReadConfigYaml()
result
->
tac
=
yaml
::
GetInt32
(
config
,
"tac"
,
0
,
0xFFFFFF
);
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"
);
if
(
yaml
::
HasField
(
config
,
"gtpAdvertiseIp"
))
...
...
@@ -63,7 +63,7 @@ static nr::gnb::GnbConfig *ReadConfigYaml()
for
(
auto
&
amfConfig
:
yaml
::
GetSequence
(
config
,
"amfConfigs"
))
{
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
));
result
->
amfConfigs
.
push_back
(
c
);
}
...
...
src/gnb/types.cpp
View file @
97aaab0e
...
...
@@ -9,6 +9,7 @@
#include <sstream>
#include <gnb/types.hpp>
#include <utils/common.hpp>
namespace
nr
::
gnb
{
...
...
@@ -38,7 +39,7 @@ Json ToJson(const NgapAmfContext &v)
return
Json
::
Obj
({
{
"id"
,
v
.
ctxId
},
{
"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
()},
{
"capacity"
,
v
.
relativeCapacity
},
{
"association"
,
ToJson
(
v
.
association
)},
...
...
src/lib/sctp/internal.cpp
View file @
97aaab0e
...
...
@@ -63,7 +63,13 @@ void BindSocket(int sd, const std::string &address, uint16_t port)
ThrowError
(
"Bad IPv4 address."
);
}
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
ThrowError
(
"Bad IPv4 or IPv6 address."
);
...
...
@@ -245,4 +251,4 @@ void ReceiveMessage(int sd, uint32_t ppid, ISctpHandler *handler)
}
}
}
// namespace sctp
\ No newline at end of file
}
// namespace sctp
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