latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses

Module Contents

Classes

WinDLL

Stub for WinDLL instance types.

SOCKADDR_IN

IPv4 address struct.

SOCKADDR_IN6

IPv6 address struct.

SOCKET_ADDRESS

Unknown address struct, can be SOCKADDR_IN or SOCKADDR_IN6.

IP_ADAPTER_GATEWAY_ADDRESS_LH

Struct for gateway address info linked lists.

IP_ADAPTER_WINS_SERVER_ADDRESS_LH

Struct for win server address info linked lists.

IP_ADAPTER_PREFIX_XP

Struct for adapter address info linked lists.

IP_ADAPTER_DNS_SERVER_ADDRESS_XP

Struct for dns address info linked lists.

IP_ADAPTER_MULTICAST_ADDRESS_XP

Struct for adapter multicast address info (deprecated Windows XP format) linked lists.

IP_ADAPTER_ANYCAST_ADDRESS_XP

Struct for adapter anycast address info (deprecated Windows XP format) linked lists.

IP_ADAPTER_UNICAST_ADDRESS_LH

Struct for adapter unicast address info linked lists.

IP_ADAPTER_DNS_SUFFIX

Struct stub for DNS suffixes.

IF_LUID

Struct for LUID info.

IP_ADAPTER_ADDRESSES_LH

Struct for GetAdaptersAddresses return values.

GetAdaptersAddresses

Attempt to find local addresses using the GetAdaptersAddresses system call.

Attributes

actual_kernel32

AF_UNSPEC

GAA_FLAG_INCLUDE_PREFIX

ERROR_BUFFER_OVERFLOW

MAX_ADAPTER_ADDRESS_LENGTH

MAX_DHCPV6_DUID_LENGTH

MAX_DNS_SUFFIX_STRING_LENGTH

IF_INDEX

IFTYPE

IF_OPER_STATUS

IP_DAD_STATE

IP_PREFIX_ORIGIN

IP_SUFFIX_ORIGIN

LPSOCKADDR

NET_IF_COMPARTMENT_ID

NET_IF_CONNECTION_TYPE

NET_IF_NETWORK_GUID

TUNNEL_TYPE

_GetAdaptersAddresses

HeapAlloc

GetProcessHeap

HeapFree

class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.WinDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False, winmode=None)

Bases: ctypes.CDLL

Stub for WinDLL instance types.

class _HeapAlloc

Bases: Protocol, SupportsInt

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto(Protocol[T]):
    def meth(self) -> T:
        ...
restype: type[ctypes.wintypes.LPVOID]
argtypes: list
__call__(hHeap: ctypes.c_void_p, dwFlags: ctypes.wintypes.DWORD, dwBytes: ctypes.c_size_t) ctypes._Pointer
class _GetProcessHeap

Bases: Protocol, SupportsInt

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto(Protocol[T]):
    def meth(self) -> T:
        ...
restype: type[ctypes.wintypes.HANDLE]
argtypes: list
__call__() ctypes._Pointer
class _HeapFree

Bases: Protocol, SupportsInt

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto(Protocol[T]):
    def meth(self) -> T:
        ...
restype: type[ctypes.wintypes.BOOL]
argtypes: list
__call__(hHeap: ctypes.c_void_p, dwFlags: ctypes.wintypes.DWORD, lpMem: ctypes._Pointer) ctypes._Pointer
HeapAlloc: WinDLL._HeapAlloc
GetProcessHeap: WinDLL._GetProcessHeap
HeapFree: WinDLL._HeapFree
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.actual_kernel32
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.AF_UNSPEC
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.GAA_FLAG_INCLUDE_PREFIX
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.ERROR_BUFFER_OVERFLOW = 111
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.MAX_ADAPTER_ADDRESS_LENGTH = 8
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.MAX_DHCPV6_DUID_LENGTH = 130
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.MAX_DNS_SUFFIX_STRING_LENGTH = 256
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IF_INDEX
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IFTYPE
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IF_OPER_STATUS
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_DAD_STATE
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_PREFIX_ORIGIN
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_SUFFIX_ORIGIN
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.LPSOCKADDR
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.NET_IF_COMPARTMENT_ID
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.NET_IF_CONNECTION_TYPE
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.NET_IF_NETWORK_GUID
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.TUNNEL_TYPE
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses._GetAdaptersAddresses
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.HeapAlloc
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.GetProcessHeap
latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.HeapFree
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.SOCKADDR_IN

