diff options
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index fc0df09df8..6785151705 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -54,6 +54,7 @@ #include "zebra/zebra_vxlan_private.h" #include "zebra/zebra_pbr.h" #include "zebra/zebra_nhg.h" +#include "zebra/zebra_evpn_mh.h" #include "zebra/interface.h" #include "northbound_cli.h" #include "zebra/zebra_nb.h" @@ -203,6 +204,14 @@ static char re_status_output_char(const struct route_entry *re, star_p = true; } + if (zrouter.asic_offloaded + && CHECK_FLAG(re->flags, ZEBRA_FLAG_TRAPPED)) + return 't'; + + if (zrouter.asic_offloaded + && !CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED)) + return 'o'; + if (star_p) return '*'; else @@ -854,6 +863,12 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn, if (CHECK_FLAG(re->status, ROUTE_ENTRY_QUEUED)) json_object_boolean_true_add(json_route, "queued"); + if (CHECK_FLAG(re->flags, ZEBRA_FLAG_TRAPPED)) + json_object_boolean_true_add(json_route, "trapped"); + + if (CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED)) + json_object_boolean_true_add(json_route, "offloaded"); + if (re->tag) json_object_int_add(json_route, "tag", re->tag); @@ -1285,13 +1300,10 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe) struct nhg_connected *rb_node_dep = NULL; struct nexthop_group *backup_nhg; - vty_out(vty, "ID: %u\n", nhe->id); + vty_out(vty, "ID: %u (%s)\n", nhe->id, zebra_route_string(nhe->type)); vty_out(vty, " RefCnt: %d\n", nhe->refcnt); vty_out(vty, " VRF: %s\n", vrf_id_to_name(nhe->vrf_id)); - if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_UNHASHABLE)) - vty_out(vty, " Duplicate - from kernel not hashable\n"); - if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_VALID)) { vty_out(vty, " Valid"); if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)) @@ -1554,6 +1566,17 @@ DEFPY_HIDDEN(nexthop_group_use_enable, return CMD_SUCCESS; } +DEFPY_HIDDEN(proto_nexthop_group_only, proto_nexthop_group_only_cmd, + "[no] zebra nexthop proto only", + NO_STR ZEBRA_STR + "Nexthop configuration\n" + "Configure exclusive use of proto nexthops\n" + "Only use proto nexthops\n") +{ + zebra_nhg_set_proto_nexthops_only(!no); + return CMD_SUCCESS; +} + DEFUN (no_ip_nht_default_route, no_ip_nht_default_route_cmd, "no ip nht resolve-via-default", @@ -2355,6 +2378,33 @@ DEFUN (show_vrf, return CMD_SUCCESS; } +DEFPY (evpn_mh_mac_holdtime, + evpn_mh_mac_holdtime_cmd, + "[no$no] evpn mh mac-holdtime (0-86400)$duration", + NO_STR + "EVPN\n" + "Multihoming\n" + "MAC hold time\n" + "Duration in seconds\n") +{ + return zebra_evpn_mh_mac_holdtime_update(vty, duration, + no ? true : false); +} + +DEFPY (evpn_mh_neigh_holdtime, + evpn_mh_neigh_holdtime_cmd, + "[no$no] evpn mh neigh-holdtime (0-86400)$duration", + NO_STR + "EVPN\n" + "Multihoming\n" + "Neighbor entry hold time\n" + "Duration in seconds\n") +{ + + return zebra_evpn_mh_neigh_holdtime_update(vty, duration, + no ? true : false); +} + DEFUN (default_vrf_vni_mapping, default_vrf_vni_mapping_cmd, "vni " CMD_VNI_RANGE "[prefix-routes-only]", @@ -3403,10 +3453,15 @@ static int config_write_protocol(struct vty *vty) /* Include dataplane info */ dplane_config_write_helper(vty); + zebra_evpn_mh_config_write(vty); + /* Include nexthop-group config */ if (!zebra_nhg_kernel_nexthops_enabled()) vty_out(vty, "no zebra nexthop kernel enable\n"); + if (zebra_nhg_proto_nexthops_only()) + vty_out(vty, "zebra nexthop proto only\n"); + #ifdef HAVE_NETLINK /* Include netlink info */ netlink_config_write_helper(vty); @@ -3423,6 +3478,9 @@ DEFUN (show_zebra, { struct vrf *vrf; + if (zrouter.asic_offloaded) + vty_out(vty, "Asic Offload is being used\n"); + vty_out(vty, " Route Route Neighbor LSP LSP\n"); vty_out(vty, @@ -3838,6 +3896,7 @@ void zebra_vty_init(void) install_element(CONFIG_NODE, &zebra_packet_process_cmd); install_element(CONFIG_NODE, &no_zebra_packet_process_cmd); install_element(CONFIG_NODE, &nexthop_group_use_enable_cmd); + install_element(CONFIG_NODE, &proto_nexthop_group_only_cmd); install_element(VIEW_NODE, &show_nexthop_group_cmd); install_element(VIEW_NODE, &show_interface_nexthop_group_cmd); @@ -3899,6 +3958,8 @@ void zebra_vty_init(void) install_element(VIEW_NODE, &show_pbr_ipset_cmd); install_element(VIEW_NODE, &show_pbr_iptable_cmd); + install_element(CONFIG_NODE, &evpn_mh_mac_holdtime_cmd); + install_element(CONFIG_NODE, &evpn_mh_neigh_holdtime_cmd); install_element(CONFIG_NODE, &default_vrf_vni_mapping_cmd); install_element(CONFIG_NODE, &no_default_vrf_vni_mapping_cmd); install_element(VRF_NODE, &vrf_vni_mapping_cmd); |
