Skip to content

Add freebsd userland platform - #715

Draft
Weiteng Chen (CvvT) wants to merge 37 commits into
mainfrom
weiteng/freebsd
Draft

Weiteng Chen (CvvT) wants to merge 37 commits into
mainfrom
weiteng/freebsd

Conversation

@CvvT

Copy link
Copy Markdown
Contributor

We used to have freebsd userland platform but was removed while undergoing drastic changes of platform interfaces. Now that we have more stable interfaces and with the help of agents, we should be able to maintain one more platform. This PR is drafted by agent based on our previous implementation.

@CvvT Weiteng Chen (CvvT) added the must-not-merge:prototype An experimental/proof-of-concept PR that must not be merged. label Mar 11, 2026
weiteng chen and others added 4 commits March 11, 2026 22:01
This is a purely-userland platform implementation (like Linux and Windows
userland) that requires std, so it should be excluded from the no_std
confirmation check.
On FreeBSD, opening /dev/tunN resets the interface configuration. This
adds programmatic IP configuration via socket ioctls (SIOCSIFADDR,
SIOCSIFDSTADDR, SIOCSIFNETMASK, SIOCSIFFLAGS) after opening the TUN
device, so tests get a properly configured interface.

- Add Socket syscall number to FreeBSD syscall table
- Add ioctl constants and structs (SockaddrIn, IfReq) for interface config
- Add configure_tun_interface() that applies IP config via ioctls
- Change FreeBSDUserland::new() to accept TunConfig instead of bare name
- Re-export TunConfig from litebox_platform_multiplex
- Update test code to construct TunConfig on FreeBSD
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

@jaybosamiya-ms

Copy link
Copy Markdown
Member

This branch is keeping around a huge file in its history. From git-sizer 53d15841d1aec43627b3913d9990490120e67847 (6206df7:litebox_shim_linux/litebox_shim_linux-.core)

Current tip of the branch as of this comment is 1130be8

I'm force-pushing a rewritten history for this branch that deletes that file, which seems unintentional anyways based on ce36346 which deletes the file immediately after it was committed.

Nonetheless, I'm writing all these commit hashes above so that we can get back to them if need be via the GitHub UI if we really need them, but in parallel, the rewritten branch will make sure our regular clones don't actually pull this up unnecessarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

must-not-merge:prototype An experimental/proof-of-concept PR that must not be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants