Network Module
SPDX-FileCopyrightText: 2024 DESY and the Constellation authors
SPDX-License-Identifier: EUPL-1.2
This module provides network helper routines.
-
core.network.get_addr(if_name: str) → str | None
Get the IPv4 address for the given interface name.
-
core.network.get_interface_addresses(interface_names: list[str]) → set[str]
Get all multicast interface addresses for a given list of interface names.
-
core.network.get_interface_names() → list[str]
Get all multicast interface names.
-
core.network.get_loopback_interface_name() → str
-
core.network.validate_interface(interface: str) → str
Validate that the provided interface exists.
interface :: IPv4 address or name of an existing network interface.
Returns IPv4 address of interface or ‘*’ for any/all interfaces.
Raises ValueError if the interface/IP does not exist.