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

WinPcap - Open the right nic (Network Interface Card) #15

Open
YoramT555 opened this issue Jul 15, 2019 · 0 comments
Open

WinPcap - Open the right nic (Network Interface Card) #15

YoramT555 opened this issue Jul 15, 2019 · 0 comments

Comments

@YoramT555
Copy link

**Hi,
I had on my computer 2 nics with same description.
It could not distinguish between the two and opened always the first one. In winpcapy.py I saw it looks for match with the description only.

@classmethod
def get_matching_device(cls, glob=None):
    for name, description in cls.list_devices().items():
        if fnmatch.fnmatch(description, glob):
            return name, description
    return None, None

I've added a search with the name and left the search by description (for backward comparability purposes). Now you can look for your nic either with a name or with the description.
Note that the name can includes the full GUID !!

@classmethod
def get_matching_device(cls, glob=None):
    for name, description in cls.list_devices().items():
        if fnmatch.fnmatch(name, glob) :
            return name, description
    for name, description in cls.list_devices().items():
        if fnmatch.fnmatch(description, glob):
            return name, description
    return None, None
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

No branches or pull requests

1 participant