aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/adapt/nstack_dmm_adpt.c13
-rw-r--r--src/adapt/nstack_rd_mng.c317
-rw-r--r--src/adapt/nstack_rd_mng.h27
-rw-r--r--src/framework/common/base/liblinuxapi/nsfw_lock_file.c7
-rw-r--r--src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c1
-rw-r--r--src/framework/include/nsfw_mgr_com_api.h2
-rw-r--r--src/framework/ipc/mgr_com/mgr_com.c102
-rw-r--r--src/framework/ipc/mgr_com/mgr_com.h4
-rw-r--r--src/nSocket/nstack/nstack.c12
-rw-r--r--src/nSocket/nstack/nstack_module.c2
-rw-r--r--stacks/lwip_stack/lwip_src/api/spl_tcpip.c1
-rw-r--r--stacks/lwip_stack/lwip_src/ip_module/container_ip.c36
-rw-r--r--stacks/lwip_stack/lwip_src/ip_module/network.c60
-rw-r--r--thirdparty/apps/CMakeLists.txt17
15 files changed, 97 insertions, 505 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cf17c75..7f91be0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,7 +113,6 @@ FILE(APPEND ${post_compile}
cp -f ${CMAKE_CURRENT_LIST_DIR}/src/nSocket/include/nstack_dmm_api.h ${CMAKE_CURRENT_LIST_DIR}/release/include/
cp -f ${CMAKE_CURRENT_LIST_DIR}/src/adapt/nstack_dmm_adpt.h ${CMAKE_CURRENT_LIST_DIR}/release/include/
cp -f ${CMAKE_CURRENT_LIST_DIR}/src/adapt/nstack_share_res.h ${CMAKE_CURRENT_LIST_DIR}/release/include/
-cp -f ${CMAKE_CURRENT_LIST_DIR}/src/adapt/nstack_rd_mng.h ${CMAKE_CURRENT_LIST_DIR}/release/include/
cp -f ${CMAKE_CURRENT_LIST_DIR}/src/nSocket/include/declare_syscalls.h ${CMAKE_CURRENT_LIST_DIR}/release/include/
cp -f ${CMAKE_CURRENT_LIST_DIR}/src/framework/include/* ${CMAKE_CURRENT_LIST_DIR}/release/include/
cp -rf ${CMAKE_CURRENT_LIST_DIR}/src/framework/common/base/include/*.h ${CMAKE_CURRENT_LIST_DIR}/release/include/
diff --git a/src/adapt/nstack_dmm_adpt.c b/src/adapt/nstack_dmm_adpt.c
index 637301b..652d0e2 100644
--- a/src/adapt/nstack_dmm_adpt.c
+++ b/src/adapt/nstack_dmm_adpt.c
@@ -32,7 +32,6 @@ extern "C" {
#include "nstack_eventpoll.h"
#include "nstack_dmm_api.h"
#include "nstack_dmm_adpt.h"
-#include "nstack_rd_mng.h"
#include "mgr_com.h"
int g_same_process = 1;
@@ -173,12 +172,6 @@ nstack_adpt_init (nstack_dmm_para * para)
NSFW_LOGERR ("nsep_create_memory failed");
return -1;
}
-
- if (nstack_rd_mng_int (0) != 0)
- {
- NSFW_LOGERR ("nstack_rd_mng_int failed");
- return -1;
- }
}
else
{
@@ -197,12 +190,6 @@ nstack_adpt_init (nstack_dmm_para * para)
NSFW_LOGERR ("nsep_adpt_attach_memory failed");
return -1;
}
-
- if (nstack_rd_mng_int (1) != 0)
- {
- NSFW_LOGERR ("nstack_rd_mng_int failed");
- return -1;
- }
}
void *pret =
diff --git a/src/adapt/nstack_rd_mng.c b/src/adapt/nstack_rd_mng.c
deleted file mode 100644
index cb6a9b1..0000000
--- a/src/adapt/nstack_rd_mng.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
-*
-* Copyright (c) 2018 Huawei Technologies Co.,Ltd.
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at:
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#include <stdlib.h>
-#include "nstack_rd_data.h"
-#include "nsfw_mem_api.h"
-#include "nstack_log.h"
-#include "nstack_securec.h"
-
-#define RD_SHMEM_NAME "rd_table"
-
-#define RD_AGE_MAX_TIME 3
-
-rd_route_table *g_rd_table_handle = NULL;
-
-#define RD_IP_ROUTE_CPY(pnode, name, data) { \
- if (EOK != STRCPY_S((pnode)->data.stack_name, RD_PLANE_NAMELEN, (name))) \
- { \
- NSSOC_LOGERR("STRCPY_S failed]copy_name=%s", name); \
- } \
- (pnode)->data.type = RD_DATA_TYPE_IP; \
- (pnode)->agetime = 0; \
- (pnode)->data.ipdata.addr = (data)->addr; \
- (pnode)->data.ipdata.masklen = (data)->masklen; \
- (pnode)->data.ipdata.resev[0] = 0; \
- (pnode)->data.ipdata.resev[1] = 0; \
-}
-
-/*****************************************************************************
-* Prototype : nstack_rd_mng_int
-* Description : rd mng module init, create a block memory
-* Input : int flag
-* Output : None
-* Return Value : int
-* Calls :
-* Called By : nStackMain
-*****************************************************************************/
-int
-nstack_rd_mng_int (int flag)
-{
- int ret;
- nsfw_mem_zone zname = {
- {NSFW_SHMEM, NSFW_PROC_MAIN, RD_SHMEM_NAME},
- sizeof (rd_route_table),
- NSFW_SOCKET_ANY,
- 0
- };
- NSSOC_LOGINF ("nstack rd mng init begin]flag=%d", flag);
- /*nstack main create, app lookup */
- if (0 == flag)
- {
- g_rd_table_handle = (rd_route_table *) nsfw_mem_zone_create (&zname);
- if (!g_rd_table_handle)
- {
- NSSOC_LOGERR ("mem create fail]mem name=%s", RD_SHMEM_NAME);
- return -1;
- }
- ret =
- MEMSET_S (&(g_rd_table_handle->node[0]), sizeof (rd_route_node), 0,
- sizeof (rd_route_node));
- if (EOK != ret)
- {
- NSSOC_LOGERR ("MEMSET_S failed]ret=%d", ret);
- return -1;
- }
- g_rd_table_handle->size = NSTACK_RD_DATA_MAX;
- g_rd_table_handle->icnt = 0;
- }
- else /* static data will not be erased in fault case */
- {
- g_rd_table_handle =
- (rd_route_table *) nsfw_mem_zone_lookup (&(zname.stname));
- if (!g_rd_table_handle)
- {
- NSSOC_LOGERR ("mem lookup fail]mem name=%s", RD_SHMEM_NAME);
- return -1;
- }
- }
- NSSOC_LOGINF ("nstack rd mng init end flag");
- return 0;
-}
-
-/*****************************************************************************
-* Prototype : nstack_rd_ip_node_insert
-* Description : insert a rd_ip_data into list
-* Input : char *name
-* rd_ip_data *data
-* Output : None
-* Return Value : int
-* Calls :
-* Called By : nStackMain
-*****************************************************************************/
-int
-nstack_rd_ip_node_insert (char *name, rd_ip_data * data)
-{
- if (!g_rd_table_handle)
- {
- NSSOC_LOGERR ("nstack rd mng not inited");
- return -1;
- }
- int iindex = 0;
- rd_route_node *pnode = NULL;
- int agetime = 0;
- int ageindex = -1;
- int freeindex = -1;
- int repeatflag = 0;
-
- for (iindex = 0; iindex < NSTACK_RD_DATA_MAX; iindex++)
- {
- pnode = &(g_rd_table_handle->node[iindex]);
- /*record the index of first free element */
- if (RD_NODE_USELESS == pnode->flag)
- {
- if (-1 == freeindex)
- {
- freeindex = iindex;
- NSSOC_LOGINF ("nstack rd ip free element index:%d was found",
- iindex);
- }
- continue;
- }
-
- /*if is using, and repeat just set flag */
- if (RD_NODE_USING == pnode->flag)
- {
- if (MASK_V (pnode->data.ipdata.addr, pnode->data.ipdata.masklen) ==
- MASK_V (data->addr, data->masklen))
- {
- NSSOC_LOGWAR
- ("nstack:%s, old_addr:0x%x index:%d new_addr:0x%x, masklen:%u was repeat",
- name, pnode->data.ipdata.addr, iindex, data->addr,
- data->masklen);
- repeatflag = 1;
- }
- continue;
- }
-
- /*if flag is deleting, just update the age time, if agetime is on, just set flag to free */
- if (RD_NODE_DELETING == pnode->flag)
- {
- pnode->agetime++;
- if (pnode->agetime >= RD_AGE_MAX_TIME)
- {
- pnode->flag = RD_NODE_USELESS;
- NSSOC_LOGINF
- ("nstack rd ip element index:%d addr:0x%x, masklen:%u was delete and set to free",
- iindex, pnode->data.ipdata.addr, pnode->data.ipdata.masklen);
- }
- /*record delete time */
- if (agetime < pnode->agetime)
- {
- agetime = pnode->agetime;
- ageindex = iindex;
- }
- continue;
- }
- }
-
- /*if repeat, just return */
- if (1 == repeatflag)
- {
- return 0;
- }
- if (-1 == freeindex)
- {
- if (-1 != ageindex)
- {
- freeindex = ageindex;
- }
- else
- {
- NSSOC_LOGERR
- ("the rd table is full,nstack:%s, rd addr:0x%x, masklen:%u can't be inserted",
- name, data->addr, data->masklen);
- return -1;
- }
- }
- pnode = &(g_rd_table_handle->node[freeindex]);
- /*if no free found, just reuse the big agetime */
- RD_IP_ROUTE_CPY (pnode, name, data);
- pnode->flag = RD_NODE_USING; /*last set */
- g_rd_table_handle->icnt++;
- NSSOC_LOGINF ("nstack:%s, rd addr:0x%x, masklen:%u index was inserted",
- name, data->addr, data->masklen);
- return 0;
-}
-
-/*****************************************************************************
-* Prototype : nstack_rd_ip_node_delete
-* Description : rd data delete
-* Input : rd_ip_data *data
-* Output : None
-* Return Value : int
-* Calls :
-* Called By : nStackMain
-* just set delete flag, because
-*****************************************************************************/
-int
-nstack_rd_ip_node_delete (rd_ip_data * data)
-{
- int iindex = 0;
- rd_route_node *pnode = NULL;
-
- if (!g_rd_table_handle)
- {
- NSSOC_LOGERR ("nstack rd mng not inited");
- return -1;
- }
-
- for (iindex = 0; iindex < NSTACK_RD_DATA_MAX; iindex++)
- {
- pnode = &(g_rd_table_handle->node[iindex]);
- if ((RD_NODE_USING == pnode->flag)
- && (MASK_V (pnode->data.ipdata.addr, pnode->data.ipdata.masklen) ==
- MASK_V (data->addr, data->masklen)))
- {
- pnode->flag = RD_NODE_DELETING; /*just set deleting state */
- pnode->agetime = 0;
- g_rd_table_handle->icnt--;
- NSSOC_LOGINF
- ("nstack rd delete:%s, addr:0x%x, masklen:%u index:%d was delete",
- pnode->data.stack_name, data->addr, data->masklen, iindex);
- return 0;
- }
- }
- NSSOC_LOGINF ("nstack rd delete, addr:0x%x, masklen:%u index was not found",
- data->addr, data->masklen);
- return 0;
-}
-
-/*****************************************************************************
-* Prototype : nstack_rd_ip_get
-* Description : get rd data from rd table
-* Input : char *planename
-* rd_route_data **data
-* int *num
-* Output : None
-* Return Value : int
-* Calls :
-* Called By :
-* Note : a block memory was alloc and return by data,
-* this need free by caller if return 0, otherwise no need
-*****************************************************************************/
-int
-nstack_rd_ip_get (rd_route_data ** data, int *num)
-{
- rd_route_data *pdata = NULL;
- rd_route_node *pnode = NULL;
- int size = 0;
- int icnt = 0;
- int idex = 0;
- int ret;
-
- if (!g_rd_table_handle || !data || !num)
- {
- NSSOC_LOGERR ("nstack rd mng not inited or input err");
- return -1;
- }
- size = sizeof (rd_route_data) * g_rd_table_handle->size;
- pdata = (rd_route_data *) malloc (size);
- if (!pdata)
- {
- NSSOC_LOGERR ("rd route data malloc fail");
- return -1;
- }
- ret = MEMSET_S (pdata, size, 0, size);
- if (EOK != ret)
- {
- NSSOC_LOGERR ("MEMSET_S failed]ret=%d", ret);
- free (pdata);
- return -1;
- }
- for (icnt = 0; icnt < g_rd_table_handle->size; icnt++)
- {
- pnode = &(g_rd_table_handle->node[icnt]);
- if (RD_NODE_USING == pnode->flag)
- {
- pdata[idex].type = pnode->data.type;
- pdata[idex].ipdata.addr = pnode->data.ipdata.addr;
- pdata[idex].ipdata.masklen = pnode->data.ipdata.masklen;
- pdata[idex].ipdata.resev[0] = pnode->data.ipdata.resev[0];
- pdata[idex].ipdata.resev[1] = pnode->data.ipdata.resev[1];
- ret =
- STRCPY_S (pdata[idex].stack_name, RD_PLANE_NAMELEN,
- pnode->data.stack_name);
- if (EOK != ret)
- {
- NSSOC_LOGERR ("STRCPY_S failed]ret=%d", ret);
- free (pdata);
- return -1;
- }
- idex++;
- }
- }
- /*if no data fetched , just return fail */
- if (idex == 0)
- {
- free (pdata);
- return -1;
- }
- *data = pdata;
- *num = idex;
- return 0;
-}
diff --git a/src/adapt/nstack_rd_mng.h b/src/adapt/nstack_rd_mng.h
deleted file mode 100644
index f1fe7a3..0000000
--- a/src/adapt/nstack_rd_mng.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-*
-* Copyright (c) 2018 Huawei Technologies Co.,Ltd.
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at:
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#ifndef __NSTACK_RD_MNG_H
-#define __NSTACK_RD_MNG_H
-#include <stdlib.h>
-#include "nstack_rd_data.h"
-
-int nstack_rd_mng_int (int flag);
-int nstack_rd_ip_node_insert (char *name, rd_ip_data * data);
-int nstack_rd_ip_node_delete (rd_ip_data * data);
-int nstack_rd_ip_get (rd_route_data ** data, int *num);
-
-#endif
diff --git a/src/framework/common/base/liblinuxapi/nsfw_lock_file.c b/src/framework/common/base/liblinuxapi/nsfw_lock_file.c
index 0ec196f..abfbfd1 100644
--- a/src/framework/common/base/liblinuxapi/nsfw_lock_file.c
+++ b/src/framework/common/base/liblinuxapi/nsfw_lock_file.c
@@ -94,13 +94,6 @@ nsfw_proc_start_with_lock (u8 proc_type)
return -1;
}
- ret = STRCAT_S (lock_fpath, NSFW_FILE_PATH_LEN, LOCK_FOLDER);
- if (EOK != ret)
- {
- NSFW_LOGERR ("lock init STRCAT_S failed]ret=%d", ret);
- return -1;
- }
-
ret = STRCAT_S (lock_fpath, NSFW_FILE_PATH_LEN, module_name);
if (EOK != ret)
{
diff --git a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c
index abd6ce0..5af828f 100644
--- a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c
+++ b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c
@@ -38,6 +38,7 @@
#define NSFW_SHMEM_FLAG (g_shmem_localdata->enflag)
extern u8 app_mode;
+u8 app_mode = 0;
nsfw_mem_localdata *g_shmem_localdata = NULL;
/*check g_mem_localdata*/
diff --git a/src/framework/include/nsfw_mgr_com_api.h b/src/framework/include/nsfw_mgr_com_api.h
index 094043e..56ec08f 100644
--- a/src/framework/include/nsfw_mgr_com_api.h
+++ b/src/framework/include/nsfw_mgr_com_api.h
@@ -107,7 +107,7 @@ typedef enum _fw_poc_type
NSFW_PROC_MAX = 16
} fw_poc_type;
-#define NSFW_DOMAIN_DIR "/var/run"
+#define NSFW_DOMAIN_DIR "/var/log/nStack/ip_module/"
#define NSTACK_MAX_PROC_NAME_LEN 20
typedef enum _nsfw_mgr_msg_rsp_code
diff --git a/src/framework/ipc/mgr_com/mgr_com.c b/src/framework/ipc/mgr_com/mgr_com.c
index 2b35e2c..bc2aca2 100644
--- a/src/framework/ipc/mgr_com/mgr_com.c
+++ b/src/framework/ipc/mgr_com/mgr_com.c
@@ -32,6 +32,7 @@
#include <stddef.h>
#include <sys/epoll.h>
#include <fcntl.h>
+#include <sys/stat.h>
#include "nsfw_maintain_api.h"
#include "nsfw_ps_api.h"
@@ -320,8 +321,9 @@ nsfw_mgr_msg_free (nsfw_mgr_msg * msg)
i32
nsfw_mgr_get_listen_socket ()
{
- i32 fd, len;
+ i32 fd, len, retVal;
struct sockaddr_un un;
+ char name[NSFW_MGRCOM_PATH_LEN] = { 0 };
if ((fd = nsfw_base_socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
{
@@ -329,7 +331,23 @@ nsfw_mgr_get_listen_socket ()
return -1;
}
- if (-1 == unlink ((char *) g_mgr_com_cfg.domain_path))
+ retVal = STRCPY_S ((char *) name, sizeof (name),
+ (char *) g_mgr_com_cfg.domain_path);
+ if (EOK != retVal)
+ {
+ (void) nsfw_base_close (fd);
+ NSFW_LOGERR ("module mgr get listen STRCPY_S failed! ret=%d", retVal);
+ return -1;
+ }
+
+ if (EOK != STRCAT_S (name, NSFW_MGRCOM_PATH_LEN, NSFW_MAIN_FILE))
+ {
+ (void) nsfw_base_close (fd);
+ NSFW_LOGERR ("module mgr get listen STRCAT_S failed!");
+ return -1;
+ }
+
+ if (-1 == unlink ((char *) name))
{
NSFW_LOGWAR ("unlink failed]error=%d", errno);
}
@@ -341,8 +359,8 @@ nsfw_mgr_get_listen_socket ()
}
un.sun_family = AF_UNIX;
- int retVal = STRCPY_S ((char *) un.sun_path, sizeof (un.sun_path),
- (char *) g_mgr_com_cfg.domain_path);
+ retVal = STRCPY_S ((char *) un.sun_path, sizeof (un.sun_path),
+ (char *) name);
if (EOK != retVal)
{
(void) nsfw_base_close (fd);
@@ -358,9 +376,7 @@ nsfw_mgr_get_listen_socket ()
return -1;
}
- len =
- offsetof (struct sockaddr_un,
- sun_path) +strlen ((char *) g_mgr_com_cfg.domain_path);
+ len = offsetof (struct sockaddr_un, sun_path) +strlen ((char *) name);
if (nsfw_base_bind (fd, (struct sockaddr *) &un, len) < 0)
{
@@ -1807,6 +1823,58 @@ nsfw_mgr_comm_fd_init (u32 proc_type)
}
/*****************************************************************************
+* Prototype : nsfw_mgr_com_mkdir_domainpath
+* Description : check whether the domain path exist.if not exist, create it.
+* Input : char *pathname
+* Output : None
+* Return Value : void
+* Calls :
+* Called By :
+*****************************************************************************/
+void nsfw_mgr_com_mkdir_domainpath (char *pathname);
+void
+nsfw_mgr_com_mkdir_domainpath (char *pathname)
+{
+ char dirname[NSFW_MGRCOM_PATH_LEN] = { 0 };
+ int i, len;
+
+ if (NULL == pathname)
+ {
+ NSFW_LOGERR ("the pathname is null.");
+ return;
+ }
+
+ strncpy (dirname, pathname, NSFW_MGRCOM_PATH_LEN - 1);
+ len = strlen (dirname);
+ if (dirname[len - 1] != '/')
+ strncat (dirname, "/", 2);
+
+ if (access (dirname, F_OK) == 0)
+ return;
+
+ len = strlen (dirname);
+
+ for (i = 1; i < len; i++)
+ {
+ if (dirname[i] == '/')
+ {
+ dirname[i] = 0;
+ if (access (dirname, F_OK) != 0)
+ {
+ if (mkdir (dirname, 0755) == -1)
+ {
+ NSFW_LOGERR ("mkdir:%s error", dirname);
+ return;
+ }
+ }
+ dirname[i] = '/';
+ }
+ }
+
+ return;
+}
+
+/*****************************************************************************
* Prototype : nsfw_mgr_com_module_init
* Description : module init
* Input : void* param
@@ -1849,15 +1917,7 @@ nsfw_mgr_com_module_init (void *param)
return -1;
}
- /* modify destMax, remove "-1" */
- if (EOK !=
- STRCAT_S (mgr_cfg->domain_path, NSFW_MGRCOM_PATH_LEN,
- NSFW_MAIN_FILE))
- {
- NSFW_LOGERR ("module mgr init STRCAT_S failed!");
- lint_unlock_1 ();
- return -1;
- }
+ nsfw_mgr_com_mkdir_domainpath (mgr_cfg->domain_path);
NSFW_LOGINF ("module mgr init]NSFW_PROC_MAIN domain_path=%s",
mgr_cfg->domain_path);
@@ -1880,16 +1940,6 @@ nsfw_mgr_com_module_init (void *param)
return -1;
}
- /* modify destMax, remove "-1" */
- if (EOK !=
- STRCAT_S (mgr_cfg->domain_path, NSFW_MGRCOM_PATH_LEN,
- NSFW_MASTER_FILE))
- {
- NSFW_LOGERR ("module mgr init STRCAT_S failed!");
- lint_unlock_1 ();
- return -1;
- }
-
NSFW_LOGINF ("module mgr init]NSFW_PROC_MASTER domain_path=%s",
mgr_cfg->domain_path);
diff --git a/src/framework/ipc/mgr_com/mgr_com.h b/src/framework/ipc/mgr_com/mgr_com.h
index 02e46c1..03f58c8 100644
--- a/src/framework/ipc/mgr_com/mgr_com.h
+++ b/src/framework/ipc/mgr_com/mgr_com.h
@@ -52,8 +52,8 @@ extern "C"{
#define MGR_COM_RECV_TIMEOUT (g_mgr_com_cfg.max_recv_timeout)
#define MGR_COM_MAX_DROP_MSG (g_mgr_com_cfg.max_recv_drop_msg)
-#define NSFW_MAIN_FILE "/ip_module/nStackMainMgr"
-#define NSFW_MASTER_FILE "/ip_module/nStackMasterMgr"
+#define NSFW_MAIN_FILE "nStackMainMgr"
+#define NSFW_MASTER_FILE "nStackMasterMgr"
#define NSFW_ALARM_FILE "/HuskyAlarm.domain"
#define NSFW_MGRCOM_THREAD "nStackMgrCom"
diff --git a/src/nSocket/nstack/nstack.c b/src/nSocket/nstack/nstack.c
index 8718091..4b01961 100644
--- a/src/nSocket/nstack/nstack.c
+++ b/src/nSocket/nstack/nstack.c
@@ -34,7 +34,6 @@
#include "nstack_fd_mng.h"
#include "nstack_info_parse.h"
#include "nstack_dmm_adpt.h"
-#include "nstack_rd_mng.h"
#include "nstack_rd.h"
#include "nstack_module.h"
#include "nstack_select.h"
@@ -447,16 +446,13 @@ nstack_init_shmem ()
NSTACK_STATIC int
nstack_init_mem (void)
{
-
int ret = ns_fail;
- int initflag = 0;
int deploytype = nstack_get_deploy_type ();
/* record unmatched app version*/
/* check lib version match - Begin */
if (deploytype != NSTACK_MODEL_TYPE1 && deploytype != NSTACK_MODEL_TYPE_SIMPLE_STACK )
{
check_main_version ();
- initflag = 1;
}
ret = nstack_init_shmem ();
@@ -466,14 +462,6 @@ nstack_init_mem (void)
return ns_fail;
}
- /*stack-x rd mng init*/
- ret = nstack_rd_mng_int(initflag);
- if (ns_success != ret)
- {
- NSSOC_LOGERR("nstack_rd_mng_int fail");
- return ns_fail;
- }
-
/*rd info sys*/
ret = nstack_rd_sys();
if (ns_success != ret)
diff --git a/src/nSocket/nstack/nstack_module.c b/src/nSocket/nstack/nstack_module.c
index 91eda84..bef91e5 100644
--- a/src/nSocket/nstack/nstack_module.c
+++ b/src/nSocket/nstack/nstack_module.c
@@ -36,7 +36,6 @@
#include "nstack_dmm_adpt.h"
#include "nstack_rd_init.h"
#include "nstack_info_parse.h"
-#include "nstack_rd_mng.h"
/* *INDENT-OFF* */
nstack_module_info g_nstack_modules = {
@@ -176,7 +175,6 @@ nstack_register_module ()
nstack_get_route_data rd_fun[] = {
nstack_stack_rd_parse,
- nstack_rd_ip_get
};
pstacks =
diff --git a/stacks/lwip_stack/lwip_src/api/spl_tcpip.c b/stacks/lwip_stack/lwip_src/api/spl_tcpip.c
index 688c34b..b627bcf 100644
--- a/stacks/lwip_stack/lwip_src/api/spl_tcpip.c
+++ b/stacks/lwip_stack/lwip_src/api/spl_tcpip.c
@@ -134,7 +134,6 @@ u8_t ip_tos2prio[(IPTOS_TOS_MASK >> 1) + 1] = {
/********************/
extern err_t ethernetif_init (struct netif *pnetif);
extern int nstack_stackx_init (int flag);
-extern int nstack_rd_mng_int (int flag);
extern void tcp_sys_rmem_init ();
extern void ethernetif_packets_input (struct netif *pstnetif);
diff --git a/stacks/lwip_stack/lwip_src/ip_module/container_ip.c b/stacks/lwip_stack/lwip_src/ip_module/container_ip.c
index 3cbe9b9..decc52c 100644
--- a/stacks/lwip_stack/lwip_src/ip_module/container_ip.c
+++ b/stacks/lwip_stack/lwip_src/ip_module/container_ip.c
@@ -28,7 +28,6 @@
#include "netif.h"
#include "nstack_log.h"
#include "nstack_securec.h"
-#include "nstack_rd_mng.h"
#include "config_common.h"
#include "igmp.h"
#include "spl_def.h"
@@ -164,38 +163,6 @@ free_container_port_ip_cidr (struct container_port_ip_cidr *ip_cidr,
}
}
-/*note:::the ip must be local order*/
-void
-container_multicast_rd (unsigned int ip, int op)
-{
- rd_ip_data rd_ip = { 0 };
- int ret = 0;
-
- rd_ip.addr = ip;
- rd_ip.masklen = 32;
- if (0 == op)
- {
- ret = nstack_rd_ip_node_insert ("nstack-dpdk", &rd_ip);
- }
- else
- {
- ret = nstack_rd_ip_node_delete (&rd_ip);
- }
-
- if (0 != ret)
- {
- NSOPR_LOGERR ("nstack rd multicast ip:0x%x %s fail", ip,
- (0 == op ? "insert" : "delete"));
- }
- else
- {
- NSOPR_LOGDBG ("nstack rd multicast ip:0x%x %s success", ip,
- (0 == op ? "insert" : "delete"));
- }
-
- return;
-}
-
static void
free_container_multicast (struct container_multicast_id *multicast,
bool_t only_free)
@@ -208,9 +175,6 @@ free_container_multicast (struct container_multicast_id *multicast,
multicast = multicast->next;
if (!only_free)
{
- /*note:::multicast ip is network, need to change to local order, delete multicast ip from rd. */
- container_multicast_rd (spl_ntohl (tmp->ip), 1);
-
trp_rb_erase ((void *) (u64_t) tmp->ip, &g_container_multicast_root,
ip_compare);
}
diff --git a/stacks/lwip_stack/lwip_src/ip_module/network.c b/stacks/lwip_stack/lwip_src/ip_module/network.c
index 83fbb7c..ef0d9a7 100644
--- a/stacks/lwip_stack/lwip_src/ip_module/network.c
+++ b/stacks/lwip_stack/lwip_src/ip_module/network.c
@@ -26,7 +26,6 @@
#include "stackx/spl_api.h"
#include "sharedmemory.h"
#include "nstack_securec.h"
-#include "nstack_rd_mng.h"
#include "spl_hal.h"
#include "inet.h"
@@ -441,59 +440,6 @@ nic_already_bond (struct network_configuration *pnetwork,
return 0;
}
-/*add network to rd*/
-void
-network_rd_proc (struct network_configuration *network, int op)
-{
- struct ip_subnet *ptsubnet = NULL;
- struct network_configuration *pn = NULL;
- rd_ip_data rd_ip = { 0 };
- int ret = 0;
-
- pn = network;
-
- while (pn)
- {
- if (0 == strcmp ("nstack-dpdk", pn->type_name))
- {
- ptsubnet = network->ip_subnet;
- while (ptsubnet)
- {
- rd_ip.addr = ptsubnet->subnet;
- rd_ip.masklen = ptsubnet->mask_len;
- if (0 == op)
- {
- ret = nstack_rd_ip_node_insert (network->type_name, &rd_ip);
- }
- else
- {
- ret = nstack_rd_ip_node_delete (&rd_ip);
- }
-
- if (0 != ret)
- {
- NSOPR_LOGERR ("nstack rd subnet:0x%x, masklen:0x%x %s fail",
- rd_ip.addr, rd_ip.masklen,
- (0 == op ? "insert" : "delete"));
- }
- else
- {
- NSOPR_LOGDBG
- ("nstack rd subnet:0x%x, masklen:0x%x %s success",
- rd_ip.addr, rd_ip.masklen,
- (0 == op ? "insert" : "delete"));
- }
-
- ptsubnet = ptsubnet->next;
- }
- }
-
- pn = pn->next;
- }
-
- return;
-}
-
/* add network to list in descending sort */
void
add_network_to_list (struct network_configuration *network)
@@ -503,9 +449,6 @@ add_network_to_list (struct network_configuration *network)
network->next = NULL;
- /*add network to rd */
- network_rd_proc (network, 0);
-
while (curr)
{
if (network->ip_subnet->mask_len >= curr->ip_subnet->mask_len)
@@ -1089,9 +1032,6 @@ del_network_by_name (char *name)
*ref = network->next;
network->next = NULL;
- /*delete netework from rd */
- network_rd_proc (network, 1);
-
free_network_configuration (network, IP_MODULE_FALSE);
return 0;
}
diff --git a/thirdparty/apps/CMakeLists.txt b/thirdparty/apps/CMakeLists.txt
index 9868c9f..c9188d6 100644
--- a/thirdparty/apps/CMakeLists.txt
+++ b/thirdparty/apps/CMakeLists.txt
@@ -43,3 +43,20 @@ ExternalProject_Add(
)
set_target_properties(NGINX PROPERTIES EXCLUDE_FROM_ALL TRUE)
+
+
+SET(IPERF_URL https://iperf.fr/download/source/iperf-3.1.3-source.tar.gz)
+
+INCLUDE(ExternalProject)
+ExternalProject_Add(
+ IPERF
+ URL ${IPERF_URL}
+ DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/iperf-3.1.3
+ BUILD_IN_SOURCE 1
+ CONFIGURE_COMMAND sh -c "LDFLAGS=\"-L${LIB_PATH_SHARED} -Wl,-rpath=${LIB_PATH_SHARED} -lnStackAPI\" ./configure"
+ BUILD_COMMAND make
+ DEPENDS nStackAPI
+)
+
+set_target_properties(IPERF PROPERTIES EXCLUDE_FROM_ALL TRUE)