OpenMediaVault  0.6 (Kralizec)
The open network attached storage solution
 All Classes Functions Variables Groups Pages
Public Member Functions | Protected Attributes | List of all members
OMVNetworkInterface Class Reference
Inheritance diagram for OMVNetworkInterface:
OMVObject

Public Member Functions

 __construct ($name)
 
 getDeviceName ()
 
 exists ()
 
 getIP ()
 
 getIP6 ()
 
 getMask ()
 
 getMask6 ()
 
 getMAC ()
 
 getMTU ()
 
 getGateway ()
 
 getGateway6 ()
 
 getState ()
 
 getLink ()
 
 getStatistics ()
 
- Public Member Functions inherited from OMVObject
 __construct ()
 
 getLastError ()
 

Protected Attributes

 $name = ""
 
 $ifconfig = null
 
 $ip = null
 
 $ethtool = null
 
 $regex
 

Additional Inherited Members

- Protected Member Functions inherited from OMVObject
 setLastError ($error)
 
 debug ()
 

Detailed Description

This class provides a simple interface to handle Linux network interfaces.

Constructor & Destructor Documentation

OMVNetworkInterface::__construct (   $name)

Constructor

Parameters
nameThe network interface name, e.g. eth0, ethx, ...

Member Function Documentation

OMVNetworkInterface::exists ( )

Check whether the network interface exists.

Returns
TRUE if the network interface exists, otherwise FALSE.
OMVNetworkInterface::getDeviceName ( )

Get the network interface name, e.g. eth0 or ethx.

Returns
The network interface name.
OMVNetworkInterface::getGateway ( )

Get the network interface IPv4 default gateway.

Returns
The interface default gateway, or FALSE on failure.
OMVNetworkInterface::getGateway6 ( )

Get the network interface IPv6 default gateway.

Returns
The interface default gateway, or FALSE on failure.
OMVNetworkInterface::getIP ( )

Get the network interface IPv4 address.

Returns
The network interface IPv4 address, otherwise FALSE.
OMVNetworkInterface::getIP6 ( )

Get the network interface IPv6 address.

Returns
The network interface IPv6 address, otherwise FALSE.
OMVNetworkInterface::getLink ( )

Get the network interface link state.

Returns
TRUE if link is established, otherwise FALSE.
OMVNetworkInterface::getMAC ( )

Get the network interface MAC address.

Returns
The network interface MAC address, otherwise FALSE.
OMVNetworkInterface::getMask ( )

Get the network interface mask.

Returns
The network interface mask, otherwise FALSE.
OMVNetworkInterface::getMask6 ( )

Get the network interface IPv6 mask/prefix length.

Returns
The network interface IPv6 mask/prefix length as integer, otherwise FALSE.
OMVNetworkInterface::getMTU ( )

Get the network interface MTU.

Returns
The network interface MTU, otherwise FALSE.
OMVNetworkInterface::getState ( )

Get the network interface state.

Returns
The network interface state, otherwise FALSE.
OMVNetworkInterface::getStatistics ( )

Get the network interface statistics.

Returns
The network interface statistics, otherwise FALSE. array( rx_bytes => xxx, rx_packets => xxx, rx_errors => xxx, rx_dropped => xxx, rx_fifo_errors => xxx, rx_frame_errors => xxx, rx_compressed => xxx, rx_multicast => xxx, tx_bytes => xxx, tx_packets => xxx, tx_errors => xxx, tx_dropped => xxx, tx_fifo_errors => xxx, tx_collisions => xxx, tx_carrier_errors => xxx, tx_compressed => xxx )

Member Data Documentation

OMVNetworkInterface::$regex
protected
Initial value:
= array(
"ipv4" => '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}',
"ipv6" => '[a-f0-9:]+',
"ipv6cidr" => '([a-f0-9:]+)\/(\d{1,2})',
"state" => 'UP|DOWN|UNKNOWN'
)

The documentation for this class was generated from the following file: