summaryrefslogtreecommitdiff
path: root/internal/namespace/namespace_stub.go
diff options
context:
space:
mode:
authorJames O'Doherty <james@theodohertyfamily.com>2026-05-29 18:29:12 -0400
committerJames O'Doherty <james@theodohertyfamily.com>2026-05-29 18:29:12 -0400
commitee2f5d545825752af63da36e2b9ec7a92985a875 (patch)
tree7328f73ac157dd19fa60e887fd243f0855935cce /internal/namespace/namespace_stub.go
parent135f6edbd9389bc4783f13c26aed0a74d3c8aca0 (diff)
feat: implement userspace wireguard data-path and unprivileged host fd-passing
- Implement complete rootless network namespace bootstrap via C launcher using unshare(CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWNET). - Resolve unprivileged network isolation blackhole via host-socket preservation (FD passing): open client UDP sockets on the host pre-isolation, clear O_CLOEXEC, and ingest them via custom `FDBind` inside the sandbox. - Implement isolated routing table automation over `tun0` (addresses, MTU, default routes). - Implement persistent, multi-process namespace sharing and joining using reference-counted PID files and the setns system call. - Write robust, self-contained E2E data plane test suites in `tests/e2e/e2e_test.go` using a mock UDP listener. - Update project documentation (`README.md` and `AGENTS.md`) to reflect completed milestones. - Ensure 100% test passing rate and zero lint/staticcheck warnings.
Diffstat (limited to 'internal/namespace/namespace_stub.go')
-rw-r--r--internal/namespace/namespace_stub.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/internal/namespace/namespace_stub.go b/internal/namespace/namespace_stub.go
index 352ec13..84946bf 100644
--- a/internal/namespace/namespace_stub.go
+++ b/internal/namespace/namespace_stub.go
@@ -2,4 +2,22 @@
package namespace
-// The namespace package provides stubs for non-Linux platforms.
+import (
+ "fmt"
+ "git.theodohertyfamily.com/tools/wg-wrap/internal/paths"
+)
+
+// PinNamespace touches the namespace path to indicate it is pinned/active.
+func PinNamespace(pm *paths.PathManager, profile string) error {
+ return fmt.Errorf("namespaces are not supported on this platform")
+}
+
+// UnpinNamespace removes the pinned namespace file from the filesystem.
+func UnpinNamespace(pm *paths.PathManager, profile string) error {
+ return fmt.Errorf("namespaces are not supported on this platform")
+}
+
+// JoinExistingNamespace attempts to join the namespaces (user, mount, net) of an already active process.
+func JoinExistingNamespace(pm *paths.PathManager, profile string) (bool, error) {
+ return false, fmt.Errorf("namespaces are not supported on this platform")
+}