\VlanGen
VLAN gen - nothing to see here!
Synopsis
class VlanGen
{
- // constants
- const MODULE = 'VlanGen';
- const MODULE_URL = '?module=pl_vlangen';
- const DB_TABLE = 'vlanhosts';
- const QINQ_DB_TABLE = 'vlanhosts_qinq';
- const SCRIPT_PATH = './config/scripts/';
- const MODULE_ADDVLAN = 'addvlan';
- const MODULE_URL_ADDVLAN = '?module=addvlan';
- const POOL_DB_TABLE = 'vlan_pools';
- // members
- protected array $VlanPoolsSelector = ;
- protected array $AllVlanHosts = ;
- protected array $AllVlanPools = ;
- protected array $AllTerminators = ;
- protected array $AltCfg = ;
- // methods
- public void __construct()
- protected void LoadTerminators()
- protected void LoadVlanHosts()
- protected void LoadVlanPoolsSelector()
- protected void loadAlter()
- public int GetVlan()
- protected int GetVlanPoolQinQ()
- protected array VlanPoolExpand()
- protected array GetAllFreeVlan()
- protected array GetAllFreeVlanQinQ()
- protected int GetNextFreeVlan()
- protected int GetNextFreeVlanQinQ()
- protected int GetNetidByIP()
- protected int GetTermIdByNetid()
- protected void AddVlanHost()
- public void AddVlanPool()
- protected void AddVlanHostQinQ()
- public void ShowVlanPools()
- public void AddVlanPoolForm()
- public void DeleteVlanHost()
- public void DeleteVlanHostQinQ()
- public void DeleteVlanPool()
- public string ChangeOnOnuForm()
- public string ChangeOnPortForm()
- public string ChangeForm()
- public string DeleteForm()
- public void EditVlanPool()
- public string VlanPoolEditForm()
- protected void OnVlanConnect()
- public void VlanChange()
Constants
Name | Value |
---|---|
MODULE | 'VlanGen' |
MODULE_URL | '?module=pl_vlangen' |
DB_TABLE | 'vlanhosts' |
QINQ_DB_TABLE | 'vlanhosts_qinq' |
SCRIPT_PATH | './config/scripts/' |
MODULE_ADDVLAN | 'addvlan' |
MODULE_URL_ADDVLAN | '?module=addvlan' |
POOL_DB_TABLE | 'vlan_pools' |
Members
protected
- $AllTerminators
—
array
Contains all vlan terminators data - $AllVlanHosts
—
array
Contains all vlan hosts data - $AllVlanPools
—
array
Contains all vlan pools data - $AltCfg
—
array
Contains system alter config as key=>value - $VlanPoolsSelector
—
array
Contains all vlan pools as vlanPool['id'] => vlanPool['desc'] for vlan pool selector
Methods
protected
- AddVlanHost() — Apply vlan to user and write to DB
- AddVlanHostQinQ() — Apply vlan to user and write to DB
- GetAllFreeVlan() — Find all unused values from all possible values from VlanPoolExpand
- GetAllFreeVlanQinQ() — Find all unused values from all possible values from VlanPoolExpand
- GetNetidByIP() — Find netid by user's IP
- GetNextFreeVlan() — Getting first unused value in all possible values of vlan pool
- GetNextFreeVlanQinQ() — Getting first unused value in all possible values of vlan pool
- GetTermIdByNetid() — Find vlan terminator id by netid
- GetVlanPoolQinQ() — Searching QinQ value for vlan pool in AllVlanPools
- LoadTerminators() — select all data from vlan_terminators and load to $AllTerminators
- LoadVlanHosts() — select all data from vlanhosts and load it to $allVlanHosts
- LoadVlanPoolsSelector() — select data from vlan_pools and load data to $AllVlanPools and loading data for vlan pool selector
- OnVlanConnect() — Apply vlan on vlan terminator
- VlanPoolExpand() — Fills array by every possible int value between $first and $end
- loadAlter() — load alter.ini config
public
- __construct()
- AddVlanPool() — Adding vlan pool data to DB
- AddVlanPoolForm() — Form for adding vlan pool data
- ChangeForm() — Returns form for change\apply vlan on user
- ChangeOnOnuForm() — Gather web form and returns it.
- ChangeOnPortForm() — For for changing pvid on switch port
- DeleteForm() — Returns form for delete users vlan
- DeleteVlanHost() — Delete users vlan data from DB
- DeleteVlanHostQinQ() — Delete users vlan data from DB
- DeleteVlanPool() — Delete vlan pool data from DB
- EditVlanPool() — Edit vlan pool data in DB
- GetVlan() — Searching vlan by login in AllVlanHosts
- ShowVlanPools() — Show all available data in vlan pools
- VlanChange() — Changes\applies users vlan on vlan terminator
- VlanPoolEditForm() — Form for editing vlan pool data