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
Add netlink structs to all notbsd platforms #922
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Working on adding some |
4fc4013
to
69ae346
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done adding genetlink/netlink structs and fields for this PR now. Ready for review.
pub const NLMSG_ERROR: ::c_int = 0x2; | ||
pub const NLMSG_DONE: ::c_int = 0x3; | ||
pub const NLMSG_OVERRUN: ::c_int = 0x4; | ||
pub const NLMSG_MIN_TYPE: ::c_int = 0x10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was able to move these up one level. Covers more platforms and with less duplication.
This PR now fixes #921 as well as my use case. Should include everything to make https://github.com/jbaublitz/neli/blob/master/src/c/netlink.c obsolete. Ping @jbaublitz |
src/unix/notbsd/linux/mod.rs
Outdated
pub const GENL_CMD_CAP_DO: ::c_int = 0x02; | ||
pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04; | ||
pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08; | ||
cfg_if! { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the location of these definitions get tweaked a bit to avoid the cfg_if!
annotations here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, done!
Looks good to me, thanks! Just one small nit but otherwise seems good to go |
aa3aad4
to
e5051a0
Compare
Now the tests started to fail on a constant added by me in a previous PR. The value of the |
e5051a0
to
95befb4
Compare
@bors: r+ |
📌 Commit 95befb4 has been approved by |
Add netlink structs to all notbsd platforms Adding the remaining structs from `<linux/netlink.h>`. Sadly very duplicated, but that's how it ended up when added to all "notbsd" platforms except musl. If there is a better way to structure it to reduce duplication I'm all ears!
☀️ Test successful - status-appveyor, status-travis |
Make netlink struct fields public I realized my netlink structs were a bit unusable if their fields are not public 🤦♂️ Follow up and improvement to #922
Adding the remaining structs from
<linux/netlink.h>
. Sadly very duplicated, but that's how it ended up when added to all "notbsd" platforms except musl. If there is a better way to structure it to reduce duplication I'm all ears!