aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-08-06 12:10:09 -0400
committerDave Barach <dave@barachs.net>2020-08-06 12:10:50 -0400
commit11fb09e38ffcbadc2629361377413f3ce12ec4da (patch)
tree65d2a0a16b6e1fce5bec0dba1368dca5db3bc9e3 /src/plugins
parent586462fabcc913a5a4fa9115d4b5caf33dfdb347 (diff)
misc: harmonize names
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ibad744788e200ce012ad88ff59c2c34920742454
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/crypto_native/aes_cbc.c16
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo_common.h2
-rw-r--r--src/plugins/lb/api.c4
-rw-r--r--src/plugins/lb/cli.c2
-rw-r--r--src/plugins/lb/lbhash.h2
-rw-r--r--src/plugins/lb/node.c5
-rw-r--r--src/plugins/nat/in2out.c10
-rw-r--r--src/plugins/nat/in2out_ed.c9
-rw-r--r--src/plugins/nsh/nsh.h4
-rw-r--r--src/plugins/nsh/nsh_node.c52
-rw-r--r--src/plugins/unittest/bier_test.c4
-rw-r--r--src/plugins/unittest/fib_test.c8
-rw-r--r--src/plugins/unittest/mfib_test.c8
-rw-r--r--src/plugins/unittest/segment_manager_test.c45
-rw-r--r--src/plugins/unittest/session_test.c136
15 files changed, 157 insertions, 150 deletions
diff --git a/src/plugins/crypto_native/aes_cbc.c b/src/plugins/crypto_native/aes_cbc.c
index 7589b4552d3..c8ec37d152d 100644
--- a/src/plugins/crypto_native/aes_cbc.c
+++ b/src/plugins/crypto_native/aes_cbc.c
@@ -237,9 +237,9 @@ aes_ops_enc_aes_cbc (vlib_main_t * vm, vnet_crypto_op_t * ops[],
crypto_native_per_thread_data_t *ptd =
vec_elt_at_index (cm->per_thread_data, vm->thread_index);
int rounds = AES_KEY_ROUNDS (ks);
- u8 dummy[8192];
+ u8 placeholder[8192];
u32 i, j, count, n_left = n_ops;
- u32xN dummy_mask = { };
+ u32xN placeholder_mask = { };
u32xN len = { };
vnet_crypto_key_index_t key_index[N];
u8 *src[N] = { };
@@ -262,10 +262,10 @@ more:
{
if (n_left == 0)
{
- /* no more work to enqueue, so we are enqueueing dummy buffer */
- src[i] = dst[i] = dummy;
- len[i] = sizeof (dummy);
- dummy_mask[i] = 0;
+ /* no more work to enqueue, so we are enqueueing placeholder buffer */
+ src[i] = dst[i] = placeholder;
+ len[i] = sizeof (placeholder);
+ placeholder_mask[i] = 0;
}
else
{
@@ -287,7 +287,7 @@ more:
src[i] = ops[0]->src;
dst[i] = ops[0]->dst;
len[i] = ops[0]->len;
- dummy_mask[i] = ~0;
+ placeholder_mask[i] = ~0;
if (key_index[i] != ops[0]->key_index)
{
aes_cbc_key_data_t *kd;
@@ -396,7 +396,7 @@ more:
if (n_left > 0)
goto more;
- if (!u32xN_is_all_zero (len & dummy_mask))
+ if (!u32xN_is_all_zero (len & placeholder_mask))
goto more;
return n_ops;
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.h b/src/plugins/hs_apps/sapi/vpp_echo_common.h
index 16dd4c39ebe..1c874c2a4c8 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo_common.h
+++ b/src/plugins/hs_apps/sapi/vpp_echo_common.h
@@ -324,7 +324,7 @@ typedef struct
u32 prealloc_fifo_pairs;
u64 rx_buf_size;
u64 tx_buf_size;
- data_source_t data_source; /* Use no/dummy/mirrored data */
+ data_source_t data_source; /* Use no/placeholder/mirrored data */
u8 send_stream_disconnects; /* actively send disconnect */
u8 output_json; /* Output stats as JSON */
volatile u8 wait_for_gdb; /* Wait for gdb to attach */
diff --git a/src/plugins/lb/api.c b/src/plugins/lb/api.c
index 0fed63f19f8..253cf5b5ba8 100644
--- a/src/plugins/lb/api.c
+++ b/src/plugins/lb/api.c
@@ -242,7 +242,7 @@ vl_api_lb_vip_dump_t_handler
/* construct vip list */
pool_foreach(vip, lbm->vips, {
- /* Hide dummy VIP */
+ /* Hide placeholder VIP */
if (vip != lbm->vips) {
msg_size = sizeof (*rmp);
rmp = vl_msg_api_alloc (msg_size);
@@ -281,7 +281,7 @@ static void send_lb_as_details
lb_as_t *as;
pool_foreach(as_index, vip->as_indexes, {
- /* Hide dummy As for specific VIP */
+ /* Hide placeholder As for specific VIP */
if (*as_index != 0) {
as = &lbm->ass[*as_index];
msg_size = sizeof (*rmp);
diff --git a/src/plugins/lb/cli.c b/src/plugins/lb/cli.c
index a12a63354cc..ecc5e66fd9e 100644
--- a/src/plugins/lb/cli.c
+++ b/src/plugins/lb/cli.c
@@ -386,7 +386,7 @@ lb_show_vips_command_fn (vlib_main_t * vm,
if (unformat(&line_input, "verbose"))
verbose = 1;
- /* Hide dummy VIP */
+ /* Hide placeholder VIP */
pool_foreach(vip, lbm->vips, {
if (vip != lbm->vips) {
vlib_cli_output(vm, "%U\n", verbose?format_lb_vip_detailed:format_lb_vip, vip);
diff --git a/src/plugins/lb/lbhash.h b/src/plugins/lb/lbhash.h
index 375227cfd06..f822d79ded8 100644
--- a/src/plugins/lb/lbhash.h
+++ b/src/plugins/lb/lbhash.h
@@ -20,7 +20,7 @@
* be 100% reliable (write can fail). It also needs to recycle
* old entries in a lazy way.
*
- * This hash table is the most dummy hash table you can do.
+ * This hash table is the most trivial hash table you can do.
* Fixed total size, fixed bucket size.
* Advantage is that it could be very efficient (maybe).
*
diff --git a/src/plugins/lb/node.c b/src/plugins/lb/node.c
index a2c35bd8e72..870201d18eb 100644
--- a/src/plugins/lb/node.c
+++ b/src/plugins/lb/node.c
@@ -185,7 +185,7 @@ lb_node_get_hash (lb_main_t *lbm, vlib_buffer_t *p, u8 is_input_v4,
if (per_port_vip)
{
- /* For per-port-vip case, ip lookup stores dummy index */
+ /* For per-port-vip case, ip lookup stores placeholder index */
key.vip_prefix_index = *vip_idx;
}
@@ -1067,7 +1067,7 @@ VLIB_REGISTER_NODE (lb4_gre6_node) =
.error_strings = lb_error_strings,
.n_next_nodes = LB_N_NEXT,
.next_nodes =
- { [LB_NEXT_DROP] = "error-drop" },
+ { [LB_NEXT_DROP] = "error-drop" },
};
VLIB_REGISTER_NODE (lb4_gre4_node) =
@@ -1278,4 +1278,3 @@ VLIB_REGISTER_NODE (lb_nat6_in2out_node) =
[LB_NAT6_IN2OUT_NEXT_LOOKUP] = "ip6-lookup",
},
};
-
diff --git a/src/plugins/nat/in2out.c b/src/plugins/nat/in2out.c
index 06a2fa1737a..9f5b7cc5709 100644
--- a/src/plugins/nat/in2out.c
+++ b/src/plugins/nat/in2out.c
@@ -136,13 +136,13 @@ snat_not_translate (snat_main_t * sm, vlib_node_runtime_t * node,
&value0))
{
/* or is static mappings */
- ip4_address_t dummy_addr;
- u16 dummy_port;
- u32 dummy_fib_index;
+ ip4_address_t placeholder_addr;
+ u16 placeholder_port;
+ u32 placeholder_fib_index;
if (!snat_static_mapping_match
(sm, ip0->dst_address, udp0->dst_port, sm->outside_fib_index,
- proto0, &dummy_addr, &dummy_port, &dummy_fib_index, 1, 0, 0, 0, 0,
- 0))
+ proto0, &placeholder_addr, &placeholder_port,
+ &placeholder_fib_index, 1, 0, 0, 0, 0, 0))
return 0;
}
else
diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c
index 4871e78ba52..7153a60353a 100644
--- a/src/plugins/nat/in2out_ed.c
+++ b/src/plugins/nat/in2out_ed.c
@@ -506,12 +506,13 @@ nat44_ed_not_translate (snat_main_t * sm, vlib_node_runtime_t * node,
if (clib_bihash_search_16_8 (&sm->out2in_ed, &kv, &value))
{
/* or is static mappings */
- ip4_address_t dummy_addr;
- u16 dummy_port;
- u32 dummy_fib_index;
+ ip4_address_t placeholder_addr;
+ u16 placeholder_port;
+ u32 placeholder_fib_index;
if (!snat_static_mapping_match
(sm, ip->dst_address, udp->dst_port, sm->outside_fib_index, proto,
- &dummy_addr, &dummy_port, &dummy_fib_index, 1, 0, 0, 0, 0, 0))
+ &placeholder_addr, &placeholder_port, &placeholder_fib_index, 1, 0,
+ 0, 0, 0, 0))
return 0;
}
else
diff --git a/src/plugins/nsh/nsh.h b/src/plugins/nsh/nsh.h
index 46dd879dce1..86a9a7e95c3 100644
--- a/src/plugins/nsh/nsh.h
+++ b/src/plugins/nsh/nsh.h
@@ -266,10 +266,10 @@ nsh_md2_register_option (u16 class,
u8 * trace (u8 * s,
nsh_tlv_header_t * opt));
-typedef struct _nsh_main_dummy
+typedef struct _nsh_main_placeholder
{
u8 output_feature_arc_index;
-} nsh_main_dummy_t;
+} nsh_main_placeholder_t;
int
nsh_add_del_map (nsh_add_del_map_args_t * a, u32 * map_indexp);
diff --git a/src/plugins/nsh/nsh_node.c b/src/plugins/nsh/nsh_node.c
index d65806871af..a467d2c34c2 100644
--- a/src/plugins/nsh/nsh_node.c
+++ b/src/plugins/nsh/nsh_node.c
@@ -235,7 +235,7 @@ nsh_input_map (vlib_main_t * vm,
uword *p0, *p1;
nsh_proxy_session_t *proxy0, *proxy1;
u32 sw_if_index0 = 0, sw_if_index1 = 0;
- ethernet_header_t dummy_eth0, dummy_eth1;
+ ethernet_header_t placeholder_eth0, placeholder_eth1;
/* Prefetch next iteration. */
{
@@ -290,17 +290,19 @@ nsh_input_map (vlib_main_t * vm,
}
else if (node_type == NSH_AWARE_VNF_PROXY_TYPE)
{
- /* Push dummy Eth header */
- char dummy_dst_address[6] =
+ /* Push placeholder Eth header */
+ char placeholder_dst_address[6] =
{ 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
- char dummy_src_address[6] =
+ char placeholder_src_address[6] =
{ 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc };
- clib_memcpy_fast (dummy_eth0.dst_address, dummy_dst_address, 6);
- clib_memcpy_fast (dummy_eth0.src_address, dummy_src_address, 6);
- dummy_eth0.type = 0x0800;
+ clib_memcpy_fast (placeholder_eth0.dst_address,
+ placeholder_dst_address, 6);
+ clib_memcpy_fast (placeholder_eth0.src_address,
+ placeholder_src_address, 6);
+ placeholder_eth0.type = 0x0800;
vlib_buffer_advance (b0, -(word) sizeof (ethernet_header_t));
hdr0 = vlib_buffer_get_current (b0);
- clib_memcpy_fast (hdr0, &dummy_eth0,
+ clib_memcpy_fast (hdr0, &placeholder_eth0,
(word) sizeof (ethernet_header_t));
sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
@@ -459,17 +461,19 @@ nsh_input_map (vlib_main_t * vm,
}
else if (node_type == NSH_AWARE_VNF_PROXY_TYPE)
{
- /* Push dummy Eth header */
- char dummy_dst_address[6] =
+ /* Push placeholder Eth header */
+ char placeholder_dst_address[6] =
{ 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
- char dummy_src_address[6] =
+ char placeholder_src_address[6] =
{ 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc };
- clib_memcpy_fast (dummy_eth1.dst_address, dummy_dst_address, 6);
- clib_memcpy_fast (dummy_eth1.src_address, dummy_src_address, 6);
- dummy_eth1.type = 0x0800;
+ clib_memcpy_fast (placeholder_eth1.dst_address,
+ placeholder_dst_address, 6);
+ clib_memcpy_fast (placeholder_eth1.src_address,
+ placeholder_src_address, 6);
+ placeholder_eth1.type = 0x0800;
vlib_buffer_advance (b1, -(word) sizeof (ethernet_header_t));
hdr1 = vlib_buffer_get_current (b1);
- clib_memcpy_fast (hdr1, &dummy_eth1,
+ clib_memcpy_fast (hdr1, &placeholder_eth1,
(word) sizeof (ethernet_header_t));
sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_TX];
@@ -631,7 +635,7 @@ nsh_input_map (vlib_main_t * vm,
uword *p0;
nsh_proxy_session_t *proxy0 = 0;
u32 sw_if_index0 = 0;
- ethernet_header_t dummy_eth0;
+ ethernet_header_t placeholder_eth0;
bi0 = from[0];
to_next[0] = bi0;
@@ -665,17 +669,19 @@ nsh_input_map (vlib_main_t * vm,
}
else if (node_type == NSH_AWARE_VNF_PROXY_TYPE)
{
- /* Push dummy Eth header */
- char dummy_dst_address[6] =
+ /* Push placeholder Eth header */
+ char placeholder_dst_address[6] =
{ 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
- char dummy_src_address[6] =
+ char placeholder_src_address[6] =
{ 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc };
- clib_memcpy_fast (dummy_eth0.dst_address, dummy_dst_address, 6);
- clib_memcpy_fast (dummy_eth0.src_address, dummy_src_address, 6);
- dummy_eth0.type = 0x0800;
+ clib_memcpy_fast (placeholder_eth0.dst_address,
+ placeholder_dst_address, 6);
+ clib_memcpy_fast (placeholder_eth0.src_address,
+ placeholder_src_address, 6);
+ placeholder_eth0.type = 0x0800;
vlib_buffer_advance (b0, -(word) sizeof (ethernet_header_t));
hdr0 = vlib_buffer_get_current (b0);
- clib_memcpy_fast (hdr0, &dummy_eth0,
+ clib_memcpy_fast (hdr0, &placeholder_eth0,
(word) sizeof (ethernet_header_t));
sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
diff --git a/src/plugins/unittest/bier_test.c b/src/plugins/unittest/bier_test.c
index 8a609e5f20d..d77e3125372 100644
--- a/src/plugins/unittest/bier_test.c
+++ b/src/plugins/unittest/bier_test.c
@@ -82,7 +82,7 @@ static u8 * format_test_interface_name (u8 * s, va_list * args)
return format (s, "test-eth%d", dev_instance);
}
-static uword dummy_interface_tx (vlib_main_t * vm,
+static uword placeholder_interface_tx (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
@@ -93,7 +93,7 @@ static uword dummy_interface_tx (vlib_main_t * vm,
VNET_DEVICE_CLASS (test_interface_device_class,static) = {
.name = "Test interface",
.format_device_name = format_test_interface_name,
- .tx_function = dummy_interface_tx,
+ .tx_function = placeholder_interface_tx,
};
static u8 *hw_address;
diff --git a/src/plugins/unittest/fib_test.c b/src/plugins/unittest/fib_test.c
index d86ccb173dc..3244b8a3001 100644
--- a/src/plugins/unittest/fib_test.c
+++ b/src/plugins/unittest/fib_test.c
@@ -93,7 +93,7 @@ static u8 * format_test_interface_name (u8 * s, va_list * args)
return format (s, "test-eth%d", dev_instance);
}
-static uword dummy_interface_tx (vlib_main_t * vm,
+static uword placeholder_interface_tx (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
@@ -115,7 +115,7 @@ test_interface_admin_up_down (vnet_main_t * vnm,
VNET_DEVICE_CLASS (test_interface_device_class,static) = {
.name = "Test interface",
.format_device_name = format_test_interface_name,
- .tx_function = dummy_interface_tx,
+ .tx_function = placeholder_interface_tx,
.admin_up_down_function = test_interface_admin_up_down,
};
@@ -455,7 +455,7 @@ fib_test_validate_lb_v (const load_balance_t *lb,
"bucket %d stacks on %U",
bucket,
format_dpo_type, dpo->dpoi_type);
-
+
mld = mpls_label_dpo_get(dpo->dpoi_index);
hdr = clib_net_to_host_u32(mld->mld_hdr[0].label_exp_s_ttl);
@@ -6688,7 +6688,7 @@ fib_test_label (void)
l1600,
FIB_ROUTE_PATH_FLAG_NONE);
- FIB_TEST(!fib_test_validate_entry(fei,
+ FIB_TEST(!fib_test_validate_entry(fei,
FIB_FORW_CHAIN_TYPE_UNICAST_IP4,
1,
&l1600_eos_o_1_1_1_1),
diff --git a/src/plugins/unittest/mfib_test.c b/src/plugins/unittest/mfib_test.c
index 764e1837653..c456d59d7db 100644
--- a/src/plugins/unittest/mfib_test.c
+++ b/src/plugins/unittest/mfib_test.c
@@ -75,7 +75,7 @@ static u8 * format_test_interface_name (u8 * s, va_list * args)
return format (s, "test-eth%d", dev_instance);
}
-static uword dummy_interface_tx (vlib_main_t * vm,
+static uword placeholder_interface_tx (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
@@ -97,7 +97,7 @@ test_interface_admin_up_down (vnet_main_t * vnm,
VNET_DEVICE_CLASS (test_interface_device_class,static) = {
.name = "Test interface",
.format_device_name = format_test_interface_name,
- .tx_function = dummy_interface_tx,
+ .tx_function = placeholder_interface_tx,
.admin_up_down_function = test_interface_admin_up_down,
};
@@ -804,7 +804,7 @@ mfib_test_i (fib_protocol_t PROTO,
MFIB_TEST_NS(!mfib_test_entry_no_itf(mfei, tm->hw[3]->sw_if_index));
/*
- * remove
+ * remove
*/
/* mfib_table_entry_path_remove(fib_index, */
/* pfx_s_g, */
@@ -824,7 +824,7 @@ mfib_test_i (fib_protocol_t PROTO,
/* MFIB_TEST_NS(!mfib_test_entry_no_itf(mfei, tm->hw[3]->sw_if_index)); */
/*
- * remove the last path and the accpeting only interface,
+ * remove the last path and the accpeting only interface,
* the entry still has flags so it remains
*/
vec_reset_length(two_paths);
diff --git a/src/plugins/unittest/segment_manager_test.c b/src/plugins/unittest/segment_manager_test.c
index 8ff6272619d..c3e7e26e246 100644
--- a/src/plugins/unittest/segment_manager_test.c
+++ b/src/plugins/unittest/segment_manager_test.c
@@ -30,64 +30,64 @@
#define SEGMENT_MANAGER_GET_INDEX_FROM_HANDLE(x) (x >> 32)
-/* dummy callback functions */
+/* placeholder callback functions */
static void
-dummy_session_reset_callback (session_t * s)
+placeholder_session_reset_callback (session_t * s)
{
clib_warning ("called...");
}
static int
-dummy_session_connected_callback (u32 app_index, u32 api_context,
- session_t * s, session_error_t err)
+placeholder_session_connected_callback (u32 app_index, u32 api_context,
+ session_t * s, session_error_t err)
{
clib_warning ("called...");
return 0;
}
static int
-dummy_add_segment_callback (u32 client_index, u64 segment_handle)
+placeholder_add_segment_callback (u32 client_index, u64 segment_handle)
{
clib_warning ("called...");
return 0;
}
static int
-dummy_del_segment_callback (u32 client_index, u64 segment_handle)
+placeholder_del_segment_callback (u32 client_index, u64 segment_handle)
{
clib_warning ("called...");
return 0;
}
static void
-dummy_session_disconnect_callback (session_t * s)
+placeholder_session_disconnect_callback (session_t * s)
{
clib_warning ("called...");
}
static int
-dummy_session_accept_callback (session_t * s)
+placeholder_session_accept_callback (session_t * s)
{
clib_warning ("called...");
return 0;
}
static int
-dummy_server_rx_callback (session_t * s)
+placeholder_server_rx_callback (session_t * s)
{
clib_warning ("called...");
return -1;
}
/* *INDENT-OFF* */
-static session_cb_vft_t dummy_session_cbs = {
- .session_reset_callback = dummy_session_reset_callback,
- .session_connected_callback = dummy_session_connected_callback,
- .session_accept_callback = dummy_session_accept_callback,
- .session_disconnect_callback = dummy_session_disconnect_callback,
- .builtin_app_rx_callback = dummy_server_rx_callback,
- .add_segment_callback = dummy_add_segment_callback,
- .del_segment_callback = dummy_del_segment_callback,
+static session_cb_vft_t placeholder_session_cbs = {
+ .session_reset_callback = placeholder_session_reset_callback,
+ .session_connected_callback = placeholder_session_connected_callback,
+ .session_accept_callback = placeholder_session_accept_callback,
+ .session_disconnect_callback = placeholder_session_disconnect_callback,
+ .builtin_app_rx_callback = placeholder_server_rx_callback,
+ .add_segment_callback = placeholder_add_segment_callback,
+ .del_segment_callback = placeholder_del_segment_callback,
};
/* *INDENT-ON* */
@@ -128,7 +128,7 @@ segment_manager_test_pressure_1 (vlib_main_t * vm, unformat_input_t * input)
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "segment_manager_test_pressure_1"),
};
@@ -292,7 +292,7 @@ segment_manager_test_pressure_2 (vlib_main_t * vm, unformat_input_t * input)
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "segment_manager_test_pressure_1"),
};
@@ -422,7 +422,7 @@ segment_manager_test_fifo_balanced_alloc (vlib_main_t * vm,
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "segment_manager_test_pressure_1"),
};
@@ -542,7 +542,7 @@ segment_manager_test_fifo_ops (vlib_main_t * vm, unformat_input_t * input)
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "segment_manager_test_pressure_1"),
};
@@ -714,7 +714,7 @@ segment_manager_test_prealloc_hdrs (vlib_main_t * vm,
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "segment_manager_prealloc_hdrs"),
};
@@ -810,4 +810,3 @@ VLIB_CLI_COMMAND (tcp_test_command, static) =
* eval: (c-set-style "gnu")
* End:
*/
-
diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c
index 72292613abd..37b4dac244d 100644
--- a/src/plugins/unittest/session_test.c
+++ b/src/plugins/unittest/session_test.c
@@ -45,7 +45,7 @@
fformat(stderr, _comment "\n", ##_args); \
void
-dummy_session_reset_callback (session_t * s)
+placeholder_session_reset_callback (session_t * s)
{
clib_warning ("called...");
}
@@ -53,8 +53,8 @@ dummy_session_reset_callback (session_t * s)
volatile u32 connected_session_index = ~0;
volatile u32 connected_session_thread = ~0;
int
-dummy_session_connected_callback (u32 app_index, u32 api_context,
- session_t * s, session_error_t err)
+placeholder_session_connected_callback (u32 app_index, u32 api_context,
+ session_t * s, session_error_t err)
{
if (s)
{
@@ -64,36 +64,36 @@ dummy_session_connected_callback (u32 app_index, u32 api_context,
return 0;
}
-static u32 dummy_segment_count;
+static u32 placeholder_segment_count;
int
-dummy_add_segment_callback (u32 client_index, u64 segment_handle)
+placeholder_add_segment_callback (u32 client_index, u64 segment_handle)
{
- dummy_segment_count = 1;
+ placeholder_segment_count = 1;
return 0;
}
int
-dummy_del_segment_callback (u32 client_index, u64 segment_handle)
+placeholder_del_segment_callback (u32 client_index, u64 segment_handle)
{
- dummy_segment_count = 0;
+ placeholder_segment_count = 0;
return 0;
}
void
-dummy_session_disconnect_callback (session_t * s)
+placeholder_session_disconnect_callback (session_t * s)
{
clib_warning ("called...");
}
-static u32 dummy_accept;
+static u32 placeholder_accept;
volatile u32 accepted_session_index;
volatile u32 accepted_session_thread;
int
-dummy_session_accept_callback (session_t * s)
+placeholder_session_accept_callback (session_t * s)
{
- dummy_accept = 1;
+ placeholder_accept = 1;
accepted_session_index = s->session_index;
accepted_session_thread = s->thread_index;
s->session_state = SESSION_STATE_READY;
@@ -101,21 +101,21 @@ dummy_session_accept_callback (session_t * s)
}
int
-dummy_server_rx_callback (session_t * s)
+placeholder_server_rx_callback (session_t * s)
{
clib_warning ("called...");
return -1;
}
/* *INDENT-OFF* */
-static session_cb_vft_t dummy_session_cbs = {
- .session_reset_callback = dummy_session_reset_callback,
- .session_connected_callback = dummy_session_connected_callback,
- .session_accept_callback = dummy_session_accept_callback,
- .session_disconnect_callback = dummy_session_disconnect_callback,
- .builtin_app_rx_callback = dummy_server_rx_callback,
- .add_segment_callback = dummy_add_segment_callback,
- .del_segment_callback = dummy_del_segment_callback,
+static session_cb_vft_t placeholder_session_cbs = {
+ .session_reset_callback = placeholder_session_reset_callback,
+ .session_connected_callback = placeholder_session_connected_callback,
+ .session_accept_callback = placeholder_session_accept_callback,
+ .session_disconnect_callback = placeholder_session_disconnect_callback,
+ .builtin_app_rx_callback = placeholder_server_rx_callback,
+ .add_segment_callback = placeholder_add_segment_callback,
+ .del_segment_callback = placeholder_del_segment_callback,
};
/* *INDENT-ON* */
@@ -178,7 +178,7 @@ session_test_basic (vlib_main_t * vm, unformat_input_t * input)
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "session_test"),
};
@@ -278,8 +278,8 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
{
session_endpoint_cfg_t client_sep = SESSION_ENDPOINT_CFG_NULL;
u32 server_index, client_index, sw_if_index[2], tries = 0;
- u64 options[APP_OPTIONS_N_OPTIONS], dummy_secret = 1234;
- u16 dummy_server_port = 1234, dummy_client_port = 5678;
+ u64 options[APP_OPTIONS_N_OPTIONS], placeholder_secret = 1234;
+ u16 placeholder_server_port = 1234, placeholder_client_port = 5678;
session_endpoint_cfg_t server_sep = SESSION_ENDPOINT_CFG_NULL;
ip4_address_t intf_addr[3];
transport_connection_t *tc;
@@ -307,7 +307,7 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
appns_id = format (0, "appns1");
vnet_app_namespace_add_del_args_t ns_args = {
.ns_id = appns_id,
- .secret = dummy_secret,
+ .secret = placeholder_secret,
.sw_if_index = sw_if_index[1],
.ip4_fib_id = 0,
.is_add = 1
@@ -326,7 +326,7 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "session_test_client"),
};
@@ -337,7 +337,7 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
attach_args.name = format (0, "session_test_server");
attach_args.namespace_id = appns_id;
- attach_args.options[APP_OPTIONS_NAMESPACE_SECRET] = dummy_secret;
+ attach_args.options[APP_OPTIONS_NAMESPACE_SECRET] = placeholder_secret;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server app attached: %U", format_clib_error,
error);
@@ -345,7 +345,7 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
server_index = attach_args.app_index;
server_sep.is_ip4 = 1;
- server_sep.port = dummy_server_port;
+ server_sep.port = placeholder_server_port;
vnet_listen_args_t bind_args = {
.sep_ext = server_sep,
.app_index = server_index,
@@ -358,10 +358,10 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
*/
client_sep.is_ip4 = 1;
client_sep.ip.ip4.as_u32 = clib_host_to_net_u32 (0x02020202);
- client_sep.port = dummy_server_port;
+ client_sep.port = placeholder_server_port;
client_sep.peer.is_ip4 = 1;
client_sep.peer.ip.ip4.as_u32 = clib_host_to_net_u32 (0x01010101);
- client_sep.peer.port = dummy_client_port;
+ client_sep.peer.port = placeholder_client_port;
client_sep.transport_proto = TRANSPORT_PROTO_TCP;
vnet_connect_args_t connect_args = {
@@ -387,7 +387,8 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
SESSION_TEST ((tc != 0), "transport should exist");
SESSION_TEST ((memcmp (&tc->lcl_ip, &client_sep.peer.ip,
sizeof (tc->lcl_ip)) == 0), "ips should be equal");
- SESSION_TEST ((tc->lcl_port == dummy_client_port), "ports should be equal");
+ SESSION_TEST ((tc->lcl_port == placeholder_client_port),
+ "ports should be equal");
/* These sessions, because of the way they're established are pinned to
* main thread, even when we have workers and we avoid polling main thread,
@@ -421,11 +422,11 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input)
static int
session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
{
- u64 options[APP_OPTIONS_N_OPTIONS], dummy_secret = 1234;
+ u64 options[APP_OPTIONS_N_OPTIONS], placeholder_secret = 1234;
u32 server_index, server_st_index, server_local_st_index;
- u32 dummy_port = 1234, client_index, server_wrk_index;
- u32 dummy_api_context = 4321, dummy_client_api_index = ~0;
- u32 dummy_server_api_index = ~0, sw_if_index = 0;
+ u32 placeholder_port = 1234, client_index, server_wrk_index;
+ u32 placeholder_api_context = 4321, placeholder_client_api_index = ~0;
+ u32 placeholder_server_api_index = ~0, sw_if_index = 0;
session_endpoint_t server_sep = SESSION_ENDPOINT_NULL;
session_endpoint_t client_sep = SESSION_ENDPOINT_NULL;
session_endpoint_t intf_sep = SESSION_ENDPOINT_NULL;
@@ -441,9 +442,9 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
client_name = format (0, "session_test_client");
server_sep.is_ip4 = 1;
- server_sep.port = dummy_port;
+ server_sep.port = placeholder_port;
client_sep.is_ip4 = 1;
- client_sep.port = dummy_port;
+ client_sep.port = placeholder_port;
clib_memset (options, 0, sizeof (options));
options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
@@ -451,7 +452,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = server_name,
};
@@ -482,7 +483,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
intf_sep.ip.ip4 = intf_addr;
intf_sep.is_ip4 = 1;
- intf_sep.port = dummy_port;
+ intf_sep.port = placeholder_port;
/*
* Insert namespace and lookup
@@ -490,7 +491,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
vnet_app_namespace_add_del_args_t ns_args = {
.ns_id = ns_id,
- .secret = dummy_secret,
+ .secret = placeholder_secret,
.sw_if_index = APP_NAMESPACE_INVALID_INDEX,
.is_add = 1
};
@@ -499,8 +500,8 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
app_ns = app_namespace_get_from_id (ns_id);
SESSION_TEST ((app_ns != 0), "should find ns %v status", ns_id);
- SESSION_TEST ((app_ns->ns_secret == dummy_secret), "secret should be %d",
- dummy_secret);
+ SESSION_TEST ((app_ns->ns_secret == placeholder_secret),
+ "secret should be %d", placeholder_secret);
SESSION_TEST ((app_ns->sw_if_index == APP_NAMESPACE_INVALID_INDEX),
"sw_if_index should be invalid");
@@ -510,9 +511,9 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
- options[APP_OPTIONS_NAMESPACE_SECRET] = dummy_secret - 1;
+ options[APP_OPTIONS_NAMESPACE_SECRET] = placeholder_secret - 1;
attach_args.namespace_id = ns_id;
- attach_args.api_client_index = dummy_server_api_index;
+ attach_args.api_client_index = placeholder_server_api_index;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error != 0), "app attachment should fail");
@@ -526,7 +527,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
options[APP_OPTIONS_FLAGS] &= ~APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
options[APP_OPTIONS_NAMESPACE_SECRET] = 0;
attach_args.namespace_id = 0;
- attach_args.api_client_index = dummy_server_api_index;
+ attach_args.api_client_index = placeholder_server_api_index;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server attachment should work");
server_index = attach_args.app_index;
@@ -564,9 +565,9 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
*/
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
- options[APP_OPTIONS_NAMESPACE_SECRET] = dummy_secret;
+ options[APP_OPTIONS_NAMESPACE_SECRET] = placeholder_secret;
attach_args.namespace_id = ns_id;
- attach_args.api_client_index = dummy_server_api_index;
+ attach_args.api_client_index = placeholder_server_api_index;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server attachment should work");
server_index = attach_args.app_index;
@@ -593,30 +594,31 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
*/
options[APP_OPTIONS_FLAGS] &= ~APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
attach_args.name = client_name;
- attach_args.api_client_index = dummy_client_api_index;
+ attach_args.api_client_index = placeholder_client_api_index;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "client attachment should work");
client_index = attach_args.app_index;
- connect_args.api_context = dummy_api_context;
+ connect_args.api_context = placeholder_api_context;
connect_args.app_index = client_index;
error = vnet_connect (&connect_args);
SESSION_TEST ((error != 0), "client connect should return error code");
SESSION_TEST ((error == SESSION_E_INVALID_RMT_IP),
"error code should be invalid value (zero ip)");
- SESSION_TEST ((dummy_segment_count == 0),
+ SESSION_TEST ((placeholder_segment_count == 0),
"shouldn't have received request to map new segment");
connect_args.sep.ip.ip4.as_u8[0] = 127;
error = vnet_connect (&connect_args);
SESSION_TEST ((error == 0), "client connect should not return error code");
- SESSION_TEST ((dummy_segment_count == 1),
+ SESSION_TEST ((placeholder_segment_count == 1),
"should've received request to map new segment");
- SESSION_TEST ((dummy_accept == 1), "should've received accept request");
+ SESSION_TEST ((placeholder_accept == 1),
+ "should've received accept request");
detach_args.app_index = client_index;
vnet_application_detach (&detach_args);
options[APP_OPTIONS_FLAGS] &= ~APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
- attach_args.api_client_index = dummy_client_api_index;
+ attach_args.api_client_index = placeholder_client_api_index;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "client attachment should work");
error = vnet_connect (&connect_args);
@@ -645,7 +647,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
options[APP_OPTIONS_FLAGS] &= ~APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
- attach_args.api_client_index = dummy_server_api_index;
+ attach_args.api_client_index = placeholder_server_api_index;
attach_args.name = server_name;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "app attachment should work");
@@ -680,7 +682,7 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
options[APP_OPTIONS_FLAGS] &= ~APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
attach_args.namespace_id = 0;
- attach_args.api_client_index = dummy_client_api_index;
+ attach_args.api_client_index = placeholder_client_api_index;
attach_args.name = client_name;
vnet_application_attach (&attach_args);
error = vnet_connect (&connect_args);
@@ -713,9 +715,9 @@ session_test_namespace (vlib_main_t * vm, unformat_input_t * input)
*/
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
- options[APP_OPTIONS_NAMESPACE_SECRET] = dummy_secret;
+ options[APP_OPTIONS_NAMESPACE_SECRET] = placeholder_secret;
attach_args.namespace_id = ns_id;
- attach_args.api_client_index = dummy_server_api_index;
+ attach_args.api_client_index = placeholder_server_api_index;
attach_args.name = server_name;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server attachment should work");
@@ -1025,9 +1027,9 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
u64 options[APP_OPTIONS_N_OPTIONS];
u16 lcl_port = 1234, rmt_port = 4321;
u32 server_index, server_index2;
- u32 dummy_server_api_index = ~0;
+ u32 placeholder_server_api_index = ~0;
transport_connection_t *tc;
- u32 dummy_port = 1111;
+ u32 placeholder_port = 1111;
u8 is_filtered = 0, *ns_id = format (0, "appns1");
session_t *listener, *s;
app_namespace_t *default_ns = app_namespace_get_default ();
@@ -1051,14 +1053,14 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
}
server_sep.is_ip4 = 1;
- server_sep.port = dummy_port;
+ server_sep.port = placeholder_port;
clib_memset (options, 0, sizeof (options));
vnet_app_attach_args_t attach_args = {
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "session_test"),
};
@@ -1074,7 +1076,7 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
attach_args.namespace_id = 0;
- attach_args.api_client_index = dummy_server_api_index;
+ attach_args.api_client_index = placeholder_server_api_index;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server attached");
server_index = attach_args.app_index;
@@ -1498,7 +1500,7 @@ session_test_rules (vlib_main_t * vm, unformat_input_t * input)
app_ns = app_namespace_get_from_id (ns_id);
attach_args.namespace_id = ns_id;
- attach_args.api_client_index = dummy_server_api_index;
+ attach_args.api_client_index = placeholder_server_api_index;
vec_free (attach_args.name);
attach_args.name = format (0, "server_test2");
error = vnet_application_attach (&attach_args);
@@ -1588,7 +1590,7 @@ session_test_proxy (vlib_main_t * vm, unformat_input_t * input)
char *show_local_listeners = "sh app ns table default";
unformat_input_t tmp_input;
u32 server_index, app_index;
- u32 dummy_server_api_index = ~0, sw_if_index = 0;
+ u32 placeholder_server_api_index = ~0, sw_if_index = 0;
u8 is_filtered = 0;
session_t *s;
transport_connection_t *tc;
@@ -1645,11 +1647,11 @@ session_test_proxy (vlib_main_t * vm, unformat_input_t * input)
.api_client_index = ~0,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "session_test"),
};
- attach_args.api_client_index = dummy_server_api_index;
+ attach_args.api_client_index = placeholder_server_api_index;
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server attachment should work");
server_index = attach_args.app_index;
@@ -1802,7 +1804,7 @@ session_test_mq_speed (vlib_main_t * vm, unformat_input_t * input)
.api_client_index = api_index,
.options = options,
.namespace_id = 0,
- .session_cb_vft = &dummy_session_cbs,
+ .session_cb_vft = &placeholder_session_cbs,
.name = format (0, "session_mq_test"),
};
error = vnet_application_attach (&attach_args);