&rpath.frp_sw_if_index,
&rpath.frp_weight))
{
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
}
&rpath.frp_sw_if_index,
&rpath.frp_weight))
{
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
vec_add1(rpaths, rpath);
}
&rpath.frp_sw_if_index))
{
rpath.frp_weight = 1;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "rx-ip4 %U",
&rpath.frp_sw_if_index))
{
rpath.frp_weight = 1;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
rpath.frp_flags = FIB_ROUTE_PATH_INTF_RX;
vec_add1(rpaths, rpath);
}
&rpath.frp_sw_if_index))
{
rpath.frp_weight = 1;
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "via %U next-hop-table %d",
{
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "via %U next-hop-table %d",
{
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "via %U",
rpath.frp_fib_index = table_id;
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "via %U",
rpath.frp_fib_index = table_id;
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
vec_add1(rpaths, rpath);
}
else if (unformat (line_input, "%d", &local_label))
"ip4-lookup-in-table %d",
&rpath.frp_fib_index))
{
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
rpath.frp_sw_if_index = FIB_NODE_INDEX_INVALID;
pfx.fp_payload_proto = DPO_PROTO_IP4;
vec_add1(rpaths, rpath);
"ip6-lookup-in-table %d",
&rpath.frp_fib_index))
{
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
rpath.frp_sw_if_index = FIB_NODE_INDEX_INVALID;
vec_add1(rpaths, rpath);
pfx.fp_payload_proto = DPO_PROTO_IP6;
"mpls-lookup-in-table %d",
&rpath.frp_fib_index))
{
- rpath.frp_proto = FIB_PROTOCOL_MPLS;
+ rpath.frp_proto = DPO_PROTO_MPLS;
rpath.frp_sw_if_index = FIB_NODE_INDEX_INVALID;
pfx.fp_payload_proto = DPO_PROTO_MPLS;
vec_add1(rpaths, rpath);
}
+ else if (unformat (line_input,
+ "l2-input-on %U",
+ unformat_vnet_sw_interface, vnm,
+ &rpath.frp_sw_if_index))
+ {
+ rpath.frp_proto = DPO_PROTO_ETHERNET;
+ pfx.fp_payload_proto = DPO_PROTO_ETHERNET;
+ rpath.frp_flags = FIB_ROUTE_PATH_INTF_RX;
+ vec_add1(rpaths, rpath);
+ }
else if (unformat (line_input, "out-label %U",
unformat_mpls_unicast_label,
&out_label))
}
else
{
- fib_node_index_t lfe, fib_index;
+ fib_node_index_t fib_index;
u32 fi;
if (NULL == rpaths)
pfx.fp_proto = FIB_PROTOCOL_MPLS;
pfx.fp_len = 21;
pfx.fp_label = local_label;
- pfx.fp_payload_proto = fib_proto_to_dpo(rpaths[0].frp_proto);
+ pfx.fp_payload_proto = rpaths[0].frp_proto;
/*
* the CLI parsing stored table Ids, swap to FIB indicies
*/
if (FIB_NODE_INDEX_INVALID == rpath.frp_sw_if_index)
{
- fi = fib_table_id_find_fib_index(dpo_proto_to_fib(pfx.fp_payload_proto),
- rpaths[0].frp_fib_index);
+ fi = fib_table_find(dpo_proto_to_fib(pfx.fp_payload_proto),
+ rpaths[0].frp_fib_index);
if (~0 == fi)
{
goto done;
}
- lfe = fib_table_entry_path_add2(fib_index,
- &pfx,
- FIB_SOURCE_CLI,
- FIB_ENTRY_FLAG_NONE,
- rpaths);
-
- if (FIB_NODE_INDEX_INVALID == lfe)
+ if (is_del)
{
- error = clib_error_return (0, "Failed to create %U-%U in MPLS table-id %d",
- format_mpls_unicast_label, local_label,
- format_mpls_eos_bit, eos,
- table_id);
- goto done;
+ fib_table_entry_path_remove2(fib_index,
+ &pfx,
+ FIB_SOURCE_CLI,
+ rpaths);
+ }
+ else
+ {
+ fib_node_index_t lfe;
+
+ lfe = fib_table_entry_path_add2(fib_index,
+ &pfx,
+ FIB_SOURCE_CLI,
+ FIB_ENTRY_FLAG_NONE,
+ rpaths);
+
+ if (FIB_NODE_INDEX_INVALID == lfe)
+ {
+ error = clib_error_return (0, "Failed to create %U-%U in MPLS table-id %d",
+ format_mpls_unicast_label, local_label,
+ format_mpls_eos_bit, eos,
+ table_id);
+ goto done;
+ }
}
}