<<

NAME

pf::vlan - Object oriented module for VLAN isolation oriented functions

SYNOPSIS

The pf::vlan module contains the functions necessary for the VLAN isolation. All the behavior contained here can be overridden in lib/pf/vlan/custom.pm.

SUBROUTINES

Warning: The list of subroutine is incomplete

new

Constructor. Usually you don't want to call this constructor but use the pf::vlan::custom subclass instead.

fetchVlanForNode

Answers the question: What VLAN should a given node be put into?

This sub is meant to be overridden in lib/pf/vlan/custom.pm if the default version doesn't do the right thing for you. However it is very generic, maybe what you are looking for needs to be done in getViolationVlan, getRegistrationVlan or getNormalVlan.

doWeActOnThisTrap

Don't act on uplinks, unkown interface types or some traps we are not interested in.

This sub is meant to be overridden in lib/pf/vlan/custom.pm if the default version doesn't do the right thing for you.

getViolationVlan

Returns the violation vlan for a node (if any)

This sub is meant to be overridden in lib/pf/vlan/custom.pm if you have specific isolation needs.

Return values:

* -1 means kick-out the node (not always supported)

* 0 means no violation for this node

* undef means there was an error

* anything else is either a VLAN name string or a VLAN number

getRegistrationVlan

Returns the registration vlan for a node if registration is enabled and node is unregistered or pending.

This sub is meant to be overridden in lib/pf/vlan/custom.pm if you have specific registration needs.

Return values:

* 0 means node is already registered

* undef means there was an error

* anything else is either a VLAN name string or a VLAN number

getNormalVlan

Returns normal vlan

This sub is meant to be overridden in lib/pf/vlan/custom.pm if the default version doesn't do the right thing for you. It will try to match a role based on a username (if provided) or on the node MAC address and return the according VLAN for the given switch.

Return values:

* -1 means kick-out the node (not always supported)

* 0 means node is already registered

* undef means there was an error

* anything else is either a VLAN name string or a VLAN number

getInlineVlan

Handling the Inline VLAN Assignment

* -1 means kick-out the node (not always supported)

* 0 means use native vlan

* undef means there was an error

* anything else is either a VLAN name string or a VLAN number

getNodeInfoForAutoReg

Basic information returned for an auto-registered node

This sub is meant to be overridden in lib/pf/vlan/custom.pm if the default version doesn't do the right thing for you.

Returns an anonymous hash that is meant for node_register()

shouldAutoRegister

Do we auto-register this node?

By default we register automatically when the switch is configured to (registration mode), when there is a violation with action autoreg and when the device is a phone.

This sub is meant to be overridden in lib/pf/vlan/custom.pm if the default version doesn't do the right thing for you.

returns 1 if we should register, 0 otherwise

isInlineTrigger

Return true if a radius properties match with the inline trigger

AUTHOR

Inverse inc. <info@inverse.ca>

COPYRIGHT

Copyright (C) 2005-2015 Inverse inc.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

<<