\UniversalQINQ
Yet another QinQ implementation.
Synopsis
class UniversalQINQ
{
- // constants
- const MODULE = '?module=universalqinq';
- const MODULE_VLANMANAGEMENT = '?module=vlanmanagement';
- // members
- protected $qinqdb;
- public array $error = ;
- public array $exceptions = ;
- protected $allData;
- protected array $allCvlans = ;
- protected array $allRealms = ;
- protected array $allSvlan = ;
- protected $switchesqinqDb;
- protected $switchesDb;
- protected $switchModelsDb;
- protected array $allSwitches = ;
- protected array $allSwitchModels = ;
- protected array $occupiedSwitches = ;
- protected $altCfg;
- protected $realmsdb;
- protected $svlandb;
- protected $defaultRealm;
- protected $messages;
- public $routing;
- // methods
- public void __construct()
- protected void loadAlter()
- protected void initRouting()
- protected void loadData()
- protected void goToStartOrError()
- protected string realmsSelector()
- public string svlanSelector()
- protected bool validateCvlan()
- protected bool validateSvlan()
- protected bool isSwitchCvlanUnique()
- protected bool isUniversalCvlanUnique()
- public bool isUserExists()
- protected bool isUserUnique()
- protected void occupiedUniversal()
- protected void occupiedSwitches()
- protected bool validator()
- public void add()
- public void delete()
- public void edit()
- public string showAll()
- public void links()
- protected void addForm()
- public string editFormGenerator()
- protected void showError()
- protected void showExceptions()
- public void getAll()
- public void ajaxData()
- public void logAdd()
- protected void logDelete()
- protected void logEdit()
Constants
Name | Value |
---|---|
MODULE | '?module=universalqinq' |
MODULE_VLANMANAGEMENT | '?module=vlanmanagement' |
Members
protected
- $allCvlans
—
array
Containts all C-vlans - $allData
—
array
Contains all - $allRealms
—
array
Contains all realms - $allSvlan
—
array
Contains all S-vlans - $allSwitchModels
—
array
Contains all switch models. - $allSwitches
—
array
Contains all switches - $altCfg
—
array
Contains system alter config as key=>value - $defaultRealm
—
string
Default realm selector - $messages
—
Placeholder for ubilling messages instance. - $occupiedSwitches
—
array
Contains all c-vlans occupied by switches. - $qinqdb
—
Placeholder for nyan orm (`qinq` table) - $realmsdb
—
Placeholder for nyan_orm instance for realms table. - $svlandb
—
Placeholder for nyan_orm instance for svlan_qinq table. - $switchModelsDb
—
Placeholder for nyan_orm instance for switchmodels table. - $switchesDb
—
Placeholder for nyan_orm isntance for switches table. - $switchesqinqDb
—
Placeholder for nyan_orm instance for switches_qinq table.
public
Methods
protected
- addForm() — Form to create new entry
- goToStartOrError() — Redirects user back and show error if any
- initRouting() — Creates new protected routing object instance for further usage
- isSwitchCvlanUnique() — Check if qinq pair is not occupied by switch.
- isUniversalCvlanUnique() — Check if qinq pair is not occupied by customer.
- isUserUnique() — User might have only one entry
- loadAlter() — Loads system alter.ini config for further usage
- loadData() — Function to preload data from qinq_bindings, realms and qinq_svlan tables.
- logDelete() — Log delete action
- logEdit() — Log edit action
- occupiedSwitches() — Get all c-vlans occupied by switches.
- occupiedUniversal() — Get all occupied c-vlans in current svlan.
- realmsSelector() — Generate dynamic selector for realms.
- showError() — If we have any errors show all of them
- showExceptions()
- validateCvlan() — Check if cvlan is int and has value from 1 to 4096
- validateSvlan() — Check if svlan_id greated than zero
- validator() — Check all validation function and return error if something didn't pass
public
- __construct()
- add() — Adding new entry
- ajaxData() — Form all the entries to ajax array
- delete() — Delete entry
- edit() — Edit entry
- editFormGenerator() — Forming edit form
- getAll()
- isUserExists() — Should we give a chance to assign vlan to non existing user?
- links()
- logAdd() — Log add action
- showAll() — Show all the entries
- svlanSelector() — Generates dynamic svlan selector.