r4438 Third round of IIF/OIF overhaul: get rid of SC, LC and MT-RJ options.
authorDenis Ovsienko <infrastation@yandex.ru>
Sat, 9 Apr 2011 14:14:41 +0000 (14:14 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Sat, 9 Apr 2011 14:14:41 +0000 (14:14 +0000)
wwwroot/inc/install.php
wwwroot/inc/snmp.php
wwwroot/inc/upgrade.php

index ebd2c7a..6c6bcd9 100644 (file)
@@ -1148,18 +1148,7 @@ INSERT INTO `PortCompat` (`type1`, `type2`) VALUES
 (17,17),
 (18,18),
 (19,19),
-(20,20),
-(21,21),
-(21,1195),
-(22,22),
-(22,1196),
-(23,23),
-(23,1196),
 (24,24),
-(25,25),
-(26,26),
-(27,27),
-(28,28),
 (18,19),
 (19,18),
 (18,24),
@@ -1167,21 +1156,6 @@ INSERT INTO `PortCompat` (`type1`, `type2`) VALUES
 (19,24),
 (24,19),
 (29,29),
-(20,21),
-(20,1083),
-(20,1195),
-(21,20),
-(21,1083),
-(22,23),
-(23,22),
-(25,26),
-(25,1202),
-(26,25),
-(26,1202),
-(27,28),
-(27,1204),
-(28,27),
-(28,1204),
 (30,30),
 (16,1322),
 (1322,16),
@@ -1206,30 +1180,17 @@ INSERT INTO `PortCompat` (`type1`, `type2`) VALUES
 (682,681),
 (682,682),
 (1077,1077),
-(1083,20),
-(1083,21),
-(1083,1083),
-(1083,1195),
 (1084,1084),
 (1087,1087),
-(1195,20),
-(1195,21),
-(1195,1083),
 (1195,1195),
-(1196,22),
-(1196,23),
 (1196,1196),
 (1197,1197),
 (1198,1199),
 (1199,1198),
 (1200,1200),
 (1201,1201),
-(1202,25),
-(1202,26),
 (1202,1202),
 (1203,1203),
-(1204,27),
-(1204,28),
 (1204,1204),
 (1205,1205),
 (1206,1207),
index e0a5eec..e3003b7 100644 (file)
@@ -25,7 +25,7 @@ $iftable_processors['catalyst-chassis-25-to-26-100FX/MT-RJ'] = array
 (
        'pattern' => '@^FastEthernet([[:digit:]]+/)?(25|26)$@',
        'replacement' => 'fa\\1\\2',
-       'dict_key' => 1083,
+       'dict_key' => 1195,
        'label' => '\\2',
        'try_next_proc' => FALSE,
 );
index e360bb2..c862540 100644 (file)
@@ -1065,6 +1065,39 @@ CREATE TABLE `PortLog` (
                        $query[] = "INSERT INTO `PortInterfaceCompat` (`iif_id`, `oif_id`) VALUES (4,1424)";
                        for ($i = 1424; $i <= 1466; $i++) # CX, then 42 ER channels
                                $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (${i},${i})";
+                       # Dismiss some overly-specific OIF types in favour of more generic counterparts.
+                       $squeeze = array
+                       (
+                               1202 => array # 1000Base-SX
+                               (
+                                       25,   # 1000Base-SX (SC)
+                                       26,   # 1000Base-SX (LC)
+                               ),
+                               1204 => array # 1000Base-LX
+                               (
+                                       27,   # 1000Base-LX (SC)
+                                       28,   # 1000Base-LX (LC)
+                               ),
+                               1196 => array # 100Base-SX
+                               (
+                                       22,   # 100Base-SX (SC)
+                                       23,   # 100Base-SX (LC)
+                               ),
+                               1195 => array # 100Base-FX
+                               (
+                                       20,   # 100Base-FX (SC)
+                                       21,   # 100Base-FX (LC)
+                                       1083, # 100Base-FX (MT-RJ)
+                               ),
+                       );
+                       foreach ($squeeze as $stays => $leaves)
+                       {
+                               $csv = implode (', ', $leaves);
+                               $query[] = "DELETE FROM PortCompat WHERE type1 IN(${csv}) OR type2 IN(${csv})";
+                               $query[] = "INSERT IGNORE INTO PortInterfaceCompat (iif_id, oif_id) SELECT iif_id, ${stays} FROM Port WHERE type IN (${csv})";
+                               $query[] = "UPDATE Port SET type = ${stays} WHERE type IN(${csv})";
+                               $query[] = "DELETE FROM PortInterfaceCompat WHERE oif_id IN(${csv})";
+                       }
                        $query[] = "UPDATE Config SET varvalue = '0.20.0' WHERE varname = 'DB_VERSION'";
                        break;
                default: