Skip to content

Commit 579e3ed

Browse files
Jonathan D.A. Jewellclaude
andcommitted
feat: complete nftables fallback and add eBPF build tooling
## nftables Fallback (Blocker #2 - FIXED) - Add NftablesManager struct with full API: - apply(): Actually applies rules to kernel (was check-only before) - block_ip(): Runtime IP blocking - allow_tcp_port()/allow_udp_port(): Dynamic port management - cleanup(): Remove yacht firewall table - Add Firewall enum to unify eBPF and nftables management - Fix critical bug: rules were validated but never applied (used -c flag) ## eBPF Build Tooling (Blocker #1 - Build Infrastructure) - Add xtask crate for workspace-level build tasks - Add cargo xtask commands: - build-ebpf: Compile XDP firewall with nightly toolchain - install-ebpf: Install to /etc/wharf/ - build-all: Build everything - Add .cargo/config.toml with xtask alias - Update workspace to include xtask, exclude fuzz/ The eBPF kernel code was already complete - this adds the build automation to compile it with: cargo xtask build-ebpf Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 76e81de commit 579e3ed

6 files changed

Lines changed: 593 additions & 65 deletions

File tree

.cargo/config.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: PMPL-1.0
2+
# SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
3+
4+
# Cargo configuration for Project Wharf
5+
6+
[alias]
7+
# Run xtask commands (e.g., cargo xtask build-ebpf)
8+
xtask = "run --package xtask --"
9+
10+
# Build everything including eBPF
11+
build-all = "xtask build-all"
12+
13+
# eBPF-specific target configuration
14+
[target.bpfel-unknown-none]
15+
rustflags = ["-C", "link-arg=--btf"]

Cargo.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ members = [
33
"crates/wharf-core",
44
"bin/wharf-cli",
55
"bin/yacht-agent",
6+
"xtask",
67
]
78
# eBPF crate excluded from default build - requires special toolchain (bpf-linker)
8-
# Build separately with: cd crates/wharf-ebpf && cargo +nightly build --target bpfel-unknown-none
9-
exclude = ["crates/wharf-ebpf"]
9+
# Build with: cargo xtask build-ebpf
10+
# Or manually: cd crates/wharf-ebpf && cargo +nightly build --target bpfel-unknown-none -Z build-std=core
11+
exclude = ["crates/wharf-ebpf", "fuzz"]
1012
resolver = "2"
1113

1214
[workspace.package]

0 commit comments

Comments
 (0)