aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/build_rsocket.sh37
-rw-r--r--src/framework/common/base/liblinuxapi/nsfw_lock_file.c2
-rw-r--r--src/framework/include/nsfw_mgr_com_api.h1
-rw-r--r--src/framework/ipc/mgr_com/mgr_com.c1
-rw-r--r--stacks/lwip_stack/CMakeLists.txt2
-rw-r--r--stacks/lwip_stack/lwip_src/api/spl_api_msg.c8
-rw-r--r--stacks/lwip_stack/lwip_src/common/stackx_common_opt.h1
-rw-r--r--stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h2
-rw-r--r--stacks/lwip_stack/lwip_src/socket/stackx_tcp.c1
-rwxr-xr-x[-rw-r--r--]stacks/lwip_stack/release/script/nstack_var.sh0
-rwxr-xr-x[-rw-r--r--]stacks/lwip_stack/release/script/run_nstack_main.sh0
-rwxr-xr-x[-rw-r--r--]stacks/lwip_stack/release/script/run_nstack_master.sh0
-rwxr-xr-x[-rw-r--r--]stacks/lwip_stack/release/send_alarm.sh0
-rwxr-xr-x[-rw-r--r--]stacks/lwip_stack/release/start_nstack.sh0
-rwxr-xr-x[-rw-r--r--]stacks/lwip_stack/release/stop_nstack.sh0
-rwxr-xr-x[-rw-r--r--]stacks/lwip_stack/release/uninstall.sh0
16 files changed, 39 insertions, 16 deletions
diff --git a/scripts/build_rsocket.sh b/scripts/build_rsocket.sh
index ef31c88..9075e3c 100755
--- a/scripts/build_rsocket.sh
+++ b/scripts/build_rsocket.sh
@@ -7,21 +7,34 @@ OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
DMM_DIR=`dirname $(readlink -f $0)`/../
BUILD_DIR=${DMM_DIR}/build
-############### build rsocket
-echo "rsocket build start"
-cd $DMM_DIR/stacks/rsocket
if [ "$OS_ID" == "ubuntu" ]; then
- wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-4.4-1.0.0.0/MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64.tgz
- tar -zxvf MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64.tgz
- cd MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64
+ INSTALLED=`apt list --installed | grep mlnx-ofed`
elif [ "$OS_ID" == "centos" ]; then
- CENT_VERSION=`grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release`
- wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-4.4-1.0.0.0/MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64.tgz
- tar -zxvf MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64.tgz
- cd MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64
+ INSTALLED=`rpm -qa | grep mlnx-ofed`
fi
-sudo ./mlnxofedinstall --force || exit 1
+############### build rsocket
+echo "rsocket build start"
+cd $DMM_DIR/stacks/rsocket
+
+if [ -z $INSTALLED ]; then
+ if [ "$OS_ID" == "ubuntu" ]; then
+ wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-4.4-1.0.0.0/MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64.tgz
+ tar -zxvf MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64.tgz
+ cd MLNX_OFED_LINUX-4.4-1.0.0.0-ubuntu16.04-x86_64
+ elif [ "$OS_ID" == "centos" ]; then
+ CENT_VERSION=`grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release`
+ wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-4.4-1.0.0.0/MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64.tgz
+ tar -zxvf MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64.tgz
+ cd MLNX_OFED_LINUX-4.4-1.0.0.0-rhel${CENT_VERSION}-x86_64
+ else
+ echo "NOT SUPPORT $OS_ID"
+ exit 1
+ fi
+
+ sudo ./mlnxofedinstall --force || exit 1
+
+fi
cd $BUILD_DIR
make dmm_rsocket
@@ -31,4 +44,4 @@ else
echo "rsocket build has FAILED"
exit 1
fi
-echo "rsocket build finished" \ No newline at end of file
+echo "rsocket build finished"
diff --git a/src/framework/common/base/liblinuxapi/nsfw_lock_file.c b/src/framework/common/base/liblinuxapi/nsfw_lock_file.c
index abfbfd1..cef8d95 100644
--- a/src/framework/common/base/liblinuxapi/nsfw_lock_file.c
+++ b/src/framework/common/base/liblinuxapi/nsfw_lock_file.c
@@ -94,6 +94,8 @@ nsfw_proc_start_with_lock (u8 proc_type)
return -1;
}
+ nsfw_mgr_com_mkdir_domainpath (lock_fpath);
+
ret = STRCAT_S (lock_fpath, NSFW_FILE_PATH_LEN, module_name);
if (EOK != ret)
{
diff --git a/src/framework/include/nsfw_mgr_com_api.h b/src/framework/include/nsfw_mgr_com_api.h
index 56ec08f..9bbcaca 100644
--- a/src/framework/include/nsfw_mgr_com_api.h
+++ b/src/framework/include/nsfw_mgr_com_api.h
@@ -186,6 +186,7 @@ extern int nsfw_mgr_run_script (const char *cmd, char *result,
extern int nsfw_mgr_com_chk_hbt (int v_add);
extern i32 nsfw_set_close_on_exec (i32 sock);
extern int nsfw_mgr_comm_fd_init (u32 proc_type);
+extern void nsfw_mgr_com_mkdir_domainpath (char *pathname);
#ifdef __cplusplus
/* *INDENT-OFF* */
diff --git a/src/framework/ipc/mgr_com/mgr_com.c b/src/framework/ipc/mgr_com/mgr_com.c
index 2fb9789..a2998fa 100644
--- a/src/framework/ipc/mgr_com/mgr_com.c
+++ b/src/framework/ipc/mgr_com/mgr_com.c
@@ -1828,7 +1828,6 @@ nsfw_mgr_comm_fd_init (u32 proc_type)
* Calls :
* Called By :
*****************************************************************************/
-void nsfw_mgr_com_mkdir_domainpath (char *pathname);
void
nsfw_mgr_com_mkdir_domainpath (char *pathname)
{
diff --git a/stacks/lwip_stack/CMakeLists.txt b/stacks/lwip_stack/CMakeLists.txt
index 297d2d9..3992f20 100644
--- a/stacks/lwip_stack/CMakeLists.txt
+++ b/stacks/lwip_stack/CMakeLists.txt
@@ -48,8 +48,6 @@ FILE(WRITE ${post_compile} "#!/bin/bash\n")
FILE(APPEND ${post_compile}
"
-find ${CMAKE_CURRENT_LIST_DIR}/release/ -name \"*.sh\" -exec chmod +x {} \\;
-find ${CMAKE_CURRENT_LIST_DIR}/release/ -name \"*.py\" -exec chmod +x {} \\;
ln -sfn ./run_nstack_main.sh ${CMAKE_CURRENT_LIST_DIR}/release/script/run_nstack.sh
echo post compile process success.
"
diff --git a/stacks/lwip_stack/lwip_src/api/spl_api_msg.c b/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
index 6bff960..c4052b3 100644
--- a/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
+++ b/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
@@ -22,6 +22,7 @@
//#include "sockets.h"
#include <netinet/in.h>
#include <errno.h>
+#include <netinet/tcp.h>
#include "stackx_prot_com.h"
#include "spl_api.h"
@@ -2523,7 +2524,12 @@ do_get_tcpproto_getsockopt_internal (struct common_pcb *cpcb,
NSPOL_LOGDBG (SOCKETS_DEBUG, "]fd=%d,SPL_TCP_KEEPCNT=%d",
cpcb->socket, *(int *) optval);
break;
-
+ case SPL_TCP_INFO:
+ ((struct tcp_info *) optval)->tcpi_total_retrans = (int) tpcb->nrtx;
+ ((struct tcp_info *) optval)->tcpi_snd_mss = (int) tpcb->mss;
+ ((struct tcp_info *) optval)->tcpi_rtt = (int) tpcb->sa;
+ ((struct tcp_info *) optval)->tcpi_snd_cwnd = (int) tpcb->cwnd;
+ break;
default:
NSPOL_LOGDBG (SOCKETS_DEBUG, "unsupported]optname=%d", optname);
SET_MSG_ERR (m, EOPNOTSUPP);
diff --git a/stacks/lwip_stack/lwip_src/common/stackx_common_opt.h b/stacks/lwip_stack/lwip_src/common/stackx_common_opt.h
index d2d01e5..feccc3f 100644
--- a/stacks/lwip_stack/lwip_src/common/stackx_common_opt.h
+++ b/stacks/lwip_stack/lwip_src/common/stackx_common_opt.h
@@ -102,6 +102,7 @@ extern "C" {
#define SPL_TCP_KEEPCNT 0x06
#define SPL_TCP_LINGER2 0x08
#define SPL_TCP_DEFER_ACCEPT 0x09
+#define SPL_TCP_INFO 0x0B
typedef enum spl_netconn_type
{
diff --git a/stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h b/stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h
index 119c26a..3088150 100644
--- a/stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h
+++ b/stacks/lwip_stack/lwip_src/common/stackx_spl_msg.h
@@ -21,6 +21,7 @@
#include "stackx_spl_share.h"
#include "stackx_common_opt.h"
#include <sys/socket.h>
+#include <netinet/tcp.h>
#ifdef __cplusplus
/* *INDENT-OFF* */
@@ -207,6 +208,7 @@ typedef struct
//struct in_addr inaddr_optval;
//struct linger _linger;
struct timeval timeval_optval;
+ struct tcp_info tpinfo;
//ipmreq ipmreq_optval; //Multicast support later
} optval;
diff --git a/stacks/lwip_stack/lwip_src/socket/stackx_tcp.c b/stacks/lwip_stack/lwip_src/socket/stackx_tcp.c
index 3225c2f..0042e54 100644
--- a/stacks/lwip_stack/lwip_src/socket/stackx_tcp.c
+++ b/stacks/lwip_stack/lwip_src/socket/stackx_tcp.c
@@ -498,6 +498,7 @@ sbr_getsockopt_ipproto_tcp (int optname, void *optval, socklen_t optlen)
case SPL_TCP_KEEPIDLE:
case SPL_TCP_KEEPINTVL:
case SPL_TCP_KEEPCNT:
+ case SPL_TCP_INFO:
break;
default:
err = ENOPROTOOPT;
diff --git a/stacks/lwip_stack/release/script/nstack_var.sh b/stacks/lwip_stack/release/script/nstack_var.sh
index 9a1c612..9a1c612 100644..100755
--- a/stacks/lwip_stack/release/script/nstack_var.sh
+++ b/stacks/lwip_stack/release/script/nstack_var.sh
diff --git a/stacks/lwip_stack/release/script/run_nstack_main.sh b/stacks/lwip_stack/release/script/run_nstack_main.sh
index 2bd9e0d..2bd9e0d 100644..100755
--- a/stacks/lwip_stack/release/script/run_nstack_main.sh
+++ b/stacks/lwip_stack/release/script/run_nstack_main.sh
diff --git a/stacks/lwip_stack/release/script/run_nstack_master.sh b/stacks/lwip_stack/release/script/run_nstack_master.sh
index 8da0d49..8da0d49 100644..100755
--- a/stacks/lwip_stack/release/script/run_nstack_master.sh
+++ b/stacks/lwip_stack/release/script/run_nstack_master.sh
diff --git a/stacks/lwip_stack/release/send_alarm.sh b/stacks/lwip_stack/release/send_alarm.sh
index 46ea413..46ea413 100644..100755
--- a/stacks/lwip_stack/release/send_alarm.sh
+++ b/stacks/lwip_stack/release/send_alarm.sh
diff --git a/stacks/lwip_stack/release/start_nstack.sh b/stacks/lwip_stack/release/start_nstack.sh
index db0c084..db0c084 100644..100755
--- a/stacks/lwip_stack/release/start_nstack.sh
+++ b/stacks/lwip_stack/release/start_nstack.sh
diff --git a/stacks/lwip_stack/release/stop_nstack.sh b/stacks/lwip_stack/release/stop_nstack.sh
index 48d1af7..48d1af7 100644..100755
--- a/stacks/lwip_stack/release/stop_nstack.sh
+++ b/stacks/lwip_stack/release/stop_nstack.sh
diff --git a/stacks/lwip_stack/release/uninstall.sh b/stacks/lwip_stack/release/uninstall.sh
index 92ae5fe..92ae5fe 100644..100755
--- a/stacks/lwip_stack/release/uninstall.sh
+++ b/stacks/lwip_stack/release/uninstall.sh