-route::path
-from_vpp(const vapi_type_fib_path& p, const nh_proto_t& nhp)
-{
- if (p.is_local) {
- return route::path(route::path::special_t::LOCAL);
- } else if (p.is_drop) {
- return route::path(route::path::special_t::DROP);
- } else if (p.is_unreach) {
- return route::path(route::path::special_t::UNREACH);
- } else if (p.is_prohibit) {
- return route::path(route::path::special_t::PROHIBIT);
- } else {
- boost::asio::ip::address address =
- from_bytes(nh_proto_t::IPV6 == nhp, p.next_hop);
- std::shared_ptr<interface> itf = interface::find(p.sw_if_index);
- if (itf) {
- if (p.is_dvr) {
- return route::path(*itf, nhp, route::path::flags_t::DVR, p.weight,
- p.preference);
- } else {
- return route::path(address, *itf, p.weight, p.preference);
- }
- } else {
- std::shared_ptr<route_domain> rd = route_domain::find(p.table_id);
- if (rd) {
- return route::path(*rd, address, p.weight, p.preference);