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
zzha zzha
OpenXG-RAN
Commits
2f2949fc
Commit
2f2949fc
authored
Dec 18, 2014
by
Lionel Gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@6288
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
c32ef303
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
57 deletions
+30
-57
openair-cn/SGW-LITE/sgw_lite_handlers.c
openair-cn/SGW-LITE/sgw_lite_handlers.c
+30
-57
No files found.
openair-cn/SGW-LITE/sgw_lite_handlers.c
View file @
2f2949fc
...
...
@@ -613,6 +613,9 @@ sgw_lite_handle_sgi_endpoint_updated(
task_id_t
to_task
;
#if defined (ENABLE_USE_GTPU_IN_KERNEL)
static
uint8_t
iptable_uplink_remove_gtpu
=
FALSE
;
char
*
chain
=
NULL
;
char
cmd
[
256
];
int
ret
;
#endif
#if defined(ENABLE_STANDALONE_EPC)
...
...
@@ -666,8 +669,6 @@ sgw_lite_handle_sgi_endpoint_updated(
modify_response_p
->
cause
=
REQUEST_ACCEPTED
;
modify_response_p
->
trxn
=
new_bearer_ctxt_info_p
->
sgw_eps_bearer_context_information
.
trxn
;
#if defined (ENABLE_USE_GTPU_IN_KERNEL)
char
cmd
[
256
];
int
ret
;
ret
=
snprintf
(
cmd
,
256
,
"iptables -t mangle -A POSTROUTING -d %u.%u.%u.%u -m mark --mark %u -j GTPUAH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action add"
,
...
...
@@ -724,72 +725,44 @@ sgw_lite_handle_sgi_endpoint_updated(
}
//use API when prototype validated
ret
=
spgw_system
(
cmd
,
SPGW_ABORT_ON_ERROR
,
__FILE__
,
__LINE__
);
if
(
ret
<
0
)
{
SPGW_APP_ERROR
(
"ERROR in setting up downlink TUNNEL
\n
"
);
}
}
if
(
iptable_uplink_remove_gtpu
==
FALSE
)
{
ret
=
snprintf
(
cmd
,
256
,
"iptables -t raw -A OUTPUT -s %u.%u.%u.%u -d %u.%u.%u.%u -p udp --dport 2152 -j GTPURH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action remove"
,
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
0
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
1
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
2
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
3
],
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x000000FF
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x0000FF00
)
>>
8
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x00FF0000
)
>>
16
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0xFF000000
)
>>
24
,
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x000000FF
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x0000FF00
)
>>
8
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x00FF0000
)
>>
16
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0xFF000000
)
>>
24
,
eps_bearer_entry_p
->
s_gw_teid_for_S1u_S12_S4_up
,
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
0
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
1
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
2
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
3
],
eps_bearer_entry_p
->
enb_teid_for_S1u
);
if
((
ret
<
0
)
||
(
ret
>
256
))
{
SPGW_APP_ERROR
(
"ERROR in preparing uplink tunnel, tune string length
\n
"
);
exit
(
-
1
);
if
(
strncasecmp
(
"tun"
,
spgw_config
.
sgw_config
.
ipv4
.
sgw_interface_name_for_S1u_S12_S4_up
,
strlen
(
"tun"
))
==
0
)
{
chain
=
"OUTPUT"
;
}
else
{
chain
=
"PREROUTING"
;
}
ret
=
spgw_system
(
cmd
,
SPGW_ABORT_ON_ERROR
,
__FILE__
,
__LINE__
);
ret
=
snprintf
(
cmd
,
256
,
"iptables -t raw -A PREROUTING -i %s -s %u.%u.%u.%u -d %u.%u.%u.%u -p udp --dport 2152 -j GTPURH --action remove --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u "
,
sgw_app
.
sgw_interface_name_for_S1u_S12_S4_up
,
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
0
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
1
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
2
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
3
],
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x000000FF
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x0000FF00
)
>>
8
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x00FF0000
)
>>
16
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0xFF000000
)
>>
24
,
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x000000FF
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x0000FF00
)
>>
8
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x00FF0000
)
>>
16
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0xFF000000
)
>>
24
,
eps_bearer_entry_p
->
s_gw_teid_for_S1u_S12_S4_up
,
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
0
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
1
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
2
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
3
],
eps_bearer_entry_p
->
enb_teid_for_S1u
);
256
,
"iptables -t raw -A %s -s %u.%u.%u.%u -d %u.%u.%u.%u -p udp --dport 2152 -j GTPURH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action remove"
,
chain
,
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
0
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
1
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
2
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
3
],
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x000000FF
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x0000FF00
)
>>
8
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x00FF0000
)
>>
16
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0xFF000000
)
>>
24
,
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x000000FF
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x0000FF00
)
>>
8
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0x00FF0000
)
>>
16
,
(
sgw_app
.
sgw_ip_address_for_S1u_S12_S4_up
&
0xFF000000
)
>>
24
,
eps_bearer_entry_p
->
s_gw_teid_for_S1u_S12_S4_up
,
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
0
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
1
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
2
],
eps_bearer_entry_p
->
enb_ip_address_for_S1u
.
address
.
ipv4_address
[
3
],
eps_bearer_entry_p
->
enb_teid_for_S1u
);
if
((
ret
<
0
)
||
(
ret
>
256
))
{
SPGW_APP_ERROR
(
"ERROR in preparing uplink tunnel, tune string length
\n
"
);
exit
(
-
1
);
}
ret
=
spgw_system
(
cmd
,
SPGW_ABORT_ON_ERROR
,
__FILE__
,
__LINE__
);
if
(
ret
<
0
)
{
SPGW_APP_ERROR
(
"ERROR in setting up uplink TUNNEL
\n
"
);
}
else
{
iptable_uplink_remove_gtpu
=
TRUE
;
}
iptable_uplink_remove_gtpu
=
TRUE
;
}
#endif
}
...
...
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