unformat_ip_address, &lloc,
unformat_ip_address, &rloc, &w))
{
- pair.lcl_loc = lloc;
- pair.rmt_loc = rloc;
+ ip_address_copy (&pair.lcl_loc, &lloc);
+ ip_address_copy (&pair.rmt_loc, &rloc);
pair.weight = w;
pair.priority = 0;
vec_add1 (pairs, pair);
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
fib_route_path_t *rpath;
u8 ip_version;
- ip_version = a->rpath.frp_proto == FIB_PROTOCOL_IP4 ? IP4 : IP6;
+ ip_version = a->rpath.frp_proto == DPO_PROTO_IP4 ? IP4 : IP6;
if (a->is_add)
{
&rpath.frp_sw_if_index))
{
rpath.frp_weight = 1;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
}
else if (unformat (line_input, "via %U %U",
unformat_ip6_address,
&rpath.frp_sw_if_index))
{
rpath.frp_weight = 1;
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
}
else if (unformat (line_input, "via %U",
unformat_ip4_address, &rpath.frp_addr.ip4))
{
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP4;
+ rpath.frp_proto = DPO_PROTO_IP4;
}
else if (unformat (line_input, "via %U",
unformat_ip6_address, &rpath.frp_addr.ip6))
{
rpath.frp_weight = 1;
rpath.frp_sw_if_index = ~0;
- rpath.frp_proto = FIB_PROTOCOL_IP6;
+ rpath.frp_proto = DPO_PROTO_IP6;
}
else
{
}
else
{
- rpath.frp_fib_index = fib_table_find (rpath.frp_proto, table_id);
+ rpath.frp_fib_index =
+ fib_table_find (dpo_proto_to_fib (rpath.frp_proto), table_id);
if ((u32) ~ 0 == rpath.frp_fib_index)
{
error = clib_error_return (0, "Nonexistent table id %d", table_id);