Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD 13.2 support #229

Open
ydirson opened this issue Sep 15, 2023 · 4 comments
Open

FreeBSD 13.2 support #229

ydirson opened this issue Sep 15, 2023 · 4 comments
Assignees

Comments

@ydirson
Copy link

ydirson commented Sep 15, 2023

FreeBSD 13.2 introduces Netlink support. libc has to expose the necessary bits for netlink-sys to build (for which I started rust-lang/libc#3201), but FreeBSD does not have the same wide support as Linux, and not all constants available on Linux are available on FreeBSD.

neli currently assumes that all Linux-available constants are exported by libc, and thus cannot currently build on FreeBSD, even if above-mentionned PR would be extended to cover all constants effectively available in FreeBSD.

Such constants include socket families (AF_AX25, ...), and other various enum values (NFULA_CT, ...,NFULA_CFG_CMD, etc)

The issue is the same that rust-netlink has, reported there as rust-netlink/netlink-packet-route#30. Likely a common solution could be worked out.

@jbaublitz
Copy link
Owner

What would you recommend here? I think it may be a little bit hard to set up a CI job with FreeBSD with Github Actions because of the difference in kernel and userspace.

@ydirson
Copy link
Author

ydirson commented Oct 11, 2023

I don't have a full battle-plan for this, but my basic idea would be to decouple the neli enums from the libc consts: use auto-numbering for the neli enums, and use a match statement to get the libc values when they are needed to make the effective calls. This should make it easier to deal with unavailable values using conditional compilation in this match statement, once for each such value.
We discussed a few alternatives privately with @cathay4t about rust-netlink but no conclusion has been reached yet.

@jbaublitz
Copy link
Owner

Hi @ydirson, I'm not entirely sure I understand the idea here. If I'm understanding the idea correctly, I don't see how preserving the enums but auto-numbering them results in less conditional compilation.

@ydirson
Copy link
Author

ydirson commented Nov 7, 2023

For rust-netlink we started to discuss concrete implementation at rust-netlink/netlink-packet-route#56 (comment), and there is concrete AddressFamily implementation now in that PR.

Maybe this part could even be shared between the two projects?

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

No branches or pull requests

2 participants