Skip to content

net: get npcap usable windows network device names  #35095

@acecase

Description

@acecase

net.Interfaces(), net.InterfaceByName(), and net.InterfaceByIndex() return an Interface struct with a Name variable. On Linux, this will tend to be the name (eth0, wlan0, en0, etc) that can be passed to pcap functions/methods (eg. "github.com/google/gopacket/pcap".OpenLive() )

However, that isn't the case on Windows 10.

On my box net.InterfaceByIndex(5), for example returns a Interface.Name "Ethernet" and what I need for pcap.OpenLive() is "\Device\NPF_{13044533-0543-4AF5-9E3C-85EBBC7C04BB}"

gopacket and gopacket/pcap are really promising. ~as simple as scappy, and ~as fast as c, and I can write it once and run it on Windows and Linux. Except, not quite yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Windows

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions