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
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
canghaiwuhen
OpenXG-RAN
Commits
7d35d3b9
Commit
7d35d3b9
authored
Dec 05, 2014
by
Lionel Gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@6177
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
b4dd000f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
openair-cn/UTILS/mme_config.c
openair-cn/UTILS/mme_config.c
+49
-0
No files found.
openair-cn/UTILS/mme_config.c
View file @
7d35d3b9
...
...
@@ -149,6 +149,23 @@ void mme_config_init(mme_config_t *mme_config_p)
mme_config_p
->
s1ap_config
.
outcome_drop_timer_sec
=
S1AP_OUTCOME_TIMER_DEFAULT
;
}
int
mme_system
(
char
*
command_pP
,
int
abort_on_errorP
)
{
int
ret
=
-
1
;
if
(
command_pP
)
{
fprintf
(
stdout
,
"system command: %s
\n
"
,
command_pP
);
ret
=
system
(
command_pP
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"ERROR in system command %s: %d
\n
"
,
command_pP
,
ret
);
if
(
abort_on_errorP
)
{
exit
(
-
1
);
// may be not exit
}
}
}
return
ret
;
}
static
int
config_parse_file
(
mme_config_t
*
mme_config_p
)
{
config_t
cfg
;
...
...
@@ -173,6 +190,9 @@ static int config_parse_file(mme_config_t *mme_config_p)
char
*
mme_interface_name_for_S11
=
NULL
;
char
*
mme_ip_address_for_S11
=
NULL
;
char
*
sgw_ip_address_for_S11
=
NULL
;
#if defined (ENABLE_USE_GTPU_IN_KERNEL)
char
system_cmd
[
256
];
#endif
config_init
(
&
cfg
);
...
...
@@ -369,6 +389,35 @@ static int config_parse_file(mme_config_t *mme_config_p)
address
=
strtok
(
cidr
,
"/"
);
IPV4_STR_ADDR_TO_INT_NWBO
(
address
,
mme_config_p
->
ipv4
.
mme_ip_address_for_S11
,
"BAD IP ADDRESS FORMAT FOR MME S11 !
\n
"
)
free
(
cidr
);
if
(
strncasecmp
(
"tun"
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
,
strlen
(
"tun"
))
==
0
)
{
if
(
snprintf
(
system_cmd
,
256
,
"ip link set %s down ;openvpn --rmtun --dev %s"
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
)
>
0
)
{
mme_system
(
system_cmd
,
1
);
}
else
{
fprintf
(
stderr
,
"Del %s
\n
"
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
);
}
if
(
snprintf
(
system_cmd
,
256
,
"openvpn --mktun --dev %s;sync;ifconfig %s up;sync"
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
)
>
0
)
{
mme_system
(
system_cmd
,
1
);
}
else
{
fprintf
(
stderr
,
"Create %s
\n
"
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
);
}
if
(
snprintf
(
system_cmd
,
256
,
"ip -4 addr add %s dev %s"
,
mme_ip_address_for_S1_MME
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
)
>
0
)
{
mme_system
(
system_cmd
,
1
);
}
else
{
fprintf
(
stderr
,
"Set IPv4 address on %s
\n
"
,
mme_config_p
->
ipv4
.
mme_interface_name_for_S1_MME
);
}
}
}
}
...
...
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