PacketFence - BTS - PacketFence
View Issue Details
0000943PacketFencerefactoringpublic2010-04-07 11:382015-02-13 15:26
obilodeau 
 
highminorN/A
closedopen 
 
 
0000943: create interfaces (abstract classes) to our switch objects
at least the following interfaces should be created (with their implemented methods):

- switch
-- _setVlan
-- getVersion

- switch port-security
-- authorizeMAC
-- isPortSecurityEnabled
-- getSecureMacAddresses
-- getAllSecureMacAddresses

- switch MAB
-- NasPortToIfIndex

- switch 802.1x
-- NasPortToIfIndex
-- dot1xPortReauthenticate

- AP / controller
-- deauthenticateMac


The interface would implement the methods but die on them with: die ("unimplemented!")

This would allow that in tests, we could test switches against each interface and trap for die and if a switch dies then it's improperly implementing it's type. I think this would need removal of empty implementations in pf::SNMP so this might be a hard decision to take.

Check here for the design pattern: http://perldesignpatterns.com/?AbstractClass [^]

I think something like:
use base('pf::SNMP::Cisco', 'pf::SNMP::WiredDot1x', 'pf::SNMP::WiredMAB', 'pf::SNMP::PortSecurity')
shoudl work

and we should be careful about left to right since the search for sub implementations is done from left to right.
No tags attached.
Issue History
2010-04-07 11:38obilodeauNew Issue
2010-04-07 11:38obilodeauStatusnew => assigned
2010-04-07 11:38obilodeauAssigned To => obilodeau
2010-04-07 11:47obilodeauNote Added: 0001507
2010-04-15 17:43obilodeauProjectPacketFence 1.9 => PacketFence
2011-01-18 11:43obilodeauTarget Version => trunk
2011-10-05 09:32obilodeauNote Added: 0002312
2012-10-19 14:21fgaudreaultAssigned Toobilodeau =>
2012-10-19 14:21fgaudreaultTarget Versiondevel => general
2015-02-13 15:26lmunroNote Added: 0003687
2015-02-13 15:26lmunroStatusassigned => closed

Notes
(0001507)
obilodeau   
2010-04-07 11:47   
forget about use base, use this instead:
http://search.cpan.org/~swalters/interface-0.03/interface.pm [^]
(0002312)
obilodeau   
2011-10-05 09:32   
Actually I've read about Moose lately and I think it should be done using Moose's roles.
(0003687)
lmunro   
2015-02-13 15:26   
Old issues.
Most are not relevant to PF 4 and up.

Let's reopen the ones that matter when we move to github.