unformat_input_t _line_input, *line_input = &_line_input;
fib_route_path_t *rpaths = NULL, rpath;
dpo_id_t dpo = DPO_INVALID, *dpos = NULL;
+ u32 table_id, is_del, udp_encap_id;
fib_prefix_t *prefixs = NULL, pfx;
mpls_label_t out_label, via_label;
clib_error_t *error = NULL;
u32 weight, preference;
- u32 table_id, is_del;
vnet_main_t *vnm;
u32 fib_index;
f64 count;
rpath.frp_proto = DPO_PROTO_IP6;
vec_add1 (rpaths, rpath);
}
+ else if (unformat (line_input, "via udp-encap %d", &udp_encap_id))
+ {
+ rpath.frp_udp_encap_id = udp_encap_id;
+ rpath.frp_flags |= FIB_ROUTE_PATH_UDP_ENCAP;
+ rpath.frp_proto = fib_proto_to_dpo (pfx.fp_proto);
+ vec_add1 (rpaths, rpath);
+ }
else if (unformat (line_input,
"lookup in table %d", &rpath.frp_fib_index))
{
{
unformat_input_t _line_input, *line_input = &_line_input;
fib_prefix_t pfx;
-
- u32 is_del;
+ u32 is_del, addr_set = 0;
vnet_main_t *vnm;
u32 sw_if_index;
vnm = vnet_get_main ();
is_del = 0;
sw_if_index = ~0;
+ memset (&pfx, 0, sizeof (pfx));
/* Get a line of input. */
if (!unformat_user (main_input, unformat_line_input, line_input))
{
pfx.fp_proto = FIB_PROTOCOL_IP4;
pfx.fp_len = 32;
+ addr_set = 1;
}
else if (unformat (line_input, "%U",
unformat_ip6_address, &pfx.fp_addr.ip6))
{
pfx.fp_proto = FIB_PROTOCOL_IP6;
pfx.fp_len = 128;
+ addr_set = 1;
}
else if (unformat (line_input, "%U",
unformat_vnet_sw_interface, vnm, &sw_if_index))
format_unformat_error, line_input));
}
- if (~0 == sw_if_index)
+ if (~0 == sw_if_index || !addr_set)
{
- return (clib_error_return (0, "no interface"));
+ vlib_cli_output (vm, "interface and address must be set");
+ return 0;
}
vnet_ip_container_proxy_args_t args = {