-
Notifications
You must be signed in to change notification settings - Fork 677
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
Added if_nametoindex (and necessary module based on Cs net/if.h) #245
Conversation
Hi! Thanks for the PR. I think this is a good place for something like that to live. I'd also like to see the reverse, but I think that can wait until it's added to libc. |
} | ||
|
||
extern { | ||
fn if_nametoindex(ifname: *const c_char) -> c_uint; |
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.
use this from libc instead of making our own extern: http://rust-lang-nursery.github.io/libc/x86_64-unknown-linux-gnu/libc/fn.if_nametoindex.html
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.
Damn, I could've sworn I already replaced it. Fixed in 8972270
FYI I just sent out rust-lang/libc#153 adding |
That concludes my changes. The code looks much cleaner and shorter now. I would appreciate it though if you could take care of the NixPath-conversion. |
This is great! I've rebased and fixed the conflicts that arose, added the NixPath stuff, and made it useable on non-Linux as well. Currently waiting for CI to go green before merging. I also sent out #250 to address the Thanks again! |
Since it's not showing up here, the CI for the patch set I'm planning to merge: https://travis-ci.org/kamalmarhubi/nix-rust |
CI went green, merged as: e8f014d...beec2f4 :-) |
Perfekt, thanks! =) Now I just need to fix the typo in the function documentation ("a" => "an")... =) |
Hopefully this crate is the right home for this snippet. I've tried to follow conventions, but I'm not sure I've gotten it right (especially the error handling). Please let me know if work needs to be done on this.