Settings¶
- class getmac.variables.Settings[source]¶
Bases:
VarsClassUser-configurable settings.
Attributes Summary
How long to keep checking the ARP table (IPv4) or NDP list (IPv6) for a host, in seconds, after sending the UDP packet to populate it (see
PORT).How long to wait for a command that getmac runs (e.g.
arporipconfig.exe) to finish, in seconds.Debugging level.
Force a specific method to be used for all lookups.
User-configurable override to force a specific platform.
UDP port to use for populating the ARP table (IPv4) or NDP list (IPv6) when looking up MACs for hosts or IPs.
Attributes Documentation
- ARP_TIMEOUT: float = 0¶
How long to keep checking the ARP table (IPv4) or NDP list (IPv6) for a host, in seconds, after sending the UDP packet to populate it (see
PORT).The host’s entry is only added once it replies, which often takes longer than getmac takes to check the table. If it isn’t there, getmac checks again with short, growing delays until the host is found or this much time has passed. Lookups of hosts that don’t reply take this much longer.
0(the default) checks once, without waiting.This doesn’t apply when getmac sends an ARP request itself and waits for the reply instead (
ArpingHostorCtypesHost).
- COMMAND_TIMEOUT: float | None = 15.0¶
How long to wait for a command that getmac runs (e.g.
arporipconfig.exe) to finish, in seconds. A command that takes longer is stopped, and the method that ran it is treated as failed, so the next method is tried.This keeps a lookup from hanging forever on a command that never exits. Commands usually finish in well under a second, but some, such as
arpwithout-non macOS, can be slow due to DNS lookups.Noneor0waits for as long as the command takes.
- FORCE_METHOD: str = ''¶
Force a specific method to be used for all lookups. Used for debugging and testing.
- OVERRIDE_PLATFORM: str = ''¶
User-configurable override to force a specific platform.
Methods for this platform are used instead of the methods for the detected platform,
PLATFORM. Use a platform identifier such as"linux"or"wsl", or any value returned byplatform.system(), such as"Darwin". Case and surrounding whitespace are ignored. An empty string (the default) means no override.