Skip to content

[Nexthop] [fboss2-dev] Add CLI commands for interface IP addresses and static routes#1118

Closed
manoharan-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:manoharan.ip-route-cmds
Closed

[Nexthop] [fboss2-dev] Add CLI commands for interface IP addresses and static routes#1118
manoharan-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:manoharan.ip-route-cmds

Conversation

@manoharan-nexthop

Copy link
Copy Markdown
Contributor

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

  1. Interface IP Address Commands
    Add/remove IP addresses on interfaces:
  - config interface <name> ip-address <prefix>
  - config interface <name> ipv6-address <prefix>
  - delete interface <name> ip-address <prefix>
  - delete interface <name> ipv6-address <prefix>
  1. Static Route Commands
    Add/remove static routes:
  - config protocol static ip route <prefix> <nexthop|null0|cpu>
  - config protocol static ipv6 route <prefix> <nexthop|null0|cpu>
  - delete protocol static ip route <prefix>
  - delete protocol static ipv6 route <prefix>

Test Plan

$ ./.build_dir/build/fboss/fboss2_cmd_config_test --gtest_filter='CmdConfigIpRouteTestFixture*'
Note: Google Test filter = CmdConfigIpRouteTestFixture*
[==========] Running 26 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 26 tests from CmdConfigIpRouteTestFixture
[ RUN      ] CmdConfigIpRouteTestFixture.addIpv4RouteSingleNexthop
[       OK ] CmdConfigIpRouteTestFixture.addIpv4RouteSingleNexthop (66 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.addIpv4RouteMultipleNexthops
[       OK ] CmdConfigIpRouteTestFixture.addIpv4RouteMultipleNexthops (60 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.addIpv4DropRoute
[       OK ] CmdConfigIpRouteTestFixture.addIpv4DropRoute (54 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.updateIpv4Route
[       OK ] CmdConfigIpRouteTestFixture.updateIpv4Route (68 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.invalidIpv4PrefixFormat
[       OK ] CmdConfigIpRouteTestFixture.invalidIpv4PrefixFormat (51 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.ipv6PrefixInIpv4Command
[       OK ] CmdConfigIpRouteTestFixture.ipv6PrefixInIpv4Command (39 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.tooFewArguments
[       OK ] CmdConfigIpRouteTestFixture.tooFewArguments (40 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.dropWithExtraNexthops
[       OK ] CmdConfigIpRouteTestFixture.dropWithExtraNexthops (42 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteIpv4RouteWithNexthops
[       OK ] CmdConfigIpRouteTestFixture.deleteIpv4RouteWithNexthops (63 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteIpv4DropRoute
[       OK ] CmdConfigIpRouteTestFixture.deleteIpv4DropRoute (67 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteNonExistentIpv4Route
[       OK ] CmdConfigIpRouteTestFixture.deleteNonExistentIpv4Route (40 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteInvalidIpv4PrefixFormat
[       OK ] CmdConfigIpRouteTestFixture.deleteInvalidIpv4PrefixFormat (38 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.addIpv6RouteSingleNexthop
[       OK ] CmdConfigIpRouteTestFixture.addIpv6RouteSingleNexthop (55 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.addIpv6DropRoute
[       OK ] CmdConfigIpRouteTestFixture.addIpv6DropRoute (50 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.addIpv6CpuRoute
[       OK ] CmdConfigIpRouteTestFixture.addIpv6CpuRoute (61 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.updateIpv6Route
[       OK ] CmdConfigIpRouteTestFixture.updateIpv6Route (77 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.ipv4PrefixInIpv6Command
[       OK ] CmdConfigIpRouteTestFixture.ipv4PrefixInIpv6Command (46 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.invalidIpv6PrefixFormat
[       OK ] CmdConfigIpRouteTestFixture.invalidIpv6PrefixFormat (46 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.tooFewArgumentsIpv6
[       OK ] CmdConfigIpRouteTestFixture.tooFewArgumentsIpv6 (41 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.ipv4NexthopInIpv6Command
[       OK ] CmdConfigIpRouteTestFixture.ipv4NexthopInIpv6Command (43 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteIpv6RouteWithNexthops
[       OK ] CmdConfigIpRouteTestFixture.deleteIpv6RouteWithNexthops (60 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteIpv6DropRoute
[       OK ] CmdConfigIpRouteTestFixture.deleteIpv6DropRoute (64 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteIpv6CpuRoute
[       OK ] CmdConfigIpRouteTestFixture.deleteIpv6CpuRoute (67 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteNonExistentIpv6Route
[       OK ] CmdConfigIpRouteTestFixture.deleteNonExistentIpv6Route (42 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteIpv4PrefixInIpv6Command
[       OK ] CmdConfigIpRouteTestFixture.deleteIpv4PrefixInIpv6Command (46 ms)
[ RUN      ] CmdConfigIpRouteTestFixture.deleteInvalidIpv6PrefixFormat
[       OK ] CmdConfigIpRouteTestFixture.deleteInvalidIpv6PrefixFormat (47 ms)
[----------] 26 tests from CmdConfigIpRouteTestFixture (1386 ms total)

[----------] Global test environment tear-down
[==========] 26 tests from 1 test suite ran. (1386 ms total)
[  PASSED  ] 26 tests.
@manoharan-nexthop manoharan-nexthop requested review from a team as code owners April 22, 2026 11:39
@meta-cla meta-cla Bot added the CLA Signed label Apr 22, 2026

@joseph5wu joseph5wu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this PR slipped out of my radar, and it's been old now.
Can you rebase and address all my comments?

Comment thread fboss/agent/state/InterfaceMap.cpp Outdated
for (const auto& itr : std::as_const(*this)) {
const auto& intf = itr.second;
if (intf->getVlanID() == vlan) {
if (intf->getVlanIDHelper() == vlan) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manoharan-nexthop What's the reason to change the vlan function here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno, removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mano's recollection is that for normal interfaces, without intf->getVlanIDHelper(), it was crashing trying to fetch the VLAN ID. I've removed this still and will see if I can repro the crash.

* For example (IPv4):
* 10.0.0.0/8 192.168.1.1 # Single nexthop
* 10.0.0.0/8 192.168.1.1 192.168.1.2 # ECMP with two nexthops
* 10.0.0.0/8 null0 # Null route (drop)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just use null? I don't think null is a keyword for our fboss2 or cli.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null0 is the name of the interface, it's referenced in other places e.g.

configerator/structs/neteng/bgp_policy/thrift/routing_policy.thrift:165:  // example: ipv6 route 2803:6082:f822:400::/54 Null0
template <network::thrift::AddressType IPVersion>
class StaticRouteAddArgBase : public utils::BaseObjectArgType<std::string> {
public:
/* implicit */ StaticRouteAddArgBase( // NOLINT(google-explicit-constructor)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider to move the implementation to .cpp and .h light-weighted

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is template code, it needs to be in the .h.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to delete the CmdDeleteConfig.cpp/.h here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Comment on lines +98 to +112
// Validate IP address version matches attribute
auto [ip, prefixLen] = folly::IPAddress::createNetwork(ipAddress);
bool expectV6 = (attribute == "ipv6-address");

if (expectV6 && !ip.isV6()) {
throw std::invalid_argument(
fmt::format(
"Expected IPv6 address for 'ipv6-address', got IPv4: {}",
ipAddress));
}
if (!expectV6 && ip.isV6()) {
throw std::invalid_argument(
fmt::format(
"Expected IPv4 address for 'ip-address', got IPv6: {}", ipAddress));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this validation logic in InterfaceDeleteConfig::InterfaceDeleteConfig()?
So that we can always assume when InterfaceDeleteConfig is created, the user input should be valid.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our internal review had actually raised something similar and we factored it out in a new header.

OBJECT_ARG_TYPE_STATIC_ROUTE_PREFIX,
OBJECT_ARG_TYPE_STATIC_ROUTE_V6,
OBJECT_ARG_TYPE_STATIC_ROUTE_PREFIX_V6,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't introduce new OBJECT_ARG_TYPE for config cli.
#1112 introduced per-Traits addCliArg method to replace the central ObjectArgTypeId enum. Please adjust this PR accordingly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread fboss/cli/fboss2/CmdArgsLists.h Outdated
// since we do a lot of work of figuring out argument types at compile time,
// for now we need to know the the theoretical max depth of nested subcommands
static constexpr auto MAX_DEPTH = 5;
static constexpr auto MAX_DEPTH = 6;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a comment here to use the example of the max depth(6) here for better understanding?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mano told me that previously the code was using ip address in the CLI, which required an increase in depth, but after discussions we changed it to ip-address so this wasn't needed anymore, and he just forgot to reduce the max depth. I've removed this change from the PR.

}},
},

{"delete",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't delete this cli

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread fboss/cli/fboss2/CmdSubcommands.cpp Outdated
"<port-list> [<attr> <value> ...] where <attr> is one "
"of: description, mtu");
break;
case utils::ObjectArgTypeId::OBJECT_ARG_TYPE_ID_INTERFACE_DELETE_CONFIG:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As comment above, please read #1112 to adjust your PR here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@benoit-nexthop benoit-nexthop force-pushed the manoharan.ip-route-cmds branch from 62409d1 to 15b3bea Compare June 23, 2026 00:30
@facebook-github-tools

Copy link
Copy Markdown

@manoharan-nexthop has updated the pull request. You must reimport the pull request before landing.

@benoit-nexthop benoit-nexthop force-pushed the manoharan.ip-route-cmds branch from 15b3bea to 0c3679d Compare June 23, 2026 00:34
@facebook-github-tools

Copy link
Copy Markdown

@manoharan-nexthop has updated the pull request. You must reimport the pull request before landing.

@benoit-nexthop benoit-nexthop force-pushed the manoharan.ip-route-cmds branch from 0c3679d to bd18480 Compare June 23, 2026 01:02
@facebook-github-tools

Copy link
Copy Markdown

@manoharan-nexthop has updated the pull request. You must reimport the pull request before landing.

@benoit-nexthop benoit-nexthop force-pushed the manoharan.ip-route-cmds branch from bd18480 to fd1393e Compare June 23, 2026 11:58
@facebook-github-tools

Copy link
Copy Markdown

@manoharan-nexthop has updated the pull request. You must reimport the pull request before landing.

@meta-codesync

meta-codesync Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D106142019.

@joseph5wu joseph5wu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core "find a route by (routerID, prefix)" predicate is duplicated 12 times across CmdConfigProtocolStaticRouteAdd.cpp and CmdDeleteProtocolStaticRoute.cpp:

std::find_if(routes.begin(), routes.end(), [vrfId, &prefix](const auto& route) {
return *route.routerID() == vrfId && *route.prefix() == prefix;
});

And in addStaticRouteImpl, each of the three branches (null0 / cpu / nexthop) independently re-implements "remove this prefix from the other two route lists" — so the same erase-from-list block is copy-pasted across branches. This is the most
error-prone part of the change: the route-list juggling is exactly where a missed list or a wrong comparison would silently corrupt the staged config, and right now correctness depends on every copy staying in sync.

Could we pull this into a small shared header (mirroring the existing InterfaceIpUtils.h), e.g. StaticRouteUtils.h:

Comment on lines +38 to +43
auto it = std::find_if(
nullRoutes.begin(),
nullRoutes.end(),
[vrfId, &prefix](const auto& route) {
return *route.routerID() == vrfId && *route.prefix() == prefix;
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this find-route-by-vrfId+prefix lambda is repeated 12 times across the whole PR.
Can we define StaticRouteUtils.h to have this common function:

  template <typename RouteList>
  auto findStaticRoute(RouteList& routes, int32_t vrfId, const std::string& prefix) {
    return std::find_if(routes.begin(), routes.end(), [&](const auto& r) {
      return *r.routerID() == vrfId && *r.prefix() == prefix;
    });
  }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines +31 to +63
auto& nhopRoutes = *swConfig.staticRoutesWithNhops();
auto nhopIt = std::find_if(
nhopRoutes.begin(),
nhopRoutes.end(),
[vrfId, &prefix](const auto& route) {
return *route.routerID() == vrfId && *route.prefix() == prefix;
});
if (nhopIt != nhopRoutes.end()) {
nhopRoutes.erase(nhopIt);
found = true;
}

auto& nullRoutes = *swConfig.staticRoutesToNull();
auto nullIt = std::find_if(
nullRoutes.begin(),
nullRoutes.end(),
[vrfId, &prefix](const auto& route) {
return *route.routerID() == vrfId && *route.prefix() == prefix;
});
if (nullIt != nullRoutes.end()) {
nullRoutes.erase(nullIt);
found = true;
}

auto& cpuRoutes = *swConfig.staticRoutesToCPU();
auto cpuIt = std::find_if(
cpuRoutes.begin(), cpuRoutes.end(), [vrfId, &prefix](const auto& route) {
return *route.routerID() == vrfId && *route.prefix() == prefix;
});
if (cpuIt != cpuRoutes.end()) {
cpuRoutes.erase(cpuIt);
found = true;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also seeing lots of erase Static Route logic is repeated across the whole PR too.
Maybe we can introduce eraseStaticRoute() in StaticRouteUtils.h

  // Returns true if a matching route was present and erased.
  template <typename RouteList>
  bool eraseStaticRoute(RouteList& routes, int32_t vrfId, const std::string& prefix) {
    auto it = findStaticRoute(routes, vrfId, prefix);
    if (it == routes.end()) {
      return false;
    }
    routes.erase(it);
    return true;
  }

Then each add branch reduces to its real intent — "remove this prefix everywhere else, then add it here":

  // e.g. the null0 branch
  auto& nullRoutes = *swConfig.staticRoutesToNull();
  if (findStaticRoute(nullRoutes, vrfId, prefix) != nullRoutes.end()) {
    return fmt::format("Static null0 route {} (VRF {}) already exists", prefix, vrfId);
  }
  eraseStaticRoute(*swConfig.staticRoutesWithNhops(), vrfId, prefix);
  eraseStaticRoute(*swConfig.staticRoutesToCPU(), vrfId, prefix);
  nullRoutes.push_back(newRoute);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@benoit-nexthop benoit-nexthop force-pushed the manoharan.ip-route-cmds branch from fd1393e to ea28d32 Compare June 24, 2026 16:31
@facebook-github-tools

Copy link
Copy Markdown

@manoharan-nexthop has updated the pull request. You must reimport the pull request before landing.

@joseph5wu

Copy link
Copy Markdown
Contributor

@manoharan-nexthop In your last change, you replaced lots of places to use eraseStaticRoute and findStaticRoute functions but you didn't commit your StaticRouteUtils.h, now build is broken

cc: @benoit-nexthop Will Nexthop internal CI block a commit with compiling error like this before publish in our github?

@benoit-nexthop benoit-nexthop force-pushed the manoharan.ip-route-cmds branch from ea28d32 to cbe8461 Compare June 25, 2026 00:02
@facebook-github-tools

Copy link
Copy Markdown

@manoharan-nexthop has updated the pull request. You must reimport the pull request before landing.

@benoit-nexthop benoit-nexthop force-pushed the manoharan.ip-route-cmds branch from cbe8461 to 6acf2b4 Compare June 25, 2026 00:03
@facebook-github-tools

Copy link
Copy Markdown

@manoharan-nexthop has updated the pull request. You must reimport the pull request before landing.

@benoit-nexthop

Copy link
Copy Markdown
Contributor

@manoharan-nexthop In your last change, you replaced lots of places to use eraseStaticRoute and findStaticRoute functions but you didn't commit your StaticRouteUtils.h, now build is broken

cc: @benoit-nexthop Will Nexthop internal CI block a commit with compiling error like this before publish in our github?

This is entirely my fault, I forgot to git add the new file. Fixed. Sorry about that.

- Add config ip/ipv6 route add commands with nexthop support
- Add delete config ip/ipv6 route commands (moved from config tree to delete tree)
- Add delete config interface ip-address/ipv6-address commands
- Add parent commands for config ip and delete config ip/ipv6
- Update integration tests to use new delete command structure
- Add unit tests and integration tests for all new commands

Address issues found during testing

Fix crash in InterfaceMap::getInterfaceInVlanIf for PORT-type interfaces

The getInterfaceInVlanIf() method was calling intf->getVlanID() which has
a CHECK that fails when the interface type is PORT or SYSTEM_PORT.

This was causing FBOSS agent crashes during IPv6 packet handling, specifically
when resolveDestAndHandlePacket() tried to look up interfaces by VLAN ID.

The fix is to use getVlanIDHelper() instead, which properly handles all
interface types:
- For VLAN type: returns the actual VLAN ID
- For PORT/SYSTEM_PORT types: returns VlanID(0)

This allows the code to work correctly with both traditional VLAN-based
routing and modern PORT-based routing configurations.

Root cause identified from core dump analysis showing crash at:
InterfaceMap::getInterfaceInVlanIf -> Interface::getVlanID() CHECK failure
when processing IPv6 packets on PORT-type interfaces.

Tested on gold405 with PORT-type interface configuration (eth1/25/1).

Refactor static route commands to use 'config protocol static' hierarchy

- Move static route commands from 'config ip/ipv6 route' to 'config protocol static ip/ipv6 route'
- New command syntax:
  * config protocol static ip route add <prefix> <nexthop|null0|cpu>
  * config protocol static ipv6 route add <prefix> <nexthop|null0|cpu>
  * delete config protocol static ip route <prefix>
  * delete config protocol static ipv6 route <prefix>

- Remove --vrf option (defaults to VRF 0)
- Remove interface parameter for nexthops (not supported in thrift structure)
- Add support for null0 (drop) and cpu as nexthop destinations
- Implement template-based code sharing between IPv4 and IPv6 commands
- Add proper IPv4/IPv6 validation with helpful error messages

- Create parent command classes for new hierarchy:
  * CmdConfigProtocolStatic
  * CmdDeleteConfigProtocol
  * CmdDeleteConfigProtocolStatic

- Update build files (CliFboss2.cmake, BUCK)
- Update command registration (CmdListConfig.cpp, CmdSubcommands.cpp)

Tested on gold221 with successful route additions for IPv4 and IPv6.

Fix delete command argument parsing by completing ParentCmd chain

Key fixes:
1. Added ParentCmd = CmdDeleteConfig to CmdDeleteConfigProtocolTraits to complete the parent chain for argument resolution
2. Increased MAX_DEPTH from 5 to 6 in CmdArgsLists to support deeper command nesting
3. Created intermediate handler classes CmdDeleteConfigProtocolStaticIp/Ipv6 (though not strictly required, kept for consistency with old structure)
4. Flattened config command structure: removed 'add' level, making 'route' the direct leaf command

The root cause was a mismatch between:
- Command depth (where CLI11 registers arguments in CmdArgsLists array)
- ParentCmd chain (how CmdHandler resolves arguments via template recursion)

The 'delete' verb adds an extra 'config' level compared to other verbs, requiring the full parent chain to be explicitly defined.

Tested on gold221:
- config protocol static ip route <prefix> <nexthop|null0|cpu> ✓
- config protocol static ipv6 route <prefix> <nexthop|null0|cpu> ✓
- delete config protocol static ip route <prefix> ✓
- delete config protocol static ipv6 route <prefix> ✓

Remove 'config' keyword from delete commands

Restructure delete commands to remove the redundant 'config' level:
- delete config interface → delete interface
- delete config protocol static → delete protocol static

Changes:
1. Renamed all CmdDeleteConfig* classes to CmdDelete*
2. Moved directory structure from delete/config/* to delete/*
3. Updated ParentCmd chains to remove CmdDeleteConfig dependency
4. Updated all includes, cmake, and BUCK files
5. Updated CmdListConfig.cpp command tree structure

Benefits:
- Shorter, cleaner commands
- Consistent with industry standard CLI patterns
- Simpler depth management (one less nesting level)
- Cleaner namespace without redundant 'config' in delete context

Files affected:
- Renamed/moved: 14 source/header files
- Updated: cmake/CliFboss2.cmake, fboss/cli/fboss2/BUCK
- Updated: CmdListConfig.cpp command tree registration

Tested on gold221:
- delete interface <interface> <ip-address|ipv6-address> <value> ✓
- delete protocol static ip route <prefix> ✓
- delete protocol static ipv6 route <prefix> ✓
@benoit-nexthop benoit-nexthop force-pushed the manoharan.ip-route-cmds branch from 6acf2b4 to d3ddaeb Compare June 25, 2026 00:34
@facebook-github-tools

Copy link
Copy Markdown

@manoharan-nexthop has updated the pull request. You must reimport the pull request before landing.

@meta-codesync meta-codesync Bot closed this in 812c688 Jun 25, 2026
@meta-codesync

meta-codesync Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@joseph5wu merged this pull request in 812c688.

@meta-codesync meta-codesync Bot added the Merged label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment