From 54611ed46bc611f9487ba6ed0f8f3dd2395dd8a5 Mon Sep 17 00:00:00 2001 From: Indu Suresh Date: Mon, 16 Sep 2024 13:25:36 -0700 Subject: [PATCH] Add support to show clientID of the routes programmed Summary: as $title show route details CLI today shows nexthop details from multiple clientIds. Adding support to print client name for user-friendly purposes. Reviewed By: Linerd, xiangxu1121 Differential Revision: D62760599 fbshipit-source-id: fd7c21188ce236ff97cbf72021fcb08b15fbf719 --- fboss/cli/fboss2/BUCK | 440 +++++++++--------- .../commands/show/route/CmdShowRouteDetails.h | 6 +- .../fboss2/test/CmdShowRouteDetailsTest.cpp | 4 +- 3 files changed, 226 insertions(+), 224 deletions(-) diff --git a/fboss/cli/fboss2/BUCK b/fboss/cli/fboss2/BUCK index 4bd85fb806335..97c5c54b51bfe 100644 --- a/fboss/cli/fboss2/BUCK +++ b/fboss/cli/fboss2/BUCK @@ -461,227 +461,227 @@ cpp_library( "utils/clients/BmcClient.h", ], exported_deps = [ - "fbcode//common/base:build_info", - "fbcode//common/config:configerator", - "fbcode//common/http_client:http_client", - "fbcode//common/network:util", - "fbcode//common/smc/cpp:util", - "fbcode//common/smc/if:Smc2-cpp2-clients", - "fbcode//common/smc/if:Smc2-cpp2-services", - "fbcode//common/strings:string_util", - "fbcode//common/thrift/thrift:monitor-cpp2-clients", - "fbcode//common/time:time_core", - "fbcode//configerator/structs/neteng/ai/te_agent:te_agent_config-cpp2-types", - "fbcode//configerator/structs/neteng/bgp_policy/thrift:rib_policy-cpp2-types", - "fbcode//configerator/structs/neteng/fboss/bgp:bgp_config-cpp2-types", - "fbcode//configerator/structs/neteng/fboss/bgp/if:bgp_attr-cpp2-types", - "fbcode//configerator/structs/neteng/fboss/push/forwarding_stack:fbpkg_map-cpp2-types", - "fbcode//configerator/structs/neteng/netwhoami:netwhoami-cpp2-types", - "fbcode//employee/if:thrift-cpp2-services", - "fbcode//employee/if:thrift-cpp2-types", - "fbcode//fastcli:utils-cpp", - "fbcode//fboss/agent:address_utils", - "fbcode//fboss/agent/hw:hardware_stats-cpp2-types", - "fbcode//fboss/agent/if:common-cpp2-types", - "fbcode//fboss/agent/if:ctrl-cpp2-clients", - "fbcode//fboss/agent/if:ctrl-cpp2-services", - "fbcode//fboss/agent/if:ctrl-cpp2-types", - "fbcode//fboss/agent/if:fboss-cpp2-types", - "fbcode//fboss/agent/if:fboss-cpp2-visitation", - "fbcode//fboss/agent/if:hw_ctrl-cpp2-services", - "fbcode//fboss/agent/if:hw_ctrl-cpp2-types", - "fbcode//fboss/cli/fboss2:cli-cpp2-types", - "fbcode//fboss/cli/fboss2:cmd-common-utils", - "fbcode//fboss/cli/fboss2:cmd-global-options", - "fbcode//fboss/cli/fboss2:cmd-handler", - "fbcode//fboss/cli/fboss2:cmd-local-options", - "fbcode//fboss/cli/fboss2:cmd-subcommands", - "fbcode//fboss/cli/fboss2:commands-show-bgp", - "fbcode//fboss/cli/fboss2:table-utils", - "fbcode//fboss/cli/fboss2/commands/facebook/rage:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/facebook/rage:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/acl:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/acl:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/agent:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/agent:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/aggregateport:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/aggregateport:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/arp:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/arp:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/cpuport:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/dsf/subscription:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/dsf/subscription:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/dsfnodes:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/dsfnodes:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/fabric:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/fabric:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/fabric/reachability:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/fabric/reachability:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/fabric/topology:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/fabric/topology:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/bgp/summary:bgp_summary-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/bgp/summary:bgp_summary-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/bgp/techsupport:bgp_techsupport-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/bmc:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/bmc:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/debugdump:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment/fan:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment/fan:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment/power:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment/power:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment/sensor:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment/temperature:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/environment/temperature:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/example:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/example:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/openr:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/state:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/state:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/teagent/flowroutes:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/techsupport:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/vip/fib:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/vip/fib:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/vip/injectors:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/vip/injectors:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/vip/overview:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/vip/overview:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/facebook/vip/prefixes:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/facebook/vip/prefixes:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/flowlet:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/hardware:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/hardware:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/host:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/hwagent:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/capabilities:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/capabilities:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/fec/ber:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/fec/ber:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/fec/histogram:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/fec/histogram:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/fec/tail:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/fec/tail:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/fec/uncorrectable:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/fec/uncorrectable:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/mka:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/counters/mka:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/errors:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/errors:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/flaps:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/flaps:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/phy:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/phy:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/phymap:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/phymap:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/prbs/capabilities:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/prbs/capabilities:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/prbs/state:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/prbs/state:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/prbs/stats:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/prbs/stats:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/status:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/status:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/interface/traffic:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/interface/traffic:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/lldp:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/lldp:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/mac:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/mac:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/mirror:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/mpls:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/ndp:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/ndp:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/port:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/port:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/product:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/rif:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/rif:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/route:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/route:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/systemport:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/systemport:model-cpp2-visitation", - "fbcode//fboss/cli/fboss2/commands/show/teflow:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/transceiver:model-cpp2-types", - "fbcode//fboss/cli/fboss2/commands/show/transceiver:model-cpp2-visitation", - "fbcode//fboss/fsdb/if:fsdb-cpp2-services", - "fbcode//fboss/fsdb/if:fsdb_common-cpp2-types", - "fbcode//fboss/fsdb/if:fsdb_model", - "fbcode//fboss/fsdb/if:fsdb_oper-cpp2-types", - "fbcode//fboss/fsdb/if:fsdb_oper-cpp2-visitation", - "fbcode//fboss/led_service/if:led_service-cpp2-services", - "fbcode//fboss/lib/phy:phy-cpp2-types", - "fbcode//fboss/lib/phy:phy-cpp2-visitation", - "fbcode//fboss/lib/phy:prbs-cpp2-types", - "fbcode//fboss/lib/phy:prbs-cpp2-visitation", - "fbcode//fboss/mka_service/if:mka_structs-cpp2-types", - "fbcode//fboss/mka_service/if/facebook:mka_service_thrift-cpp2-services", - "fbcode//fboss/platform/data_corral_service/if:data_corral_service-cpp2-services", - "fbcode//fboss/platform/fan_service/if:fan_service-cpp2-services", - "fbcode//fboss/platform/rackmon/if:rackmonsvc-cpp2-services", - "fbcode//fboss/platform/sensor_service/if:sensor_service-cpp2-services", - "fbcode//fboss/qsfp_service/if:qsfp-cpp2-services", - "fbcode//fboss/qsfp_service/if:transceiver-cpp2-types", - "fbcode//folly:conv", - "fbcode//folly:exception", - "fbcode//folly:format", - "fbcode//folly:network_address", - "fbcode//folly:range", - "fbcode//folly:stop_watch", - "fbcode//folly:string", - "fbcode//folly/container:access", - "fbcode//folly/executors:io_thread_pool_executor", - "fbcode//folly/experimental/coro:async_pipe", - "fbcode//folly/experimental/coro:blocking_wait", - "fbcode//folly/experimental/coro:task", - "fbcode//folly/gen:base", - "fbcode//folly/json:dynamic", - "fbcode//folly/logging:logging", - "fbcode//folly/testing:test_util", - "fbcode//neteng/ai/te_agent/if:TeAgent-cpp2-services", - "fbcode//neteng/fboss/bgp/if:bgp_stream-cpp2-services", - "fbcode//neteng/fboss/bgp/if:bgp_stream-cpp2-types", - "fbcode//neteng/fboss/bgp/if:bgp_thrift-cpp2-services", - "fbcode//neteng/fboss/bgp/if:bgp_thrift-cpp2-types", - "fbcode//neteng/fboss/coop/if:coop_thrift-cpp2-services", - "fbcode//neteng/fboss/coop/if:coop_thrift-cpp2-types", - "fbcode//neteng/fboss/drain/local_drainer/server:thrift-cpp2-clients", - "fbcode//neteng/netwhoami/lib/cpp:client", - "fbcode//neteng/netwhoami/lib/cpp:recover", - "fbcode//neteng/routing/policy/if:policy_thrift-cpp2-types", - "fbcode//nettools/bgplib:bgp_parser", - "fbcode//nettools/bgplib:bgplib", - "fbcode//nettools/bgplib/if:bgp-structs-cpp2-types", - "fbcode//nettools/skynet/if:query-cpp2-types", - "fbcode//nettools/skynet/if:skynet_structs-cpp2-types", - "fbcode//nettools/skynet/lib/cpp:skynet_thrift_client", - "fbcode//nettools/vipinjector/vip_service/if:vip_service-cpp2-services", - "fbcode//nettools/vipinjector/vip_service/if:vip_service-cpp2-types", - "fbcode//openr/common:network_util", - "fbcode//openr/if:if-cpp-cpp2-clients", - "fbcode//openr/if:if-cpp-cpp2-services", - "fbcode//openr/if:if-cpp2-types", - "fbcode//openr/if:kvstore-cpp2-types", - "fbcode//openr/if:network-cpp2-types", - "fbcode//openr/if:openr_config-cpp2-types", - "fbcode//openr/if:types-cpp2-types", - "fbcode//scribe/client:scribe_client_no_sr", - "fbcode//servicerouter/client/cpp2:cpp2", - "fbcode//task/if:if-cpp2-services", - "fbcode//thrift/lib/cpp/transport:transport-core", - "fbcode//thrift/lib/cpp/util:enum_utils", - "fbcode//thrift/lib/cpp2/async:client_buferred_stream", - "fbcode//thrift/lib/cpp2/async:header_client_channel", - "fbcode//thrift/lib/cpp2/folly_dynamic:folly_dynamic", - "fbcode//thrift/lib/cpp2/gen:module_types_h", - "fbcode//thrift/lib/cpp2/protocol:protocol", "fbsource//third-party/fmt:fmt", + ":cli-cpp2-types", + ":cmd-common-utils", + ":cmd-global-options", + ":cmd-handler", + ":cmd-local-options", + ":cmd-subcommands", + ":commands-show-bgp", + ":table-utils", + "//common/base:build_info", + "//common/config:configerator", + "//common/http_client:http_client", + "//common/network:util", + "//common/smc/cpp:util", + "//common/smc/if:Smc2-cpp2-clients", + "//common/smc/if:Smc2-cpp2-services", + "//common/strings:string_util", + "//common/thrift/thrift:monitor-cpp2-clients", + "//common/time:time_core", + "//configerator/structs/neteng/ai/te_agent:te_agent_config-cpp2-types", + "//configerator/structs/neteng/bgp_policy/thrift:rib_policy-cpp2-types", + "//configerator/structs/neteng/fboss/bgp:bgp_config-cpp2-types", + "//configerator/structs/neteng/fboss/bgp/if:bgp_attr-cpp2-types", + "//configerator/structs/neteng/fboss/push/forwarding_stack:fbpkg_map-cpp2-types", + "//configerator/structs/neteng/netwhoami:netwhoami-cpp2-types", + "//employee/if:thrift-cpp2-services", + "//employee/if:thrift-cpp2-types", + "//fastcli:utils-cpp", + "//fboss/agent:address_utils", + "//fboss/agent/hw:hardware_stats-cpp2-types", + "//fboss/agent/if:common-cpp2-types", + "//fboss/agent/if:ctrl-cpp2-clients", + "//fboss/agent/if:ctrl-cpp2-services", + "//fboss/agent/if:ctrl-cpp2-types", + "//fboss/agent/if:fboss-cpp2-types", + "//fboss/agent/if:fboss-cpp2-visitation", + "//fboss/agent/if:hw_ctrl-cpp2-services", + "//fboss/agent/if:hw_ctrl-cpp2-types", + "//fboss/cli/fboss2/commands/facebook/rage:model-cpp2-types", + "//fboss/cli/fboss2/commands/facebook/rage:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/acl:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/acl:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/agent:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/agent:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/aggregateport:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/aggregateport:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/arp:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/arp:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/cpuport:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/dsf/subscription:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/dsf/subscription:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/dsfnodes:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/dsfnodes:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/fabric:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/fabric:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/fabric/reachability:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/fabric/reachability:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/fabric/topology:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/fabric/topology:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/bgp/summary:bgp_summary-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/bgp/summary:bgp_summary-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/bgp/techsupport:bgp_techsupport-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/bmc:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/bmc:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/debugdump:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/environment:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/environment:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/environment/fan:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/environment/fan:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/environment/power:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/environment/power:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/environment/sensor:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/environment/temperature:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/environment/temperature:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/example:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/example:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/openr:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/state:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/state:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/teagent/flowroutes:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/techsupport:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/vip/fib:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/vip/fib:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/vip/injectors:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/vip/injectors:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/vip/overview:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/vip/overview:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/facebook/vip/prefixes:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/facebook/vip/prefixes:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/flowlet:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/hardware:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/hardware:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/host:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/hwagent:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/capabilities:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/capabilities:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/counters:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/counters:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/counters/fec/ber:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/counters/fec/ber:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/counters/fec/histogram:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/counters/fec/histogram:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/counters/fec/tail:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/counters/fec/tail:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/counters/fec/uncorrectable:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/counters/fec/uncorrectable:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/counters/mka:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/counters/mka:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/errors:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/errors:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/flaps:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/flaps:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/phy:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/phy:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/phymap:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/phymap:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/prbs/capabilities:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/prbs/capabilities:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/prbs/state:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/prbs/state:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/prbs/stats:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/prbs/stats:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/status:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/status:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/interface/traffic:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/interface/traffic:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/lldp:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/lldp:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/mac:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/mac:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/mirror:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/mpls:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/ndp:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/ndp:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/port:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/port:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/product:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/rif:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/rif:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/route:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/route:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/systemport:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/systemport:model-cpp2-visitation", + "//fboss/cli/fboss2/commands/show/teflow:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/transceiver:model-cpp2-types", + "//fboss/cli/fboss2/commands/show/transceiver:model-cpp2-visitation", + "//fboss/fsdb/if:fsdb-cpp2-services", + "//fboss/fsdb/if:fsdb_common-cpp2-types", + "//fboss/fsdb/if:fsdb_model", + "//fboss/fsdb/if:fsdb_oper-cpp2-types", + "//fboss/fsdb/if:fsdb_oper-cpp2-visitation", + "//fboss/led_service/if:led_service-cpp2-services", + "//fboss/lib/phy:phy-cpp2-types", + "//fboss/lib/phy:phy-cpp2-visitation", + "//fboss/lib/phy:prbs-cpp2-types", + "//fboss/lib/phy:prbs-cpp2-visitation", + "//fboss/mka_service/if:mka_structs-cpp2-types", + "//fboss/mka_service/if/facebook:mka_service_thrift-cpp2-services", + "//fboss/platform/data_corral_service/if:data_corral_service-cpp2-services", + "//fboss/platform/fan_service/if:fan_service-cpp2-services", + "//fboss/platform/rackmon/if:rackmonsvc-cpp2-services", + "//fboss/platform/sensor_service/if:sensor_service-cpp2-services", + "//fboss/qsfp_service/if:qsfp-cpp2-services", + "//fboss/qsfp_service/if:transceiver-cpp2-types", + "//folly:conv", + "//folly:exception", + "//folly:format", + "//folly:network_address", + "//folly:range", + "//folly:stop_watch", + "//folly:string", + "//folly/container:access", + "//folly/coro:async_pipe", + "//folly/coro:blocking_wait", + "//folly/coro:task", + "//folly/executors:io_thread_pool_executor", + "//folly/gen:base", + "//folly/json:dynamic", + "//folly/logging:logging", + "//folly/testing:test_util", + "//neteng/ai/te_agent/if:TeAgent-cpp2-services", + "//neteng/fboss/bgp/if:bgp_stream-cpp2-services", + "//neteng/fboss/bgp/if:bgp_stream-cpp2-types", + "//neteng/fboss/bgp/if:bgp_thrift-cpp2-services", + "//neteng/fboss/bgp/if:bgp_thrift-cpp2-types", + "//neteng/fboss/coop/if:coop_thrift-cpp2-services", + "//neteng/fboss/coop/if:coop_thrift-cpp2-types", + "//neteng/fboss/drain/local_drainer/server:thrift-cpp2-clients", + "//neteng/netwhoami/lib/cpp:client", + "//neteng/netwhoami/lib/cpp:recover", + "//neteng/routing/policy/if:policy_thrift-cpp2-types", + "//nettools/bgplib:bgp_parser", + "//nettools/bgplib:bgplib", + "//nettools/bgplib/if:bgp-structs-cpp2-types", + "//nettools/skynet/if:query-cpp2-types", + "//nettools/skynet/if:skynet_structs-cpp2-types", + "//nettools/skynet/lib/cpp:skynet_thrift_client", + "//nettools/vipinjector/vip_service/if:vip_service-cpp2-services", + "//nettools/vipinjector/vip_service/if:vip_service-cpp2-types", + "//openr/common:network_util", + "//openr/if:if-cpp-cpp2-clients", + "//openr/if:if-cpp-cpp2-services", + "//openr/if:if-cpp2-types", + "//openr/if:kvstore-cpp2-types", + "//openr/if:network-cpp2-types", + "//openr/if:openr_config-cpp2-types", + "//openr/if:types-cpp2-types", + "//scribe/client:scribe_client_no_sr", + "//servicerouter/client/cpp2:cpp2", + "//task/if:if-cpp2-services", + "//thrift/lib/cpp/transport:transport-core", + "//thrift/lib/cpp/util:enum_utils", + "//thrift/lib/cpp2/async:client_buferred_stream", + "//thrift/lib/cpp2/async:header_client_channel", + "//thrift/lib/cpp2/folly_dynamic:folly_dynamic", + "//thrift/lib/cpp2/gen:module_types_h", + "//thrift/lib/cpp2/protocol:protocol", ], exported_external_deps = [ "re2", diff --git a/fboss/cli/fboss2/commands/show/route/CmdShowRouteDetails.h b/fboss/cli/fboss2/commands/show/route/CmdShowRouteDetails.h index be3f1c3ab595c..eb3eca440cd51 100644 --- a/fboss/cli/fboss2/commands/show/route/CmdShowRouteDetails.h +++ b/fboss/cli/fboss2/commands/show/route/CmdShowRouteDetails.h @@ -15,6 +15,7 @@ #include #include #include "fboss/agent/if/gen-cpp2/common_types.h" +#include "fboss/agent/if/gen-cpp2/ctrl_types.h" #include "fboss/cli/fboss2/CmdHandler.h" #include "fboss/cli/fboss2/commands/show/route/CmdShowRoute.h" #include "fboss/cli/fboss2/commands/show/route/gen-cpp2/model_types.h" @@ -79,8 +80,9 @@ class CmdShowRouteDetails entry.get_isConnected() ? " (connected)" : ""); for (const auto& clAndNxthops : entry.get_nextHopMulti()) { - out << fmt::format( - " Nexthops from client {}\n", clAndNxthops.get_clientId()); + auto clientId = static_cast(*clAndNxthops.clientId()); + auto clientName = apache::thrift::util::enumNameSafe(clientId); + out << fmt::format(" Nexthops from client {}\n", clientName); for (const auto& nextHop : clAndNxthops.get_nextHops()) { out << fmt::format( " {}\n", show::route::utils::getNextHopInfoStr(nextHop)); diff --git a/fboss/cli/fboss2/test/CmdShowRouteDetailsTest.cpp b/fboss/cli/fboss2/test/CmdShowRouteDetailsTest.cpp index 9e164623c7c37..a655bd6586dff 100644 --- a/fboss/cli/fboss2/test/CmdShowRouteDetailsTest.cpp +++ b/fboss/cli/fboss2/test/CmdShowRouteDetailsTest.cpp @@ -237,7 +237,7 @@ TEST_F(CmdShowRouteDetailsTestFixture, printOutput) { std::string output = ss.str(); std::string expectOutput = R"( Network Address: 2401:db00::/32 - Nexthops from client 0 + Nexthops from client BGPD 2401:db00:e32f:8fc::2 weight 1 MPLS -> SWAP : 1 Action: Nexthops Forwarding via: @@ -247,7 +247,7 @@ Network Address: 2401:db00::/32 Class Id: DST_CLASS_L3_DPR(20) Network Address: 176.161.6.0/32 (connected) - Nexthops from client 1 + Nexthops from client STATIC_ROUTE 240.161.6.0 Action: Nexthops Forwarding via: