10#include <netinet/in.h>
18 Unspec =
static_cast<std::uint32_t
>(FI_ADDR_UNSPEC),
79 using Native = std::variant<std::monostate,
116 return std::holds_alternative<std::monostate>(
_native);
134 std::optional<std::string>
node()
const;
138 std::optional<std::string>
service()
const;
Owning, type-safe representation of a libfabric address.
static FabricAddress parse(Provider provider, std::optional< std::string > node, std::optional< std::string > service)
Parse a node/service pair into a typed address for the given provider.
bool empty() const noexcept
True if the address could not be decoded (holds std::monostate).
Native const & native() const noexcept
Access the underlying variant.
std::optional< std::string > node() const
Return the host portion of the address as a string.
FabricAddressFormat addressFormat() const noexcept
Return the libfabric address format constant (FI_SOCKADDR_IN, etc.).
static FabricAddress fromSource(FabricInfoView info) noexcept
Build a FabricAddress from the source address of info.
static FabricAddress decode(FabricAddressFormat addrFormat, void const *addr, std::size_t len)
Decode a raw libfabric address buffer of the given addr_format.
static FabricAddress fromDestination(FabricInfoView info) noexcept
Build a FabricAddress from the destination address of info.
std::optional< std::string > service() const
Return the service/port portion of the address as a string.
std::string toString() const
Format the address exactly as libfabric's internal ofi_straddr.
std::variant< std::monostate, ::sockaddr_in, ::sockaddr_in6, OfiSockaddrIb, EfaAddress, std::string > Native
Non-owning view of a FabricInfo. Returned when iterating over a FabricInfoList.
FabricAddressFormat convertAddressFormat(std::uint32_t fiAddrFormat)
Convert from libfabric address format value to FabricAddressFormat.
Provider
Internal representation of supported libfabric providers.
FabricAddressFormat mustConvertAddressFormat(std::uint32_t fiAddrFormat)
Convert from libfabric address format value to FabricAddressFormat Never returns FabricAddressFormat:...
Decoded representation of an FI_ADDR_EFA address.
Local declaration of libfabric's internal struct ofi_sockaddr_ib.
std::uint64_t sib_sid_mask
std::uint32_t sib_flowinfo
unsigned short sib_family
std::uint8_t sib_addr[16]
std::uint64_t sib_scope_id