pf::Switch::MockedSwitch - Fake switch module designed to document our interfaces and for tests
pf::Switch::MockedSwitch is first an exercice to be able to see what our pfsetvlan daemon does under stress. As it was implemented it became obvious that it would be useful to help us understand our own switch interfaces too.
This modules extends pf::Switch.
It's not complete yet
* all methods here should have at least one logger->debug statement and a realistic sleep based on what it does
* Full POD for pf::Switch
* Add new subs from Cisco and friends that were added in trunk
* Create a pf::MockedWireless
conf/switches.conf
Warning: The list of subroutine is incomplete
Establishes an SNMP Write connection to a given IP and installs the session object into this object's sessionKey. It performs a write test to make sure that the write actually works.
Closes an SNMP Write connection. Requires sessionKey stored in object (as when calling connectWriteTo).
Performs a shut / no-shut on the port. Usually used to force the operating system to do a new DHCP Request after a VLAN change.
Just performing the wait, no setAdminStatus
Cisco is very fancy about fetching it's VLAN information. In SNMPv3 the context is used to specify a VLAN and in SNMPv1/2c an @<vlan> is appended to the read-only community name when reading.
Warning: this method should _never_ be called in a thread. Net::Appliance::Session is not thread safe:
With no VoIP switchport port-security maximum 1 vlan access switchport port-security switchport port-security violation restrict switchport port-security mac-adress xxxx.xxxx.xxxx
With VoIP switchport port-security maximum 2 switchport port-security maximum 1 vlan access switchport port-security switchport port-security violation restrict switchport port-security mac-adress xxxx.xxxx.xxxx
Sets the global (data + voice) maximum number of MAC addresses for port-security on a port
Sets the maximum number of MAC addresses on the data vlan for port-security on a port
Tells the switch what to do when the number of MAC addresses on the port has exceeded the maximum: shut down the port, send a trap or only allow traffic from the secure port and drop packets from other MAC addresses
Allows all the tagged Vlans on a multi-Vlan port. Used for floating network devices only
Removes all the tagged Vlans on a multi-Vlan port. Used for floating network devices only
Forces 802.1x re-authentication of a given ifIndex
ifIndex - ifIndex to force re-authentication on
Actual implementation. Allows callers to refer to this implementation even though someone along the way override the above call.
Get Voice over IP RADIUS Vendor Specific Attribute (VSA).
Return the reference to the deauth technique or the default deauth technique.
return Default Deauthentication Method
return Default Deauthentication Default technique
return IfIndexByNasPortId
Extract VLAN from the radius attributes.
Return the reference to the deauth technique or the default deauth technique.
Takes FreeRADIUS' RAD_REQUEST hash and process it to return NAS Port type (Ethernet, Wireless, etc.) Network Device IP EAP MAC NAS-Port (port) User-Name
Extract all the param from the url.
Inverse inc. <info@inverse.ca>
Copyright (C) 2005-2015 Inverse inc.
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.