Constants¶
- class getmac.variables.Constants[source]¶
Bases:
VarsClassPlatform identifiers and other constants.
Attributes Summary
If the system is running Linux (excluding WSL1), including Android.
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.
Possible values:
wsl (WSL1 only, see
WSL1. WSL2 islinux.)linux (including Android)
windows
darwin
openbsd
freebsd
netbsd
sunos
hp-ux
- Any other values that can be returned by
platform.system(), converted to lowercase.
- Any other values that can be returned by
- WSL1: Final[bool]¶
Windows Subsystem for Linux (WSL) version 1. The version that’s a very cool abstraction layer remapping Linux syscalls to Windows syscalls.
Its kernel release and version contain
Microsoft, e.g.4.4.0-19041-Microsoft. On WSL1,PLATFORMis"wsl"andLINUXisFalse.
- WSL2: Final[bool]¶
Windows Subsystem for Linux (WSL) version 2. The version that’s basically a fancy Linux VM on Hyper-V.
Its kernel release ends with
-microsoft-standard-WSL2, or with-microsoft-standardon older (4.19) kernels. WSL2 uses the Linux methods, soPLATFORMis"linux"andLINUXisTrue.