]> git.sesse.net Git - nms/commitdiff
Changed to seven distros. Oh, the madness!
authorSteinar H. Gunderson <sesse@samfundet.no>
Mon, 10 Apr 2006 18:28:56 +0000 (18:28 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Mon, 10 Apr 2006 18:28:56 +0000 (18:28 +0000)
zyxel/switchmap.py
zyxel/zyxelcommon.py

index d0800ccb3156cd669c15a251b9a50e86fb3aebec..6a402cfaa12e97c2c675e1c764638b1093b0bf30 100755 (executable)
@@ -1,7 +1,7 @@
 #! /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 = {}
 
@@ -12,10 +12,10 @@ for sw in range(1,7):
                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))
@@ -38,7 +38,7 @@ for row in range(1,75,2):
                if sw == 3:
                        print "   ",
        print ""
-       if row in (17, 33, 49, 67):
+       if row in (17, 33, 49, 65):
                print ""
 
 # evil side-effect =)
index 1c1ca7878c07ea1b8de54a80cbac8ac278460134..d35c540a04ebf3416fa4dfd0805f206e0d63f312 100644 (file)
@@ -6,15 +6,21 @@ LOGHOST="194.0.255.20"
 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
@@ -24,4 +30,4 @@ def retIP(sw):
 
 # ooh, fugly
 def retColor(sw):
-    return "\e[%um" % (int(retSubnet(sw)) - 209)
+    return "\e[%um" % (int(retSubnet(sw)) - 210)