"Zebra interface type gre.";
}
- /*
- * Multicast RPF mode configurable type
- */
-
- typedef mcast-rpf-lookup-mode {
- type enumeration {
- enum "none" {
- value 0;
- description
- "No mode set.";
- }
- enum "mrib-only" {
- value 1;
- description
- "Lookup in unicast RIB only.";
- }
- enum "urib-only" {
- value 2;
- description
- "Lookup in multicast RIB only.";
- }
- enum "mrib-then-urib" {
- value 3;
- description
- "Try multicast RIB first, fall back to unicast RIB.";
- }
- enum "lower-distance" {
- value 4;
- description
- "Lookup both unicast and mcast, use entry with lower distance.";
- }
- enum "longer-prefix" {
- value 5;
- description
- "Lookup both unicast and mcast, use entry with longer prefix.";
- }
- }
- description
- "Multicast RPF lookup behavior";
- }
-
// End of ip6-route
/*
* VxLAN Network Identifier type
container zebra {
description
"Data model for the Zebra daemon.";
- leaf mcast-rpf-lookup {
- type frr-zebra:mcast-rpf-lookup-mode;
- default "mrib-then-urib";
- description
- "Multicast RPF lookup behavior.";
- }
leaf ip-forwarding {
type boolean;
description
RB_PROTOTYPE(zebra_router_table_head, zebra_router_table,
zebra_router_table_entry, zebra_router_table_entry_compare)
-/* RPF lookup behaviour */
-enum multicast_mode {
- MCAST_NO_CONFIG = 0, /* MIX_MRIB_FIRST, but no show in config write */
- MCAST_MRIB_ONLY, /* MRIB only */
- MCAST_URIB_ONLY, /* URIB only */
- MCAST_MIX_MRIB_FIRST, /* MRIB, if nothing at all then URIB */
- MCAST_MIX_DISTANCE, /* MRIB & URIB, lower distance wins */
- MCAST_MIX_PFXLEN, /* MRIB & URIB, longer prefix wins */
- /* on equal value, MRIB wins for last 2 */
-};
-
/* An interface can be error-disabled if a protocol (such as EVPN or
* VRRP) detects a problem with keeping it operationally-up.
* If any of the protodown bits are set protodown-on is programmed
uint32_t multipath_num;
- /* RPF Lookup behavior */
- enum multicast_mode ipv4_multicast_mode;
-
/*
* zebra start time and time of sweeping RIB of old routes
*/
: zebra_vrf_lookup_by_id(VRF_DEFAULT);
}
-extern void multicast_mode_ipv4_set(enum multicast_mode mode);
-
-extern enum multicast_mode multicast_mode_ipv4_get(void);
-
extern bool zebra_router_notify_on_ack(void);
static inline void zebra_router_set_supports_nhgs(bool support)
const struct route_entry *re,
unsigned int num);
-DEFUN (ip_multicast_mode,
- ip_multicast_mode_cmd,
- "ip multicast rpf-lookup-mode <urib-only|mrib-only|mrib-then-urib|lower-distance|longer-prefix>",
- IP_STR
- "Multicast options\n"
- "RPF lookup behavior\n"
- "Lookup in unicast RIB only\n"
- "Lookup in multicast RIB only\n"
- "Try multicast RIB first, fall back to unicast RIB\n"
- "Lookup both, use entry with lower distance\n"
- "Lookup both, use entry with longer prefix\n")
-{
- char *mode = argv[3]->text;
-
- if (strmatch(mode, "urib-only"))
- multicast_mode_ipv4_set(MCAST_URIB_ONLY);
- else if (strmatch(mode, "mrib-only"))
- multicast_mode_ipv4_set(MCAST_MRIB_ONLY);
- else if (strmatch(mode, "mrib-then-urib"))
- multicast_mode_ipv4_set(MCAST_MIX_MRIB_FIRST);
- else if (strmatch(mode, "lower-distance"))
- multicast_mode_ipv4_set(MCAST_MIX_DISTANCE);
- else if (strmatch(mode, "longer-prefix"))
- multicast_mode_ipv4_set(MCAST_MIX_PFXLEN);
- else {
- vty_out(vty, "Invalid mode specified\n");
- return CMD_WARNING_CONFIG_FAILED;
- }
-
- return CMD_SUCCESS;
-}
-
-DEFUN (no_ip_multicast_mode,
- no_ip_multicast_mode_cmd,
- "no ip multicast rpf-lookup-mode [<urib-only|mrib-only|mrib-then-urib|lower-distance|longer-prefix>]",
- NO_STR
- IP_STR
- "Multicast options\n"
- "RPF lookup behavior\n"
- "Lookup in unicast RIB only\n"
- "Lookup in multicast RIB only\n"
- "Try multicast RIB first, fall back to unicast RIB\n"
- "Lookup both, use entry with lower distance\n"
- "Lookup both, use entry with longer prefix\n")
-{
- multicast_mode_ipv4_set(MCAST_NO_CONFIG);
- return CMD_SUCCESS;
-}
-
-
DEFPY (show_ip_rpf,
show_ip_rpf_cmd,
"show [ip$ip|ipv6$ipv6] rpf [json]",
struct route_node *rn;
struct route_entry *re;
- re = rib_match_multicast(AFI_IP, VRF_DEFAULT, (union g_addr *)&address,
- &rn);
+ re = rib_match(AFI_IP, SAFI_MULTICAST, VRF_DEFAULT, (union g_addr *)&address, &rn);
if (re)
vty_show_ip_route_detail(vty, rn, 1, false, false);
struct route_node *rn;
struct route_entry *re;
- re = rib_match_multicast(AFI_IP6, VRF_DEFAULT, (union g_addr *)&address,
- &rn);
+ re = rib_match(AFI_IP6, SAFI_MULTICAST, VRF_DEFAULT, (union g_addr *)&address, &rn);
if (re)
vty_show_ip_route_detail(vty, rn, 1, false, false);
vty_out(vty, "zebra zapi-packets %u\n",
zrouter.packets_to_process);
- enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get();
-
- if (ipv4_multicast_mode != MCAST_NO_CONFIG)
- vty_out(vty, "ip multicast rpf-lookup-mode %s\n",
- ipv4_multicast_mode == MCAST_URIB_ONLY
- ? "urib-only"
- : ipv4_multicast_mode == MCAST_MRIB_ONLY
- ? "mrib-only"
- : ipv4_multicast_mode
- == MCAST_MIX_MRIB_FIRST
- ? "mrib-then-urib"
- : ipv4_multicast_mode
- == MCAST_MIX_DISTANCE
- ? "lower-distance"
- : "longer-prefix");
-
/* Include dataplane info */
dplane_config_write_helper(vty);
install_element(CONFIG_NODE, &allow_external_route_update_cmd);
install_element(CONFIG_NODE, &no_allow_external_route_update_cmd);
- install_element(CONFIG_NODE, &ip_multicast_mode_cmd);
- install_element(CONFIG_NODE, &no_ip_multicast_mode_cmd);
-
install_element(CONFIG_NODE, &zebra_nexthop_group_keep_cmd);
install_element(CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
install_element(CONFIG_NODE, &no_ip_zebra_import_table_cmd);