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

Wired interface names on windows {C685FC7C-553A-11EC-8BBC-806E6F6E6963} #16

Closed
mjarkk opened this issue Dec 19, 2021 · 4 comments · Fixed by #34
Closed

Wired interface names on windows {C685FC7C-553A-11EC-8BBC-806E6F6E6963} #16

mjarkk opened this issue Dec 19, 2021 · 4 comments · Fixed by #34

Comments

@mjarkk
Copy link

mjarkk commented Dec 19, 2021

First of all thanks for forking the original project and continue working on it!

On windows all the network interfaces have an UUID like name format but i would suspect it returning the name of the network device as shown in the configuration panel > network connections.

What is returned by this package:

Interface {
    name: "{59837432-A818-4A26-934C-95AA7E3B38B8}",
    addr: V6(
        Ifv6Addr {
            ip: 2001:1c01:3b03:bc00:893d:d764:d21b:e1d0,
            netmask: ffff:ffff:ffff:ffff::,
            broadcast: None,
        },
    ),
}
Interface {
    name: "{59837432-A818-4A26-934C-95AA7E3B38B8}",
    addr: V6(
        Ifv6Addr {
            ip: 2001:1c01:3b03:bc00:e00f:77c8:6e1e:9d2a,
            netmask: ffff:ffff:ffff:ffff::,
            broadcast: None,
        },
    ),
}
Interface {
    name: "{59837432-A818-4A26-934C-95AA7E3B38B8}",
    addr: V4(
        Ifv4Addr {
            ip: 192.168.178.21,
            netmask: 255.255.255.0,
            broadcast: Some(
                192.168.178.255,
            ),
        },
    ),
}
Interface {
    name: "{C685FC7C-553A-11EC-8BBC-806E6F6E6963}",
    addr: V6(
        Ifv6Addr {
            ip: ::1,
            netmask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff,
            broadcast: None,
        },
    ),
}
Interface {
    name: "{C685FC7C-553A-11EC-8BBC-806E6F6E6963}",
    addr: V4(
        Ifv4Addr {
            ip: 127.0.0.1,
            netmask: 255.0.0.0,
            broadcast: Some(
                127.255.255.255,
            ),
        },
    ),
}
Interface {
    name: "{EE4F5BC4-EBAD-46B5-B1CD-745513792416}",
    addr: V4(
        Ifv4Addr {
            ip: 172.28.48.1,
            netmask: 255.255.31.0,
            broadcast: Some(
                172.28.240.255,
            ),
        },
    ),
}

The names i suspected:

image

@messense
Copy link
Owner

I don't know much about Windows so I'm unable to help. Feel free to open a PR if you find a way to do that.

@DoumanAsh
Copy link

You need friendlyName for that, which require to not set flag GAA_FLAG_SKIP_FRIENDLY_NAME
https://github.com/messense/if-addrs/blob/master/src/windows.rs#L50

@HuakunShen
Copy link

any update on this?

@mon
Copy link
Collaborator

mon commented Mar 31, 2024

I'd like to pick this up, but some questions before I start:

  • Is it OK to make the breaking change of using the human-readable name instead of the GUID?
  • Is it OK to add a windows-only guid field to the pub struct Interface? The GUIDs are still useful when integrating with npcap, as that doesn't expose names either.

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 a pull request may close this issue.

5 participants