liranringel / ipconfig Goto Github PK
View Code? Open in Web Editor NEWGet network adapters information for windows (written in Rust).
License: Apache License 2.0
Get network adapters information for windows (written in Rust).
License: Apache License 2.0
Hi,
any reason not to have unix support as well?
Would be nice to have one cross platform crate instead of multiple
It would be nice to have the ipv6_if_index()
feature (PR #30) in an official release.
This crate cannot be compiled for i686-pc-windows-msvc until rust-lang/rust-bindgen#541 is resolved.
get_search_list is returning
["lan ad.x.com other.com", "lan", "ad.x.com", "other.com"]
Looking at adaptor properties the first entry doesn't appear but the other three do. The spaces in the first entry cause issues upstream in trust_dns_proto.
This is on Windows 10.
I'm trying to appease cargo-deny
and that would be much easier if there was a new ipconfig 0.3.1 release that just ships latest HEAD (-:
I couldn't get ipconfig to build using cargo 0.23.0-nightly because it could not find clang.dll:
thread 'main' panicked at 'Unable to find libclang: "couldn't find any of ['clang.dll', 'libclang.dll'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (skipped: [])"', src\libcore\result.rs:906:4
note: Run withRUST_BACKTRACE=1
for a backtrace.
IMO, it would be much better to add the necessary Windows API bindings to winapi and/or at least generate them once statically using bindgen, instead of running bindgen as part of build.rs. That way, people using the library wouldn't have to build all of bindgen's dependencies and they wouldn't have to run into issues like this one.
Hi,
thank you very much for this useful crate :D
I'm trying to get the local ip address of the computer and as I have VirtualBox installed, I have multiple interfaces.
How can I distinguish the real one from the virtual one? Both are EthernetCsmacd
.
I'd like to create a server which as the IP address of my computer :)
docs.rs says "The requested resource does not exist"
On two different computers running Windows 10 version 1803 (OS build 17134.191), I encountered the following panic while running cargo test
:
thread 'no_error' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Io(Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }), State { next_error: None, backtrace: Some(stack backtrace:
0: 0x7ff743abc920 - backtrace::backtrace::trace<closure>
at C:\Users\tyn\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.9\src\backtrace\mod.rs:42
1: 0x7ff743ab3f94 - backtrace::capture::Backtrace::new_unresolved
at C:\Users\tyn\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.9\src\capture.rs:88
2: 0x7ff743ab3efd - backtrace::capture::Backtrace::new
at C:\Users\tyn\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.9\src\capture.rs:64
3: 0x7ff743ab1ccc - error_chain::make_backtrace
at C:\Users\tyn\.cargo\registry\src\github.com-1ecc6299db9ec823\error-chain-0.8.1\src\lib.rs:413
4: 0x7ff743ab1d8a - error_chain::{{impl}}::default
at C:\Users\tyn\.cargo\registry\src\github.com-1ecc6299db9ec823\error-chain-0.8.1\src\lib.rs:494
5: 0x7ff743a8fdb8 - ipconfig::error::Error::from_kind
at E:\dev\ipconfig\<error_chain_processed macros>:49
6: 0x7ff743a8fee3 - ipconfig::error::{{impl}}::from
at E:\dev\ipconfig\<error_chain_processed macros>:77
7: 0x7ff743a9580a - ipconfig::computer::get_search_list
at E:\dev\ipconfig\src\computer.rs:52
8: 0x7ff743a42fe3 - test::no_error
at E:\dev\ipconfig\tests\test.rs:7
9: 0x7ff743a4244e - test::__test::TESTS::{{closure}}
at E:\dev\ipconfig\tests\test.rs:5
10: 0x7ff743a419fb - core::ops::function::FnOnce::call_once<closure,()>
at C:\projects\rust\src\libcore\ops\function.rs:223
11: 0x7ff743a4569e - alloc::boxed::{{impl}}::call_box<(),closure>
at C:\projects\rust\src\liballoc\boxed.rs:643
12: 0x7ff743ae7fe2 - panic_unwind::__rust_maybe_catch_panic
at C:\projects\rust\src\libpanic_unwind\lib.rs:105
13: 0x7ff743a5097b - std::sys_common::backtrace::__rust_begin_short_backtrace<closure,()>
at C:\projects\rust\src\libstd\sys_common\backtrace.rs:136
14: 0x7ff743a5186e - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure>,()>
at C:\projects\rust\src\libstd\panicking.rs:312
15: 0x7ff743ae7fe2 - panic_unwind::__rust_maybe_catch_panic
at C:\projects\rust\src\libpanic_unwind\lib.rs:105
16: 0x7ff743a58a15 - alloc::boxed::{{impl}}::call_box<(),closure>
at C:\projects\rust\src\liballoc\boxed.rs:642
17: 0x7ff743ad04a2 - std::sys_common::thread::start_thread
at C:\projects\rust\src\libstd\sys_common\thread.rs:25
18: 0x7ff743ad29e9 - std::sys::windows::thread::{{impl}}::new::thread_start
at C:\projects\rust\src\libstd\sys\windows\thread.rs:58
19: 0x7ff8975e3034 - BaseThreadInitThunk) })', libcore\result.rs:983:5
On both computers, I do not have a SearchList
subkey in SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
. I assume that it can be a valid state, since I didn't remove it manually.
I can work around this issue by creating an empty SearchList
subkey at that location, but it's obviously not great.
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
https://crates.io/crates/socket2
socket2
have release v0.4.
I'm seeing this in our GitHub Actions failing. Tests worked with Rust 1.69.0 using stable-i686-pc-windows-msvc
toolchain, but seems to fail with Rust 1.70.0 with same toolchain.
thread '<redacted>' panicked at 'panic in a function that cannot unwind', library\core\src\panicking.rs:126:5
thread '<redacted>' panicked at 'misaligned pointer dereference: address must be a multiple of 0x8 but is 0x189f604', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1cd66030c949c28d\ipconfig-0.3.1\src\adapter.rs:293:23
Affected function:
Lines 289 to 301 in f6d918f
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.