linux: add ifaddrmsg and rtattr#5234
Conversation
| // include/uapi/linux/if_addr.h | ||
| pub struct ifaddrmsg { | ||
| pub ifa_family: c_uchar, | ||
| pub ifa_prefixlen: c_uchar, | ||
| pub ifa_flags: c_uchar, | ||
| pub ifa_scope: c_uchar, | ||
| pub ifa_index: c_uint, | ||
| } |
There was a problem hiding this comment.
Please place this in a new file at src/new/linux_uapi/linux/if_addr.rs, and export that new module at src/new/mod.rs. We're nudging new code to the organized new module.
(The existing if_addr.h constants can move there too if you want, or I can do it in a followup)
There was a problem hiding this comment.
Should I do the same for rtnetlink.h? Create a new module and move existing constants and structs?
And for the other two PRs as well?
There was a problem hiding this comment.
No need to worry about it for anything where there's already a comment with the header path, for the sake of keeping things together. I'm just trying to nudge any new sections to use src/new instead.
|
Reminder, once the PR becomes ready for a review, use |
rtnetlink message bodies from linux/if_addr.h and linux/rtnetlink.h.
9858b37 to
af0a570
Compare
rtnetlink message bodies from linux/if_addr.h and linux/rtnetlink.h. (backport <rust-lang#5234>) (cherry picked from commit cf94474)
(backport <rust-lang#5234>) (cherry picked from commit 2ffa363)
rtnetlink message bodies from linux/if_addr.h and linux/rtnetlink.h. (backport <rust-lang#5234>) (cherry picked from commit cf94474)
(backport <rust-lang#5234>) (cherry picked from commit 2ffa363)
rtnetlink message bodies from linux/if_addr.h and linux/rtnetlink.h. (backport <rust-lang#5234>) (cherry picked from commit cf94474)
(backport <rust-lang#5234>) (cherry picked from commit 2ffa363)
Description
Add
ifaddrmsgandrtattr, the rtnetlink message bodies, next toifinfomsg. Used to parse RTM_*ADDR/RTM_*LINK dumps and walk rtattr attributes.Sources
ifaddrmsg(linux/if_addr.h): https://github.com/torvalds/linux/blob/dc59e4fea9d83f03bad6bddf3fa2e52491777482/include/uapi/linux/if_addr.h#L8rtattr(linux/rtnetlink.h): https://github.com/torvalds/linux/blob/dc59e4fea9d83f03bad6bddf3fa2e52491777482/include/uapi/linux/rtnetlink.h#L219Checklist
libc-test/semverhave been updated*LASTor*MAXare includedcd libc-test && cargo test --target mytarget)