Public Member Functions | |
__toString () | |
Returns name or MAC address of device. | |
is_mac_unique ($iface_id, $mac) | |
Checks whether the given new MAC of the given iface is unique in all subnets that are in relation with the iface over his IP addresses. | |
count_ifaces_of_device ($device_id) | |
Get count of ifaces of device. | |
get_all_ifaces ($limit_from=0, $limit_results=20, $order_by= 'id', $order_by_direction= 'asc', $filter_sql= '') | |
Function gets all interfaces. | |
count_all_ifaces ($filter_sql= '') | |
Function counts all interfaces. | |
get_all_ifaces_of_device ($device_id, $type=NULL) | |
Returns all interfaces of device. | |
get_all_vlan_ifaces_of_device ($device_id) | |
Returns all VLAN ifaces of device. | |
get_all_wireless_ifaces_of_device ($device_id) | |
Returns all wireless interfaces of device. | |
get_virtual_ap_ifaces_of_parent ($parent_iface_id=NULL) | |
Gets ifaces of parent iface which is given by ID. | |
select_list_grouped_by_device ($device_id=NULL, $restrict_types=array()) | |
Gets array of ifaces grouped by device for dropdown. | |
count_items_by_mode_and_link ($wmode, $link_id, $iface_id=NULL) | |
Counts items by wireless mode and link. | |
get_iface_connected_to_iface ($iface=NULL) | |
Gets interface connected to interface via link. | |
get_ifaces_connected_to_iface ($iface=NULL) | |
Gets all interfaces connected to interface via link. | |
get_iface_for_connecting_to_iface ($user_id, $type, $gps=array(), $filter_sql= '', $wmode=NULL) | |
Tries to find best suitable interface for connecting of a new device of user. | |
vlan_exists ($vlan_id) | |
Checks whether VLAN exists on ports or VLAN ifaces. | |
get_untagged_vlan () | |
Returns untagged VLAN of port (if exists) | |
is_in_bridge () | |
Checks whether iface is in bridge. |
Static Public Member Functions | |
static | type_has_link ($type) |
Tests if type can have link. | |
static | get_types_has_link () |
Gets whole array of indicator of available link. | |
static | get_type_has_link_with_medium ($type) |
Gets link mediums types for interface type. | |
static | get_types_has_link_with_medium ($type) |
Gets link mediums for interface type. | |
static | type_has_mac_address ($type) |
Tests if type can have mac address. | |
static | type_has_ip_address ($type) |
Tests if type can have IP address. | |
static | get_types_has_mac_address () |
Gets whole array of indicator of available MAC. | |
static | get_can_connect_to ($type) |
Gets array of iface type to which the given type of interface may connect. | |
static | get_can_be_child_of ($type) |
Gets array of iface type of which the given interface may be child. | |
static | get_type ($type) |
Returns type of current interface. | |
static | get_types () |
Returns all types of interfaces. | |
static | get_necessary_types () |
Returns necessary types of interfaces. | |
static | get_default_name ($type) |
Returns default name of current type of interface. | |
static | get_default_names () |
Returns all default names of interfaces. | |
static | get_wireless_mode ($mode=NULL) |
Returns mode of current wireless interface. | |
static | get_wireless_modes () |
Returns all modes of wireless interfaces. | |
static | get_wireless_antenna ($antenna) |
Returns antenna of current wireless interface. | |
static | get_wireless_antennas () |
Returns all antennas of wireless interfaces. | |
static | get_port_mode ($mode) |
Return human format for given const of mode. | |
static | get_port_modes () |
Return human format for modes. | |
static | get_port_vlan_types () |
Return human format for port VLAN types. |
Public Attributes | |
const | TYPE_WIRELESS = 1 |
Wireless type of iface. | |
const | TYPE_ETHERNET = 2 |
Ethernet type of iface. | |
const | TYPE_PORT = 3 |
Interface is port (link layer - without MAC) | |
const | TYPE_BRIDGE = 4 |
Bridge interface. | |
const | TYPE_VLAN = 5 |
Virtual interface. | |
const | TYPE_INTERNAL = 6 |
Special type of interface for configuration of switches. | |
const | TYPE_VIRTUAL_AP = 7 |
Virtual AP over a wireless iface. | |
const | WIRELESS_MODE_AP = 1 |
AP mode of wireless iface. | |
const | WIRELESS_MODE_CLIENT = 2 |
Client mode of wireless iface. | |
const | WIRELESS_ANTENNA_DIRECTIONAL = 1 |
Directional type of antenna. | |
const | WIRELESS_ANTENNA_OMNIDIRECTIONAL = 2 |
Omnidirectional type of antenna. | |
const | WIRELESS_ANTENNA_SECTIONAL = 3 |
Sectional type of antenna. | |
const | PORT_MODE_ACCESS = 1 |
Const for mode access. | |
const | PORT_MODE_TRUNK = 2 |
Const for mode trunk. | |
const | PORT_MODE_HYBRID = 3 |
Const for mode hybrid. | |
const | PORT_VLAN_TAGGED = 1 |
Const for type tagged. | |
const | PORT_VLAN_UNTAGGED = 2 |
Const for type untagged. |
Protected Attributes | |
$belongs_to = array('link', 'device') | |
$has_many |
Iface_Model::__toString | ( | ) |
Returns name or MAC address of device.
Iface_Model::count_all_ifaces | ( | $filter_sql = '' | ) |
Function counts all interfaces.
Iface_Model::count_ifaces_of_device | ( | $device_id | ) |
Get count of ifaces of device.
integer | $device_id |
Iface_Model::count_items_by_mode_and_link | ( | $wmode, | |
$link_id, | |||
$iface_id = NULL |
|||
) |
Counts items by wireless mode and link.
integer | $wmode | |
integer | $link_id | |
integer | $iface_id | If set this interface is avoided [optional] |
Iface_Model::get_all_ifaces | ( | $limit_from = 0 , |
|
$limit_results = 20 , |
|||
$order_by = 'id' , |
|||
$order_by_direction = 'asc' , |
|||
$filter_sql = '' |
|||
) |
Function gets all interfaces.
$limit_from | |
$limit_results | |
$order_by | |
$order_by_direction |
Iface_Model::get_all_ifaces_of_device | ( | $device_id, | |
$type = NULL |
|||
) |
Returns all interfaces of device.
int | $device_id | |
mixed | $type | Array of types or a single type |
Iface_Model::get_all_vlan_ifaces_of_device | ( | $device_id | ) |
Returns all VLAN ifaces of device.
type | $device_id |
Iface_Model::get_all_wireless_ifaces_of_device | ( | $device_id | ) |
Returns all wireless interfaces of device.
type | $device_id |
|
static |
Gets array of iface type of which the given interface may be child.
type | $type | One of ifaces types |
|
static |
Gets array of iface type to which the given type of interface may connect.
integer | $type | One of ifaces types |
|
static |
Returns default name of current type of interface.
integer | $type |
|
static |
Returns all default names of interfaces.
Iface_Model::get_iface_connected_to_iface | ( | $iface = NULL | ) |
Gets interface connected to interface via link.
Only first founded is returned
Iface_Model | $iface |
Iface_Model::get_iface_for_connecting_to_iface | ( | $user_id, | |
$type, | |||
$gps = array() , |
|||
$filter_sql = '' , |
|||
$wmode = NULL |
|||
) |
Tries to find best suitable interface for connecting of a new device of user.
integer | $user_id | User identificator |
integer | $type | Type of interface for connection |
array | $gps | location of device - default member AP [optional] |
string | $filter_sql | Filter SQL |
integer | $wmode | Wireless mode of interface which try to connect [optional] |
Iface_Model::get_ifaces_connected_to_iface | ( | $iface = NULL | ) |
Gets all interfaces connected to interface via link.
Iface_Model | $iface |
|
static |
|
static |
Return human format for given const of mode.
integer | $mode |
|
static |
Return human format for modes.
|
static |
Return human format for port VLAN types.
|
static |
Returns type of current interface.
integer | $type |
|
static |
Gets link mediums types for interface type.
integer | $type | Iface type |
|
static |
Returns all types of interfaces.
|
static |
Gets whole array of indicator of available link.
|
static |
Gets link mediums for interface type.
array | $type | Iface type |
|
static |
Gets whole array of indicator of available MAC.
Iface_Model::get_untagged_vlan | ( | ) |
Returns untagged VLAN of port (if exists)
Iface_Model::get_virtual_ap_ifaces_of_parent | ( | $parent_iface_id = NULL | ) |
Gets ifaces of parent iface which is given by ID.
integer | $parent_iface_id |
|
static |
Returns antenna of current wireless interface.
integer | $antenna |
|
static |
Returns all antennas of wireless interfaces.
integer | $mode |
|
static |
Returns mode of current wireless interface.
integer | $mode |
|
static |
Returns all modes of wireless interfaces.
integer | $mode |
Iface_Model::is_in_bridge | ( | ) |
Checks whether iface is in bridge.
Iface_Model::is_mac_unique | ( | $iface_id, | |
$mac | |||
) |
Checks whether the given new MAC of the given iface is unique in all subnets that are in relation with the iface over his IP addresses.
This function should not be use during adding of an iface!
int | $iface_id | |
string | $mac |
Iface_Model::select_list_grouped_by_device | ( | $device_id = NULL , |
|
$restrict_types = array() |
|||
) |
Gets array of ifaces grouped by device for dropdown.
integer | $device_id | Only iface of one device? |
array | $restrict_types | Array of allowed types |
|
static |
Tests if type can have IP address.
integer | $type |
|
static |
Tests if type can have link.
type | $type |
|
static |
Tests if type can have mac address.
integer | $type |
Iface_Model::vlan_exists | ( | $vlan_id | ) |
Checks whether VLAN exists on ports or VLAN ifaces.
type | $vlan_id |
|
protected |