"module_list": [
{
"stack_name": "kernel",
- "function_name": "kernel_stack_register",
"libname": "./",
"loadtype": "static",
"deploytype": "1",
},
{
"stack_name": "lwip",
- "function_name": "nstack_stack_register",
"libname": "liblwip_dpdk.so",
"loadtype": "dynmic",
"deploytype": "3",
},
{
"stack_name": "vpp_hoststack",
- "function_name": "vpphs_stack_register",
"libname": "./libdmm_vcl.so",
"loadtype": "dynmic",
"deploytype": "4",
"module_list": [
{
"stack_name": "kernel",
- "function_name": "kernel_stack_register",
"libname": "./",
"loadtype": "static",
"deploytype": "1",
},
{
"stack_name": "lwip",
- "function_name": "nstack_stack_register",
"libname": "liblwip_dpdk.so",
"loadtype": "dynmic",
"deploytype": "3",
},
{
"stack_name": "vpp_hoststack",
- "function_name": "vpphs_stack_register",
"libname": "./libdmm_vcl.so",
"loadtype": "dynmic",
"deploytype": "4",
"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*/
*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",
int ret = NSTACK_RETURN_FAIL;
int index = 0;
int icnt = 0;
+ int ret_val;
if (!obj)
{
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);
#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
"module_list": [
{
"stack_name": "kernel",
- "function_name": "kernel_stack_register",
"libname": "./",
"loadtype": "static",
"deploytype": "1",
},
{
"stack_name": "lwip",
- "function_name": "nstack_stack_register",
"libname": "liblwip_dpdk.so",
"loadtype": "dynmic",
"deploytype": "3",
*
*****************************************************************************/
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)
{
"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*/
},
{
"stack_name": "rsocket",
- "function_name": "rsocket_stack_register",
"libname": "libdmm_rsocket.so",
"loadtype": "dynmic",
"deploytype": "1",
}
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
"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*/
},
{
"stack_name": "vpp_hoststack",
- "function_name": "vpphs_stack_register",
"libname": "../lib64/libdmm_vcl.so",
"loadtype": "dynmic",
"deploytype": "4",