aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app_example/func-test/CMakeLists.txt2
-rw-r--r--app_example/func-test/file_transfer/CMakeLists.txt32
-rw-r--r--app_example/func-test/file_transfer/client_filetrans.c284
-rw-r--r--app_example/func-test/file_transfer/server_filetrans.c344
-rw-r--r--app_example/func-test/fork/CMakeLists.txt17
-rw-r--r--demo/nginx_proxy/demo-1/module_config.json15
-rw-r--r--demo/nginx_proxy/demo-2/README.md4
-rw-r--r--demo/nginx_proxy/demo-2/module_config.json15
-rw-r--r--release/configure/module_config.json10
-rw-r--r--scripts/csit/README.txt3
-rwxr-xr-xscripts/csit/common.sh87
-rwxr-xr-xscripts/csit/file.txt12
-rwxr-xr-xscripts/csit/run/run_dmm.sh38
-rwxr-xr-xscripts/csit/run/run_dmm_fork.sh68
-rwxr-xr-xscripts/csit/run/run_dmm_fork_with_lwip.sh68
-rwxr-xr-xscripts/csit/run/run_dmm_tcp_filetrans.sh68
-rwxr-xr-xscripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh69
-rwxr-xr-xscripts/csit/run/run_dmm_udp_filetrans.sh68
-rwxr-xr-xscripts/csit/run/run_dmm_udp_filetrans_with_lwip.sh70
-rwxr-xr-xscripts/csit/run/run_dmm_with_lwip.sh42
-rw-r--r--src/nSocket/nstack/nstack_info_parse.c48
-rw-r--r--src/nSocket/nstack/nstack_module.h5
-rw-r--r--stacks/lwip_stack/app_conf/module_config.json10
-rw-r--r--stacks/lwip_stack/lwip_src/ip_module/container_ip.c2
-rw-r--r--stacks/lwip_stack/release/configure/ip_data.json25
-rw-r--r--stacks/lwip_stack/release/configure/network_data_tonStack.json22
-rwxr-xr-xstacks/lwip_stack/release/lwip_helper_files/download_lwip.sh4
-rw-r--r--stacks/lwip_stack/src/sbr/sbr_socket.c2
-rwxr-xr-xstacks/lwip_stack/vagrant/start_nstackMain.sh12
-rw-r--r--stacks/rsocket/config/module_config.json10
-rw-r--r--stacks/vpp/adapt/dmm_vcl_adpt.c2
-rw-r--r--stacks/vpp/configure/module_config.json10
32 files changed, 1252 insertions, 216 deletions
diff --git a/app_example/func-test/CMakeLists.txt b/app_example/func-test/CMakeLists.txt
index e6357b8..865eba5 100644
--- a/app_example/func-test/CMakeLists.txt
+++ b/app_example/func-test/CMakeLists.txt
@@ -15,4 +15,4 @@
#########################################################################
ADD_SUBDIRECTORY(fork)
-
+ADD_SUBDIRECTORY(file_transfer)
diff --git a/app_example/func-test/file_transfer/CMakeLists.txt b/app_example/func-test/file_transfer/CMakeLists.txt
new file mode 100644
index 0000000..408fc7a
--- /dev/null
+++ b/app_example/func-test/file_transfer/CMakeLists.txt
@@ -0,0 +1,32 @@
+#########################################################################
+#
+# 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.
+#########################################################################
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -fPIC -m64 -mssse3 -std=gnu89")
+
+LINK_DIRECTORIES(${LIB_PATH_SHARED} ${LIB_PATH_STATIC})
+
+ADD_EXECUTABLE(vc_serv_file server_filetrans.c)
+ADD_DEPENDENCIES(vc_serv_file nStackAPI)
+TARGET_LINK_LIBRARIES(vc_serv_file libnStackAPI.so -lpthread -lrt)
+
+ADD_EXECUTABLE(vc_cli_file client_filetrans.c)
+ADD_DEPENDENCIES(vc_cli_file nStackAPI)
+TARGET_LINK_LIBRARIES(vc_cli_file libnStackAPI.so -lpthread -lrt)
+
+ADD_EXECUTABLE(kc_serv_file server_filetrans.c)
+TARGET_LINK_LIBRARIES(kc_serv_file pthread)
+
+ADD_EXECUTABLE(kc_cli_file client_filetrans.c)
+TARGET_LINK_LIBRARIES(kc_cli_file pthread) \ No newline at end of file
diff --git a/app_example/func-test/file_transfer/client_filetrans.c b/app_example/func-test/file_transfer/client_filetrans.c
new file mode 100644
index 0000000..cc8386d
--- /dev/null
+++ b/app_example/func-test/file_transfer/client_filetrans.c
@@ -0,0 +1,284 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <ctype.h>
+char *END_FLAG = "=================END";
+#define HEXCONVERT_COLS 8
+#define HEX_CONVERT 1
+//#define DEBUG 1
+#define out(fmt, arg...) (void)printf(fmt, ##arg)
+
+#ifdef DEBUG
+#define DBG(fmt, arg...) do { \
+ out("[Debug] " fmt, ##arg); \
+ } while (0)
+#else
+#define DBG(fmt, arg...) ((void)0)
+#endif
+
+void
+error (const char *msg)
+{
+ perror (msg);
+ out
+ ("./client_tcp [server_ip_address] [port number] [filename] [client_ip_address]\n");
+ exit (1);
+}
+
+#if defined(HEX_CONVERT) && defined(DEBUG)
+void
+hexconvert (void *mem, unsigned int len)
+{
+ unsigned int i;
+
+ for (i = 0;
+ i <
+ len +
+ ((len % HEXCONVERT_COLS) ? (HEXCONVERT_COLS -
+ len % HEXCONVERT_COLS) : 0); i++)
+ {
+ /* print offset */
+ if (i % HEXCONVERT_COLS == 0)
+ {
+ DBG ("\n0x%06x: ", i);
+ }
+
+ /*print hex data */
+ if (i < len)
+ {
+ DBG ("%02x ", 0xFF & ((char *) mem)[i]);
+ }
+ else /* end of block, just aligning for ASCII dump */
+ {
+ DBG ("\n");
+ }
+ }
+}
+#endif
+
+void
+tcp (char **pArgv)
+{
+
+ int sockfd, portno;
+ char buff[1024];
+
+ struct sockaddr_in serv_addr, cli_addr;
+ struct hostent *server;
+
+ sockfd = socket (AF_INET, SOCK_STREAM, 0);
+ if (sockfd < 0)
+ {
+ error ("error in socket creation\n");
+ }
+ out ("socket create successful\n");
+
+ portno = atoi (pArgv[2]);
+ server = gethostbyname (pArgv[1]);
+
+ if (server == NULL)
+ {
+ fprintf (stderr, "error no such host\n");
+ }
+
+ bzero ((char *) &serv_addr, sizeof (serv_addr));
+ serv_addr.sin_family = AF_INET;
+ bcopy ((char *) server->h_addr, (char *) &serv_addr.sin_addr,
+ server->h_length);
+ serv_addr.sin_port = htons (portno);
+ bzero ((char *) &cli_addr, sizeof (serv_addr));
+
+ cli_addr.sin_family = AF_INET;
+ cli_addr.sin_addr.s_addr = inet_addr (pArgv[4]);
+ cli_addr.sin_port = htons (portno);
+ if (bind (sockfd, (struct sockaddr *) &cli_addr, sizeof (cli_addr)) < 0)
+ {
+ error ("bind fail");
+ }
+ out ("Bind successful\n");
+
+ if (connect (sockfd, (struct sockaddr *) &serv_addr, sizeof (serv_addr)) <
+ 0)
+ {
+ error ("connection fail");
+ }
+ out ("connection done\n");
+
+ FILE *file;
+ int filebyte = 0;
+ int lsize, totalsize = 0;
+
+ file = fopen (pArgv[3], "r");
+ fseek (file, 0, SEEK_END);
+ lsize = ftell (file);
+ rewind (file);
+ out ("Name of file: %s, Size of file : %d\n", pArgv[3], lsize);
+ if (write (sockfd, &lsize, sizeof (int)) == -1)
+ {
+ out ("error executing write\n");
+ }
+ if (write (sockfd, pArgv[3], 255) == -1)
+ {
+ out ("error executing write\n");
+ }
+ while (lsize > totalsize)
+ {
+ bzero (buff, 1024);
+ fseek (file, totalsize, SEEK_SET);
+ filebyte = fread (buff, 1, sizeof (buff), file);
+ if (filebyte == 0)
+ {
+ printf ("file End of file\n");
+ break;
+ }
+
+ if (filebyte < 0)
+ error ("error in reading file. \n");
+#if defined(HEX_CONVERT) && defined(DEBUG)
+ DBG ("=========================================\n");
+ hexconvert (buff, filebyte);
+ DBG ("=========================================\n");
+#endif
+
+ void *p = buff;
+ totalsize += filebyte;
+
+ while (filebyte > 0)
+ {
+#ifdef DEBUG
+ DBG ("=========================================\n");
+ puts ((const char *) p);
+ DBG ("=========================================\n");
+#endif
+ int bytes_written = write (sockfd, p, filebyte);
+ if (bytes_written <= 0)
+ {
+ error ("error in Socket write.\n");
+ }
+
+ filebyte -= bytes_written;
+ p += bytes_written;
+//#if DEBUG
+ DBG
+ ("Total size of file = %d, Total Bytes sent to socket = %d, bytes_written in each step = %d\n",
+ lsize, totalsize, bytes_written);
+//#endif
+ }
+ }
+ out ("file has been sent successfully\n");
+ out ("Final Total size of file = %d, Total Bytes sent to socket = %d\n",
+ lsize, totalsize);
+
+ fclose (file);
+ sleep (60);
+ close (sockfd);
+ return;
+}
+
+void
+udp (char **pArgv)
+{
+ int sockfd, n, fd, sz, portno, MAXLINE;
+ FILE *fp;
+ struct sockaddr_in servaddr, cliaddr;
+ char *buf;
+ char *target, *path;
+ portno = atoi (pArgv[2]);
+ bzero (&servaddr, sizeof (servaddr));
+ servaddr.sin_family = AF_INET;
+ servaddr.sin_port = htons (portno);
+ servaddr.sin_addr.s_addr = inet_addr (pArgv[1]);
+ bzero (&cliaddr, sizeof (servaddr));
+ cliaddr.sin_family = AF_INET;
+ cliaddr.sin_port = htons (portno);
+ cliaddr.sin_addr.s_addr = inet_addr (pArgv[3]);
+ sockfd = socket (AF_INET, SOCK_DGRAM, 0);
+ if (sockfd < 0)
+ {
+ out ("error in socket creation\n");
+ }
+ out ("socket create successful\n");
+
+ if (bind (sockfd, (struct sockaddr *) &cliaddr, sizeof (cliaddr)) < 0)
+ {
+ out ("bind fail");
+ }
+ out ("Bind successful\n");
+
+ path = pArgv[4];
+ target = pArgv[5];
+ MAXLINE = atoi (pArgv[6]);
+ buf = malloc (MAXLINE * sizeof (int));
+ fp = fopen (path, "r");
+ fseek (fp, 0L, SEEK_END);
+ sz = ftell (fp);
+ out ("The size of the path file is %d", sz);
+ sendto (sockfd, target, strlen (target), 0,
+ (struct sockaddr *) &servaddr, sizeof (servaddr));
+ n = recvfrom (sockfd, buf, MAXLINE, 0, NULL, NULL);
+ if (!strncmp (buf, "ok", 2))
+ {
+ out ("Filename sent.\n");
+ }
+
+ fd = open (path, O_RDONLY);
+ while ((n = read (fd, buf, MAXLINE)) > 0)
+ {
+ sendto (sockfd, buf, n, 0, (struct sockaddr *) &servaddr,
+ sizeof (servaddr));
+ }
+ sendto (sockfd, END_FLAG, strlen (END_FLAG), 0,
+ (struct sockaddr *) &servaddr, sizeof (servaddr));
+ fclose (fp);
+ sleep (60);
+ close (sockfd);
+ return;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+ char **pArgv, str[10];
+ pArgv = (char **) malloc (sizeof (char *) * 10);
+ for (i = 0; i < 10; i++)
+ {
+ pArgv[i] = (char *) malloc (sizeof (char) * 20);
+ }
+ printf ("%s", argv[1]);
+
+ if (strcmp ("tcp", argv[1]) == 0)
+ {
+ strcpy (pArgv[0], "tcp");
+ printf ("pArgv[0]=%s", pArgv[0]);
+ /* The arguments of tcp are [server_ip_address] [port number] [filename] [client_ip_address] */
+ for (i = 1; i < 5; i++)
+ {
+ strcpy (pArgv[i], argv[i + 1]);
+ }
+ tcp (pArgv);
+ }
+
+ else
+ {
+ strcpy (str, argv[1]);
+ if (strcmp ("udp", str) == 0)
+ {
+ strcpy (pArgv[0], "udp");
+ printf ("pArgv[0]=%s", pArgv[0]);
+ /* The arguments of udp are [server_ip_address] [port number] [client_ip_address] [filename] [target_filename] [MAX_BUFFER_LENGTH] */
+ for (i = 1; i < 7; i++)
+ {
+ strcpy (pArgv[i], argv[i + 1]);
+ }
+ udp (pArgv);
+ }
+ }
+ return 0;
+}
diff --git a/app_example/func-test/file_transfer/server_filetrans.c b/app_example/func-test/file_transfer/server_filetrans.c
new file mode 100644
index 0000000..9463c70
--- /dev/null
+++ b/app_example/func-test/file_transfer/server_filetrans.c
@@ -0,0 +1,344 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <ctype.h>
+#include <arpa/inet.h>
+#include <fcntl.h>
+char *END_FLAG = "=================END";
+#define HEXCONVERT_COLS 8
+#define HEX_CONVERT 1
+//#define DEBUG 1
+#define out(fmt, arg...) (void)printf(fmt, ##arg)
+
+#ifdef DEBUG
+#define DBG(fmt, arg...) do { \
+ out("[Debug] " fmt, ##arg); \
+ } while (0)
+#else
+#define DBG(fmt, arg...) ((void)0)
+#endif
+
+void
+error (const char *msg)
+{
+ perror (msg);
+ out ("./server_tcp [server_ip_address] [port number]\n");
+ exit (1);
+}
+
+#if defined(HEX_CONVERT) && defined(DEBUG)
+void
+hexconvert (void *mem, unsigned int len)
+{
+ unsigned int i;
+
+ for (i = 0;
+ i <
+ len +
+ ((len % HEXCONVERT_COLS) ? (HEXCONVERT_COLS -
+ len % HEXCONVERT_COLS) : 0); i++)
+ {
+ /* print offset */
+ if (i % HEXCONVERT_COLS == 0)
+ {
+ DBG ("\n0x%06x: ", i);
+ }
+
+ /*print hex data */
+ if (i < len)
+ {
+ DBG ("%02x ", 0xFF & ((char *) mem)[i]);
+ }
+ else /* end of block, just aligning for ASCII dump */
+ {
+ DBG ("\n");
+ }
+ }
+}
+#endif
+int
+compareFiles (FILE * fp1, FILE * fp2)
+{
+
+ char ch1 = getc (fp1);
+ char ch2 = getc (fp2);
+ int error = 0, pos = 0, line = 1;
+
+ while (ch1 != EOF && ch2 != EOF)
+ {
+ pos++;
+ if (ch1 == '\n' && ch2 == '\n')
+ {
+ line++;
+ pos = 0;
+ }
+
+ if (ch1 != ch2)
+ {
+ error++;
+ DBG ("Line Number : %d \tError" " Position :%d \n", line, pos);
+ }
+
+ ch1 = getc (fp1);
+ ch2 = getc (fp2);
+ }
+
+ //printf("Total Errors : %d\t", error);
+ return error;
+}
+
+void
+tcp (char **pArgv)
+{
+
+ int sockfd, newsockfd, portno;
+ char buff[1024], filename[255];
+
+ struct sockaddr_in serv_addr, cli_addr;
+ socklen_t clilen;
+
+ sockfd = socket (AF_INET, SOCK_STREAM, 0);
+ if (sockfd < 0)
+ {
+ error ("error in socket creation");
+ }
+ out ("socket create successful\n");
+
+ bzero ((char *) &serv_addr, sizeof (serv_addr));
+ portno = atoi (pArgv[2]);
+
+ serv_addr.sin_family = AF_INET;
+ serv_addr.sin_addr.s_addr = inet_addr (pArgv[1]);
+ serv_addr.sin_port = htons (portno);
+
+ if (bind (sockfd, (struct sockaddr *) &serv_addr, sizeof (serv_addr)) < 0)
+ {
+ error ("bind fail");
+ }
+ out ("Bind successful\n");
+ listen (sockfd, 5);
+ clilen = sizeof (cli_addr);
+
+ newsockfd = accept (sockfd, (struct sockaddr *) &cli_addr, &clilen);
+ if (newsockfd < 0)
+ {
+ error ("error in accept");
+ }
+ out ("socket accept succesful\n");
+ bzero (buff, 1024);
+
+ FILE *fp;
+ int lSize = 0, totallSize = 0;
+
+ bzero (filename, 255);
+
+ fclose (fopen ("receive_file.txt", "w"));
+ if (system ("chmod +x *") == -1)
+ {
+ out (" incorrect use of system\n");
+ }
+ fp = fopen ("receive_file.txt", "a");
+
+ if (read (newsockfd, &lSize, sizeof (int)) == -1)
+ {
+ out ("error executing read\n");
+ }
+ if (read (newsockfd, filename, sizeof (filename)) == -1)
+ {
+ out ("error executing read\n");
+ }
+
+ while (lSize > totallSize)
+ {
+ int bytes_read = 0;
+ bzero (buff, 1024);
+
+ bytes_read = read (newsockfd, buff, 1024);
+
+ if (bytes_read == 0)
+ {
+ break;
+ }
+
+ if (bytes_read < 0)
+ {
+ error ("error in Socket read.\n");
+ }
+
+#if defined(HEX_CONVERT) && defined(DEBUG)
+ DBG ("=========================================\n");
+ hexconvert (buff, bytes_read);
+ DBG ("=========================================\n");
+#endif
+#ifdef DEBUG
+ DBG ("=========================================\n");
+ puts ((const char *) buff);
+ DBG ("=========================================\n");
+#endif
+ totallSize += bytes_read;
+
+ if (fwrite (buff, 1, bytes_read, fp) == -1)
+ {
+ error ("error in file write\n");
+ }
+//#if DEBUG
+ DBG
+ ("Total size of file = %d, Total Bytes sent to socket = %d, bytes_read in each step = %d\n",
+ lSize, totallSize, bytes_read);
+//#endif
+ }
+ out ("file name = %s\n", filename);
+ out ("Final total size of file = %d, total read from socket = %d\n", lSize,
+ totallSize);
+ out ("copy complete\n");
+ fclose (fp);
+
+ FILE *fp1 = fopen ("receive_file.txt", "r");
+ FILE *fp2 = fopen (filename, "r");
+
+ fseek (fp2, 0L, SEEK_END);
+ int lfile_size = ftell (fp2);
+ rewind (fp2);
+ if (lfile_size != lSize)
+ {
+ out ("Size unmatch...\n");
+ }
+ else
+ {
+ out ("Size match...\n");
+ }
+
+ if (compareFiles (fp1, fp2) > 0)
+ {
+ out ("file unmatch...\n");
+ }
+ else
+ {
+ out ("file match...\n");
+ }
+
+ close (newsockfd);
+ close (sockfd);
+ return;
+}
+
+void
+run (int sockfd, struct sockaddr *cliaddr, socklen_t clilen, char *res_buf,
+ int MAXLINE)
+{
+ int n, fd;
+ socklen_t len;
+ char *buf, *buf2;
+ FILE *fp1, *fp2;
+ buf = malloc (MAXLINE + 1);
+ len = clilen;
+ n = recvfrom (sockfd, buf, MAXLINE, 0, cliaddr, &len);
+ buf[n] = 0;
+ out ("Received from client:[%s] \n", buf);
+ buf2 = malloc (MAXLINE);
+ strcpy (buf2, buf);
+ sendto (sockfd, "ok", strlen ("ok"), 0, cliaddr, len);
+ fd = open (buf, O_RDWR | O_CREAT, 0666);
+ while ((n = recvfrom (sockfd, buf, MAXLINE, 0, cliaddr, &len)))
+ {
+ buf[n] = 0;
+ //out("%s", buf);
+ if (!(strcmp (buf, END_FLAG)))
+ {
+ break;
+ }
+ if (write (fd, buf, n) == -1)
+ {
+ out ("error in executing write\n");
+ }
+ }
+ fp1 = fopen (buf2, "r");
+ fp2 = fopen (res_buf, "r");
+
+ if (compareFiles (fp1, fp2) == 0)
+ {
+ out ("\nPass:The contents of the files are same");
+ }
+ else
+ {
+ out ("\nFail:The contents of the files are different");
+ }
+ close (fd);
+}
+
+void
+udp (char **pArgv)
+{
+ int sockfd, portno, MAXLINE;
+ struct sockaddr_in servaddr, cliaddr;
+ char *res_buf;
+ res_buf = pArgv[3];
+
+ portno = atoi (pArgv[2]);
+ MAXLINE = atoi (pArgv[4]);
+ sockfd = socket (AF_INET, SOCK_DGRAM, 0);
+ if (sockfd < 0)
+ {
+ out ("error in socket creation\n");
+ }
+ out ("socket create successful\n");
+
+ bzero (&servaddr, sizeof (servaddr));
+ servaddr.sin_family = AF_INET;
+ servaddr.sin_addr.s_addr = inet_addr (pArgv[1]);
+ servaddr.sin_port = htons (portno);
+
+ if (bind (sockfd, (struct sockaddr *) &servaddr, sizeof (servaddr)) < 0)
+ {
+ out ("bind fail");
+ }
+ out ("Binded successfully\n");
+ fd_set read_fds;
+ FD_ZERO (&read_fds);
+ FD_SET (sockfd, &read_fds);
+ int fdmax = sockfd;
+ if (FD_ISSET (sockfd, &read_fds))
+ {
+ run (fdmax, (struct sockaddr *) &cliaddr, sizeof (cliaddr), res_buf,
+ MAXLINE);
+ }
+ return;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i, j;
+ char **pArgv;
+ pArgv = (char **) malloc (sizeof (char *) * 10);
+ for (i = 0; i < 10; i++)
+ {
+ pArgv[i] = (char *) malloc (sizeof (char) * 20);
+ }
+ if (strcmp ("tcp", argv[1]) == 0)
+ {
+ strcpy (pArgv[0], "tcp");
+ /* The arguments of tcp are [server_ip_address] [port number] */
+ for (i = 1; i < 3; i++)
+ {
+ strcpy (pArgv[i], argv[i + 1]);
+ }
+ tcp (pArgv);
+ }
+ else if (strcmp ("udp", argv[1]) == 0)
+ {
+ strcpy (pArgv[0], "udp");
+ /* The arguments of udp are [server_ip_address] [port number] [filename] [MAX_BUFFER_LENGTH] */
+ for (i = 1; i < 5; i++)
+ {
+ strcpy (pArgv[i], argv[i + 1]);
+ }
+ udp (pArgv);
+ }
+
+ return 0;
+}
diff --git a/app_example/func-test/fork/CMakeLists.txt b/app_example/func-test/fork/CMakeLists.txt
index 266dd9f..f37dae7 100644
--- a/app_example/func-test/fork/CMakeLists.txt
+++ b/app_example/func-test/fork/CMakeLists.txt
@@ -17,11 +17,16 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -fPIC -m64 -mssse3 -std=gnu89")
LINK_DIRECTORIES(${LIB_PATH_SHARED} ${LIB_PATH_STATIC})
-ADD_EXECUTABLE(tcp_fork_server tcpserver.c)
-ADD_DEPENDENCIES(tcp_fork_server nStackAPI)
-TARGET_LINK_LIBRARIES(tcp_fork_server libnStackAPI.so -lpthread -lrt)
+ADD_EXECUTABLE(vtcp_fork_server tcpserver.c)
+ADD_DEPENDENCIES(vtcp_fork_server nStackAPI)
+TARGET_LINK_LIBRARIES(vtcp_fork_server libnStackAPI.so -lpthread -lrt)
-ADD_EXECUTABLE(tcp_client tcpclient.c)
-ADD_DEPENDENCIES(tcp_client nStackAPI)
-TARGET_LINK_LIBRARIES(tcp_client libnStackAPI.so -lpthread -lrt)
+ADD_EXECUTABLE(vtcp_client tcpclient.c)
+ADD_DEPENDENCIES(vtcp_client nStackAPI)
+TARGET_LINK_LIBRARIES(vtcp_client libnStackAPI.so -lpthread -lrt)
+ADD_EXECUTABLE(ktcp_fork_server tcpserver.c)
+TARGET_LINK_LIBRARIES(ktcp_fork_server pthread)
+
+ADD_EXECUTABLE(ktcp_client tcpclient.c)
+TARGET_LINK_LIBRARIES(ktcp_client pthread) \ No newline at end of file
diff --git a/demo/nginx_proxy/demo-1/module_config.json b/demo/nginx_proxy/demo-1/module_config.json
index 5861153..5f9424f 100644
--- a/demo/nginx_proxy/demo-1/module_config.json
+++ b/demo/nginx_proxy/demo-1/module_config.json
@@ -3,35 +3,20 @@
"module_list": [
{
"stack_name": "kernel",
- "function_name": "kernel_stack_register",
"libname": "./",
- "loadtype": "static",
"deploytype": "1",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "0",
},
{
"stack_name": "lwip",
- "function_name": "nstack_stack_register",
"libname": "liblwip_dpdk.so",
- "loadtype": "dynmic",
"deploytype": "3",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "1",
},
{
"stack_name": "vpp_hoststack",
- "function_name": "vpphs_stack_register",
"libname": "./libdmm_vcl.so",
- "loadtype": "dynmic",
"deploytype": "4",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "2",
},
]
diff --git a/demo/nginx_proxy/demo-2/README.md b/demo/nginx_proxy/demo-2/README.md
index 173e93b..7d6feb1 100644
--- a/demo/nginx_proxy/demo-2/README.md
+++ b/demo/nginx_proxy/demo-2/README.md
@@ -52,7 +52,7 @@ Hello from upstream rproxy-server1 172.167.50.30:80. Connect from - via 172.16
```
$ vagrant ssh rproxy-client
vagrant@rproxy-client:~$ cd /CLIENT/
-vagrant@rproxy-client:/CLIENT$ curl http://192.168.50.20
+vagrant@rproxy-client:/CLIENT$ ./udpclient
Hello message sent.
Server : Hello from server
```
@@ -66,4 +66,4 @@ nstack_bind<NSSOC>fd addr Select module]fd=22,addr=172.167.50.20,module=vpp_host
...
nstack_bind<NSSOC>fd addr Select module]fd=22,addr=182.167.50.20,module=kernel
```
-b. This demo depends on commit of dmm. Please check commit version of your code. \ No newline at end of file
+b. This demo depends on commit of dmm. Please check commit version of your code.
diff --git a/demo/nginx_proxy/demo-2/module_config.json b/demo/nginx_proxy/demo-2/module_config.json
index 5861153..5f9424f 100644
--- a/demo/nginx_proxy/demo-2/module_config.json
+++ b/demo/nginx_proxy/demo-2/module_config.json
@@ -3,35 +3,20 @@
"module_list": [
{
"stack_name": "kernel",
- "function_name": "kernel_stack_register",
"libname": "./",
- "loadtype": "static",
"deploytype": "1",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "0",
},
{
"stack_name": "lwip",
- "function_name": "nstack_stack_register",
"libname": "liblwip_dpdk.so",
- "loadtype": "dynmic",
"deploytype": "3",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "1",
},
{
"stack_name": "vpp_hoststack",
- "function_name": "vpphs_stack_register",
"libname": "./libdmm_vcl.so",
- "loadtype": "dynmic",
"deploytype": "4",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "2",
},
]
diff --git a/release/configure/module_config.json b/release/configure/module_config.json
index 4532d1a..e8e9001 100644
--- a/release/configure/module_config.json
+++ b/release/configure/module_config.json
@@ -3,29 +3,19 @@
"module_list": [
{
"stack_name": "kernel", /*stack name*/
- "function_name": "kernel_stack_register", /*function name*/
"libname": "./", /*library name, if loadtype is static, this maybe
null, else must give a library name*/
- "loadtype": "static", /*library load type: static or dynamic*/
"deploytype": "1", /*deploy model type:model type1, model type2,
model type3. Indicating single or multi process
deployment. Used during shared memory initialization.*/
- "maxfd": "1024", /*the max fd supported*/
- "minfd": "0", /*the min fd supported*/
- "priorty": "1", /*priorty when executing, reserv*/
"stackid": "0", /*stack id, this must be ordered and not be repeated*/
},
/**************************
*this is not a real stack, just an example for multiple stack configurations*
{
"stack_name": "stackx",
- "function_name": "stackx_register",
"libname": "libstackx.so",
- "loadtype": "dynmic",
"deploytype": "3",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "1",
},
***************************/
diff --git a/scripts/csit/README.txt b/scripts/csit/README.txt
index 0f91dbb..66cb214 100644
--- a/scripts/csit/README.txt
+++ b/scripts/csit/README.txt
@@ -31,4 +31,5 @@
1. make a new script in "dmm/scripts/csit/run/" with the help of
"dmm/scripts/csit/template.sh".
- 2. And handle all the actions in it(can go through existing scripts for reference). \ No newline at end of file
+ 2. The functions in dmm/scripts/csit/run/common.sh can be reused in the new script.
+ 3. And handle all the actions in it(can go through existing scripts for reference).
diff --git a/scripts/csit/common.sh b/scripts/csit/common.sh
new file mode 100755
index 0000000..110273a
--- /dev/null
+++ b/scripts/csit/common.sh
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+set -x
+setup_preparation(){
+ ip addr
+ lspci -nn
+ lsmod | grep uio
+ bash $CSIT_SCRIPT_DIR/kill_given_proc.sh $1
+ bash $CSIT_SCRIPT_DIR/setup_hugepage.sh
+
+ cp -f $DMM_SCRIPT_DIR/prep_app_test.sh $DMM_SCRIPT_DIR/prep_app_test_csit.sh
+ sed -i 's!.*check_hugepage.sh!#skip hugepage check!1' $DMM_SCRIPT_DIR/prep_app_test_csit.sh
+ sed -i 's!enp0s8!'$ifname'!1' $DMM_SCRIPT_DIR/prep_app_test_csit.sh
+ bash -x $DMM_SCRIPT_DIR/prep_app_test_csit.sh
+}
+
+setup_preparation_lwip(){
+ bash $CSIT_SCRIPT_DIR/kill_given_proc.sh $1
+ bash $CSIT_SCRIPT_DIR/setup_hugepage.sh
+ cat /proc/meminfo
+ cp -f $VAG_DIR/start_nstackMain.sh $VAG_DIR/start_nstackMain_csit.sh
+ sed -i 's!.*check_hugepage.sh!#skip hugepage check!1' $VAG_DIR/start_nstackMain_csit.sh
+ sed -i 's!ifname=.*!ifname='$ifname'!1' $VAG_DIR/start_nstackMain_csit.sh
+ sudo LD_LIBRARY_PATH=${LIB_PATH} bash $VAG_DIR/start_nstackMain_csit.sh || exit 1
+ sleep 5
+
+ #after nstackmain
+ echo "after nstackmain"
+ ip addr
+ lspci -nn
+ lsmod | grep uio
+ cat /proc/meminfo | grep Huge
+ /tmp/dpdk/dpdk-18.02/usertools/dpdk-devbind.py --status
+}
+
+
+execution(){
+ cd $APP_DIR
+ ls -l
+ if [ "x$node" == "x0" ]; then
+ eval $1
+ else
+ eval $2
+ fi
+}
+
+verification(){
+ flag=0
+ for var in "$@"
+ do
+ eval $var
+ if [ $? != 0 ]; then
+ flag=1
+ break
+ fi
+ done
+ if [ "x$flag" == "x0" ]; then
+ echo "DMM_CSIT_TEST_PASSED"
+ else
+ echo "DMM_CSIT_TEST_FAILED"
+ fi
+}
+
+print_log(){
+ if [ "x$node" == "x0" ]; then
+ cat $LOG_PATH/app_$1*.log
+ elif [ "x$node" == "x1" ]; then
+ cat $LOG_PATH/app_$2*.log
+ fi
+}
+
+cleanup(){
+ if [ "x$node" == "x0" ]; then
+ bash $CSIT_SCRIPT_DIR/kill_given_proc.sh $1
+ rm $LOG_PATH/app_$1*.log
+ elif [ "x$node" == "x1" ]; then
+ rm $LOG_PATH/app_$2*.log
+ fi
+}
+
+cleanup_lwip(){
+ if [ "x$node" == "x0" ]; then
+ bash $CSIT_SCRIPT_DIR/kill_given_proc.sh $1
+ fi
+ sudo bash $APP_DIR/../release/stop_nstack.sh
+ sudo rm $LOG_PATH/running.log
+}
diff --git a/scripts/csit/file.txt b/scripts/csit/file.txt
new file mode 100755
index 0000000..45973dd
--- /dev/null
+++ b/scripts/csit/file.txt
@@ -0,0 +1,12 @@
+172.28.128.3
+172.28.128.5
+
+ #server
+ ./vs_epoll -p 20000 -d 172.28.128.5 -a 10000 -s 172.28.128.3 -l 200 -t 5000000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1
+
+ #client
+ ./vc_epoll -p 20000 -d 172.28.128.3 -a 10000 -s 172.28.128.5 -l 200 -t 50000 -i 1000 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1
+
+ sudo LD_LIBRARY_PATH=/DMM/stacks/lwip_stack/release/lib64/ ./vs_epoll -p 20000 -d 172.28.128.5 -a 10000 -s 172.28.128.3 -l 200 - t 5000000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1
+
+sudo LD_LIBRARY_PATH=/DMM/stacks/lwip_stack/release/lib64/ ./vc_common -p 20000 -d 172.28.128.3 -a 10000 -s 172.28.128.5 -l 200 -t 50 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1 \ No newline at end of file
diff --git a/scripts/csit/run/run_dmm.sh b/scripts/csit/run/run_dmm.sh
index fb65f65..8bada97 100755
--- a/scripts/csit/run/run_dmm.sh
+++ b/scripts/csit/run/run_dmm.sh
@@ -21,35 +21,22 @@ ROOTDIR=$CSIT_SCRIPT_DIR/../../../
APP_DIR=${ROOTDIR}/dmm/config/app_test
LIB_PATH=${ROOTDIR}/dmm/release/lib64
DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts
+LOG_PATH=/var/log
+source $DMM_SCRIPT_DIR/csit/common.sh
#################################################
# Setup preparation
if [ "x$action" == "xsetup" ]; then
- ip addr
- lspci -nn
- lsmod | grep uio
- bash $CSIT_SCRIPT_DIR/kill_given_proc.sh vs_epoll
- bash $CSIT_SCRIPT_DIR/setup_hugepage.sh
-
- cp -f $DMM_SCRIPT_DIR/prep_app_test.sh $DMM_SCRIPT_DIR/prep_app_test_csit.sh
- sed -i 's!.*check_hugepage.sh!#skip hugepage check!1' $DMM_SCRIPT_DIR/prep_app_test_csit.sh
- sed -i 's!enp0s8!'$ifname'!1' $DMM_SCRIPT_DIR/prep_app_test_csit.sh
- bash -x $DMM_SCRIPT_DIR/prep_app_test_csit.sh
+ setup_preparation vs_epoll
fi
#################################################
# Execution
if [ "x$action" == "xrun" ]; then
- cd $APP_DIR
- ls -l
- #only for kernal stack
- if [ "x$node" == "x0" ]; then
- sudo LD_LIBRARY_PATH=${LIB_PATH} ./vs_epoll -p 20000 -d ${dut2_if_ip} -a 10000 -s ${dut1_if_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1
- else
- sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_common -p 20000 -d ${dut1_if_ip} -a 10000 -s ${dut2_if_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1
- fi
+ execution "sudo LD_LIBRARY_PATH=${LIB_PATH} NSTACK_LOG_FILE_FLAG=1 ./vs_epoll -p 20000 -d ${dut2_if_ip} -a 10000 -s ${dut1_if_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1" \
+ "sudo LD_LIBRARY_PATH=${LIB_PATH} NSTACK_LOG_FILE_FLAG=1 ./vc_common -p 20000 -d ${dut1_if_ip} -a 10000 -s ${dut2_if_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1"
fi
#################################################
@@ -57,14 +44,9 @@ fi
if [ "x$action" == "xverify" ]; then
if [ "x$node" == "x1" ]; then
- sudo cat $RUN_DIR/log_$(basename $0).txt | grep "send 50000"
- if [ $? == 0 ]; then
- echo "DMM_CSIT_TEST_PASSED"
- else
- echo "DMM_CSIT_TEST_FAILED"
- fi
+ verification "sudo cat $RUN_DIR/log_$(basename $0).txt | grep \"send 50000\""
elif [ "x$node" == "x0" ]; then
- echo "DMM_CSIT_TEST_PASSED"
+ verification
fi
fi
@@ -72,16 +54,14 @@ fi
# Print Log
if [ "x$action" == "xlog" ]; then
- echo "print log"
+ print_log vs_epoll vc_common
fi
#################################################
# Cleanup
if [ "x$action" == "xcleanup" ]; then
- if [ "x$node" == "x0" ]; then
- bash $CSIT_SCRIPT_DIR/kill_given_proc.sh vs_epoll
- fi
+ cleanup vs_epoll vc_common
fi
exit 0 \ No newline at end of file
diff --git a/scripts/csit/run/run_dmm_fork.sh b/scripts/csit/run/run_dmm_fork.sh
new file mode 100755
index 0000000..b406ba5
--- /dev/null
+++ b/scripts/csit/run/run_dmm_fork.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+set -x
+
+#################################################
+# Store arguments values
+# verify, log, cleanup actions gets first two arguments
+
+action=$1 #action: [setup, run, verify, cleanup]
+node=$2 #node: [0 - dut1 node, 1 - dut2 node]
+ifname=$3 #dut1 interface name when node is 0 /dut2 interface name when node is 1
+dut1_if_ip=$4 #dut1 interface ip
+dut2_if_ip=$5 #dut2 interface ip
+
+#################################################
+# Get path details
+
+RUN_DIR=`dirname $(readlink -f $0)`
+CSIT_SCRIPT_DIR=$RUN_DIR/..
+ROOTDIR=$CSIT_SCRIPT_DIR/../../../
+APP_DIR=${ROOTDIR}/dmm/config/app_test
+LIB_PATH=${ROOTDIR}/dmm/release/lib64
+DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts
+LOG_PATH=/var/log
+
+source $DMM_SCRIPT_DIR/csit/common.sh
+#################################################
+# Setup preparation
+
+if [ "x$action" == "xsetup" ]; then
+ setup_preparation vtcp_fork_server
+fi
+
+#################################################
+# Execution
+#execution "sudo LD_LIBRARY_PATH=${LIB_PATH} ./ktcp_fork_server -a 10000 -s ${dut1_if_ip} -t 50000"
+# "sudo LD_LIBRARY_PATH=${LIB_PATH} ./ktcp_client -p 10000 -d ${dut1_if_ip} -a 10000 -s ${dut2_if_ip} -t 50000"
+if [ "x$action" == "xrun" ]; then
+ execution "sudo LD_LIBRARY_PATH=${LIB_PATH} NSTACK_LOG_FILE_FLAG=1 ./vtcp_fork_server -a 10000 -s ${dut1_if_ip} -t 50000" \
+ "sudo LD_LIBRARY_PATH=${LIB_PATH} NSTACK_LOG_FILE_FLAG=1 ./vtcp_client -p 10000 -d ${dut1_if_ip} -a 10000 -s ${dut2_if_ip} -t 50000"
+fi
+
+#################################################
+# Verification
+
+if [ "x$action" == "xverify" ]; then
+ if [ "x$node" == "x1" ]; then
+ verification "sudo cat $RUN_DIR/log_$(basename $0).txt | grep \"Success\""
+ elif [ "x$node" == "x0" ]; then
+ verification
+ fi
+fi
+
+#################################################
+# Print Log
+
+if [ "x$action" == "xlog" ]; then
+ print_log vtcp_fork_server vtcp_client
+fi
+
+#################################################
+# Cleanup
+
+if [ "x$action" == "xcleanup" ]; then
+ cleanup vtcp_fork_server vtcp_client
+fi
+
+exit 0
diff --git a/scripts/csit/run/run_dmm_fork_with_lwip.sh b/scripts/csit/run/run_dmm_fork_with_lwip.sh
new file mode 100755
index 0000000..0ee9d07
--- /dev/null
+++ b/scripts/csit/run/run_dmm_fork_with_lwip.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+set -x
+
+#################################################
+# Store arguments values
+# verify, log, cleanup actions gets first two arguments[action, node]
+
+action=$1 #action: [setup, run, verify, cleanup]
+node=$2 #node: [0 - dut1 node, 1 - dut2 node]
+ifname=$3 #dut1 interface name(when node is 0)/dut2 interface name(when node is 1)
+dut1_if_ip=$4 #dut1 interface ip
+dut2_if_ip=$5 #dut2 interface ip
+
+#################################################
+# Get path details
+
+RUN_DIR=`dirname $(readlink -f $0)`
+CSIT_SCRIPT_DIR=$RUN_DIR/..
+ROOTDIR=$CSIT_SCRIPT_DIR/../../../
+APP_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/app_test/
+LIB_PATH=${APP_DIR}/../release/lib64/
+VAG_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/vagrant
+LOG_PATH=/var/log/nStack
+DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts
+
+source $DMM_SCRIPT_DIR/csit/common.sh
+#################################################
+# Setup preparation
+
+if [ "x$action" == "xsetup" ]; then
+ setup_preparation_lwip vtcp_fork_server
+fi
+
+#################################################
+# Execution
+
+if [ "x$action" == "xrun" ]; then
+ execution "sudo LD_LIBRARY_PATH=${LIB_PATH} ./vtcp_fork_server -a 10000 -s ${dut1_if_ip} -t 50000" \
+ "sudo LD_LIBRARY_PATH=${LIB_PATH} ./vtcp_client -p 10000 -d ${dut1_if_ip} -a 10000 -s ${dut2_if_ip} -t 50000"
+fi
+
+#################################################
+# Verification
+
+if [ "x$action" == "xverify" ]; then
+ if [ "x$node" == "x1" ]; then
+ verification "cat $RUN_DIR/log_$(basename $0).txt | grep \"Success\""
+ elif [ "x$node" == "x0" ]; then
+ verification
+ fi
+fi
+
+#################################################
+# Print Log
+
+if [ "x$action" == "xlog" ]; then
+ cat $LOG_PATH/running.log
+fi
+
+#################################################
+# Cleanup
+
+if [ "x$action" == "xcleanup" ]; then
+ cleanup_lwip vtcp_fork_server
+fi
+
+exit 0
diff --git a/scripts/csit/run/run_dmm_tcp_filetrans.sh b/scripts/csit/run/run_dmm_tcp_filetrans.sh
new file mode 100755
index 0000000..fddc017
--- /dev/null
+++ b/scripts/csit/run/run_dmm_tcp_filetrans.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+set -x
+
+#################################################
+# Store arguments values
+# verify, log, cleanup actions gets first two arguments
+
+action=$1 #action: [setup, run, verify, cleanup]
+node=$2 #node: [0 - dut1 node, 1 - dut2 node]
+ifname=$3 #dut1 interface name when node is 0 /dut2 interface name when node is 1
+dut1_if_ip=$4 #dut1 interface ip
+dut2_if_ip=$5 #dut2 interface ip
+
+
+#################################################
+# Get path details
+
+RUN_DIR=`dirname $(readlink -f $0)`
+CSIT_SCRIPT_DIR=$RUN_DIR/..
+ROOTDIR=$CSIT_SCRIPT_DIR/../../../
+APP_DIR=${ROOTDIR}/dmm/config/app_test
+LIB_PATH=${ROOTDIR}/dmm/release/lib64
+DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts
+LOG_PATH=/var/log
+
+source $DMM_SCRIPT_DIR/csit/common.sh
+#################################################
+# Setup preparation
+
+if [ "x$action" == "xsetup" ]; then
+ setup_preparation vc_serv_file
+fi
+
+#################################################
+# Execution
+
+if [ "x$action" == "xrun" ]; then
+ execution "cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} NSTACK_LOG_FILE_FLAG=1 ./vc_serv_file tcp ${dut1_if_ip} 1234" \
+ "cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} NSTACK_LOG_FILE_FLAG=1 ./vc_cli_file tcp ${dut1_if_ip} 1234 file.txt ${dut2_if_ip}"
+fi
+
+#################################################
+# Verification
+
+if [ "x$action" == "xverify" ]; then
+ if [ "x$node" == "x0" ]; then
+ verification "diff $APP_DIR/file.txt $APP_DIR/receive_file.txt >/dev/null"
+ elif [ "x$node" == "x1" ]; then
+ verification
+ fi
+fi
+
+#################################################
+# Print Log
+
+if [ "x$action" == "xlog" ]; then
+ print_log vc_serv_file vc_cli_file
+fi
+
+#################################################
+# Cleanup
+
+if [ "x$action" == "xcleanup" ]; then
+ cleanup vc_serv_file vc_cli_file
+fi
+
+exit 0 \ No newline at end of file
diff --git a/scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh b/scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh
new file mode 100755
index 0000000..5713d50
--- /dev/null
+++ b/scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+set -x
+
+#################################################
+# Store arguments values
+# verify, log, cleanup actions gets first two arguments[action, node]
+
+action=$1 #action: [setup, run, verify, cleanup]
+node=$2 #node: [0 - dut1 node, 1 - dut2 node]
+ifname=$3 #dut1 interface name(when node is 0)/dut2 interface name(when node is 1)
+dut1_if_ip=$4 #dut1 interface ip
+dut2_if_ip=$5 #dut2 interface ip
+
+#################################################
+# Get path details
+
+RUN_DIR=`dirname $(readlink -f $0)`
+CSIT_SCRIPT_DIR=$RUN_DIR/..
+ROOTDIR=$CSIT_SCRIPT_DIR/../../../
+APP_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/app_test/
+LIB_PATH=${APP_DIR}/../release/lib64/
+VAG_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/vagrant
+LOG_PATH=/var/log/nStack
+DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts
+
+source $DMM_SCRIPT_DIR/csit/common.sh
+#################################################
+# Setup preparation
+
+if [ "x$action" == "xsetup" ]; then
+ setup_preparation_lwip vc_serv_file
+fi
+
+#################################################
+# Execution
+
+if [ "x$action" == "xrun" ]; then
+ execution "sudo cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_serv_file tcp ${dut1_if_ip} 1234" \
+ "sudo cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_cli_file tcp ${dut1_if_ip} 1234 file.txt ${dut2_if_ip}"
+fi
+
+#################################################
+
+# Verification
+
+if [ "x$action" == "xverify" ]; then
+ if [ "x$node" == "x0" ]; then
+ verification "diff $APP_DIR/file.txt $APP_DIR/receive_file.txt >/dev/null"
+ elif [ "x$node" == "x1" ]; then
+ verification
+ fi
+fi
+
+#################################################
+# Print Log
+
+if [ "x$action" == "xlog" ]; then
+ cat $LOG_PATH/running.log
+fi
+
+#################################################
+# Cleanup
+
+if [ "x$action" == "xcleanup" ]; then
+ cleanup_lwip vc_serv_file
+fi
+
+exit 0
diff --git a/scripts/csit/run/run_dmm_udp_filetrans.sh b/scripts/csit/run/run_dmm_udp_filetrans.sh
new file mode 100755
index 0000000..b8838bb
--- /dev/null
+++ b/scripts/csit/run/run_dmm_udp_filetrans.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+set -x
+
+#################################################
+# Store arguments values
+# verify, log, cleanup actions gets first two arguments
+
+action=$1 #action: [setup, run, verify, cleanup]
+node=$2 #node: [0 - dut1 node, 1 - dut2 node]
+ifname=$3 #dut1 interface name when node is 0 /dut2 interface name when node is 1
+dut1_if_ip=$4 #dut1 interface ip
+dut2_if_ip=$5 #dut2 interface ip
+
+
+#################################################
+# Get path details
+
+RUN_DIR=`dirname $(readlink -f $0)`
+CSIT_SCRIPT_DIR=$RUN_DIR/..
+ROOTDIR=$CSIT_SCRIPT_DIR/../../../
+APP_DIR=${ROOTDIR}/dmm/config/app_test
+LIB_PATH=${ROOTDIR}/dmm/release/lib64
+DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts
+LOG_PATH=/var/log
+
+source $DMM_SCRIPT_DIR/csit/common.sh
+#################################################
+# Setup preparation
+
+if [ "x$action" == "xsetup" ]; then
+ setup_preparation vc_serv_file
+fi
+
+#################################################
+# Execution
+
+if [ "x$action" == "xrun" ]; then
+ execution "cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_serv_file udp ${dut1_if_ip} 1235 file.txt 256" \
+ "cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_cli_file udp ${dut1_if_ip} 1235 ${dut2_if_ip} file.txt receive_file.txt 256"
+fi
+
+#################################################
+# Verification
+
+if [ "x$action" == "xverify" ]; then
+ if [ "x$node" == "x0" ]; then
+ verification "diff $APP_DIR/file.txt $APP_DIR/receive_file.txt >/dev/null"
+ elif [ "x$node" == "x1" ]; then
+ verification
+ fi
+fi
+
+#################################################
+# Print Log
+
+if [ "x$action" == "xlog" ]; then
+ print_log vc_serv_file vc_cli_file
+fi
+
+#################################################
+# Cleanup
+
+if [ "x$action" == "xcleanup" ]; then
+ cleanup vc_serv_file vc_cli_file
+fi
+
+exit 0 \ No newline at end of file
diff --git a/scripts/csit/run/run_dmm_udp_filetrans_with_lwip.sh b/scripts/csit/run/run_dmm_udp_filetrans_with_lwip.sh
new file mode 100755
index 0000000..b8310dd
--- /dev/null
+++ b/scripts/csit/run/run_dmm_udp_filetrans_with_lwip.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+set -x
+
+#################################################
+# Store arguments values
+# verify, log, cleanup actions gets first two arguments[action, node]
+
+action=$1 #action: [setup, run, verify, cleanup]
+node=$2 #node: [0 - dut1 node, 1 - dut2 node]
+ifname=$3 #dut1 interface name(when node is 0)/dut2 interface name(when node is 1)
+dut1_if_ip=$4 #dut1 interface ip
+dut2_if_ip=$5 #dut2 interface ip
+
+#################################################
+# Get path details
+
+RUN_DIR=`dirname $(readlink -f $0)`
+CSIT_SCRIPT_DIR=$RUN_DIR/..
+ROOTDIR=$CSIT_SCRIPT_DIR/../../../
+APP_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/app_test/
+LIB_PATH=${APP_DIR}/../release/lib64/
+VAG_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/vagrant
+LOG_PATH=/var/log/nStack
+DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts
+
+source $DMM_SCRIPT_DIR/csit/common.sh
+#################################################
+# Setup preparation
+
+if [ "x$action" == "xsetup" ]; then
+ setup_preparation_lwip vc_serv_file
+ sudo sed -i '23s/kernel/lwip/' $APP_DIR/rd_config.json
+fi
+
+#################################################
+# Execution
+
+if [ "x$action" == "xrun" ]; then
+ execution "sudo cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_serv_file udp ${dut1_if_ip} 1236 file.txt 256" \
+ "sudo cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_cli_file udp ${dut1_if_ip} 1236 ${dut2_if_ip} file.txt receive_file.txt 256"
+fi
+
+#################################################
+
+# Verification
+
+if [ "x$action" == "xverify" ]; then
+ if [ "x$node" == "x0" ]; then
+ verification "diff $APP_DIR/file.txt $APP_DIR/receive_file.txt >/dev/null"
+ elif [ "x$node" == "x1" ]; then
+ verification
+ fi
+fi
+
+#################################################
+# Print Log
+
+if [ "x$action" == "xlog" ]; then
+ cat $LOG_PATH/running.log
+fi
+
+#################################################
+# Cleanup
+
+if [ "x$action" == "xcleanup" ]; then
+ cleanup_lwip vc_serv_file
+fi
+
+exit 0
diff --git a/scripts/csit/run/run_dmm_with_lwip.sh b/scripts/csit/run/run_dmm_with_lwip.sh
index 1174697..3b02e28 100755
--- a/scripts/csit/run/run_dmm_with_lwip.sh
+++ b/scripts/csit/run/run_dmm_with_lwip.sh
@@ -22,39 +22,22 @@ APP_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/app_test/
LIB_PATH=${APP_DIR}/../release/lib64/
VAG_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/vagrant
LOG_PATH=/var/log/nStack
+DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts
+source $DMM_SCRIPT_DIR/csit/common.sh
#################################################
# Setup preparation
if [ "x$action" == "xsetup" ]; then
- bash $CSIT_SCRIPT_DIR/kill_given_proc.sh vs_epoll
- bash $CSIT_SCRIPT_DIR/setup_hugepage.sh
- cat /proc/meminfo
- cp -f $VAG_DIR/start_nstackMain.sh $VAG_DIR/start_nstackMain_csit.sh
- sed -i 's!.*check_hugepage.sh!#skip hugepage check!1' $VAG_DIR/start_nstackMain_csit.sh
- sed -i 's!ifname=.*!ifname='$ifname'!1' $VAG_DIR/start_nstackMain_csit.sh
- sudo LD_LIBRARY_PATH=${LIB_PATH} bash $VAG_DIR/start_nstackMain_csit.sh || exit 1
- sleep 5
-
- #after nstackmain
- echo "after nstackmain"
- ip addr
- lspci -nn
- lsmod | grep uio
- cat /proc/meminfo | grep Huge
- /tmp/dpdk/dpdk-18.02/usertools/dpdk-devbind.py --status
+ setup_preparation_lwip vs_epoll
fi
#################################################
# Execution
if [ "x$action" == "xrun" ]; then
- cd ${APP_DIR}
- if [ "x$node" == "x0" ]; then
- sudo LD_LIBRARY_PATH=${LIB_PATH} ./vs_epoll -p 20000 -d ${dut2_if_ip} -a 10000 -s ${dut1_if_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1
- else
- sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_common -p 20000 -d ${dut1_if_ip} -a 10000 -s ${dut2_if_ip} -l 200 -t 50 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1
- fi
+ execution "sudo LD_LIBRARY_PATH=${LIB_PATH} ./vs_epoll -p 20000 -d ${dut2_if_ip} -a 10000 -s ${dut1_if_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1" \
+ "sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_common -p 20000 -d ${dut1_if_ip} -a 10000 -s ${dut2_if_ip} -l 200 -t 50 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1"
fi
#################################################
@@ -62,14 +45,9 @@ fi
if [ "x$action" == "xverify" ]; then
if [ "x$node" == "x1" ]; then
- cat $RUN_DIR/log_$(basename $0).txt | grep "send 50"
- if [ $? == 0 ]; then
- echo "DMM_CSIT_TEST_PASSED"
- else
- echo "DMM_CSIT_TEST_FAILED"
- fi
+ verification "cat $RUN_DIR/log_$(basename $0).txt | grep \"send 50\""
elif [ "x$node" == "x0" ]; then
- echo "DMM_CSIT_TEST_PASSED"
+ verification
fi
fi
@@ -84,11 +62,7 @@ fi
# Cleanup
if [ "x$action" == "xcleanup" ]; then
- if [ "x$node" == "x0" ]; then
- bash $CSIT_SCRIPT_DIR/kill_given_proc.sh vs_epoll
- fi
- sudo bash $APP_DIR/../release/stop_nstack.sh
- sudo rm $LOG_PATH/running.log
+ cleanup_lwip vs_epoll
fi
exit 0
diff --git a/src/nSocket/nstack/nstack_info_parse.c b/src/nSocket/nstack/nstack_info_parse.c
index 04abb4e..8b2d62f 100644
--- a/src/nSocket/nstack/nstack_info_parse.c
+++ b/src/nSocket/nstack/nstack_info_parse.c
@@ -66,8 +66,14 @@
} \
else \
{ \
- NSSOC_LOGERR("can't get obj from %s index:%d", name, (index)); \
- goto RETURN_ERROR; \
+ if (strcmp(name, "deploytype") == 0 || strcmp(name, "stackid") == 0) \
+ { \
+ NSSOC_LOGERR("can't get obj from %s index:%d", name, (index)); \
+ } \
+ else\
+ { \
+ NSSOC_LOGWAR("can't get obj from %s index:%d", name, (index)); \
+ } \
} \
} while ( 0 );
@@ -85,6 +91,7 @@ nstack_parse_module_cfg_json (char *param)
int ret = NSTACK_RETURN_FAIL;
int index = 0;
int icnt = 0;
+ int ret_val;
if (!obj)
{
@@ -125,10 +132,21 @@ nstack_parse_module_cfg_json (char *param)
NSTACK_JSON_PARSE_STRING (module_obj, "stack_name", MODULE_NAME_MAX,
&(g_nstack_module_desc[icnt].modName[0]),
index);
- NSTACK_JSON_PARSE_STRING (module_obj, "function_name",
- MODULE_NAME_MAX,
- &(g_nstack_module_desc
- [icnt].register_fn_name[0]), index);
+ STRCPY_S (&(g_nstack_module_desc[icnt].register_fn_name[0]),
+ sizeof (&
+ (g_nstack_module_desc[icnt].register_fn_name[0])),
+ &(g_nstack_module_desc[icnt].modName[0]));
+ ret_val =
+ STRCAT_S (&(g_nstack_module_desc[icnt].register_fn_name[0]),
+ sizeof (&
+ (g_nstack_module_desc[icnt].register_fn_name
+ [0])), "_stack_register");
+ if (EOK != ret_val)
+ {
+ NSFW_LOGERR ("register_fn_name STRCAT_S failed]ret_val=%d",
+ ret_val);
+ return -1;
+ }
NSTACK_JSON_PARSE_STRING (module_obj, "libname", MODULE_NAME_MAX,
&(g_nstack_module_desc[icnt].libPath[0]),
index);
@@ -149,14 +167,28 @@ nstack_parse_module_cfg_json (char *param)
}
else
{
- NSSOC_LOGERR ("can't get value from loadtype index:%d", index);
- goto RETURN_ERROR;
+ if (strcmp (g_nstack_module_desc[icnt].modName, "kernel") == 0)
+ {
+ g_nstack_module_desc[icnt].libtype = NSTACK_LIB_LOAD_STATIC;
+ }
+ else
+ {
+ g_nstack_module_desc[icnt].libtype = NSTACK_LIB_LOAD_DYN;
+ }
+ NSSOC_LOGWAR ("can't get the value of loadtype for module:%s",
+ g_nstack_module_desc[icnt].modName);
}
+ NSSBR_LOGINF ("load type of %d has been chosen",
+ g_nstack_module_desc[icnt].libtype);
NSTACK_JSON_PARSE_INT (module_obj, "deploytype", MODULE_NAME_MAX,
g_nstack_module_desc[icnt].deploytype,
index);
NSTACK_JSON_PARSE_INT (module_obj, "maxfd", MODULE_NAME_MAX,
g_nstack_module_desc[icnt].maxfdid, index);
+ if (g_nstack_module_desc[icnt].maxfdid == 0)
+ {
+ g_nstack_module_desc[icnt].maxfdid = 1024;
+ }
NSTACK_JSON_PARSE_INT (module_obj, "minfd", MODULE_NAME_MAX,
g_nstack_module_desc[icnt].minfdid, index);
NSTACK_JSON_PARSE_INT (module_obj, "priorty", MODULE_NAME_MAX,
diff --git a/src/nSocket/nstack/nstack_module.h b/src/nSocket/nstack/nstack_module.h
index ec81ac1..40a2ef8 100644
--- a/src/nSocket/nstack/nstack_module.h
+++ b/src/nSocket/nstack/nstack_module.h
@@ -38,11 +38,6 @@ extern "C"{
#define NSTACK_MAX_MODULE_NUM 8
#define NSTACK_PRO_MODULE 1
-#define MIN_SOCK_FOR_STACKX 0
-
-#define MOD_PRI_FOR_STACKX 1
-#define REG_FUN_FOR_STACKX "nstack_stack_register"
-
#define NSTACK_EP_FREE_NEED_REF 1 /*when epoll information free, need to wait that stack would not notify event */
#define NSTACK_EP_FREE_NONEED_REF 0
diff --git a/stacks/lwip_stack/app_conf/module_config.json b/stacks/lwip_stack/app_conf/module_config.json
index 6a2f5fb..c9c872b 100644
--- a/stacks/lwip_stack/app_conf/module_config.json
+++ b/stacks/lwip_stack/app_conf/module_config.json
@@ -3,24 +3,14 @@
"module_list": [
{
"stack_name": "kernel",
- "function_name": "kernel_stack_register",
"libname": "./",
- "loadtype": "static",
"deploytype": "1",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "0",
},
{
"stack_name": "lwip",
- "function_name": "nstack_stack_register",
"libname": "liblwip_dpdk.so",
- "loadtype": "dynmic",
"deploytype": "3",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "1",
},
]
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 decc52c..52f7c64 100644
--- a/stacks/lwip_stack/lwip_src/ip_module/container_ip.c
+++ b/stacks/lwip_stack/lwip_src/ip_module/container_ip.c
@@ -533,7 +533,7 @@ parse_container_ip_json (char *param)
else
{
/* this mandatory parameter */
- goto RETURN_ERROR;
+ NSOPR_LOGWAR ("json_object_object_get_ex containerID failed");
}
json_object_object_get_ex (obj, "ports_list", &ports_list_obj);
diff --git a/stacks/lwip_stack/release/configure/ip_data.json b/stacks/lwip_stack/release/configure/ip_data.json
index f29103e..1d52b77 100644
--- a/stacks/lwip_stack/release/configure/ip_data.json
+++ b/stacks/lwip_stack/release/configure/ip_data.json
@@ -1,31 +1,8 @@
{
- "containerID": "9112d2b6aa31",
- "primary_port": "PortA",
"ports_list": [
{
"port_name": "PortA",
- "ref_nic": [
- "eth7"
- ],
- "mac": [
- "00:54:32:19:3d:19"
- ],
- "net_name": "IDX-M",
- "ip_cidr": ["192.168.1.207/24"],
- "multicast_id": [
- {
- "group_id": "cast_group_1",
- "group_ip": "239.0.0.1"
- },
- {
- "group_id": "cast_group_2",
- "group_ip": "239.0.0.2"
- }
- ],
- "vlan_id": 42,
- "vlan_inside": true,
- "vxlan_id": -1,
- "vxlan_inside": false
+ "ip_cidr": ["192.168.1.207/24"]
}
]
}
diff --git a/stacks/lwip_stack/release/configure/network_data_tonStack.json b/stacks/lwip_stack/release/configure/network_data_tonStack.json
index 7c059ef..7b734b0 100644
--- a/stacks/lwip_stack/release/configure/network_data_tonStack.json
+++ b/stacks/lwip_stack/release/configure/network_data_tonStack.json
@@ -1,31 +1,15 @@
[
{
- "cniVersion": "0.2.0",
- "name": "IDX-M",
- "multi_entry": "3",
+ "name": "network1",
"type": "nstack-dpdk",
- "vlanID": 42,
- "vlan_inside": true,
"ipam": {
- "type": "canal-ipam",
- "subnet": "192.168.1.1/24",
- "gateway": "192.168.1.254",
- "range-start": "192.168.1.198",
- "range-end": "192.168.1.209",
- "routes": [
- {
- "dst": "192.168.1.0/24",
- "gw": "192.168.1.254"
- }
- ]
+ "subnet": "192.168.1.1/24"
},
"args": {
"phynet": {
"ref_nic": [
"eth7"
- ],
- "bond_name": "",
- "bond_mode": -1
+ ]
}
}
},
diff --git a/stacks/lwip_stack/release/lwip_helper_files/download_lwip.sh b/stacks/lwip_stack/release/lwip_helper_files/download_lwip.sh
index 316859b..bbb8afb 100755
--- a/stacks/lwip_stack/release/lwip_helper_files/download_lwip.sh
+++ b/stacks/lwip_stack/release/lwip_helper_files/download_lwip.sh
@@ -23,7 +23,7 @@ echo $LWIP_DOWNLOAD_DIR
if [ ! -d "${LWIP_DOWNLOAD_DIR}/lwip/" ]; then
mkdir -p ${LWIP_DOWNLOAD_DIR}/lwip/
cd ${LWIP_DOWNLOAD_DIR}/
- wget -N --no-check-certificate http://download.savannah.nongnu.org/releases/lwip/lwip-2.0.3.zip
+ wget -N --no-check-certificate http://download-mirror.savannah.nongnu.org/releases/lwip/lwip-2.0.3.zip
unzip ${LWIP_DOWNLOAD_DIR}/lwip-2.0.3.zip "lwip-2.0.3/src/*" -d ${LWIP_DOWNLOAD_DIR}/lwip
mv ${LWIP_DOWNLOAD_DIR}/lwip/lwip-2.0.3/src/* ${LWIP_DOWNLOAD_DIR}/lwip/
rm -rf ${LWIP_DOWNLOAD_DIR}/lwip/lwip-2.0.3/
@@ -32,4 +32,4 @@ if [ ! -d "${LWIP_DOWNLOAD_DIR}/lwip/" ]; then
cp -r ${SCRIPT_DIR}/core/* ${LWIP_DOWNLOAD_DIR}/lwip/core/
cp -r ${SCRIPT_DIR}/include/* ${LWIP_DOWNLOAD_DIR}/lwip/include/lwip/
mv ${LWIP_DOWNLOAD_DIR}/lwip/include/lwip/errno.h ${LWIP_DOWNLOAD_DIR}/lwip/include/lwip/lwip_errno.h
-fi \ No newline at end of file
+fi
diff --git a/stacks/lwip_stack/src/sbr/sbr_socket.c b/stacks/lwip_stack/src/sbr/sbr_socket.c
index 6f867ab..69481b5 100644
--- a/stacks/lwip_stack/src/sbr/sbr_socket.c
+++ b/stacks/lwip_stack/src/sbr/sbr_socket.c
@@ -1249,7 +1249,7 @@ SBR_INTERCEPT (void, fork_free_fd, (int s, pid_t p, pid_t c))
*
*****************************************************************************/
int
-nstack_stack_register (nstack_proc_cb * ops, nstack_event_cb * val)
+lwip_stack_register (nstack_proc_cb * ops, nstack_event_cb * val)
{
if (!ops || !val || !val->handle)
{
diff --git a/stacks/lwip_stack/vagrant/start_nstackMain.sh b/stacks/lwip_stack/vagrant/start_nstackMain.sh
index 00d4370..0c6d0a4 100755
--- a/stacks/lwip_stack/vagrant/start_nstackMain.sh
+++ b/stacks/lwip_stack/vagrant/start_nstackMain.sh
@@ -68,21 +68,9 @@ chmod 775 *
cp ./configure/*.json bin/
cd bin
-if [ "$OS_ID" == "centos" ]; then
- sed -i 's!eth7!'$ifname'!1' ip_data.json
-elif [ "$OS_ID" == "ubuntu" ]; then
- sed -i 's!eth7!'$ifname'!1' ip_data.json
-fi
-
-sed -i 's!00:54:32:19:3d:19!'$ifmac'!1' ip_data.json
sed -i 's!192.168.1.207!'$ifaddress1'!1' ip_data.json
sed -i 's!192.168.1.1!'$ifaddresscut'.0!1' network_data_tonStack.json
-sed -i 's!192.168.1.254!'$ifaddresscut'.1!1' network_data_tonStack.json
-sed -i 's!192.168.1.098!'$ifaddresscut'.5!1' network_data_tonStack.json
-sed -i 's!192.168.1.209!'$ifaddresscut'.254!1' network_data_tonStack.json
-sed -i 's!192.168.1.0!'$ifaddresscut'.0!1' network_data_tonStack.json
-sed -i 's!192.168.1.254!'$ifaddresscut'.1!1' network_data_tonStack.json
if [ "$OS_ID" == "centos" ]; then
sed -i 's!eth7!'$ifname'!1' network_data_tonStack.json
diff --git a/stacks/rsocket/config/module_config.json b/stacks/rsocket/config/module_config.json
index 2df82cd..736de24 100644
--- a/stacks/rsocket/config/module_config.json
+++ b/stacks/rsocket/config/module_config.json
@@ -3,27 +3,17 @@
"module_list": [
{
"stack_name": "kernel", /*stack name*/
- "function_name": "kernel_stack_register", /*function name*/
"libname": "./", /*library name, if loadtype is static, this maybe
null, else must give a library name*/
- "loadtype": "static", /*library load type: static or dynamic*/
"deploytype": "1", /*deploy model type:model type1, model type2,
model type3. Indicating single or multi process
deployment. Used during shared memory initialization.*/
- "maxfd": "1024", /*the max fd supported*/
- "minfd": "0", /*the min fd supported*/
- "priorty": "1", /*priorty when executing, reserv*/
"stackid": "0", /*stack id, this must be ordered and not be repeated*/
},
{
"stack_name": "rsocket",
- "function_name": "rsocket_stack_register",
"libname": "libdmm_rsocket.so",
- "loadtype": "dynmic",
"deploytype": "1",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "1",
},
]
diff --git a/stacks/vpp/adapt/dmm_vcl_adpt.c b/stacks/vpp/adapt/dmm_vcl_adpt.c
index d4974e2..56f9033 100644
--- a/stacks/vpp/adapt/dmm_vcl_adpt.c
+++ b/stacks/vpp/adapt/dmm_vcl_adpt.c
@@ -143,7 +143,7 @@ dmm_vpphs_init ()
}
int
-vpphs_stack_register (nstack_proc_cb * ops, nstack_event_cb * val)
+vpp_hoststack_stack_register (nstack_proc_cb * ops, nstack_event_cb * val)
{
#undef NSTACK_MK_DECL
diff --git a/stacks/vpp/configure/module_config.json b/stacks/vpp/configure/module_config.json
index 49b7ca9..fb73574 100644
--- a/stacks/vpp/configure/module_config.json
+++ b/stacks/vpp/configure/module_config.json
@@ -3,27 +3,17 @@
"module_list": [
{
"stack_name": "kernel", /*stack name*/
- "function_name": "kernel_stack_register", /*function name*/
"libname": "./", /*library name, if loadtype is static, this maybe
null, else must give a library name*/
- "loadtype": "static", /*library load type: static or dynamic*/
"deploytype": "1", /*deploy model type:model type1, model type2,
model type3. Indicating single or multi process
deployment. Used during shared memory initialization.*/
- "maxfd": "1024", /*the max fd supported*/
- "minfd": "0", /*the min fd supported*/
- "priorty": "1", /*priorty when executing, reserv*/
"stackid": "0", /*stack id, this must be ordered and not be repeated*/
},
{
"stack_name": "vpp_hoststack",
- "function_name": "vpphs_stack_register",
"libname": "../lib64/libdmm_vcl.so",
- "loadtype": "dynmic",
"deploytype": "4",
- "maxfd": "1024",
- "minfd": "0",
- "priorty": "1",
"stackid": "1",
},
]