EstebanBorai / network-interface

Retrieve system's Network Interfaces on Linux, macOS and Windows on a standardized manner
https://crates.io/crates/network-interface
Apache License 2.0
61 stars 28 forks source link

feat: Add interface index (#11) #25

Closed YuiYukihira closed 1 year ago

YuiYukihira commented 1 year ago

Hey there, 👋

I'm writing my own project that needs network interfaces, and this crate looks pretty good for my needs.

My only problem is that I need the interface index as well. I saw that there's a currently open issue (#11) for this but no PR, so I thought I'd give it a go.

Testing

Let me know if there's any changes you think I should make.

EstebanBorai commented 1 year ago

Hi @YuiYukihira!

Thanks so much for opening this PR, it looks like the changes are not compiling for Windows. Looks related to not passing the new index param to mostly.

Otherwise looks great!

YuiYukihira commented 1 year ago

Hey @EstebanBorai,

I've added a new commit to resolve the windows issues, I also had to add a new error type because winapi uses u32 sized errors codes, instead of i32.

Let me know before you merge anything and I'll squash this into a single commit.

YuiYukihira commented 1 year ago

Sorry about that, should all be fine this time.

EstebanBorai commented 1 year ago

Sorry about that, should all be fine this time.

No worries!

YuiYukihira commented 1 year ago

Great, thanks!

Btw, do you have an idea when you might make a new release that incorporates this?