Compare commits
15 Commits
v24.02-rc2
...
v18.01-rc2
Author | SHA1 | Date | |
---|---|---|---|
|
bbdfeaebf2 | ||
|
9a5e61d775 | ||
|
fd66de0f31 | ||
|
d01f4e76bd | ||
|
c287cd550b | ||
|
f453a10cd4 | ||
|
2b97ac55ed | ||
|
12bf52bae2 | ||
|
eeafbef61d | ||
|
43ad007a0c | ||
|
37aa1ffae6 | ||
|
848b47c70e | ||
|
72247c8032 | ||
|
1f720c3b19 | ||
|
8c2bacde4f |
@ -2,3 +2,4 @@
|
||||
host=gerrit.fd.io
|
||||
port=29418
|
||||
project=vpp
|
||||
defaultbranch=stable/1801
|
||||
|
@ -48,10 +48,13 @@ endif
|
||||
|
||||
vpp_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
|
||||
-fstack-protector-all -fPIC -Werror
|
||||
vpp_debug_TAG_CXXFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
|
||||
-fstack-protector-all -fPIC -Werror
|
||||
vpp_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
|
||||
-fstack-protector-all -fPIC -Werror
|
||||
|
||||
vpp_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
|
||||
vpp_TAG_CXXFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
|
||||
vpp_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
|
||||
|
||||
vpp_clang_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
|
||||
|
@ -245,6 +245,8 @@ tag_var_with_added_space_fn = $(if $($(TAG)_TAG_$(1)),$($(TAG)_TAG_$(1)) )
|
||||
# TAG=debug for debugging
|
||||
debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||
-fstack-protector-all -fPIC
|
||||
debug_TAG_CXXFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||
-fstack-protector-all -fPIC
|
||||
debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||
-fstack-protector-all -fPIC
|
||||
|
||||
@ -537,6 +539,8 @@ configure_ldflags_fn = \
|
||||
CONFIGURE_ENV = \
|
||||
$(if $(call configure_var_fn,CPPFLAGS), \
|
||||
CPPFLAGS="$(CPPFLAGS) $(call configure_var_fn,CPPFLAGS)") \
|
||||
$(if $(call configure_var_fn,CXXFLAGS), \
|
||||
CXXFLAGS="$(CXXFLAGS) $(call configure_var_fn,CXXFLAGS)") \
|
||||
$(if $(call configure_var_fn,CFLAGS), \
|
||||
CFLAGS="$(CFLAGS) $(call configure_var_fn,CFLAGS)") \
|
||||
$(if $(call configure_var_fn,CCASFLAGS), \
|
||||
|
@ -294,25 +294,6 @@ gtpu_decap_next_is_valid (gtpu_main_t * gtm, u32 is_ip6, u32 decap_next_index)
|
||||
return decap_next_index < r->n_next_nodes;
|
||||
}
|
||||
|
||||
static void
|
||||
hash_set_key_copy (uword ** h, void *key, uword v)
|
||||
{
|
||||
size_t ksz = hash_header (*h)->user;
|
||||
void *copy = clib_mem_alloc (ksz);
|
||||
clib_memcpy (copy, key, ksz);
|
||||
hash_set_mem (*h, copy, v);
|
||||
}
|
||||
|
||||
static void
|
||||
hash_unset_key_free (uword ** h, void *key)
|
||||
{
|
||||
hash_pair_t *hp = hash_get_pair_mem (*h, key);
|
||||
ASSERT (hp);
|
||||
key = uword_to_pointer (hp->key, void *);
|
||||
hash_unset_mem (*h, key);
|
||||
clib_mem_free (key);
|
||||
}
|
||||
|
||||
static uword
|
||||
vtep_addr_ref (ip46_address_t * ip)
|
||||
{
|
||||
@ -323,7 +304,7 @@ vtep_addr_ref (ip46_address_t * ip)
|
||||
return ++(*vtep);
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_set (gtpu_main.vtep4, ip->ip4.as_u32, 1) :
|
||||
hash_set_key_copy (>pu_main.vtep6, &ip->ip6, 1);
|
||||
hash_set_mem_alloc (>pu_main.vtep6, &ip->ip6, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -338,7 +319,7 @@ vtep_addr_unref (ip46_address_t * ip)
|
||||
return *vtep;
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_unset (gtpu_main.vtep4, ip->ip4.as_u32) :
|
||||
hash_unset_key_free (>pu_main.vtep6, &ip->ip6);
|
||||
hash_unset_mem_free (>pu_main.vtep6, &ip->ip6);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -370,7 +351,7 @@ mcast_shared_add (ip46_address_t * dst, fib_node_index_t mfei, adj_index_t ai)
|
||||
.mfib_entry_index = mfei,
|
||||
};
|
||||
|
||||
hash_set_key_copy (>pu_main.mcast_shared, dst, new_ep.as_u64);
|
||||
hash_set_mem_alloc (>pu_main.mcast_shared, dst, new_ep.as_u64);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -381,7 +362,7 @@ mcast_shared_remove (ip46_address_t * dst)
|
||||
adj_unlock (ep.mcast_adj_index);
|
||||
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_GTPU);
|
||||
|
||||
hash_unset_key_free (>pu_main.mcast_shared, dst);
|
||||
hash_unset_mem_free (>pu_main.mcast_shared, dst);
|
||||
}
|
||||
|
||||
static inline fib_protocol_t
|
||||
@ -442,8 +423,8 @@ int vnet_gtpu_add_del_tunnel
|
||||
|
||||
/* copy the key */
|
||||
if (is_ip6)
|
||||
hash_set_key_copy (>m->gtpu6_tunnel_by_key, &key6,
|
||||
t - gtm->tunnels);
|
||||
hash_set_mem_alloc (>m->gtpu6_tunnel_by_key, &key6,
|
||||
t - gtm->tunnels);
|
||||
else
|
||||
hash_set (gtm->gtpu4_tunnel_by_key, key4.as_u64, t - gtm->tunnels);
|
||||
|
||||
@ -621,7 +602,7 @@ int vnet_gtpu_add_del_tunnel
|
||||
if (!is_ip6)
|
||||
hash_unset (gtm->gtpu4_tunnel_by_key, key4.as_u64);
|
||||
else
|
||||
hash_unset_key_free (>m->gtpu6_tunnel_by_key, &key6);
|
||||
hash_unset_mem_free (>m->gtpu6_tunnel_by_key, &key6);
|
||||
|
||||
if (!ip46_address_is_multicast (&t->dst))
|
||||
{
|
||||
|
@ -136,12 +136,12 @@ l2_emulation_cli (vlib_main_t * vm,
|
||||
}
|
||||
|
||||
/*?
|
||||
* Configure l2 emualtion.
|
||||
* Configure l2 emulation.
|
||||
* When the interface is in L2 mode, configure the extraction of L3
|
||||
* packets out of the L2 path and into the L3 path.
|
||||
*
|
||||
* @cliexpar
|
||||
* @cliexstart{set interface l2 input l2-emulation <interface-name> [disable]
|
||||
* @cliexstart{set interface l2 input l2-emulation <interface-name> [disable]}
|
||||
* @cliexend
|
||||
?*/
|
||||
/* *INDENT-OFF* */
|
||||
@ -179,7 +179,7 @@ l2_emulation_show (vlib_main_t * vm,
|
||||
* packets out of the L2 path and into the L3 path.
|
||||
*
|
||||
* @cliexpar
|
||||
* @cliexstart{show interface l2 l2-emulation
|
||||
* @cliexstart{show interface l2 l2-emulation}
|
||||
* @cliexend
|
||||
?*/
|
||||
/* *INDENT-OFF* */
|
||||
|
@ -1582,7 +1582,7 @@ int snat_set_workers (uword * bitmap)
|
||||
clib_bitmap_foreach (i, bitmap,
|
||||
({
|
||||
vec_add1(sm->workers, i);
|
||||
sm->per_thread_data[i].snat_thread_index = j;
|
||||
sm->per_thread_data[sm->first_worker_index + i].snat_thread_index = j;
|
||||
j++;
|
||||
}));
|
||||
|
||||
@ -2726,6 +2726,7 @@ snat_get_worker_out2in_cb (ip4_header_t * ip0, u32 rx_fib_index0)
|
||||
snat_session_t *s;
|
||||
int i;
|
||||
u32 proto;
|
||||
u32 next_worker_index = 0;
|
||||
|
||||
/* first try static mappings without port */
|
||||
if (PREDICT_FALSE (pool_elts (sm->static_mappings)))
|
||||
@ -2841,7 +2842,10 @@ snat_get_worker_out2in_cb (ip4_header_t * ip0, u32 rx_fib_index0)
|
||||
}
|
||||
|
||||
/* worker by outside port */
|
||||
return (u32) ((clib_net_to_host_u16 (port) - 1024) / sm->port_per_thread);
|
||||
next_worker_index = sm->first_worker_index;
|
||||
next_worker_index +=
|
||||
sm->workers[(clib_net_to_host_u16 (port) - 1024) / sm->port_per_thread];
|
||||
return next_worker_index;
|
||||
}
|
||||
|
||||
static clib_error_t *
|
||||
|
@ -202,7 +202,7 @@ nat64_get_worker_out2in (ip4_header_t * ip)
|
||||
/* worker by outside port (TCP/UDP) */
|
||||
port = clib_net_to_host_u16 (port);
|
||||
if (port > 1024)
|
||||
return (u32) ((port - 1024) / sm->port_per_thread);
|
||||
return nm->sm->first_worker_index + ((port - 1024) / sm->port_per_thread);
|
||||
|
||||
return vlib_get_thread_index ();
|
||||
}
|
||||
@ -497,13 +497,17 @@ nat64_alloc_out_addr_and_port (u32 fib_index, snat_protocol_t proto,
|
||||
snat_main_t *sm = nm->sm;
|
||||
snat_session_key_t k;
|
||||
u32 ai;
|
||||
u32 worker_index = 0;
|
||||
int rv;
|
||||
|
||||
k.protocol = proto;
|
||||
|
||||
if (sm->num_workers > 1)
|
||||
worker_index = thread_index - sm->first_worker_index;
|
||||
|
||||
rv =
|
||||
sm->alloc_addr_and_port (nm->addr_pool, fib_index, thread_index, &k, &ai,
|
||||
sm->port_per_thread, thread_index);
|
||||
sm->port_per_thread, worker_index);
|
||||
|
||||
if (!rv)
|
||||
{
|
||||
|
@ -150,10 +150,11 @@ pppoe_fixup (vlib_main_t * vm, ip_adjacency_t * adj, vlib_buffer_t * b0)
|
||||
{
|
||||
pppoe_header_t *pppoe0;
|
||||
|
||||
pppoe0 = vlib_buffer_get_current (b0);
|
||||
pppoe0 = vlib_buffer_get_current (b0) + sizeof (ethernet_header_t);
|
||||
|
||||
pppoe0->length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0)
|
||||
- sizeof (pppoe_header_t)
|
||||
+ sizeof (pppoe0->ppp_proto)
|
||||
- sizeof (ethernet_header_t));
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ vl_api_bier_imp_add_t_handler (vl_api_bier_imp_add_t * mp)
|
||||
/* *INDENT-OFF* */
|
||||
REPLY_MACRO2 (VL_API_BIER_IMP_ADD_REPLY,
|
||||
({
|
||||
rmp->bi_index = bii;
|
||||
rmp->bi_index = ntohl (bii);
|
||||
}));
|
||||
/* *INDENT-OM* */
|
||||
}
|
||||
|
@ -239,6 +239,7 @@ show_bier_bift_cmd (vlib_main_t * vm,
|
||||
if (NULL == bier_bift_table)
|
||||
{
|
||||
vlib_cli_output(vm, "no BIFT entries");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (~0 == set)
|
||||
|
@ -1123,6 +1123,12 @@ arp_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
|
||||
&arp0->ip4_over_ethernet[0]);
|
||||
goto drop1;
|
||||
}
|
||||
else if (arp0->opcode ==
|
||||
clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_request) &&
|
||||
(dst_is_local0 == 0))
|
||||
{
|
||||
goto drop1;
|
||||
}
|
||||
|
||||
send_reply:
|
||||
/* Send a reply.
|
||||
|
@ -288,25 +288,6 @@ geneve_decap_next_is_valid (geneve_main_t * vxm, u32 is_ip6,
|
||||
return decap_next_index < r->n_next_nodes;
|
||||
}
|
||||
|
||||
static void
|
||||
hash_set_key_copy (uword ** h, void *key, uword v)
|
||||
{
|
||||
size_t ksz = hash_header (*h)->user;
|
||||
void *copy = clib_mem_alloc (ksz);
|
||||
clib_memcpy (copy, key, ksz);
|
||||
hash_set_mem (*h, copy, v);
|
||||
}
|
||||
|
||||
static void
|
||||
hash_unset_key_free (uword ** h, void *key)
|
||||
{
|
||||
hash_pair_t *hp = hash_get_pair_mem (*h, key);
|
||||
ASSERT (hp);
|
||||
key = uword_to_pointer (hp->key, void *);
|
||||
hash_unset_mem (*h, key);
|
||||
clib_mem_free (key);
|
||||
}
|
||||
|
||||
static uword
|
||||
vtep_addr_ref (ip46_address_t * ip)
|
||||
{
|
||||
@ -317,7 +298,7 @@ vtep_addr_ref (ip46_address_t * ip)
|
||||
return ++(*vtep);
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_set (geneve_main.vtep4, ip->ip4.as_u32, 1) :
|
||||
hash_set_key_copy (&geneve_main.vtep6, &ip->ip6, 1);
|
||||
hash_set_mem_alloc (&geneve_main.vtep6, &ip->ip6, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -332,7 +313,7 @@ vtep_addr_unref (ip46_address_t * ip)
|
||||
return *vtep;
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_unset (geneve_main.vtep4, ip->ip4.as_u32) :
|
||||
hash_unset_key_free (&geneve_main.vtep6, &ip->ip6);
|
||||
hash_unset_mem_free (&geneve_main.vtep6, &ip->ip6);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -365,7 +346,7 @@ mcast_shared_add (ip46_address_t * remote,
|
||||
.mfib_entry_index = mfei,
|
||||
};
|
||||
|
||||
hash_set_key_copy (&geneve_main.mcast_shared, remote, new_ep.as_u64);
|
||||
hash_set_mem_alloc (&geneve_main.mcast_shared, remote, new_ep.as_u64);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -376,7 +357,7 @@ mcast_shared_remove (ip46_address_t * remote)
|
||||
adj_unlock (ep.mcast_adj_index);
|
||||
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_GENEVE);
|
||||
|
||||
hash_unset_key_free (&geneve_main.mcast_shared, remote);
|
||||
hash_unset_mem_free (&geneve_main.mcast_shared, remote);
|
||||
}
|
||||
|
||||
static inline fib_protocol_t
|
||||
@ -445,8 +426,8 @@ int vnet_geneve_add_del_tunnel
|
||||
|
||||
/* copy the key */
|
||||
if (is_ip6)
|
||||
hash_set_key_copy (&vxm->geneve6_tunnel_by_key, &key6,
|
||||
t - vxm->tunnels);
|
||||
hash_set_mem_alloc (&vxm->geneve6_tunnel_by_key, &key6,
|
||||
t - vxm->tunnels);
|
||||
else
|
||||
hash_set (vxm->geneve4_tunnel_by_key, key4.as_u64, t - vxm->tunnels);
|
||||
|
||||
@ -624,7 +605,7 @@ int vnet_geneve_add_del_tunnel
|
||||
if (!is_ip6)
|
||||
hash_unset (vxm->geneve4_tunnel_by_key, key4.as_u64);
|
||||
else
|
||||
hash_unset_key_free (&vxm->geneve6_tunnel_by_key, &key6);
|
||||
hash_unset_mem_free (&vxm->geneve6_tunnel_by_key, &key6);
|
||||
|
||||
if (!ip46_address_is_multicast (&t->remote))
|
||||
{
|
||||
|
@ -54,19 +54,8 @@ static void vl_api_gre_add_del_tunnel_t_handler
|
||||
vl_api_gre_add_del_tunnel_reply_t *rmp;
|
||||
int rv = 0;
|
||||
vnet_gre_add_del_tunnel_args_t _a, *a = &_a;
|
||||
u32 outer_fib_id;
|
||||
u32 p;
|
||||
u32 sw_if_index = ~0;
|
||||
|
||||
p = fib_table_find (!mp->is_ipv6 ? FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6,
|
||||
ntohl (mp->outer_fib_id));
|
||||
if (p == ~0)
|
||||
{
|
||||
rv = VNET_API_ERROR_NO_SUCH_FIB;
|
||||
goto out;
|
||||
}
|
||||
outer_fib_id = p;
|
||||
|
||||
/* Check src & dst are different */
|
||||
if ((mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 16) == 0) ||
|
||||
(!mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 4) == 0))
|
||||
@ -92,7 +81,7 @@ static void vl_api_gre_add_del_tunnel_t_handler
|
||||
clib_memcpy (&(a->dst.ip6), mp->dst_address, 16);
|
||||
}
|
||||
|
||||
a->outer_fib_id = outer_fib_id;
|
||||
a->outer_fib_id = ntohl (mp->outer_fib_id);
|
||||
rv = vnet_gre_add_del_tunnel (a, &sw_if_index);
|
||||
|
||||
out:
|
||||
|
@ -270,7 +270,7 @@ vnet_gre_tunnel_add (vnet_gre_add_del_tunnel_args_t * a, u32 * sw_if_indexp)
|
||||
return VNET_API_ERROR_NO_SUCH_FIB;
|
||||
|
||||
t =
|
||||
gre_tunnel_db_find (&a->src, &a->dst, a->outer_fib_id, a->is_ipv6, &key);
|
||||
gre_tunnel_db_find (&a->src, &a->dst, outer_fib_index, a->is_ipv6, &key);
|
||||
|
||||
if (NULL != t)
|
||||
return VNET_API_ERROR_INVALID_VALUE;
|
||||
@ -426,9 +426,18 @@ vnet_gre_tunnel_delete (vnet_gre_add_del_tunnel_args_t * a,
|
||||
gre_tunnel_t *t;
|
||||
gre_tunnel_key_t key;
|
||||
u32 sw_if_index;
|
||||
u32 outer_fib_index;
|
||||
|
||||
if (!a->is_ipv6)
|
||||
outer_fib_index = ip4_fib_index_from_table_id (a->outer_fib_id);
|
||||
else
|
||||
outer_fib_index = ip6_fib_index_from_table_id (a->outer_fib_id);
|
||||
|
||||
if (~0 == outer_fib_index)
|
||||
return VNET_API_ERROR_NO_SUCH_FIB;
|
||||
|
||||
t =
|
||||
gre_tunnel_db_find (&a->src, &a->dst, a->outer_fib_id, a->is_ipv6, &key);
|
||||
gre_tunnel_db_find (&a->src, &a->dst, outer_fib_index, a->is_ipv6, &key);
|
||||
|
||||
if (NULL == t)
|
||||
return VNET_API_ERROR_NO_SUCH_ENTRY;
|
||||
|
@ -75,24 +75,24 @@ create_sl (mpls_sr_policy_t * sr_policy, mpls_label_t * sl, u32 weight)
|
||||
(weight != (u32) ~ 0 ? weight : SR_SEGMENT_LIST_WEIGHT_DEFAULT);
|
||||
segment_list->segments = vec_dup (sl);
|
||||
|
||||
fib_route_path_t path = {
|
||||
.frp_proto = DPO_PROTO_MPLS,
|
||||
.frp_sw_if_index = ~0,
|
||||
.frp_fib_index = 0,
|
||||
.frp_weight = segment_list->weight,
|
||||
.frp_flags = FIB_ROUTE_PATH_FLAG_NONE,
|
||||
.frp_label_stack = NULL,
|
||||
.frp_local_label = sl[0],
|
||||
};
|
||||
|
||||
vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
|
||||
|
||||
fib_route_path_t *paths = NULL;
|
||||
vec_add1 (paths, path);
|
||||
|
||||
mpls_eos_bit_t eos;
|
||||
FOR_EACH_MPLS_EOS_BIT (eos)
|
||||
{
|
||||
fib_route_path_t path = {
|
||||
.frp_proto = DPO_PROTO_MPLS,
|
||||
.frp_sw_if_index = ~0,
|
||||
.frp_fib_index = 0,
|
||||
.frp_weight = segment_list->weight,
|
||||
.frp_flags = FIB_ROUTE_PATH_FLAG_NONE,
|
||||
.frp_label_stack = NULL,
|
||||
.frp_local_label = sl[0],
|
||||
};
|
||||
|
||||
vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
|
||||
|
||||
fib_route_path_t *paths = NULL;
|
||||
vec_add1 (paths, path);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
fib_prefix_t pfx = {
|
||||
.fp_len = 21,
|
||||
@ -109,10 +109,9 @@ create_sl (mpls_sr_policy_t * sr_policy, mpls_label_t * sl, u32 weight)
|
||||
(sr_policy->type == SR_POLICY_TYPE_DEFAULT ?
|
||||
FIB_ENTRY_FLAG_NONE :
|
||||
FIB_ENTRY_FLAG_MULTICAST), paths);
|
||||
vec_free (paths);
|
||||
}
|
||||
|
||||
vec_free (paths);
|
||||
|
||||
return segment_list;
|
||||
}
|
||||
|
||||
|
@ -177,22 +177,27 @@ compute_rewrite_encaps (ip6_address_t * sl)
|
||||
iph->protocol = IP_PROTOCOL_IPV6;
|
||||
iph->hop_limit = IPv6_DEFAULT_HOP_LIMIT;
|
||||
|
||||
srh = (ip6_sr_header_t *) (iph + 1);
|
||||
iph->protocol = IP_PROTOCOL_IPV6_ROUTE;
|
||||
srh->protocol = IP_PROTOCOL_IPV6;
|
||||
srh->type = ROUTING_HEADER_TYPE_SR;
|
||||
srh->segments_left = vec_len (sl) - 1;
|
||||
srh->first_segment = vec_len (sl) - 1;
|
||||
srh->length = ((sizeof (ip6_sr_header_t) +
|
||||
(vec_len (sl) * sizeof (ip6_address_t))) / 8) - 1;
|
||||
srh->flags = 0x00;
|
||||
srh->reserved = 0x00;
|
||||
addrp = srh->segments + vec_len (sl) - 1;
|
||||
vec_foreach (this_address, sl)
|
||||
{
|
||||
clib_memcpy (addrp->as_u8, this_address->as_u8, sizeof (ip6_address_t));
|
||||
addrp--;
|
||||
}
|
||||
if (vec_len (sl) > 1)
|
||||
{
|
||||
srh = (ip6_sr_header_t *) (iph + 1);
|
||||
iph->protocol = IP_PROTOCOL_IPV6_ROUTE;
|
||||
srh->protocol = IP_PROTOCOL_IPV6;
|
||||
srh->type = ROUTING_HEADER_TYPE_SR;
|
||||
srh->segments_left = vec_len (sl) - 1;
|
||||
srh->first_segment = vec_len (sl) - 1;
|
||||
srh->length = ((sizeof (ip6_sr_header_t) +
|
||||
(vec_len (sl) * sizeof (ip6_address_t))) / 8) - 1;
|
||||
srh->flags = 0x00;
|
||||
srh->reserved = 0x00;
|
||||
addrp = srh->segments + vec_len (sl) - 1;
|
||||
vec_foreach (this_address, sl)
|
||||
{
|
||||
clib_memcpy (addrp->as_u8, this_address->as_u8,
|
||||
sizeof (ip6_address_t));
|
||||
addrp--;
|
||||
}
|
||||
}
|
||||
|
||||
iph->dst_address.as_u64[0] = sl->as_u64[0];
|
||||
iph->dst_address.as_u64[1] = sl->as_u64[1];
|
||||
return rs;
|
||||
@ -1332,8 +1337,13 @@ encaps_processing_v4 (vlib_node_runtime_t * node,
|
||||
ip0->ip_version_traffic_class_and_flow_label =
|
||||
clib_host_to_net_u32 (0 | ((6 & 0xF) << 28) |
|
||||
((ip0_encap->tos & 0xFF) << 20));
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP_IN_IP;
|
||||
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP_IN_IP;
|
||||
}
|
||||
else
|
||||
ip0->protocol = IP_PROTOCOL_IP_IN_IP;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1816,13 +1826,37 @@ sr_policy_rewrite_encaps_l2 (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
ip3->payload_length =
|
||||
clib_host_to_net_u16 (b3->current_length - sizeof (ip6_header_t));
|
||||
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr1 = (void *) (ip1 + 1);
|
||||
sr2 = (void *) (ip2 + 1);
|
||||
sr3 = (void *) (ip3 + 1);
|
||||
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
sr0->protocol = sr1->protocol = sr2->protocol = sr3->protocol =
|
||||
IP_PROTOCOL_IP6_NONXT;
|
||||
if (ip1->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr1 = (void *) (ip1 + 1);
|
||||
sr1->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip1->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
if (ip2->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr2 = (void *) (ip2 + 1);
|
||||
sr2->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip2->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
if (ip3->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr3 = (void *) (ip3 + 1);
|
||||
sr3->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip3->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
/* Which Traffic class and flow label do I set ? */
|
||||
//ip0->ip_version_traffic_class_and_flow_label = clib_host_to_net_u32(0|((6&0xF)<<28)|((ip0_encap->tos&0xFF)<<20));
|
||||
@ -1930,8 +1964,13 @@ sr_policy_rewrite_encaps_l2 (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
ip0->payload_length =
|
||||
clib_host_to_net_u16 (b0->current_length - sizeof (ip6_header_t));
|
||||
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
|
||||
{
|
||||
sr0 = (void *) (ip0 + 1);
|
||||
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
}
|
||||
else
|
||||
ip0->protocol = IP_PROTOCOL_IP6_NONXT;
|
||||
|
||||
if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE) &&
|
||||
PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
|
||||
|
@ -381,25 +381,6 @@ vxlan6_gpe_rewrite (vxlan_gpe_tunnel_t * t, u32 extension_size,
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
hash_set_key_copy (uword ** h, void *key, uword v)
|
||||
{
|
||||
size_t ksz = hash_header (*h)->user;
|
||||
void *copy = clib_mem_alloc (ksz);
|
||||
clib_memcpy (copy, key, ksz);
|
||||
hash_set_mem (*h, copy, v);
|
||||
}
|
||||
|
||||
static void
|
||||
hash_unset_key_free (uword ** h, void *key)
|
||||
{
|
||||
hash_pair_t *hp = hash_get_pair_mem (*h, key);
|
||||
ASSERT (hp);
|
||||
key = uword_to_pointer (hp->key, void *);
|
||||
hash_unset_mem (*h, key);
|
||||
clib_mem_free (key);
|
||||
}
|
||||
|
||||
static uword
|
||||
vtep_addr_ref (ip46_address_t * ip)
|
||||
{
|
||||
@ -410,7 +391,7 @@ vtep_addr_ref (ip46_address_t * ip)
|
||||
return ++(*vtep);
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_set (vxlan_gpe_main.vtep4, ip->ip4.as_u32, 1) :
|
||||
hash_set_key_copy (&vxlan_gpe_main.vtep6, &ip->ip6, 1);
|
||||
hash_set_mem_alloc (&vxlan_gpe_main.vtep6, &ip->ip6, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -425,7 +406,7 @@ vtep_addr_unref (ip46_address_t * ip)
|
||||
return *vtep;
|
||||
ip46_address_is_ip4 (ip) ?
|
||||
hash_unset (vxlan_gpe_main.vtep4, ip->ip4.as_u32) :
|
||||
hash_unset_key_free (&vxlan_gpe_main.vtep6, &ip->ip6);
|
||||
hash_unset_mem_free (&vxlan_gpe_main.vtep6, &ip->ip6);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -459,7 +440,7 @@ mcast_shared_add (ip46_address_t * remote,
|
||||
.mfib_entry_index = mfei,
|
||||
};
|
||||
|
||||
hash_set_key_copy (&vxlan_gpe_main.mcast_shared, remote, new_ep.as_u64);
|
||||
hash_set_mem_alloc (&vxlan_gpe_main.mcast_shared, remote, new_ep.as_u64);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -470,7 +451,7 @@ mcast_shared_remove (ip46_address_t * remote)
|
||||
adj_unlock (ep.mcast_adj_index);
|
||||
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_VXLAN_GPE);
|
||||
|
||||
hash_unset_key_free (&vxlan_gpe_main.mcast_shared, remote);
|
||||
hash_unset_mem_free (&vxlan_gpe_main.mcast_shared, remote);
|
||||
}
|
||||
|
||||
static inline fib_protocol_t
|
||||
@ -535,15 +516,18 @@ int vnet_vxlan_gpe_add_del_tunnel
|
||||
memset (t, 0, sizeof (*t));
|
||||
|
||||
/* copy from arg structure */
|
||||
/* *INDENT-OFF* */
|
||||
#define _(x) t->x = a->x;
|
||||
foreach_gpe_copy_field;
|
||||
if (!a->is_ip6)
|
||||
foreach_copy_ipv4
|
||||
else
|
||||
else
|
||||
foreach_copy_ipv6
|
||||
#undef _
|
||||
if (!a->is_ip6)
|
||||
t->flags |= VXLAN_GPE_TUNNEL_IS_IPV4;
|
||||
/* *INDENT-ON* */
|
||||
|
||||
if (!a->is_ip6)
|
||||
t->flags |= VXLAN_GPE_TUNNEL_IS_IPV4;
|
||||
|
||||
if (!a->is_ip6)
|
||||
{
|
||||
@ -743,7 +727,7 @@ int vnet_vxlan_gpe_add_del_tunnel
|
||||
if (!is_ip6)
|
||||
hash_unset (ngm->vxlan4_gpe_tunnel_by_key, key4.as_u64);
|
||||
else
|
||||
hash_unset_key_free (&ngm->vxlan6_gpe_tunnel_by_key, &key6);
|
||||
hash_unset_mem_free (&ngm->vxlan6_gpe_tunnel_by_key, &key6);
|
||||
|
||||
if (!ip46_address_is_multicast (&t->remote))
|
||||
{
|
||||
@ -940,14 +924,17 @@ vxlan_gpe_add_del_tunnel_command_fn (vlib_main_t * vm,
|
||||
a->is_add = is_add;
|
||||
a->is_ip6 = ipv6_set;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#define _(x) a->x = x;
|
||||
foreach_gpe_copy_field;
|
||||
if (ipv4_set)
|
||||
foreach_copy_ipv4
|
||||
else
|
||||
else
|
||||
foreach_copy_ipv6
|
||||
#undef _
|
||||
rv = vnet_vxlan_gpe_add_del_tunnel (a, &sw_if_index);
|
||||
/* *INDENT-ON* */
|
||||
|
||||
rv = vnet_vxlan_gpe_add_del_tunnel (a, &sw_if_index);
|
||||
|
||||
switch (rv)
|
||||
{
|
||||
|
@ -263,23 +263,6 @@ vxlan_decap_next_is_valid (vxlan_main_t * vxm, u32 is_ip6, u32 decap_next_index)
|
||||
return decap_next_index < r->n_next_nodes;
|
||||
}
|
||||
|
||||
static void
|
||||
hash_set_key_copy (uword ** h, void * key, uword v) {
|
||||
size_t ksz = hash_header(*h)->user;
|
||||
void * copy = clib_mem_alloc (ksz);
|
||||
clib_memcpy (copy, key, ksz);
|
||||
hash_set_mem (*h, copy, v);
|
||||
}
|
||||
|
||||
static void
|
||||
hash_unset_key_free (uword ** h, void * key) {
|
||||
hash_pair_t * hp = hash_get_pair_mem (*h, key);
|
||||
ASSERT (hp);
|
||||
key = uword_to_pointer (hp->key, void *);
|
||||
hash_unset_mem (*h, key);
|
||||
clib_mem_free (key);
|
||||
}
|
||||
|
||||
static uword
|
||||
vtep_addr_ref(ip46_address_t *ip)
|
||||
{
|
||||
@ -290,7 +273,7 @@ vtep_addr_ref(ip46_address_t *ip)
|
||||
return ++(*vtep);
|
||||
ip46_address_is_ip4(ip) ?
|
||||
hash_set (vxlan_main.vtep4, ip->ip4.as_u32, 1) :
|
||||
hash_set_key_copy (&vxlan_main.vtep6, &ip->ip6, 1);
|
||||
hash_set_mem_alloc (&vxlan_main.vtep6, &ip->ip6, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -305,7 +288,7 @@ vtep_addr_unref(ip46_address_t *ip)
|
||||
return *vtep;
|
||||
ip46_address_is_ip4(ip) ?
|
||||
hash_unset (vxlan_main.vtep4, ip->ip4.as_u32) :
|
||||
hash_unset_key_free (&vxlan_main.vtep6, &ip->ip6);
|
||||
hash_unset_mem_free (&vxlan_main.vtep6, &ip->ip6);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -336,7 +319,7 @@ mcast_shared_add(ip46_address_t *dst,
|
||||
.mfib_entry_index = mfei,
|
||||
};
|
||||
|
||||
hash_set_key_copy (&vxlan_main.mcast_shared, dst, new_ep.as_u64);
|
||||
hash_set_mem_alloc (&vxlan_main.mcast_shared, dst, new_ep.as_u64);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -348,7 +331,7 @@ mcast_shared_remove(ip46_address_t *dst)
|
||||
mfib_table_entry_delete_index(ep.mfib_entry_index,
|
||||
MFIB_SOURCE_VXLAN);
|
||||
|
||||
hash_unset_key_free (&vxlan_main.mcast_shared, dst);
|
||||
hash_unset_mem_free (&vxlan_main.mcast_shared, dst);
|
||||
}
|
||||
|
||||
static inline fib_protocol_t
|
||||
@ -415,7 +398,8 @@ int vnet_vxlan_add_del_tunnel
|
||||
|
||||
/* copy the key */
|
||||
if (is_ip6)
|
||||
hash_set_key_copy (&vxm->vxlan6_tunnel_by_key, &key6, t - vxm->tunnels);
|
||||
hash_set_mem_alloc (&vxm->vxlan6_tunnel_by_key, &key6,
|
||||
t - vxm->tunnels);
|
||||
else
|
||||
hash_set (vxm->vxlan4_tunnel_by_key, key4.as_u64, t - vxm->tunnels);
|
||||
|
||||
@ -588,7 +572,7 @@ int vnet_vxlan_add_del_tunnel
|
||||
if (!is_ip6)
|
||||
hash_unset (vxm->vxlan4_tunnel_by_key, key4.as_u64);
|
||||
else
|
||||
hash_unset_key_free (&vxm->vxlan6_tunnel_by_key, &key6);
|
||||
hash_unset_mem_free (&vxm->vxlan6_tunnel_by_key, &key6);
|
||||
|
||||
if (!ip46_address_is_multicast(&t->dst))
|
||||
{
|
||||
|
@ -15,8 +15,7 @@ AUTOMAKE_OPTIONS = foreign
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
AM_LIBTOOLFLAGS = --quiet
|
||||
|
||||
AM_CXXFLAGS = -Wall -std=gnu++11 -I${top_srcdir} -I${top_builddir}/vpp-api/vapi/ -I$(top_srcdir)/vpp-api/ -I${libdir}/../include -O0
|
||||
AM_LDFLAGS = -shared -no-undefined
|
||||
AM_CXXFLAGS = -Wall -Werror -std=gnu++11 -I${top_srcdir} -I${top_builddir}/vpp-api/vapi/ -I$(top_srcdir)/vpp-api/ -I${libdir}/../include
|
||||
|
||||
bin_PROGRAMS =
|
||||
noinst_LTLIBRARIES =
|
||||
|
@ -119,7 +119,7 @@ nat_binding::update(const nat_binding& desired)
|
||||
HW::enqueue(new nat_binding_cmds::bind_44_input_cmd(
|
||||
m_binding, m_itf->handle(), m_zone));
|
||||
} else {
|
||||
HW::enqueue(new nat_binding_cmds::bind_44_input_cmd(
|
||||
HW::enqueue(new nat_binding_cmds::bind_44_output_cmd(
|
||||
m_binding, m_itf->handle(), m_zone));
|
||||
}
|
||||
}
|
||||
|
@ -168,12 +168,12 @@ private:
|
||||
/**
|
||||
* The 'inside' IP address, could be v4 or v6
|
||||
*/
|
||||
const boost::asio::ip::address& m_inside;
|
||||
const boost::asio::ip::address m_inside;
|
||||
|
||||
/**
|
||||
* The 'outside' IP address - always v4
|
||||
*/
|
||||
const boost::asio::ip::address_v4& m_outside;
|
||||
const boost::asio::ip::address_v4 m_outside;
|
||||
|
||||
/**
|
||||
* A map of all NAT statics
|
||||
|
@ -273,12 +273,33 @@ uword hash_bytes (void *v);
|
||||
/* Public macro to set (key, value) for pointer key */
|
||||
#define hash_set_mem(h,key,value) hash_set3 (h, pointer_to_uword (key), (value), 0)
|
||||
|
||||
/* Public inline funcion allocate and copy key to use in hash for pointer key */
|
||||
always_inline void
|
||||
hash_set_mem_alloc (uword ** h, void *key, uword v)
|
||||
{
|
||||
size_t ksz = hash_header (*h)->user;
|
||||
void *copy = clib_mem_alloc (ksz);
|
||||
clib_memcpy (copy, key, ksz);
|
||||
hash_set_mem (*h, copy, v);
|
||||
}
|
||||
|
||||
/* Public macro to set (key, 0) for pointer key */
|
||||
#define hash_set1_mem(h,key) hash_set3 ((h), pointer_to_uword (key), 0, 0)
|
||||
|
||||
/* Public macro to unset (key, value) for pointer key */
|
||||
#define hash_unset_mem(h,key) ((h) = _hash_unset ((h), pointer_to_uword (key),0))
|
||||
|
||||
/* Public inline funcion to unset pointer key and then free the key memory */
|
||||
always_inline void
|
||||
hash_unset_mem_free (uword ** h, void *key)
|
||||
{
|
||||
hash_pair_t *hp = hash_get_pair_mem (*h, key);
|
||||
ASSERT (hp);
|
||||
key = uword_to_pointer (hp->key, void *);
|
||||
hash_unset_mem (*h, key);
|
||||
clib_mem_free (key);
|
||||
}
|
||||
|
||||
/* internal routine to free a hash table */
|
||||
extern void *_hash_free (void *v);
|
||||
|
||||
|
@ -747,6 +747,25 @@ class VppTestCase(unittest.TestCase):
|
||||
"Finished sleep (%s) - slept %ss (wanted %ss)" % (
|
||||
remark, after - before, timeout))
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark=""):
|
||||
self.vapi.cli("clear trace")
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
timeout = 1
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0, timeout=timeout)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
timeout = 0.1
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
self.vapi.cli("clear trace")
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
return rx
|
||||
|
||||
|
||||
class TestCasePrinter(object):
|
||||
_shared_state = {}
|
||||
|
@ -66,21 +66,6 @@ class TestBier(VppTestCase):
|
||||
i.admin_down()
|
||||
super(TestBier, self).tearDown()
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
self.vapi.cli("trace add bier-mpls-lookup 10")
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
return rx
|
||||
|
||||
def test_bier_midpoint(self):
|
||||
"""BIER midpoint"""
|
||||
|
||||
@ -485,10 +470,14 @@ class TestBier(VppTestCase):
|
||||
bier_route.add_vpp_config()
|
||||
|
||||
#
|
||||
# An imposition object with all bit-positions set
|
||||
# An 2 imposition objects with all bit-positions set
|
||||
# only use the second, but creating 2 tests with a non-zero
|
||||
# value index in the route add
|
||||
#
|
||||
bi = VppBierImp(self, bti, 333, chr(0xff) * 32)
|
||||
bi.add_vpp_config()
|
||||
bi2 = VppBierImp(self, bti, 334, chr(0xff) * 32)
|
||||
bi2.add_vpp_config()
|
||||
|
||||
#
|
||||
# Add a multicast route that will forward into the BIER doamin
|
||||
@ -503,7 +492,7 @@ class TestBier(VppTestCase):
|
||||
VppMRoutePath(0xffffffff,
|
||||
MRouteItfFlags.MFIB_ITF_FLAG_FORWARD,
|
||||
proto=DpoProto.DPO_PROTO_BIER,
|
||||
bier_imp=bi.bi_index)])
|
||||
bier_imp=bi2.bi_index)])
|
||||
route_ing_232_1_1_1.add_vpp_config()
|
||||
|
||||
#
|
||||
|
@ -77,13 +77,6 @@ class TestDHCP(VppTestCase):
|
||||
i.admin_down()
|
||||
super(TestDHCP, self).tearDown()
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def verify_dhcp_has_option(self, pkt, option, value):
|
||||
dhcp = pkt[DHCP]
|
||||
found = False
|
||||
|
@ -36,23 +36,6 @@ class TestDVR(VppTestCase):
|
||||
|
||||
super(TestDVR, self).tearDown()
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts):
|
||||
self.vapi.cli("clear trace")
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured()
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
self.vapi.cli("clear trace")
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
return rx
|
||||
|
||||
def assert_same_mac_addr(self, tx, rx):
|
||||
t_eth = tx[Ether]
|
||||
for p in rx:
|
||||
|
@ -572,14 +572,6 @@ class TestIPDisabled(VppTestCase):
|
||||
i.unconfig_ip4()
|
||||
i.admin_down()
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_ip_disabled(self):
|
||||
""" IP Disabled """
|
||||
|
||||
@ -667,14 +659,6 @@ class TestIPSubNets(VppTestCase):
|
||||
for i in self.pg_interfaces:
|
||||
i.admin_down()
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_ip_sub_nets(self):
|
||||
""" IP Sub Nets """
|
||||
|
||||
@ -985,12 +969,6 @@ class TestIPVlan0(VppTestCase):
|
||||
i.admin_down()
|
||||
super(TestIPVlan0, self).tearDown()
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
|
||||
def test_ip_vlan_0(self):
|
||||
""" IP VLAN-0 """
|
||||
|
||||
@ -1028,23 +1006,6 @@ class TestIPPunt(VppTestCase):
|
||||
i.unconfig_ip4()
|
||||
i.admin_down()
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
self.vapi.cli("clear trace")
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
return rx
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
self.vapi.cli("clear trace")
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_ip_punt(self):
|
||||
""" IP punt police and redirect """
|
||||
|
||||
@ -1138,23 +1099,6 @@ class TestIPDeag(VppTestCase):
|
||||
i.unconfig_ip4()
|
||||
i.admin_down()
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
self.vapi.cli("clear trace")
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
return rx
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
self.vapi.cli("clear trace")
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_ip_deag(self):
|
||||
""" IP Deag Routes """
|
||||
|
||||
@ -1246,23 +1190,6 @@ class TestIPInput(VppTestCase):
|
||||
i.unconfig_ip4()
|
||||
i.admin_down()
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
self.vapi.cli("clear trace")
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
return rx
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
self.vapi.cli("clear trace")
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_ip_input(self):
|
||||
""" IP Input Exceptions """
|
||||
|
||||
|
@ -136,14 +136,6 @@ class TestIPv6ND(VppTestCase):
|
||||
rx = rx[0]
|
||||
self.validate_ns(rx_intf, rx, tgt_ip)
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def verify_ip(self, rx, smac, dmac, sip, dip):
|
||||
ether = rx[Ether]
|
||||
self.assertEqual(ether.dst, dmac)
|
||||
@ -1179,14 +1171,6 @@ class TestIPDisabled(VppTestCase):
|
||||
i.unconfig_ip4()
|
||||
i.admin_down()
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_ip_disabled(self):
|
||||
""" IP Disabled """
|
||||
|
||||
@ -1528,22 +1512,6 @@ class TestIP6Punt(VppTestCase):
|
||||
i.unconfig_ip6()
|
||||
i.admin_down()
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
return rx
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
self.vapi.cli("clear trace")
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_ip_punt(self):
|
||||
""" IP6 punt police and redirect """
|
||||
|
||||
@ -1641,23 +1609,6 @@ class TestIP6Input(VppTestCase):
|
||||
i.unconfig_ip6()
|
||||
i.admin_down()
|
||||
|
||||
def send_and_expect(self, input, pkts, output):
|
||||
self.vapi.cli("clear trace")
|
||||
input.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
rx = output.get_capture(len(pkts))
|
||||
return rx
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
self.vapi.cli("clear trace")
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_ip_input(self):
|
||||
""" IP6 Input Exceptions """
|
||||
|
||||
|
@ -38,13 +38,6 @@ class TestMAP(VppTestCase):
|
||||
i.unconfig_ip6()
|
||||
i.admin_down()
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def send_and_assert_encapped(self, tx, ip6_src, ip6_dst, dmac=None):
|
||||
if not dmac:
|
||||
dmac = self.pg1.remote_mac
|
||||
|
@ -314,13 +314,6 @@ class TestMPLS(VppTestCase):
|
||||
except:
|
||||
raise
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_swap(self):
|
||||
""" MPLS label swap tests """
|
||||
|
||||
@ -1218,7 +1211,13 @@ class TestMPLS(VppTestCase):
|
||||
#
|
||||
tx = self.create_stream_labelled_ip6(self.pg0, [34], 255,
|
||||
dst_ip="ff01::1", hlim=1)
|
||||
self.send_and_assert_no_replies(self.pg0, tx, "Hop Limt Expired")
|
||||
self.pg0.add_stream(tx)
|
||||
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
|
||||
rx = self.pg0.get_capture(257)
|
||||
self.verify_capture_ip6_icmp(self.pg0, rx, tx)
|
||||
|
||||
#
|
||||
# set the RPF-ID of the enrtry to not match the input packet's
|
||||
@ -1258,14 +1257,6 @@ class TestMPLSDisabled(VppTestCase):
|
||||
self.pg0.disable_mpls()
|
||||
super(TestMPLSDisabled, self).tearDown()
|
||||
|
||||
def send_and_assert_no_replies(self, intf, pkts, remark):
|
||||
intf.add_stream(pkts)
|
||||
self.pg_enable_capture(self.pg_interfaces)
|
||||
self.pg_start()
|
||||
for i in self.pg_interfaces:
|
||||
i.get_capture(0)
|
||||
i.assert_nothing_captured(remark=remark)
|
||||
|
||||
def test_mpls_disabled(self):
|
||||
""" MPLS Disabled """
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user