[Nexthop] [fboss2-dev] Add BGP CLI show commands and tests#1039
Open
manoharan-nexthop wants to merge 2 commits into
Open
[Nexthop] [fboss2-dev] Add BGP CLI show commands and tests#1039manoharan-nexthop wants to merge 2 commits into
manoharan-nexthop wants to merge 2 commits into
Conversation
10dcdb2 to
5b087e9
Compare
2 tasks
9262a08 to
83e2d58
Compare
128f228 to
61ac3e3
Compare
Contributor
|
bgp_thrift.thrift and policy_thrift.thrift have been published already, could we remove from the current PR? |
a7df529 to
77f2cbd
Compare
Contributor
Author
@induvsuresh , This has been updated.. please let me know if anything else to be changed. Thanks! |
induvsuresh
requested changes
May 14, 2026
Contributor
induvsuresh
left a comment
There was a problem hiding this comment.
Thank you for the working on this! the test changes, cmake are going to be super useful and it is very thorough
I've left some comments that are blockers for merge , eg: the buck changes etc, could we address that for merge pls
496831c to
e74db48
Compare
induvsuresh
reviewed
May 22, 2026
e74db48 to
b9bdfc0
Compare
This commit adds build configuration for existing upstream BGP thrift interfaces from the neteng/ directory. Files Referenced: - neteng/fboss/bgp/if/bgp_thrift.thrift - Main BGP service interface (TBgpService) defining RPC methods for BGP operations, session management, RIB queries, policy management, and monitoring - neteng/fboss/bgp/if/policy_thrift.thrift - Routing policy statistics - fboss/cli/fboss2/commands/show/bgp/summary/bgp_summary.thrift - BGP summary data model for CLI commands Build System Updates: - CMakeLists.txt - Added thrift compilation targets for BGP thrift files referencing the upstream neteng/ implementations with dependencies on configerator BGP policy and attribute definitions - fboss/cli/fboss2/commands/show/bgp/summary/BUCK - Thrift library for bgp_summary Dependencies: - Uses upstream neteng BGP thrift definitions (full-featured version) - Requires configerator BGP policy and attribute thrift definitions - Integrates with fb303 for service monitoring Migration Notes: - Previously attempted to create custom thrift files in fboss/bgp/if/ and fboss/routing/policy/if/, but upstream Meta already provides these in neteng/fboss/bgp/if/ with full BGP++ feature set including health checks, partial drain state, profiler, and advanced session management - Migrated to use the full-featured upstream version to avoid duplication and benefit from complete BGP++ functionality
This commit adds comprehensive BGP (Border Gateway Protocol) CLI show commands for the fboss2 CLI tool. These commands provide visibility into BGP state, configuration, routes, neighbors, and statistics. BGP Show Commands Added: ======================== Core Commands: - show bgp summary - Display BGP session summary - show bgp summary egress - Display egress BGP summary - show bgp neighbors - Show BGP neighbor information - show bgp table - Display BGP routing table - show bgp table <prefix> - Show specific prefix details - show bgp table detail - Show detailed routing table - show bgp table community <community> - Filter by community - show bgp table more-specifics <prefix> - Show more specific routes - show bgp originated-routes - Display originated routes - show bgp shadowrib - Show shadow RIB entries - show bgp changelist - Display BGP changelist - show version bgp - Show BGP version information Configuration Commands: - show config running bgp - Display running BGP configuration Neighbor Route Commands: - show bgp neighbors <neighbor> received pre-policy - Routes received before policy - show bgp neighbors <neighbor> received post-policy - Routes received after policy - show bgp neighbors <neighbor> received rejected - Rejected received routes - show bgp neighbors <neighbor> advertised pre-policy - Routes to advertise before policy - show bgp neighbors <neighbor> advertised post-policy - Routes advertised after policy - show bgp neighbors <neighbor> advertised rejected - Rejected advertised routes - show bgp neighbors <neighbor> advertised dry-run - Dry-run advertised routes - show bgp neighbors <neighbor> session-id - Display session ID Statistics Commands: - show bgp stats entries - Display BGP entry statistics - show bgp stats policy - Show BGP policy statistics - show bgp stats attrs - Display BGP attribute statistics Stream Commands: - show bgp stream summary - Display BGP stream summary - show bgp stream subscriber - Show stream subscribers - show bgp stream subscriber pre-policy - Pre-policy stream subscribers - show bgp stream subscriber post-policy - Post-policy stream subscribers Implementation Details: ====================== Command Handler: - CmdHandlerImplBgp.cpp - BGP command handler implementation - CmdList.cpp - Updated to register BGP commands Utilities: - CmdShowUtils.cpp/h - Common utilities for BGP show commands - NetTools.h - Network utility functions Build System Updates: - cmake/CliFboss2.cmake - Added BGP command sources - cmake/CliFboss2Test.cmake - Added BGP test sources Migration Notes: - Updated bgp_summary.thrift to use neteng/fboss/bgp/if/ include path - Updated all C++ includes to use neteng/fboss/bgp/if/gen-cpp2/ for generated code - Removed OSS-specific simplified policy stats implementation to use full-featured upstream implementation everywhere Dependencies: This commit depends on the BGP thrift definitions added in the previous commit. Total Changes: - 39 command implementation files - 22 test files - 8 utility/infrastructure files - 2 cmake build files - 85 files changed
b9bdfc0 to
d246ad3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
Adds BGP CLI show commands for the fboss2 CLI tool. These commands provide visibility into BGP state, configuration, routes, neighbors, and statistics.
BGP Show Commands Added:
Core Commands:
Configuration Commands:
Neighbor Route Commands:
Statistics Commands:
Stream Commands:
Implementation Details:
Command Handler:
Utilities:
Tests (22 test files):
Test Infrastructure:
Build System Updates:
Test Plan
All the CLI unit tests passes.