Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
a38e368b
Commit
a38e368b
authored
Nov 16, 2021
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix gtp-u address between NSA and SA modes
parent
66073d50
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
51 deletions
+44
-51
executables/nr-softmodem.c
executables/nr-softmodem.c
+4
-0
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+29
-27
openair2/GNB_APP/gnb_paramdef.h
openair2/GNB_APP/gnb_paramdef.h
+11
-23
openair3/ocp-gtpu/gtp_itf.cpp
openair3/ocp-gtpu/gtp_itf.cpp
+0
-1
No files found.
executables/nr-softmodem.c
View file @
a38e368b
...
...
@@ -326,6 +326,10 @@ int create_gNB_tasks(uint32_t gnb_nb) {
if
(
AMF_MODE_ENABLED
)
{
char
*
gnb_ipv4_address_for_NGU
=
NULL
;
uint32_t
gnb_port_for_NGU
=
0
;
char
*
gnb_ipv4_address_for_S1U
=
NULL
;
uint32_t
gnb_port_for_S1U
=
0
;
paramdef_t
NETParams
[]
=
GNBNETPARAMS_DESC
;
char
aprefix
[
MAX_OPTNAME_SIZE
*
2
+
8
];
sprintf
(
aprefix
,
"%s.[%i].%s"
,
GNB_CONFIG_STRING_GNB_LIST
,
0
,
GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG
);
...
...
openair2/GNB_APP/gnb_config.c
View file @
a38e368b
...
...
@@ -1126,22 +1126,14 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
int
RCconfig_nr_gtpu
(
void
)
{
int
num_gnbs
=
0
;
char
*
gnb_interface_name_for_NGU
=
NULL
;
char
*
gnb_ipv4_address_for_NGU
=
NULL
;
uint32_t
gnb_port_for_NGU
=
0
;
char
*
gnb_interface_name_for_S1U
=
NULL
;
char
*
gnb_ipv4_address_for_S1U
=
NULL
;
uint32_t
gnb_port_for_S1U
=
0
;
char
*
address
=
NULL
;
char
*
cidr
=
NULL
;
char
gtpupath
[
MAX_OPTNAME_SIZE
*
2
+
8
];
paramdef_t
GNBSParams
[]
=
GNBSPARAMS_DESC
;
paramdef_t
NETParams
[]
=
GNBNETPARAMS_DESC
;
paramdef_t
GTPUParams
[]
=
GNBGTPUPARAMS_DESC
;
LOG_I
(
GTPU
,
"Configuring GTPu
\n
"
);
/* get number of active eNodeBs */
...
...
@@ -1151,17 +1143,18 @@ int RCconfig_nr_gtpu(void ) {
"Failed to parse config file no active gNodeBs in %s
\n
"
,
GNB_CONFIG_STRING_ACTIVE_GNBS
);
sprintf
(
gtpupath
,
"%s.[%i].%s"
,
GNB_CONFIG_STRING_GNB_LIST
,
0
,
GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG
);
config_get
(
GTPUParams
,
sizeof
(
GTPUParams
)
/
sizeof
(
paramdef_t
),
gtpupath
);
config_get
(
NETParams
,
sizeof
(
NETParams
)
/
sizeof
(
paramdef_t
),
gtpupath
);
if
(
NETParams
[
0
].
strptr
!=
NULL
)
char
*
cidr
=
NULL
,
*
address
=
NULL
;
int
port
;
if
(
NETParams
[
1
].
strptr
!=
NULL
)
{
LOG_I
(
GTPU
,
"SA mode
\n
"
);
else
address
=
strtok_r
(
gnb_ipv4_address_for_NGU
,
"/"
,
&
cidr
);
port
=
gnb_port_for_NGU
;
}
else
{
LOG_I
(
GTPU
,
"NSA mode
\n
"
);
cidr
=
gnb_ipv4_address
_for_S1U
;
address
=
strtok
(
cidr
,
"/"
);
address
=
strtok_r
(
gnb_ipv4_address_for_S1U
,
"/"
,
&
cidr
);
port
=
gnb_port
_for_S1U
;
}
if
(
address
)
{
MessageDef
*
message
;
...
...
@@ -1169,12 +1162,12 @@ int RCconfig_nr_gtpu(void ) {
AssertFatal
(
message
!=
NULL
,
""
);
IPV4_STR_ADDR_TO_INT_NWBO
(
address
,
GTPV1U_REQ
(
message
).
localAddr
,
"BAD IP ADDRESS FORMAT FOR gNB NG_U !
\n
"
);
LOG_I
(
GTPU
,
"Configuring GTPu address : %s -> %x
\n
"
,
address
,
GTPV1U_REQ
(
message
).
localAddr
);
GTPV1U_REQ
(
message
).
localPort
=
gnb_port_for_NGU
;
GTPV1U_REQ
(
message
).
localPort
=
port
;
strcpy
(
GTPV1U_REQ
(
message
).
localAddrStr
,
address
);
sprintf
(
GTPV1U_REQ
(
message
).
localPortStr
,
"%d"
,
gnb_port_for_NGU
);
sprintf
(
GTPV1U_REQ
(
message
).
localPortStr
,
"%d"
,
port
);
itti_send_msg_to_task
(
TASK_VARIABLE
,
0
,
message
);
// data model is wrong: gtpu doesn't have enb_id (or module_id)
}
else
LOG_E
(
GTPU
,
"invalid address for NG
U
\n
"
);
LOG_E
(
GTPU
,
"invalid address for NGU or S1
U
\n
"
);
return
0
;
}
...
...
@@ -1193,6 +1186,10 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
(
void
)
my_int
;
memset
((
char
*
)
active_gnb
,
0
,
MAX_GNB
*
sizeof
(
char
*
));
char
*
gnb_ipv4_address_for_NGU
=
NULL
;
uint32_t
gnb_port_for_NGU
=
0
;
char
*
gnb_ipv4_address_for_S1U
=
NULL
;
uint32_t
gnb_port_for_S1U
=
0
;
paramdef_t
GNBSParams
[]
=
GNBSPARAMS_DESC
;
paramdef_t
GNBParams
[]
=
GNBPARAMS_DESC
;
...
...
@@ -1534,6 +1531,11 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
paramdef_t
X2Params
[]
=
X2PARAMS_DESC
;
paramlist_def_t
X2ParamList
=
{
ENB_CONFIG_STRING_TARGET_ENB_X2_IP_ADDRESS
,
NULL
,
0
};
paramdef_t
SCTPParams
[]
=
GNBSCTPPARAMS_DESC
;
char
*
gnb_ipv4_address_for_NGU
=
NULL
;
uint32_t
gnb_port_for_NGU
=
0
;
char
*
gnb_ipv4_address_for_S1U
=
NULL
;
uint32_t
gnb_port_for_S1U
=
0
;
paramdef_t
NETParams
[]
=
GNBNETPARAMS_DESC
;
/* TODO: fix the size - if set lower we have a crash (MAX_OPTNAME_SIZE was 64 when this code was written) */
/* this is most probably a problem with the config module */
...
...
openair2/GNB_APP/gnb_paramdef.h
View file @
a38e368b
...
...
@@ -334,29 +334,17 @@ typedef enum {
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GNBNETPARAMS_DESC { \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NGU, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_NGU, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0} \
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* GTPU configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GNBGTPUPARAMS_DESC { \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NGU, NULL, 0, strptr:&gnb_interface_name_for_NGU, defstrval:"lo", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_NGU, NULL, 0, strptr:&gnb_ipv4_address_for_NGU, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, uptr:&gnb_port_for_NGU, defintval:2152, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:&gnb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1U, NULL, 0, strptr:&gnb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:&gnb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \
}
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NGU, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_NGU, NULL, 0, strptr:&gnb_ipv4_address_for_NGU, defstrval:"127.0.0.1",TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, uptr:&gnb_port_for_NGU, defintval:2152L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1U, NULL, 0, strptr:&gnb_ipv4_address_for_S1U, defstrval:"127.0.0.1",TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:&gnb_port_for_S1U, defintval:2152L, TYPE_UINT, 0} \
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
...
...
openair3/ocp-gtpu/gtp_itf.cpp
View file @
a38e368b
...
...
@@ -150,7 +150,6 @@ static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, te
to
.
sin_addr
.
s_addr
=
peerIp
;
LOG_D
(
GTPU
,
"sending packet size: %d to %s
\n
"
,
fullSize
,
inet_ntoa
(
to
.
sin_addr
)
);
int
ret
;
if
((
ret
=
sendto
(
h
,
(
void
*
)
buffer
,
(
size_t
)
fullSize
,
0
,(
struct
sockaddr
*
)
&
to
,
sizeof
(
to
)
))
!=
fullSize
)
{
LOG_E
(
GTPU
,
"[SD %d] Failed to send data to "
IPV4_ADDR
" on port %d, buffer size %u, ret: %d, errno: %d
\n
"
,
h
,
IPV4_ADDR_FORMAT
(
peerIp
),
peerPort
,
fullSize
,
ret
,
errno
);
...
...
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