diff options
| author | Anuradha Karuppiah <anuradhak@nvidia.com> | 2021-12-18 10:34:31 -0800 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-06-27 07:56:55 -0400 | 
| commit | 59f47eb0107517f417820d82db1226d011113039 (patch) | |
| tree | 8c064b7e198417fcc80134338f5cea43e082b5e9 /zebra/zebra_vty.c | |
| parent | 4cf4fad15307fab9e21dd228fc7f80be4da801c2 (diff) | |
zebra: expand pbr rule action for dataplane programming
PBR rules are installed as match, action rules in most dataplanes. This
requires the action to be resolved via a GW. And the GW to be subsequently
resolved to {SMAC, DMAC}.
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 27 | 
1 files changed, 27 insertions, 0 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 0725d19677..440e4fce62 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -3652,6 +3652,29 @@ DEFUN (show_pbr_iptable,  	return CMD_SUCCESS;  } +/* policy routing contexts */ +DEFPY (show_pbr_rule, +       show_pbr_rule_cmd, +       "show pbr rule", +       SHOW_STR +       "Policy-Based Routing\n" +       "Rule\n") +{ +	zebra_pbr_show_rule(vty); +	return CMD_SUCCESS; +} + +DEFPY (pbr_nexthop_resolve, +       pbr_nexthop_resolve_cmd, +       "[no$no] pbr nexthop-resolve", +       NO_STR +       "Policy Based Routing\n" +       "Resolve nexthop for dataplane programming\n") +{ +	zebra_pbr_expand_action_update(!no); +	return CMD_SUCCESS; +} +  DEFPY (clear_evpn_dup_addr,         clear_evpn_dup_addr_cmd,         "clear evpn dup-addr vni <all$vni_all |" CMD_VNI_RANGE"$vni [mac X:X:X:X:X:X | ip <A.B.C.D|X:X::X:X>]>", @@ -3922,6 +3945,8 @@ static int config_write_protocol(struct vty *vty)  	zebra_evpn_mh_config_write(vty); +	zebra_pbr_config_write(vty); +  	/* Include nexthop-group config */  	if (!zebra_nhg_kernel_nexthops_enabled())  		vty_out(vty, "no zebra nexthop kernel enable\n"); @@ -4543,6 +4568,8 @@ void zebra_vty_init(void)  	install_element(VIEW_NODE, &show_pbr_ipset_cmd);  	install_element(VIEW_NODE, &show_pbr_iptable_cmd); +	install_element(VIEW_NODE, &show_pbr_rule_cmd); +	install_element(CONFIG_NODE, &pbr_nexthop_resolve_cmd);  	install_element(VIEW_NODE, &show_route_zebra_dump_cmd);  	install_element(CONFIG_NODE, &evpn_mh_mac_holdtime_cmd);  | 
