module

RNS::NetInfo

Network interface information module. Provides interface enumeration, address lookup, and name-to-index mapping using POSIX getifaddrs. Ports the functionality of RNS/Interfaces/util/netinfo.py.

Constants

AF_INET = Socket::Family::INET.value
AF_INET6 = Socket::Family::INET6.value
INET6_ADDRSTRLEN = 46

Class methods

format_ipv6(bytes : Bytes) : String

Format 16 bytes as a compressed IPv6 address string

Source
ifaddresses(ifname : String) : Hash(Int32, Array(AddressInfo))

Get addresses for an interface, grouped by address family. Returns Hash mapping AF_INET/AF_INET6 to arrays of AddressInfo.

Source
interface_name_to_index(ifname : String) : UInt32

Get OS index for an interface name

Source
interface_name_to_nice_name(ifname : String) : String | Nil

Get display name for an interface (on POSIX, same as name)

Source
interface_names_to_indexes

Map interface names to their OS indexes

Source
interfaces

Get list of all network interface names

Source

Nested types