* via a DVR.
*/
FIB_PATH_TYPE_DVR,
- /**
- * Marker. Add new types before this one, then update it.
- */
- FIB_PATH_TYPE_LAST = FIB_PATH_TYPE_BIER_FMASK,
} __attribute__ ((packed)) fib_path_type_t;
-/**
- * The maximum number of path_types
- */
-#define FIB_PATH_TYPE_MAX (FIB_PATH_TYPE_LAST + 1)
-
#define FIB_PATH_TYPES { \
[FIB_PATH_TYPE_ATTACHED_NEXT_HOP] = "attached-nexthop", \
[FIB_PATH_TYPE_ATTACHED] = "attached", \
[FIB_PATH_TYPE_DVR] = "dvr", \
}
-#define FOR_EACH_FIB_PATH_TYPE(_item) \
- for (_item = FIB_PATH_TYPE_FIRST; \
- _item <= FIB_PATH_TYPE_LAST; \
- _item++)
-
/**
* Enurmeration of path operational (i.e. derived) attributes
*/
* The path is resolved
*/
FIB_PATH_OPER_ATTRIBUTE_RESOLVED,
- /**
- * The path is attached, despite what the next-hop may say.
- */
- FIB_PATH_OPER_ATTRIBUTE_ATTACHED,
/**
* The path has become a permanent drop.
*/
FIB_PATH_OPER_FLAG_RECURSIVE_LOOP = (1 << FIB_PATH_OPER_ATTRIBUTE_RECURSIVE_LOOP),
FIB_PATH_OPER_FLAG_DROP = (1 << FIB_PATH_OPER_ATTRIBUTE_DROP),
FIB_PATH_OPER_FLAG_RESOLVED = (1 << FIB_PATH_OPER_ATTRIBUTE_RESOLVED),
- FIB_PATH_OPER_FLAG_ATTACHED = (1 << FIB_PATH_OPER_ATTRIBUTE_ATTACHED),
} __attribute__ ((packed)) fib_path_oper_flags_t;
/**
u32 fp_interface;
} attached_next_hop;
struct {
+ /**
+ * The Connected local address
+ */
+ fib_prefix_t fp_connected;
/**
* The interface
*/
mpls_eos_bit_t fp_eos;
};
} fp_nh;
- union {
- /**
- * The FIB table index in which to find the next-hop.
- */
- fib_node_index_t fp_tbl_id;
- /**
- * The BIER FIB the fmask is in
- */
- index_t fp_bier_fib;
- };
+ /**
+ * The FIB table index in which to find the next-hop.
+ */
+ fib_node_index_t fp_tbl_id;
} recursive;
struct {
/**
STRUCT_MARK(path_hash_end);
/**
- * Memebers in this last section represent information that is
+ * Members in this last section represent information that is
* dervied during resolution. It should not be copied to new paths
* nor compared.
*/
ai = adj_glean_add_or_lock(nh_proto, link,
path->attached.fp_interface,
- NULL);
+ &path->attached.fp_connected);
dpo_set(dpo, DPO_ADJACENCY_GLEAN, vnet_link_to_dpo_proto(link), ai);
adj_unlock(ai);
}
&path->fp_dpo);
}
if ((FIB_NODE_BW_REASON_FLAG_ADJ_UPDATE & ctx->fnbw_reason) ||
+ (FIB_NODE_BW_REASON_FLAG_ADJ_MTU & ctx->fnbw_reason) ||
(FIB_NODE_BW_REASON_FLAG_ADJ_DOWN & ctx->fnbw_reason))
{
/*
cfg_flags |= FIB_PATH_CFG_FLAG_ICMP_UNREACH;
if (rpath->frp_flags & FIB_ROUTE_PATH_ICMP_PROHIBIT)
cfg_flags |= FIB_PATH_CFG_FLAG_ICMP_PROHIBIT;
+ if (rpath->frp_flags & FIB_ROUTE_PATH_GLEAN)
+ cfg_flags |= FIB_PATH_CFG_FLAG_GLEAN;
return (cfg_flags);
}
path->fp_type = FIB_PATH_TYPE_SPECIAL;
path->classify.fp_classify_table_id = rpath->frp_classify_table_id;
}
+ else if (path->fp_cfg_flags & FIB_PATH_CFG_FLAG_GLEAN)
+ {
+ path->fp_type = FIB_PATH_TYPE_ATTACHED;
+ path->attached.fp_interface = rpath->frp_sw_if_index;
+ path->attached.fp_connected = rpath->frp_connected;
+ }
else if (~0 != rpath->frp_sw_if_index)
{
if (ip46_address_is_zero(&rpath->frp_addr))
break;
}
case FIB_PATH_TYPE_DVR:
- dvr_dpo_add_or_lock(path->attached.fp_interface,
+ dvr_dpo_add_or_lock(path->dvr.fp_interface,
path->fp_nh_proto,
&path->fp_dpo);
break;
else
{
vlib_cli_output (vm, "FIB Paths");
- pool_foreach_index (pi, fib_path_pool,
- ({
+ pool_foreach_index (pi, fib_path_pool)
+ {
vlib_cli_output (vm, "%U", format_fib_path, pi, 0,
FIB_PATH_FORMAT_FLAGS_NONE);
- }));
+ }
}
return (NULL);