#! /usr/bin/env python
from zyxelcommon import *
-distro_num_switches = [ 0, 0, 0, 0, 0 ];
+distro_num_switches = [ 0, 0, 0, 0, 0, 0, 0, 0 ];
vlans = {}
print " ",
print ""
-for row in range(1,75,2):
+for row in range(1,73,2):
print "\e[37;0m%2u: " % row,
for sw in range(1,7):
- if (row <= 3 and sw <= 3) or (row >= 69 and (sw == 1 or sw == 6)):
+ if (row <= 3 and sw <= 3) or (row >= 67 and (sw == 1 or sw == 6)) or (row >= 71 and (sw <= 3)):
print "%-20s " % "",
else:
ip = retIP((row,sw))
if sw == 3:
print " ",
print ""
- if row in (17, 33, 49, 67):
+ if row in (17, 33, 49, 65):
print ""
# evil side-effect =)
def retSubnet(sw):
(rad,num) = sw
drad = (rad + 1) / 2
- if drad <= 7 or (drad == 8 and (num <= 3 or num == 6)):
+ if drad <= 4 or (drad == 5 and (num <= 2)):
return "241"
- if drad <= 13 or (drad == 14 and num != 4) or (drad == 15 and num <= 3):
+ if drad <= 7 or (drad == 8 and (num <= 3 or num == 6)):
return "242"
- if drad <= 22 or (drad == 23 and num >= 4) or (drad == 24 and num == 4):
+ if drad <= 13 or (drad == 14 and num != 4) or (drad == 15 and num <= 3):
return "243"
- if drad <= 29 or (drad == 30 and (num == 4 or num == 5)):
+ if drad <= 22 or (drad == 23 and num >= 4) or (drad == 24 and num == 4):
return "244"
- return "245"
+ if drad <= 29 or (drad == 30 and (num == 4 or num == 5)):
+ return "245"
+ if drad <= 31 or (drad == 32 and (num <= 5)):
+ return "246"
+ if drad <= 33 or (num >= 4):
+ return "247"
+ return "248"
def retIP(sw):
(rad,num) = sw
# ooh, fugly
def retColor(sw):
- return "\e[%um" % (int(retSubnet(sw)) - 209)
+ return "\e[%um" % (int(retSubnet(sw)) - 210)