cli: merge ping{,6} and traceroute{,6} commands - #577
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR centralizes ICMP CLI handling by introducing a generic ICMP CLI module that registers address-family-specific handlers via a new Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The IPv4 and IPv6 ping/traceroute commands share the same argument structure. Introduce a cli_icmp_ops dispatch table in the infra CLI so that a single "ping" and "traceroute" command handles both address families, selected automatically based on the destination address format. Register per-family callbacks via cli_icmp_ops_register() instead of creating separate CLI contexts. Remove the ping6 and traceroute6 commands from the CLI and update smoke tests accordingly. Signed-off-by: Robin Jarry <rjarry@redhat.com> Reviewed-by: Christophe Fontaine <cfontain@redhat.com>
The IPv4 and IPv6 ping/traceroute commands share the same argument structure. Introduce a cli_icmp_ops dispatch table in the infra CLI so that a single "ping" and "traceroute" command handles both address families, selected automatically based on the destination address format.
Register per-family callbacks via cli_icmp_ops_register() instead of creating separate CLI contexts. Remove the ping6 and traceroute6 commands from the CLI and update smoke tests accordingly.
Command consolidation via dispatch table
Adds struct cli_icmp_ops and registration API in modules/infra/cli/gr_cli_l3.h:
Implements a centralized ICMP CLI context in modules/infra/cli/icmp.c:
IPv4 and IPv6 implementation refactoring
modules/ip/cli/icmp.c
modules/ip6/cli/icmp6.c
Build, docs and test updates