Source for file policy1.php
Documentation is available at policy1.php
* 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.
* @author Sean Boran (FreeNAC Core Team)
* @author Thomas Seiler (contributer)
* @author Hector Ortiz (FreeNAC Core Team)
* @copyright 2007 FreeNAC
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License Version 2
* @link http://www.freenac.net
* This method logs to syslog the decision taken so far.
* @param object $REQUEST A request object
* @param integer $vlan The vlan id of the assigned vlan. Default is 0.
* @param mixed $message A message to display along with the host and port information
$this->logger->logit("Note: Device {$REQUEST->host->getmac()}({
$REQUEST->host->gethostname()},{
$REQUEST->host->getusername()}) on switch {
$REQUEST->switch_port->getswitch_ip()}({
$REQUEST->switch_port->getswitch_name()}), port {
$REQUEST->switch_port->getport_name()}, office {
$REQUEST->switch_port->getoffice()}@{
$REQUEST->switch_port->getbuilding()} has been placed in vlan
".
vlanId2Name($vlan));
$this->logger->logit("Note: $message {$REQUEST->host->getmac()}({
$REQUEST->host->gethostname()},{
$REQUEST->host->getusername()}) on switch {
$REQUEST->switch_port->getswitch_ip()}({
$REQUEST->switch_port->getswitch_name()}), port {
$REQUEST->switch_port->getport_name()}, office {
$REQUEST->switch_port->getoffice()}@{
$REQUEST->switch_port->getbuilding()} has been placed in vlan
".
vlanId2Name($vlan));
* The preconnect method is used by vmpsd_external.
* Here we define how to handle devices with different status
* @param object $REQUEST The VMPS request, which contains also HOST and PORT information
#Handling of active systems
if ($REQUEST->host->isActive())
#Allow host in global default vlan
DENY('Default policy reached. Unknown or unmanaged device and no default_vlan specified');
* 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.
* @param integer $vlan Vlan ID of the assigned vlan
* @return integer Vlan Id of the assigned vlan
* 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.
* @param object $REQUEST A SyslogRequest object
Documentation generated on Mon, 01 Dec 2008 01:10:39 +0100 by phpDocumentor 1.4.0