Bases: ctypes.Structure

IPv4 address struct.

_fields_ = [('sin_family',), ('sin_port',), ('sin_addr',), ('sin_zero',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.SOCKADDR_IN6

Bases: ctypes.Structure

IPv6 address struct.

_fields_ = [('sin6_family',), ('sin6_port',), ('sin6_flowinfo',), ('sin6_addr',), ('sin6_scope_id',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.SOCKET_ADDRESS

Bases: ctypes.Structure

Unknown address struct, can be SOCKADDR_IN or SOCKADDR_IN6.

_fields_ = [('lpSockaddr',), ('iSockaddrLength',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_GATEWAY_ADDRESS_LH

Bases: ctypes.Structure

Struct for gateway address info linked lists.

class _u1

Bases: ctypes.Union

Union base class

class _s1

Bases: ctypes.Structure

Structure base class

_fields_ = [('Length',), ('Reserved',)]
_fields_ = [('Alignment',), ('__s1',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_WINS_SERVER_ADDRESS_LH

Bases: ctypes.Structure

Struct for win server address info linked lists.

class _u1

Bases: ctypes.Union

Union base class

class _s1

Bases: ctypes.Structure

Structure base class

_fields_ = [('Length',), ('Reserved',)]
_fields_ = [('Alignment',), ('__s1',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_PREFIX_XP

Bases: ctypes.Structure

Struct for adapter address info linked lists.

class _u1

Bases: ctypes.Union

Union base class

class _s1

Bases: ctypes.Structure

Structure base class

_fields_ = [('Length',), ('Flags',)]
_fields_ = [('Alignment',), ('__s1',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_DNS_SERVER_ADDRESS_XP

Bases: ctypes.Structure

Struct for dns address info linked lists.

class _u1

Bases: ctypes.Union

Union base class

class _s1

Bases: ctypes.Structure

Structure base class

_fields_ = [('Length',), ('Reserved',)]
_fields_ = [('Alignment',), ('__s1',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_MULTICAST_ADDRESS_XP

Bases: ctypes.Structure

Struct for adapter multicast address info (deprecated Windows XP format) linked lists.

class _u1

Bases: ctypes.Union

Union base class

class _s1

Bases: ctypes.Structure

Structure base class

_fields_ = [('Length',), ('Flags',)]
_fields_ = [('Alignment',), ('__s1',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_ANYCAST_ADDRESS_XP

Bases: ctypes.Structure

Struct for adapter anycast address info (deprecated Windows XP format) linked lists.

class _u1

Bases: ctypes.Union

Union base class

class _s1

Bases: ctypes.Structure

Structure base class

_fields_ = [('Length',), ('Flags',)]
_fields_ = [('Alignment',), ('__s1',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_UNICAST_ADDRESS_LH

Bases: ctypes.Structure

Struct for adapter unicast address info linked lists.

class _u1

Bases: ctypes.Union

Union base class

class _s1

Bases: ctypes.Structure

Structure base class

_fields_ = [('Length',), ('Flags',)]
_fields_ = [('Alignment',), ('__s1',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_DNS_SUFFIX

Bases: ctypes.Structure

Struct stub for DNS suffixes.

class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IF_LUID

Bases: ctypes.Structure

Struct for LUID info.

_fields_ = [('LowPart',), ('HighPart',)]
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.IP_ADAPTER_ADDRESSES_LH

Bases: ctypes.Structure

Struct for GetAdaptersAddresses return values.

class _u1

Bases: ctypes.Union

Union base class

class _s1

Bases: ctypes.Structure

Structure base class

_fields_ = [('Length',), ('IfIndex',)]
_fields_ = [('Alignment',), ('__s1',)]
__slots__ = ['__u1', 'Next', 'AdapterName', 'FirstUnicastAddress', 'FirstAnycastAddress',...
class latest.ipv8.messaging.interfaces.lan_addresses.windows.GetAdaptersAddresses.GetAdaptersAddresses(verbose: bool = False)

Bases: latest.ipv8.messaging.interfaces.lan_addresses.addressprovider.AddressProvider

Attempt to find local addresses using the GetAdaptersAddresses system call.

get_addresses() set

Call GetAdaptersAddresses() to retrieve addresses.