Skip to main content

Module network

Module network 

Source
Expand description

Provides helpers for selecting a network interface on the current host through which to preform network scanning, and for detecting the default gateway from the OS routing table.

Structs§

NetworkInterface
Represents a network interface on current host

Functions§

get_available_port
Finds an available port on the current host. This is useful when setting the listening port on a scanner where packets will be received.
get_default_gateway
Returns the default gateway IPv4 address by parsing the system routing table. Works on Linux (ip route show). Returns None if the gateway cannot be determined.
get_default_interface
Finds and returns the default NetworkInterface for current host
get_interface
Finds and returns a NetworkInterface by name for current host