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
Implement nic on windows #297
Conversation
Hey, @daladim, amazing work! There is a lot to review and due to holiday season I'm not sure if I'll be able do that very soon, but your change looks very helpful and promising, so I'll try my best to do that asap |
Hi @svartalf , did you have time to review these changes? Do you want any help to do so? |
@daladim I'm sorry, definitely not cool from my side. |
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.
Looks good in general, I have one tiny nitpick regarding the mem::size_of
usage and after that I'll merge this PR
} | ||
|
||
pub fn is_running(&self) -> bool { | ||
unimplemented!() | ||
// TODO: not sure how to tell on Windows | ||
true |
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.
As a reminder: after all reviews it would be nice to create tracking issues for this and above TODO
s in order not to forget about these things.
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.
https://todo.jasonet.co/ I've used this in some projects to great effect. It's a bot that automatically opens issues for TODO comments when merging a PR. Thought you might be interested ^^.
Nothing to hurry about, I was just checking all my pending pull requests. Thanks for the review! |
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.
I've also found GetIfTable2
and MIB_IF_ROW2
, which is also used by psutil
(except they are using outdated GetIfTable
).
Looks like it also have a lot of interesting information, @daladim, I'm curious if you checked it before? GetInterfaceAddresses
covers current public API, but this thing is also might be interesting.
Unfortunately, I can't find how to provide information for destination
and is_running
methods, which means that if we will not be able to figure them out, I'll demote them to be *nix-specific methods and move into heim::net::os::nix::NicExt
(it is out of scope for this PR, though).
There are indeed quite a few Microsoft APIs to retrieve info about network interfaces. I've had a look at all of them (at least all which are part of the IP Helper API), but it turns out |
As to the merge conflicts, do you prefer a rebase on master, or a merge commit that merges master on my current branch? |
Thanks, looks like the best choice we have :)
No personal choice from me, I usually just squashing branches before merge into master branch :| |
This is consistent with the Linux behaviour
5a43731
to
f2fdf4d
Compare
I've rebased on master to solve the merge conflicts (basically due to the |
Some new clippy lint breaks CI, but I'll fix that separately on my own. |
Hello, I had to implement a piece of heim for my needs, let"s share it!
This MR implements
heim::net::nic()
on Windows using theGetAdaptersAddresses
API.It closes #24
It also adds an
index()
member function forNic
s on Windows, macOS and Linux