Skip to content

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 12 Oct 11:59

Added

  • UDPEndpoint(sock, *, pktinfo=True, interfaces=()) knows the interfaces it
    serves: .interfaces is a tuple of Interface, and admits(datagram) -> bool is true when it is empty or the datagram arrived on one of them (a
    datagram with no arrival interface is not admitted by a limited endpoint).
    Receiving never filters, so a caller can count what it drops. An item that is
    not an Interface, or has no index, is refused at construction.

  • bind_listen(listen=None, default_ports=0, *, family=None, per_address=None, device_binding=True, allow_address_takeover=False, broadcast=False) -> Tuple[UDPEndpoint, ...] binds what parse_listen names and returns an
    endpoint for each socket, in order. An address is one exclusive socket; a
    wildcard is one socket with packet info, or, with per_address=True or on a
    host whose sockets report no packet info, one socket for each address of the
    host (loopback and link-local included; an IPv6 link-local address is bound with
    its zone); an interface binding is one wildcard socket whose endpoint serves
    those adapters (.interfaces), bound to the device where the platform can
    (device_binding=False to decline) and otherwise left to admits. A device
    bind the kernel refuses is repeated without it and logged once at WARNING on
    netimps._listen. An IPv6 socket is IPv6 only on every platform, so * and
    :: on one port are two sockets and no arrival is v4-mapped. A selector that
    matches no adapter is NetimpsValueError before any socket is opened, and a
    failure closes every socket the call opened.

  • parse_listen(listen=None, default_ports=0, *, family=None) -> Tuple[ListenAddress, ...]
    reads where a service listens: text ("*", ":67", "127.0.0.1:67",
    "[::1]:69", "eth1:67", "aa-bb-cc-dd-ee-ff", several joined by commas), an
    IPv4Address or IPv6Address, an Interface or MACAddress, a
    (host, ports) pair (a list from a configuration file too), or a sequence of
    those. It does no I/O: no name is resolved and no interface is looked up.
    Each address and port appears once, in the order first written. Text that is
    no address names an interface, as a MAC or an adapter name, and limits a
    wildcard socket to it. family=socket.AF_INET6 makes the wildcard forms and an
    interface binding IPv6's; the default takes the wildcard forms as IPv4's, as
    bind("") does. ListenAddress (.address, .port, .interfaces) is the
    result's item, and is itself an accepted binding, so parsing a result gives it
    back. ListenLike is the alias of what is accepted.

Changed

  • The cli extra needs duho 0.7.3: duho>=0.7.3,<0.8, where it was
    >=0.7.0,<0.8. The netimps command, its options and its output are the
    same. Served as tools (NETIMPS_MCP=stdio), that duho also reads
    NETIMPS_MCP_OUTPUT, where a tool's output that is not text would go; no
    netimps command writes any, and a value that does not qualify ends the
    server with status 2.

Fixed

  • Windows: recvmsg sets MSG_TRUNC only when the payload was cut. A control
    buffer too small for the packet information, on a socket whose option is on,
    came back as MSG_TRUNC | MSG_CTRUNC with the data whole, so
    UDPEndpoint(sock, pktinfo=False).recv(...).truncated was true for a datagram
    that fit. Each buffer now reports as its own flag, as on POSIX.

Full Changelog: v0.4.0...v0.4.1