get_by_method¶
- getmac.getmac.get_by_method(method_type, arg='', network_request=True)[source]¶
Query for a MAC using a specific method.
- Parameters:
method_type (
str) – the type of lookup being performed. Allowed values are:ip4,ip6,iface,default_ifacearg (
str) – Argument to pass to the method, e.g. an interface name or IP addressnetwork_request (
bool) – if methods that make network requests should be included (those methods that have the attributenetwork_requestset toTrue)
- Return type:
- Returns:
The MAC address string, or
Noneif the operation failed