return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
}
+fib_forward_chain_type_t
+fib_forw_chain_type_from_fib_proto (fib_protocol_t proto)
+{
+ switch (proto)
+ {
+ case FIB_PROTOCOL_IP4:
+ return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
+ case FIB_PROTOCOL_IP6:
+ return (FIB_FORW_CHAIN_TYPE_UNICAST_IP6);
+ case FIB_PROTOCOL_MPLS:
+ return (FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS);
+ }
+ ASSERT(0);
+ return (FIB_FORW_CHAIN_TYPE_UNICAST_IP4);
+}
+
vnet_link_t
fib_forw_chain_type_to_link_type (fib_forward_chain_type_t fct)
{
vnet_main_t *vnm;
vnm = vnet_get_main ();
- memset(rpath, 0, sizeof(*rpath));
+ clib_memset(rpath, 0, sizeof(*rpath));
rpath->frp_weight = 1;
rpath->frp_sw_if_index = ~0;
rpath->frp_proto = DPO_PROTO_IP4;
rpath->frp_flags = FIB_ROUTE_PATH_INTF_RX;
}
- else if (unformat (input, "out-labels"))
+ else if (unformat (input, "local"))
+ {
+ clib_memset (&rpath->frp_addr, 0, sizeof (rpath->frp_addr));
+ rpath->frp_sw_if_index = ~0;
+ rpath->frp_weight = 1;
+ rpath->frp_flags |= FIB_ROUTE_PATH_LOCAL;
+ }
+ else if (unformat (input, "out-labels"))
{
while (unformat (input, "%U",
unformat_mpls_unicast_label, &out_label))
{
rpath->frp_proto = *payload_proto;
}
+ else if (unformat (input, "via"))
+ {
+ /* new path, back up and return */
+ unformat_put_input (input);
+ unformat_put_input (input);
+ unformat_put_input (input);
+ unformat_put_input (input);
+ break;
+ }
else
{
return (0);