liranringel / ipconfig

Get network adapters information for windows (written in Rust).
Apache License 2.0
37 stars 15 forks source link

Feature Request: Connection Profile #52

Open laduke opened 1 year ago

laduke commented 1 year ago

Hey there, I'm interested in getting the Connection Profile of an Adapter. It's in a different section of the windows api sadly. It's the thing that says if a network is "private" or "public".

If I figure out how to do this FFI stuff, would you take a PR?

get-netconnectionprofile

Name                     : Network
InterfaceAlias           : Ethernet
InterfaceIndex           : 7
NetworkCategory          : Private
DomainAuthenticationKind : None
IPv4Connectivity         : Internet
IPv6Connectivity         : Internet

https://learn.microsoft.com/en-us/windows/win32/api/netlistmgr/nf-netlistmgr-inetwork-getcategory

liranringel commented 1 year ago

Sure :)

laduke commented 1 year ago

Alright. I think I run bindgen for with that function added to the whitelist. Then make a rust type for it and do similar to what's in Adapter.

I might not be able to work on this any time soon.