from ipaddress import IPv4Address, IPv6Address
from typing import Any, Awaitable, final
@final
class Device:
def ipv4_addr(self, /) -> "Awaitable[IPv4Address]":
def ipv6_addr(self, /) -> "Awaitable[IPv6Address]":
def peer_by_name(self, /, name: "str") -> "Awaitable[dict[str, Any]]":
def peer_by_tailnet_ip(
self, /, ip: "IPv4Address | IPv6Address | str"
) -> "Awaitable[dict[str, Any]]":
def peers_with_route(
self, /, ip: "IPv4Address | IPv6Address | str"
) -> "Awaitable[list[dict[str, Any]]]":
def self_node(self, /) -> "Awaitable[dict[str, Any]]":
def tcp_connect(
self, /, addr: "tuple[IPv4Address | IPv6Address | str, int]"
) -> "Awaitable[TcpStream]":
def tcp_listen(
self, /, addr: "tuple[IPv4Address | IPv6Address | str, int]"
) -> "Awaitable[TcpListener]":
def udp_bind(
self, /, addr: "tuple[IPv4Address | IPv6Address | str, int]"
) -> "Awaitable[UdpSocket]":
@final
class Keystate:
def __new__(
cls,
/,
machine: "bytes | None" = None,
node: "bytes | None" = None,
network_lock: "bytes | None" = None,
) -> Keystate: ...
def __repr__(self, /) -> str: ...
@property
def machine(self, /) -> bytes:
@property
def network_lock(self, /) -> bytes:
@property
def node(self, /) -> bytes:
@final
class TcpListener:
def __repr__(self, /) -> str: ...
def accept(self, /) -> "Awaitable[TcpStream]":
def local_addr(self, /) -> "tuple[IPv4Address | IPv6Address, int]":
@final
class TcpStream:
def __repr__(self, /) -> str: ...
def fileno(self, /) -> int:
def isatty(self, /) -> bool:
def local_addr(self, /) -> "tuple[IPv4Address | IPv6Address, int]":
def readable(self, /) -> bool:
def recv(self, /) -> "Awaitable[bytes]":
def remote_addr(self, /) -> "tuple[IPv4Address | IPv6Address, int]":
def seekable(self, /) -> bool:
def send(self, /, msg: "bytes") -> "Awaitable[int]":
def tell(self, /) -> int:
def writable(self, /) -> bool:
@final
class UdpSocket:
def __repr__(self, /) -> str: ...
def local_addr(self, /) -> "tuple[IPv4Address | IPv6Address, int]":
def recvfrom(
self, /
) -> "Awaitable[tuple[bytes, tuple[IPv4Address | IPv6Address | str, int]]]":
def sendto(
self, /, addr: "tuple[IPv4Address | IPv6Address | str, int]", msg: "bytes"
) -> "Awaitable[None]":
def connect(
key_file_path: "str | None" = None,
/,
auth_key: "str | None" = None,
*,
control_server_url: "str | None" = None,
hostname: "str | None" = None,
tags: "list[str] | None" = None,
keys: "Keystate | None" = None,
) -> "Awaitable[Device]":