Class BasicPolicy

Description

Sample Policy File

This policy file allows access to known devices into the network and will place them in the global default vlan defined in the config table and accessible via the conf object. If an unknown device connects to the network, it will be denied.

Located in /etc/policy1.php (line 21)

Common
   |
   --Policy
      |
      --BasicPolicy
Method Summary
 integer catch_ALLOW (integer $vlan)
 void postconnect (object $REQUEST)
 void preconnect (object $REQUEST)
 void reportDecision (object $REQUEST, [integer $vlan = 0], [mixed $message = ''])
Variables

Inherited Variables

Inherited from Common

Common::$conf
Common::$db_conn
Common::$logger
Methods
catch_ALLOW (line 69)

This function will provide an interface to change the current decision.

This can prove useful for hub detection tests. At the moment it doesn't do anything in particular, it is here only for completeness' sake.

  • return: Vlan Id of the assigned vlan
  • access: public
integer catch_ALLOW (integer $vlan)
  • integer $vlan: Vlan ID of the assigned vlan
postconnect (line 81)

The postconnect method is used by the postconnect daemon.

It updates information for PORTS and HOSTS This method writes to the database, so it shouldn't be called from a slave server.

  • access: public
void postconnect (object $REQUEST)
  • object $REQUEST: A SyslogRequest object

Redefinition of:
Policy::postconnect()
Default policy is to deny everything
preconnect (line 45)

The preconnect method is used by vmpsd_external.

Here we define how to handle devices with different status

  • access: public
void preconnect (object $REQUEST)
  • object $REQUEST: The VMPS request, which contains also HOST and PORT information

Redefinition of:
Policy::preconnect()
Default policy is to deny everything
reportDecision (line 29)

This method logs to syslog the decision taken so far.

  • access: public
void reportDecision (object $REQUEST, [integer $vlan = 0], [mixed $message = ''])
  • object $REQUEST: A request object
  • integer $vlan: The vlan id of the assigned vlan. Default is 0.
  • mixed $message: A message to display along with the host and port information

Inherited Methods

Inherited From Policy

 Policy::postconnect()
 Policy::preconnect()

Inherited From Common

 Common::__construct()
 Common::getConnection()
 Common::htmlescape()
 Common::log2db()
 Common::real_escape_string1()
 Common::sqlescape()

Documentation generated on Mon, 06 Oct 2008 01:10:36 +0200 by phpDocumentor 1.4.0