Skip to content

My alternative to netifaces on Windows #8

@robertsdotpm

Description

@robertsdotpm

Hello Github,

I've been using netifaces for my P2P networking project and the software is great for the most part. But on Windows it requires the .NET framework which isn't very portable. There is also the issue of interface names being unintelligible and other small bugs. For example: I've noticed on some platforms IPv6 link-local net masks are incorrect. While on Android the software fails to find default gateways. So I've written some patches for these problems.

My own library replaces netifaces on Windows completely with a wrapper around powershell. It uses async coroutines so the program doesn't block. Usage looks like this:

python3 -m asyncio
... REPR starts now with await support ...

from p2pd import *
netifaces = await init_p2pd()

The interface for this object is compatible with netifaces. The software also supports selecting different interfaces for use with network programming and handles loading all address information for you.

i = await Interface()
await i.load_nat()
print(i)

If you're interested in async networking or P2P networking there's more information on p2pd.net. Cheers and hope this issue isn't taken badly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions