Commit 7b7bfdaf authored by Lionel Gauthier's avatar Lionel Gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6285 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 21fd7cb0
This diff is collapsed.
......@@ -123,37 +123,35 @@ int sgw_lite_init(char* config_file_name_pP)
{
SPGW_APP_DEBUG("Initializing SPGW-APP task interface\n");
#if defined (ENABLE_USE_GTPU_IN_KERNEL)
spgw_system("modprobe ip_tables", SPGW_ABORT_ON_ERROR);
spgw_system("modprobe x_tables", SPGW_ABORT_ON_ERROR);
spgw_system("iptables -P INPUT ACCEPT", SPGW_WARN_ON_ERROR);
spgw_system("iptables -F INPUT", SPGW_WARN_ON_ERROR);
spgw_system("iptables -P OUTPUT ACCEPT", SPGW_WARN_ON_ERROR);
spgw_system("iptables -F OUTPUT", SPGW_WARN_ON_ERROR);
spgw_system("iptables -P FORWARD ACCEPT", SPGW_WARN_ON_ERROR);
spgw_system("iptables -F FORWARD", SPGW_WARN_ON_ERROR);
spgw_system("iptables -t nat -F", SPGW_WARN_ON_ERROR);
spgw_system("iptables -t mangle -F", SPGW_WARN_ON_ERROR);
spgw_system("iptables -t filter -F", SPGW_WARN_ON_ERROR);
spgw_system("iptables -t raw -F", SPGW_WARN_ON_ERROR);
spgw_system("ip route flush cache", SPGW_WARN_ON_ERROR);
spgw_system("rmmod iptable_raw > /dev/null 2>&1", SPGW_WARN_ON_ERROR);
spgw_system("rmmod iptable_mangle > /dev/null 2>&1", SPGW_WARN_ON_ERROR);
spgw_system("rmmod iptable_nat > /dev/null 2>&1", SPGW_WARN_ON_ERROR);
spgw_system("rmmod iptable_filter > /dev/null 2>&1", SPGW_WARN_ON_ERROR);
spgw_system("rmmod ip_tables > /dev/null 2>&1", SPGW_WARN_ON_ERROR);
spgw_system("rmmod xt_state xt_mark xt_GTPUAH xt_GTPURH xt_tcpudp xt_connmark ipt_LOG ipt_MASQUERADE > /dev/null 2>&1", SPGW_WARN_ON_ERROR);
spgw_system("rmmod x_tables > /dev/null 2>&1", SPGW_WARN_ON_ERROR);
spgw_system("rmmod nf_conntrack_netlink nfnetlink nf_nat nf_conntrack_ipv4 nf_conntrack > /dev/null 2>&1", SPGW_WARN_ON_ERROR);
spgw_system("modprobe ip_tables", SPGW_ABORT_ON_ERROR);
spgw_system("modprobe x_tables", SPGW_ABORT_ON_ERROR);
spgw_system("sysctl -w net.ipv4.netfilter.ip_conntrack_max=16000", SPGW_WARN_ON_ERROR);
spgw_system("sysctl -w net.ipv4.ip_forward=1", SPGW_WARN_ON_ERROR);
spgw_system("sysctl -w net.ipv4.conf.all.accept_local=1",SPGW_WARN_ON_ERROR);
spgw_system("sysctl -w net.ipv4.conf.all.log_martians=1",SPGW_WARN_ON_ERROR);
spgw_system("sysctl -w net.ipv4.conf.all.route_localnet=1",SPGW_WARN_ON_ERROR);
spgw_system("sysctl -w net.ipv4.conf.all.rp_filter=0",SPGW_WARN_ON_ERROR);
spgw_system("insmod $OPENAIR_TARGETS/bin/xt_GTPUAH.ko", SPGW_ABORT_ON_ERROR);
spgw_system("insmod $OPENAIR_TARGETS/bin/xt_GTPURH.ko", SPGW_ABORT_ON_ERROR);
spgw_system("modprobe ip_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe x_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -P INPUT ACCEPT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F INPUT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -P OUTPUT ACCEPT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F OUTPUT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -P FORWARD ACCEPT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F FORWARD", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t nat -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t mangle -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t filter -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t raw -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("ip route flush cache", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod iptable_raw > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod iptable_mangle > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod iptable_nat > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod iptable_filter > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod ip_tables > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod xt_state xt_mark xt_GTPUAH xt_GTPURH xt_tcpudp xt_connmark ipt_LOG ipt_MASQUERADE > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod x_tables > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod nf_conntrack_netlink nfnetlink nf_nat nf_conntrack_ipv4 nf_conntrack > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe ip_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe x_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.netfilter.ip_conntrack_max=16000", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.ip_forward=1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.conf.all.accept_local=1",SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.conf.all.log_martians=1",SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.conf.all.route_localnet=1",SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.conf.all.rp_filter=0",SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
#endif
spgw_config_init(config_file_name_pP, &spgw_config);
pgw_lite_load_pool_ip_addresses();
......
This diff is collapsed.
......@@ -96,6 +96,7 @@ typedef struct sgw_config_s {
int sgw_ip_netmask_for_S11;
} ipv4;
int sgw_interface_mtu_for_S1u_S12_S4_up;
int sgw_udp_port_for_S1u_S12_S4_up;
uint8_t sgw_drop_uplink_traffic;
uint8_t sgw_drop_downlink_traffic;
......@@ -148,7 +149,7 @@ extern spgw_config_t spgw_config;
typedef enum { SPGW_WARN_ON_ERROR = 0, SPGW_ABORT_ON_ERROR} spgw_system_abort_control_e;
int spgw_system(char *command_pP, spgw_system_abort_control_e abort_on_errorP);
int spgw_system(char *command_pP, spgw_system_abort_control_e abort_on_errorP, const char * const file_nameP, const int line_numberP);
int spgw_config_process(spgw_config_t* config_pP);
int spgw_config_init(char* lib_config_file_name_pP, spgw_config_t* config_pP);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment