Documentation

SystemNodeProvider
in package
implements NodeProviderInterface

SystemNodeProvider retrieves the system node ID, if possible

The system node ID, or host ID, is often the same as the MAC address for a network interface on the host.

Interfaces, Classes, Traits and Enums

NodeProviderInterface
A node provider retrieves or generates a node ID

Table of Contents

IFCONFIG_PATTERN  = '/[^:]([0-9a-f]{2}([:-])[0-9a-f]{2}(\\2[0-9a-f]{2}){4})[^:]/i'
Pattern to match nodes in ifconfig and ipconfig output.
SYSFS_PATTERN  = '/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i'
Pattern to match nodes in sysfs stream output.
getNode()  : Hexadecimal
Returns a node ID
getIfconfig()  : string
Returns the network interface configuration for the system
getNodeFromSystem()  : string
Returns the system node, if it can find it
getSysfs()  : string
Returns MAC address from the first system interface via the sysfs interface

Constants

IFCONFIG_PATTERN

Pattern to match nodes in ifconfig and ipconfig output.

private mixed IFCONFIG_PATTERN = '/[^:]([0-9a-f]{2}([:-])[0-9a-f]{2}(\\2[0-9a-f]{2}){4})[^:]/i'

SYSFS_PATTERN

Pattern to match nodes in sysfs stream output.

private mixed SYSFS_PATTERN = '/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i'

Methods

getIfconfig()

Returns the network interface configuration for the system

protected getIfconfig() : string
Tags
codeCoverageIgnore
Return values
string

getNodeFromSystem()

Returns the system node, if it can find it

protected getNodeFromSystem() : string
Return values
string

getSysfs()

Returns MAC address from the first system interface via the sysfs interface

protected getSysfs() : string
Return values
string

Search results