#include <vnet/dpo/receive_dpo.h>
#include <vnet/dpo/lookup_dpo.h>
#include <vnet/dpo/classify_dpo.h>
+#include <vnet/dpo/ip_null_dpo.h>
#define f64_endian(a)
#define f64_print(a,b)
add_del_route_t_handler (u8 is_multipath,
u8 is_add,
u8 is_drop,
+ u8 is_unreach,
+ u8 is_prohibit,
u8 is_local,
u8 is_classify,
u32 classify_table_index,
u32 next_hop_weight, u32 next_hop_out_label)
{
vnet_classify_main_t *cm = &vnet_classify_main;
- fib_protocol_t proto = prefix->fp_proto;
stats_main_t *sm = &stats_main;
if (is_multipath)
dslock (sm, 1 /* release hint */ , 2 /* tag */ );
- if (is_drop || is_local || is_classify)
+ if (is_drop || is_local || is_classify || is_unreach || is_prohibit)
{
/*
* special route types that link directly to the adj
*/
if (is_add)
{
- dpo_id_t dpo = DPO_NULL;
+ dpo_id_t dpo = DPO_INVALID;
dpo_proto_t dproto;
dproto = fib_proto_to_dpo (prefix->fp_proto);
if (is_drop)
- dpo_copy (&dpo, drop_dpo_get (dproto));
+ ip_null_dpo_add_and_lock (dproto, IP_NULL_ACTION_NONE, &dpo);
else if (is_local)
receive_dpo_add_or_lock (dproto, ~0, NULL, &dpo);
+ else if (is_unreach)
+ ip_null_dpo_add_and_lock (dproto,
+ IP_NULL_ACTION_SEND_ICMP_UNREACH, &dpo);
+ else if (is_prohibit)
+ ip_null_dpo_add_and_lock (dproto,
+ IP_NULL_ACTION_SEND_ICMP_PROHIBIT,
+ &dpo);
else if (is_classify)
{
if (pool_is_free_index (cm->tables,
return VNET_API_ERROR_NO_SUCH_TABLE;
}
- dpo_set (&dpo, DPO_CLASSIFY, proto,
- classify_dpo_create (prefix->fp_proto,
+ dpo_set (&dpo, DPO_CLASSIFY, dproto,
+ classify_dpo_create (dproto,
ntohl (classify_table_index)));
}
else
return VNET_API_ERROR_NO_SUCH_TABLE;
}
- fib_table_entry_special_dpo_add (fib_index,
- prefix,
- FIB_SOURCE_API,
- FIB_ENTRY_FLAG_EXCLUSIVE, &dpo);
+ fib_table_entry_special_dpo_update (fib_index,
+ prefix,
+ FIB_SOURCE_API,
+ FIB_ENTRY_FLAG_EXCLUSIVE, &dpo);
dpo_reset (&dpo);
}
else
memset (&nh, 0, sizeof (nh));
memcpy (&nh.ip4, mp->next_hop_address, sizeof (nh.ip4));
- return (add_del_route_t_handler (mp->is_multipath, mp->is_add, mp->is_drop, mp->is_local, mp->is_classify, mp->classify_table_index, mp->is_resolve_host, mp->is_resolve_attached, fib_index, &pfx, 1, // is_ip4
+ return (add_del_route_t_handler (mp->is_multipath,
+ mp->is_add,
+ mp->is_drop,
+ mp->is_unreach,
+ mp->is_prohibit,
+ mp->is_local,
+ mp->is_classify,
+ mp->classify_table_index,
+ mp->is_resolve_host,
+ mp->is_resolve_attached,
+ fib_index, &pfx, 1,
&nh,
ntohl (mp->next_hop_sw_if_index),
next_hop_fib_index,
memset (&nh, 0, sizeof (nh));
memcpy (&nh.ip6, mp->next_hop_address, sizeof (nh.ip6));
- return (add_del_route_t_handler (mp->is_multipath, mp->is_add, mp->is_drop, mp->is_local, mp->is_classify, mp->classify_table_index, mp->is_resolve_host, mp->is_resolve_attached, fib_index, &pfx, 0, // is_ip4
+ return (add_del_route_t_handler (mp->is_multipath,
+ mp->is_add,
+ mp->is_drop,
+ mp->is_unreach,
+ mp->is_prohibit,
+ mp->is_local,
+ mp->is_classify,
+ mp->classify_table_index,
+ mp->is_resolve_host,
+ mp->is_resolve_attached,
+ fib_index, &pfx, 0,
&nh, ntohl (mp->next_hop_sw_if_index),
next_hop_fib_index,
mp->next_hop_weight,
memcpy (&nh.ip6, mp->mr_next_hop, sizeof (nh.ip6));
return (add_del_route_t_handler (mp->mr_is_multipath, mp->mr_is_add, 0, // mp->is_drop,
+ 0, // mp->is_unreach,
+ 0, // mp->is_prohibit,
0, // mp->is_local,
mp->mr_is_classify,
mp->mr_classify_table_index,
vnet_main_t *vnm = vnet_get_main ();
vlib_main_t *vm = vlib_get_main ();
-#if DPDK > 0 && DPDK_VHOST_USER
- rv = dpdk_vhost_user_create_if (
-#else
- rv = vhost_user_create_if (
-#endif
- vnm, vm, (char *) mp->sock_filename,
- mp->is_server, &sw_if_index, (u64) ~ 0,
- mp->renumber, ntohl (mp->custom_dev_instance),
- (mp->use_custom_mac) ? mp->mac_address : NULL);
+ rv = vhost_user_create_if (vnm, vm, (char *) mp->sock_filename,
+ mp->is_server, &sw_if_index, (u64) ~ 0,
+ mp->renumber, ntohl (mp->custom_dev_instance),
+ (mp->use_custom_mac) ? mp->mac_address : NULL);
/* *INDENT-OFF* */
REPLY_MACRO2(VL_API_CREATE_VHOST_USER_IF_REPLY,
vnet_main_t *vnm = vnet_get_main ();
vlib_main_t *vm = vlib_get_main ();
-#if DPDK > 0 && DPDK_VHOST_USER
- rv = dpdk_vhost_user_modify_if (
-#else
- rv = vhost_user_modify_if (
-#endif
- vnm, vm, (char *) mp->sock_filename,
- mp->is_server, sw_if_index, (u64) ~ 0,
- mp->renumber, ntohl (mp->custom_dev_instance));
+ rv = vhost_user_modify_if (vnm, vm, (char *) mp->sock_filename,
+ mp->is_server, sw_if_index, (u64) ~ 0,
+ mp->renumber, ntohl (mp->custom_dev_instance));
REPLY_MACRO (VL_API_MODIFY_VHOST_USER_IF_REPLY);
}
vnet_main_t *vnm = vnet_get_main ();
vlib_main_t *vm = vlib_get_main ();
-#if DPDK > 0 && DPDK_VHOST_USER
- rv = dpdk_vhost_user_delete_if (vnm, vm, sw_if_index);
-#else
rv = vhost_user_delete_if (vnm, vm, sw_if_index);
-#endif
REPLY_MACRO (VL_API_DELETE_VHOST_USER_IF_REPLY);
if (!rv)
if (q == 0)
return;
-#if DPDK > 0 && DPDK_VHOST_USER
- rv = dpdk_vhost_user_dump_ifs (vnm, vm, &ifaces);
-#else
rv = vhost_user_dump_ifs (vnm, vm, &ifaces);
-#endif
if (rv)
return;