From f35c043fd045b77fa81a76e477fbe10f32ec58d3 Mon Sep 17 00:00:00 2001 From: sharath Date: Mon, 19 Nov 2018 20:51:50 +0530 Subject: Fix: removing unwanted json elements Change-Id: Id77dd8100bf1a8474b2a6d4f08be1adbc313064e Signed-off-by: sharath --- demo/nginx_proxy/demo-1/module_config.json | 12 ---------- demo/nginx_proxy/demo-2/module_config.json | 12 ---------- release/configure/module_config.json | 8 ------- src/nSocket/nstack/nstack_info_parse.c | 28 ++++++++++++++++++---- stacks/lwip_stack/app_conf/module_config.json | 8 ------- .../lwip_stack/lwip_src/ip_module/container_ip.c | 2 +- stacks/lwip_stack/release/configure/ip_data.json | 25 +------------------ .../release/configure/network_data_tonStack.json | 22 +++-------------- stacks/lwip_stack/vagrant/start_nstackMain.sh | 12 ---------- stacks/rsocket/config/module_config.json | 8 ------- stacks/vpp/configure/module_config.json | 8 ------- 11 files changed, 29 insertions(+), 116 deletions(-) diff --git a/demo/nginx_proxy/demo-1/module_config.json b/demo/nginx_proxy/demo-1/module_config.json index 24f5cf8..5f9424f 100644 --- a/demo/nginx_proxy/demo-1/module_config.json +++ b/demo/nginx_proxy/demo-1/module_config.json @@ -4,31 +4,19 @@ { "stack_name": "kernel", "libname": "./", - "loadtype": "static", "deploytype": "1", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "0", }, { "stack_name": "lwip", "libname": "liblwip_dpdk.so", - "loadtype": "dynmic", "deploytype": "3", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "1", }, { "stack_name": "vpp_hoststack", "libname": "./libdmm_vcl.so", - "loadtype": "dynmic", "deploytype": "4", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "2", }, ] diff --git a/demo/nginx_proxy/demo-2/module_config.json b/demo/nginx_proxy/demo-2/module_config.json index 24f5cf8..5f9424f 100644 --- a/demo/nginx_proxy/demo-2/module_config.json +++ b/demo/nginx_proxy/demo-2/module_config.json @@ -4,31 +4,19 @@ { "stack_name": "kernel", "libname": "./", - "loadtype": "static", "deploytype": "1", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "0", }, { "stack_name": "lwip", "libname": "liblwip_dpdk.so", - "loadtype": "dynmic", "deploytype": "3", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "1", }, { "stack_name": "vpp_hoststack", "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 aebbf39..e8e9001 100644 --- a/release/configure/module_config.json +++ b/release/configure/module_config.json @@ -5,13 +5,9 @@ "stack_name": "kernel", /*stack 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*/ }, /************************** @@ -19,11 +15,7 @@ { "stack_name": "stackx", "libname": "libstackx.so", - "loadtype": "dynmic", "deploytype": "3", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "1", }, ***************************/ diff --git a/src/nSocket/nstack/nstack_info_parse.c b/src/nSocket/nstack/nstack_info_parse.c index 84538cc..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 ); @@ -161,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/stacks/lwip_stack/app_conf/module_config.json b/stacks/lwip_stack/app_conf/module_config.json index 3531fb1..c9c872b 100644 --- a/stacks/lwip_stack/app_conf/module_config.json +++ b/stacks/lwip_stack/app_conf/module_config.json @@ -4,21 +4,13 @@ { "stack_name": "kernel", "libname": "./", - "loadtype": "static", "deploytype": "1", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "0", }, { "stack_name": "lwip", "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/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 2ca6b6f..736de24 100644 --- a/stacks/rsocket/config/module_config.json +++ b/stacks/rsocket/config/module_config.json @@ -5,23 +5,15 @@ "stack_name": "kernel", /*stack 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", "libname": "libdmm_rsocket.so", - "loadtype": "dynmic", "deploytype": "1", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "1", }, ] diff --git a/stacks/vpp/configure/module_config.json b/stacks/vpp/configure/module_config.json index 46c9c85..fb73574 100644 --- a/stacks/vpp/configure/module_config.json +++ b/stacks/vpp/configure/module_config.json @@ -5,23 +5,15 @@ "stack_name": "kernel", /*stack 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", "libname": "../lib64/libdmm_vcl.so", - "loadtype": "dynmic", "deploytype": "4", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", "stackid": "1", }, ] -- cgit 1.2.3-korg