Fix: stack_register function name should be same. 77/16077/5
authorcharan makkina <charan795m@gmail.com>
Wed, 21 Nov 2018 09:47:39 +0000 (15:17 +0530)
committercharan makkina <charan795m@gmail.com>
Mon, 26 Nov 2018 05:02:58 +0000 (10:32 +0530)
Change-Id: Ib091993ca2ba4df1dab00ace93e0d1dfa4145807
Signed-off-by: charan makkina <charan795m@gmail.com>
demo/nginx_proxy/demo-1/module_config.json
demo/nginx_proxy/demo-2/module_config.json
release/configure/module_config.json
src/nSocket/nstack/nstack_info_parse.c
src/nSocket/nstack/nstack_module.h
stacks/lwip_stack/app_conf/module_config.json
stacks/lwip_stack/src/sbr/sbr_socket.c
stacks/rsocket/config/module_config.json
stacks/vpp/adapt/dmm_vcl_adpt.c
stacks/vpp/configure/module_config.json

index 5861153..24f5cf8 100644 (file)
@@ -3,7 +3,6 @@
   "module_list": [
     {
       "stack_name": "kernel",
-         "function_name": "kernel_stack_register",
          "libname": "./",
          "loadtype": "static",
       "deploytype": "1",
@@ -14,7 +13,6 @@
     },
     {
       "stack_name": "lwip",
-      "function_name": "nstack_stack_register",
       "libname": "liblwip_dpdk.so",
       "loadtype": "dynmic",
       "deploytype": "3",
@@ -25,7 +23,6 @@
     },
     {
         "stack_name": "vpp_hoststack",
-        "function_name": "vpphs_stack_register",
         "libname": "./libdmm_vcl.so",
         "loadtype": "dynmic",
        "deploytype": "4",
index 5861153..24f5cf8 100644 (file)
@@ -3,7 +3,6 @@
   "module_list": [
     {
       "stack_name": "kernel",
-         "function_name": "kernel_stack_register",
          "libname": "./",
          "loadtype": "static",
       "deploytype": "1",
@@ -14,7 +13,6 @@
     },
     {
       "stack_name": "lwip",
-      "function_name": "nstack_stack_register",
       "libname": "liblwip_dpdk.so",
       "loadtype": "dynmic",
       "deploytype": "3",
@@ -25,7 +23,6 @@
     },
     {
         "stack_name": "vpp_hoststack",
-        "function_name": "vpphs_stack_register",
         "libname": "./libdmm_vcl.so",
         "loadtype": "dynmic",
        "deploytype": "4",
index 4532d1a..aebbf39 100644 (file)
@@ -3,7 +3,6 @@
     "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*/
@@ -19,7 +18,6 @@
      *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",
index 04abb4e..84538cc 100644 (file)
@@ -85,6 +85,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 +126,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);
index ec81ac1..40a2ef8 100644 (file)
@@ -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
 
index 6a2f5fb..3531fb1 100644 (file)
@@ -3,7 +3,6 @@
   "module_list": [
     {
       "stack_name": "kernel",
-         "function_name": "kernel_stack_register",
          "libname": "./",
          "loadtype": "static",
       "deploytype": "1",
@@ -14,7 +13,6 @@
     },
     {
       "stack_name": "lwip",
-      "function_name": "nstack_stack_register",
       "libname": "liblwip_dpdk.so",
       "loadtype": "dynmic",
       "deploytype": "3",
index 6f867ab..69481b5 100644 (file)
@@ -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)
     {
index 2df82cd..2ca6b6f 100644 (file)
@@ -3,7 +3,6 @@
     "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*/
@@ -17,7 +16,6 @@
         },
     {
         "stack_name": "rsocket",
-        "function_name": "rsocket_stack_register",
         "libname": "libdmm_rsocket.so",
         "loadtype": "dynmic",
         "deploytype": "1",
index d4974e2..56f9033 100644 (file)
@@ -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
index 49b7ca9..46c9c85 100644 (file)
@@ -3,7 +3,6 @@
     "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*/
@@ -17,7 +16,6 @@
         },
     {
         "stack_name": "vpp_hoststack",
-        "function_name": "vpphs_stack_register",
         "libname": "../lib64/libdmm_vcl.so",
         "loadtype": "dynmic",
         "deploytype": "4",