[draft] calicovppctl: add HTTP capture server for BPF filtering with binary API support#862
Draft
[draft] calicovppctl: add HTTP capture server for BPF filtering with binary API support#862
Conversation
added 2 commits
January 8, 2026 13:42
- Add CLI flags: -srcip, -dstip, -srcport, -dstport, -protocol - Implement BPF filter building and application using VPP CLI - Handle empty capture files gracefully - Support BPF filtering for trace, pcap, and dispatch commands Signed-off-by: Aritra Basu <aritrbas@cisco.com>
- Serialize capture operations (trace/pcap/dispatch) per VPP pod using an in-pod lock file (/tmp/calicovppctl.lock), preventing parallel captures from multiple clients - Provide clear error output when a capture is already running - Add forced cleanup option: `calicovppctl capture clear -node <node>` - clears trace - stops `pcap trace` and `pcap dispatch trace` - clears BPF filters and restores default filter functions - removes hanging in-pod lock file Signed-off-by: Aritra Basu <aritrbas@cisco.com>
Capture Server (calico-vpp-agent/capture/capture_server.go): - HTTP server running on port 9999 (configurable via CaptureServerPort) - Endpoints: /api/status, /api/trace, /api/pcap, /api/dispatch, /api/stop - Handles timeouts and user conflicts via mutex-based single-instance execution - Handles client disconnect to cleanup captures - Uses vpplink binary API for stability instead of vppctl CLI vpplink API additions: - vpplink/bpf.go: BPF filter management via binary API - vpplink/tracedump.go: trace capture and dump via binary API - Generated bindings for bpf_trace_filter and tracedump calicovppctl updates: - Added --use-api flag to use the capture server instead of vppctl commands via kubectl exec for trace, pcap and dispatch - Added 'capture status' subcommand to check capture status - Added 'capture stop' subcommand to stop running captures config updates: - Added CaptureServerPort configuration option (default: 9999)
d391f4e to
525a10a
Compare
fed6073 to
0ca6ae3
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.
Capture Server (calico-vpp-agent/capture/capture_server.go):
vpplink API additions:
calicovppctl updates:
config updates: