Constants¶
- class getmac.variables.Constants[source]¶
Bases:
VarsClassPlatform identifiers and other constants.
Attributes Summary
If the system is running Linux (excluding WSL1).
Regular expression pattern for MAC addresses with
:(colon) characters.Regular expression pattern for MAC addresses with
-(dash) characters.On OSX, some MACs in
arpoutput may have a single digit instead of two.Generic platform identifier used for filtering methods.
Windows Subsystem for Linux (WSL) version 1.
Windows Subsystem for Linux (WSL) version 2.
Attributes Documentation
-
ANDROID:
Final[bool]¶ Note
“Linux” methods apply to Android without modifications. If there’s Android-specific stuff then we can add a platform identifier for it.
-
MAC_RE_COLON:
Final[str] = '([0-9a-fA-F]{2}(?::[0-9a-fA-F]{2}){5})'¶ Regular expression pattern for MAC addresses with
:(colon) characters.
-
MAC_RE_DASH:
Final[str] = '([0-9a-fA-F]{2}(?:-[0-9a-fA-F]{2}){5})'¶ Regular expression pattern for MAC addresses with
-(dash) characters.
-
MAC_RE_SHORT:
Final[str] = '([0-9a-fA-F]{1,2}(?::[0-9a-fA-F]{1,2}){5})'¶ On OSX, some MACs in
arpoutput may have a single digit instead of two. This can also happen on other platforms, like Solaris.Examples:
18:4f:32:5a:64:5(note the:5at the end)14:cc:20:1a:99:0(note the:0at the end)
-
PLATFORM:
Final[str]¶ Generic platform identifier used for filtering methods.
# TODO: change “wsl” to “wsl1”, since WSL2 method should just work like normal linux
Possible values:
wsl
linux
windows
darwin
openbsd
freebsd
netbsd
sunos
hp-ux
- Any other values that can be returned by
platform.uname(), converted to lowercase.
- Any other values that can be returned by
-
ANDROID: