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

Added if_nametoindex (and necessary module based on Cs net/if.h) #245

Closed
wants to merge 6 commits into from

Conversation

mbr
Copy link
Contributor

@mbr mbr commented Jan 25, 2016

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.

@kamalmarhubi
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

@kamalmarhubi
Copy link
Member

FYI I just sent out rust-lang/libc#153 adding if_indextoname to libc.

@mbr
Copy link
Contributor Author

mbr commented Jan 27, 2016

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.

@kamalmarhubi
Copy link
Member

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 str issue you mentioned with NixPath.

Thanks again!

@kamalmarhubi
Copy link
Member

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

@kamalmarhubi
Copy link
Member

CI went green, merged as: e8f014d...beec2f4 :-)

@mbr
Copy link
Contributor Author

mbr commented Jan 29, 2016

Perfekt, thanks! =) Now I just need to fix the typo in the function documentation ("a" => "an")... =)

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

Successfully merging this pull request may close these issues.

2 participants