Hi Kerry,

On 19/10/10 4:27 AM, Kerry Milestone wrote:
>
> Hello,
>
> in our testing, we are trying to extend beyond customvlan_5.  However, it 
> seems to be a hardcoded limit throughout - ie
> it appears in at least pfcmd.pm, pfcmd_pregrammar.pm, SNMP.pm, 
> SwitchFactory.pm.
>
Yes, we added customVlans lately and defined 5 of them for now. The 
current design prevented us from adding a flexible number of them 
without intrusive changes to the code.

However, I might have a solution for you.

> Any suggestions would be neat.

custom_getCorrectVlan's purpose is to return a VLAN id.
Using switches.conf customVlans is only a commodity to have different 
VLAN ids share a unified meaning. In exemple: engineering in building A 
is VLAN 100 and in building B is VLAN 200. But will be assigned by 
customVlan1. Buildings are differentiated by switch at this point.

You seem to be relying on categories for assignment. Do you need per 
switch per category VLANs? If not then you could replace
return $switch->{_customVlan7};
by
return 100;

Or, if you do need per switch per category VLAN assignation then as an 
example:
if category = prod
   if $switch->{_ip} =~ /192\.168\.(\d+)\.\d+/
     return $1 . 20;

would return for a prod node the before last byte of the switch's IP + 
20. ex: for a switch 192.168.22.10, VLAN 2220 would be returned.

The point is that the flexibility is there, it's just that you lose 
convenience of a editing a configuration file over changing code.

Hopefully some of the above will help you ;)

Have a good one!
-- 
Olivier Bilodeau
[email protected]  ::  +1.514.447.4918 *115  ::  www.inverse.ca
Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence 
(www.packetfence.org)

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Packetfence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to