libioc.helpers_ioctl module

Interface for ioctl abstraction.

class libioc.helpers_ioctl.SOCKIO_IOCTLS[source]

Bases: enum.Enum

Hardcoded ioctl numbers.

SIOCGIFADDR = -1071617759
SIOCGIFMTU = -1071617741
libioc.helpers_ioctl.get_interface_ip4_address(nic_name)[source]

Return the primary IPv4Address of a given NIC.

Return type

IPv4Address

libioc.helpers_ioctl.get_interface_mtu(nic_name)[source]

Return the primary MTU of a given NIC.

Return type

int

libioc.helpers_ioctl.get_sockio_ioctl(nic_name, ioctl)[source]

Query a sockio ioctl for a given NIC.

Return type

bytes