Added some code cleanup.
[racktables] / wwwroot / inc / install.php
CommitLineData
0e7f2155 1<?php
5b4523dc 2
cddbb9fd
DO
3# This file is a part of RackTables, a datacenter and server room management
4# framework. See accompanying file "COPYING" for the full copyright and
5# licensing information.
6
e37cfe5f
DO
7function renderInstallerHTML()
8{
0e7f2155
DO
9$stepfunc[1] = 'not_already_installed';
10$stepfunc[2] = 'platform_is_ok';
11$stepfunc[3] = 'init_config';
96e102b2
DO
12$stepfunc[4] = 'init_database_static';
13$stepfunc[5] = 'init_database_dynamic';
14$stepfunc[6] = 'congrats';
0e7f2155
DO
15
16if (isset ($_REQUEST['step']))
17 $step = $_REQUEST['step'];
18else
19 $step = 1;
20
21if ($step > count ($stepfunc))
22{
790a60e8
DO
23 $root = (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') ? 'http://' : 'https://';
24 $root .= isset ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']=='80'?'':$_SERVER['SERVER_PORT']));
25 // "Since PHP 4.3.0, you will often get a slash or a dot back from
26 // dirname() in situations where the older functionality would have given
27 // you the empty string."
28 // "On Windows, both slash (/) and backslash (\) are used as directory
29 // separator character."
30 $root .= strtr (dirname ($_SERVER['PHP_SELF']), '\\', '/');
31 if (substr ($root, -1) != '/')
32 $root .= '/';
33 header ("Location: ${root}");
0e7f2155
DO
34 exit;
35}
36$title = "RackTables installation: step ${step} of " . count ($stepfunc);
878512c6 37header ('Content-Type: text/html; charset=UTF-8');
e37cfe5f 38?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
f48dc2cc 39<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
0e7f2155 40<head><title><?php echo $title; ?></title>
e37cfe5f
DO
41<style type="text/css">
42.tdleft {
43 text-align: left;
44}
45
46.trok {
47 background-color: #80FF80;
48}
49
50.trwarning {
51 background-color: #FFFF80;
52}
53
54.trerror {
55 background-color: #FF8080;
56}
57</style>
f48dc2cc
DO
58</head>
59<body>
0e7f2155 60<center>
f48dc2cc 61<?php
f92287f4
DO
62echo "<h1>${title}</h1><p>";
63
64echo "</p><form method=post>\n";
65$testres = $stepfunc[$step] ();
66if ($testres)
67{
68 $next_step = $step + 1;
ae067ef3 69 echo "<br><input type=submit value='proceed'>";
f92287f4
DO
70}
71else
72{
73 $next_step = $step;
ae067ef3 74 echo "<br><input type=submit value='retry'>";
f92287f4
DO
75}
76echo "<input type=hidden name=step value='${next_step}'>\n";
77
78?>
79</form>
80</center>
81</body>
82</html>
83
84<?php
e37cfe5f
DO
85}
86
0e7f2155
DO
87// Check if the software is already installed.
88function not_already_installed()
f48dc2cc 89{
b00cc78c
AA
90 global $found_secret_file, $pdo_dsn;
91 if ($found_secret_file and isset ($pdo_dsn))
f92287f4
DO
92 {
93 echo 'Your configuration file exists and seems to hold necessary data already.<br>';
94 return FALSE;
95 }
96 else
97 {
43f06d53 98 echo 'There seem to be no existing installation here, I am going to setup one now.<br>';
f92287f4
DO
99 return TRUE;
100 }
f48dc2cc
DO
101}
102
0e7f2155
DO
103// Check that we can write to configuration file.
104// If so, ask for DB connection paramaters and test
105// the connection. Neither save the parameters nor allow
dec748f6 106// going further until we succeed with the given
0e7f2155
DO
107// credentials.
108function init_config ()
109{
f3a3c66d 110 function print_form
f92287f4 111 (
f3a3c66d
DO
112 $use_tcp = TRUE,
113 $tcp_host = 'localhost',
114 $tcp_port = '',
115 $unix_socket = '/var/lib/mysql/mysql.sock',
116 $database = 'racktables_db',
117 $username = 'racktables_user',
118 $password = ''
f92287f4
DO
119 )
120 {
121 echo "<input type=hidden name=save_config value=1>\n";
f3a3c66d 122 echo '<h3>Server-side MySQL setup of the database:</h3><div align=left><pre class=trok>';
d6958fdb 123 echo "mysql&gt;\nCREATE DATABASE racktables_db CHARACTER SET utf8 COLLATE utf8_general_ci;\n";
f3a3c66d 124 echo "GRANT ALL PRIVILEGES ON racktables_db.* TO racktables_user@localhost IDENTIFIED BY 'MY_SECRET_PASSWORD';\n</pre></div>";
f92287f4 125 echo '<table>';
f3a3c66d
DO
126 echo '<tr><td><label for=conn_tcp>TCP connection</label></td>';
127 echo '<td><input type=radio name=conn value=conn_tcp id=conn_tcp' . ($use_tcp ? ' checked' : '') . '></td></tr>';
128 echo '<tr><td><label for=conn_unix>UNIX socket</label></td>';
129 echo '<td><input type=radio name=conn value=conn_unix id=conn_unix' . ($use_tcp ? '' : ' checked') . '></td></tr>';
130 echo "<tr><td><label for=mysql_host>TCP host:</label></td>";
131 echo "<td><input type=text name=mysql_host id=mysql_host value='${tcp_host}'></td></tr>\n";
132 echo "<tr><td><label for=mysql_port>TCP port (if not 3306):</label></td>";
133 echo "<td><input type=text name=mysql_port id=mysql_port value='${tcp_port}'></td></tr>\n";
134 echo "<tr><td><label for=mysql_socket>UNIX socket:</label></td>";
135 echo "<td><input type=text name=mysql_socket id=mysql_socket value='${unix_socket}'></td></tr>\n";
559f11e7 136 echo "<tr><td><label for=mysql_db>database:</label></td>";
f3a3c66d 137 echo "<td><input type=text name=mysql_db id=mysql_db value='${database}'></td></tr>\n";
f92287f4 138 echo "<tr><td><label for=mysql_username>username:</label></td>";
f3a3c66d 139 echo "<td><input type=text name=mysql_username id=mysql_username value='${username}'></td></tr>\n";
f92287f4 140 echo "<tr><td><label for=mysql_password>password:</label></td>";
f3a3c66d 141 echo "<td><input type=password name=mysql_password id=mysql_password value='${password}'></td></tr>\n";
f92287f4 142 echo '</table>';
f3a3c66d
DO
143 }
144 global $path_to_secret_php;
145 if (!is_writable ($path_to_secret_php))
146 {
147 echo "The $path_to_secret_php file is not writable by web-server. Make sure it is.";
148 echo "The following commands should suffice:<pre>touch '$path_to_secret_php'; chmod 666 '$path_to_secret_php'</pre>";
149 echo 'Fedora Linux with SELinux may require this file to be owned by specific user (apache) and/or executing "setenforce 0" for the time of installation. ';
150 echo 'SELinux may be turned back on with "setenforce 1" command.<br>';
151 return FALSE;
152 }
153 if (! array_key_exists ('save_config', $_REQUEST))
154 {
155 print_form();
156 return FALSE;
157 }
158 if (empty ($_REQUEST['mysql_db']) or empty ($_REQUEST['mysql_username']))
159 {
160 print_form
161 (
162 $_REQUEST['conn'] == 'conn_tcp',
163 $_REQUEST['mysql_host'],
164 $_REQUEST['mysql_port'],
165 $_REQUEST['mysql_socket'],
166 $_REQUEST['mysql_db'],
167 $_REQUEST['mysql_username'],
168 $_REQUEST['mysql_password']
169 );
170 echo '<h2 class=trerror>Missing database/username parameter!</h2>';
171 return FALSE;
172 }
173 if ($_REQUEST['conn'] == 'conn_tcp' and empty ($_REQUEST['mysql_host']))
174 {
175 print_form
176 (
177 $_REQUEST['conn'] == 'conn_tcp',
178 $_REQUEST['mysql_host'],
179 $_REQUEST['mysql_port'],
180 $_REQUEST['mysql_socket'],
181 $_REQUEST['mysql_db'],
182 $_REQUEST['mysql_username'],
183 $_REQUEST['mysql_password']
184 );
185 echo '<h2 class=trerror>Missing TCP hostname parameter!</h2>';
186 return FALSE;
187 }
188 if ($_REQUEST['conn'] == 'conn_unix' and empty ($_REQUEST['mysql_socket']))
189 {
190 print_form
191 (
192 $_REQUEST['conn'] == 'conn_tcp',
193 $_REQUEST['mysql_host'],
194 $_REQUEST['mysql_port'],
195 $_REQUEST['mysql_socket'],
196 $_REQUEST['mysql_db'],
197 $_REQUEST['mysql_username'],
198 $_REQUEST['mysql_password']
199 );
200 echo '<h2 class=trerror>Missing UNIX socket parameter!</h2>';
201 return FALSE;
202 }
203 # finally OK to make a connection attempt
204 $pdo_dsn = 'mysql:';
205 switch ($_REQUEST['conn'])
206 {
207 case 'conn_tcp':
208 $pdo_dsn .= 'host=' . $_REQUEST['mysql_host'];
209 if (!empty ($_REQUEST['mysql_port']) and $_REQUEST['mysql_port'] != '3306')
210 $pdo_dsn .= ';port=' . $_REQUEST['mysql_port'];
211 break;
212 case 'conn_unix':
213 $pdo_dsn .= 'unix_socket=' . $_REQUEST['mysql_socket'];
214 break;
215 default:
216 print_form();
217 echo '<h2 class=trerror>form error</h2>';
f92287f4
DO
218 return FALSE;
219 }
559f11e7 220 $pdo_dsn .= ';dbname=' . $_REQUEST['mysql_db'];
f92287f4
DO
221 try
222 {
223 $dbxlink = new PDO ($pdo_dsn, $_REQUEST['mysql_username'], $_REQUEST['mysql_password']);
224 }
225 catch (PDOException $e)
226 {
f3a3c66d
DO
227 print_form
228 (
229 $_REQUEST['conn'] == 'conn_tcp',
230 $_REQUEST['mysql_host'],
231 $_REQUEST['mysql_port'],
232 $_REQUEST['mysql_socket'],
233 $_REQUEST['mysql_db'],
234 $_REQUEST['mysql_username'],
235 $_REQUEST['mysql_password']
236 );
ce4bfbee 237 echo "<h2 class=trerror>Database connection failed. Check parameters and try again.</h2>\n";
f3a3c66d 238 echo "PDO DSN: <tt class=trwarning>${pdo_dsn}</tt><br>";
f92287f4
DO
239 return FALSE;
240 }
e1ae3fb4 241
b00cc78c 242 $conf = fopen ($path_to_secret_php, 'w+');
f92287f4
DO
243 if ($conf === FALSE)
244 {
b00cc78c 245 echo "Error: failed to open $path_to_secret_php for writing";
f92287f4
DO
246 return FALSE;
247 }
d829377c 248 fwrite ($conf, "<?php\n# This file has been generated automatically by RackTables installer.\n");
f92287f4
DO
249 fwrite ($conf, "\$pdo_dsn = '${pdo_dsn}';\n");
250 fwrite ($conf, "\$db_username = '" . $_REQUEST['mysql_username'] . "';\n");
e0dcbf1e 251 fwrite ($conf, "\$db_password = '" . $_REQUEST['mysql_password'] . "';\n\n");
2a622048 252 fwrite ($conf, <<<ENDOFTEXT
d829377c
DO
253
254\$user_auth_src = 'database';
255\$require_local_account = TRUE;
256# Default setting is to authenticate users locally, but it is possible to
257# employ existing LDAP or Apache user accounts. Check RackTables wiki for
258# more information, in particular, this page for LDAP configuration details:
d042d2c4 259# http://wiki.racktables.org/index.php?title=LDAP
d829377c
DO
260
261#\$LDAP_options = array
262#(
263# 'server' => 'localhost',
264# 'domain' => 'example.com',
265# 'search_attr' => '',
266# 'search_dn' => '',
b6556a7a
DO
267# // The following credentials will be used when searching for the user's DN:
268# 'search_bind_rdn' => NULL,
269# 'search_bind_password' => NULL,
d829377c
DO
270# 'displayname_attrs' => '',
271# 'options' => array (LDAP_OPT_PROTOCOL_VERSION => 3),
2f9a653f 272# 'use_tls' => 2, // 0 == don't attempt, 1 == attempt, 2 == require
d829377c 273#);
2a622048 274
56a0bd8c
DO
275# This HTML banner is intended to assist users in dispatching their issues
276# to the local tech support service. Its text (in its verbatim form) will
277# be appended to assorted error messages visible in user's browser (including
278# "not authenticated" message). Beware of placing any sensitive information
279# here, it will be readable by unauthorized visitors.
cab16ef4
DO
280#\$helpdesk_banner = '<B>This RackTables instance is supported by Example Inc. IT helpdesk, dial ext. 1234 to report a problem.</B>';
281
2a622048
DO
282
283ENDOFTEXT
284);
f92287f4
DO
285 fwrite ($conf, "?>\n");
286 fclose ($conf);
287 echo "The configuration file has been written successfully.<br>";
0e7f2155 288 return TRUE;
f48dc2cc
DO
289}
290
b00cc78c 291function connect_to_db_or_die ()
96e102b2 292{
96e102b2
DO
293 try
294 {
b00cc78c 295 connectDB();
96e102b2 296 }
b00cc78c 297 catch (RackTablesError $e)
96e102b2
DO
298 {
299 die ('Error connecting to the database');
300 }
301}
302
303function init_database_static ()
0e7f2155 304{
b00cc78c 305 connect_to_db_or_die();
01539ac3 306 global $dbxlink;
485cf8a8
DO
307 if (!isInnoDBSupported())
308 {
309 echo 'InnoDB test failed! Please configure MySQL server properly and retry.';
310 return FALSE;
311 }
01539ac3
DO
312 $result = $dbxlink->query ('show tables');
313 $tables = $result->fetchAll (PDO::FETCH_NUM);
314 $result->closeCursor();
315 unset ($result);
316 if (count ($tables))
317 {
318 echo 'Your database is already holding ' . count ($tables);
319 echo ' tables, so I will stop here and let you check it yourself.<br>';
320 echo 'There is some important data there probably.<br>';
321 return FALSE;
322 }
0e7f2155 323 echo 'Initializing the database...<br>';
96e102b2 324 echo '<table border=1>';
aa004b1a 325 echo "<tr><th>section</th><th>queries</th><th>errors</th></tr>";
b2bdfd89 326 $errlist = array();
3fb336f6 327 foreach (array ('structure', 'dictbase') as $part)
f92287f4 328 {
aa004b1a 329 echo "<tr><td>${part}</td>";
b2bdfd89 330 $nq = $nerrs = 0;
aa004b1a 331 foreach (preg_split ("/;\s*\n/", get_pseudo_file ($part)) as $query)
96e102b2 332 {
5fe42ae4 333 $query = trim($query);
aa004b1a 334 if (empty ($query) or '--' == substr ($query, 0, 2))
96e102b2
DO
335 continue;
336 $nq++;
b2bdfd89
DO
337 if ($dbxlink->exec ($query) === FALSE)
338 {
339 $nerrs++;
340 $errlist[] = $query;
341 }
96e102b2 342 }
b2bdfd89 343 echo "<td>${nq}</td><td>${nerrs}</td></tr>\n";
f92287f4 344 }
3fb336f6 345 // (re)load dictionary by pure PHP means w/o any external file
20ba7f38 346 echo "<tr><td>dictionary</td>";
3fb336f6 347 $nq = $nerrs = 0;
3fb336f6 348 $dictq = array();
ca3d68bd
DO
349 foreach (reloadDictionary() as $query)
350 {
351 $nq++;
352 if ($dbxlink->exec ($query) === FALSE)
3fb336f6 353 {
ca3d68bd
DO
354 $nerrs++;
355 $errlist[] = $query;
3fb336f6 356 }
ca3d68bd 357 }
3fb336f6 358 echo "<td>${nq}</td><td>${nerrs}</td></tr>\n";
dec748f6 359
96e102b2 360 echo '</table>';
b2bdfd89
DO
361 if (count ($errlist))
362 {
363 echo '<pre>The following queries failed:\n';
364 foreach ($errlist as $q)
365 echo "${q}\n\n";
366 echo '</pre>';
367 return FALSE;
368 }
0e7f2155
DO
369 return TRUE;
370}
f48dc2cc 371
96e102b2
DO
372function init_database_dynamic ()
373{
b00cc78c 374 connect_to_db_or_die();
96e102b2 375 global $dbxlink;
43f06d53 376 if (!isset ($_REQUEST['password']) or empty ($_REQUEST['password']))
96e102b2
DO
377 {
378 $result = $dbxlink->query ('select count(user_id) from UserAccount where user_id = 1');
379 $row = $result->fetch (PDO::FETCH_NUM);
380 $nrecs = $row[0];
381 $result->closeCursor();
382 if (!$nrecs)
383 {
384 echo '<table border=1>';
385 echo '<caption>Administrator password not set</caption>';
386 echo '<tr><td><input type=password name=password></td></tr>';
387 echo '</table>';
388 }
43f06d53 389 return FALSE;
96e102b2
DO
390 }
391 else
392 {
93bdb7ba
DO
393 // Never send cleartext password over the wire.
394 $hash = sha1 ($_REQUEST['password']);
79b8ad1e 395 $query = "INSERT INTO `UserAccount` (`user_id`, `user_name`, `user_password_hash`, `user_realname`) " .
93bdb7ba 396 "VALUES (1,'admin','${hash}','RackTables Administrator')";
43f06d53
DO
397 $result = $dbxlink->exec ($query);
398 echo "Administrator password has been set successfully.<br>";
399 return TRUE;
96e102b2 400 }
96e102b2
DO
401}
402
0e7f2155 403function congrats ()
f48dc2cc 404{
01539ac3 405 echo 'Congratulations! RackTables installation is complete. After pressing Proceed you will ';
ad592f37 406 echo 'enter the system. Authenticate with <strong>admin</strong> username.<br>RackTables project has a ';
d042d2c4 407 echo "<a href='http://wiki.racktables.org/index.php?title=RackTablesAdminGuide'>";
ad592f37
DO
408 echo "wiki</a> and a ";
409 echo "<a href='http://www.freelists.org/list/racktables-users'>mailing list</a> for users. Have fun.<br>";
0e7f2155 410 return TRUE;
f48dc2cc
DO
411}
412
aa004b1a
DO
413function get_pseudo_file ($name)
414{
415 switch ($name)
416 {
417 case 'structure':
418 return <<<END_OF_FILE
419alter database character set utf8;
420set names 'utf8';
421SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
422
423CREATE TABLE `Atom` (
424 `molecule_id` int(10) unsigned default NULL,
425 `rack_id` int(10) unsigned default NULL,
426 `unit_no` int(10) unsigned default NULL,
6e5556bc
AD
427 `atom` enum('front','interior','rear') default NULL,
428 CONSTRAINT `Atom-FK-molecule_id` FOREIGN KEY (`molecule_id`) REFERENCES `Molecule` (`id`) ON DELETE CASCADE,
429 CONSTRAINT `Atom-FK-rack_id` FOREIGN KEY (`rack_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
aa004b1a
DO
430) ENGINE=InnoDB;
431
432CREATE TABLE `Attribute` (
433 `id` int(10) unsigned NOT NULL auto_increment,
86ff26ae 434 `type` enum('string','uint','float','dict','date') default NULL,
aa004b1a
DO
435 `name` char(64) default NULL,
436 PRIMARY KEY (`id`),
437 UNIQUE KEY `name` (`name`)
08aa9c0b 438) ENGINE=InnoDB;
aa004b1a
DO
439
440CREATE TABLE `AttributeMap` (
441 `objtype_id` int(10) unsigned NOT NULL default '1',
442 `attr_id` int(10) unsigned NOT NULL default '1',
443 `chapter_id` int(10) unsigned default NULL,
08aa9c0b
DO
444 UNIQUE KEY `objtype_id` (`objtype_id`,`attr_id`),
445 KEY `attr_id` (`attr_id`),
c7968df3
DO
446 KEY `chapter_id` (`chapter_id`),
447 CONSTRAINT `AttributeMap-FK-chapter_id` FOREIGN KEY (`chapter_id`) REFERENCES `Chapter` (`id`),
08aa9c0b 448 CONSTRAINT `AttributeMap-FK-attr_id` FOREIGN KEY (`attr_id`) REFERENCES `Attribute` (`id`)
aa004b1a
DO
449) ENGINE=InnoDB;
450
451CREATE TABLE `AttributeValue` (
b55f913c 452 `object_id` int(10) unsigned NOT NULL,
7d68a0fb
DO
453 -- Default value intentionally breaks the constraint, this blocks
454 -- any insertion, which doesn't have 'object_tid' on the column list.
455 `object_tid` int(10) unsigned NOT NULL default '0',
b55f913c 456 `attr_id` int(10) unsigned NOT NULL,
42b4722b 457 `string_value` char(255) default NULL,
aa004b1a
DO
458 `uint_value` int(10) unsigned default NULL,
459 `float_value` float default NULL,
b55f913c 460 PRIMARY KEY (`object_id`,`attr_id`),
ed4c863c
DO
461 KEY `attr_id-uint_value` (`attr_id`,`uint_value`),
462 KEY `attr_id-string_value` (`attr_id`,`string_value`(12)),
7d68a0fb
DO
463 KEY `id-tid` (`object_id`,`object_tid`),
464 KEY `object_tid-attr_id` (`object_tid`,`attr_id`),
465 CONSTRAINT `AttributeValue-FK-map` FOREIGN KEY (`object_tid`, `attr_id`) REFERENCES `AttributeMap` (`objtype_id`, `attr_id`),
0dffb2b7 466 CONSTRAINT `AttributeValue-FK-object` FOREIGN KEY (`object_id`, `object_tid`) REFERENCES `Object` (`id`, `objtype_id`) ON DELETE CASCADE ON UPDATE CASCADE
aa004b1a
DO
467) ENGINE=InnoDB;
468
469CREATE TABLE `CachedPAV` (
470 `object_id` int(10) unsigned NOT NULL,
471 `port_name` char(255) NOT NULL,
472 `vlan_id` int(10) unsigned NOT NULL default '0',
473 PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
474 KEY `vlan_id` (`vlan_id`),
475 CONSTRAINT `CachedPAV-FK-object-port` FOREIGN KEY (`object_id`, `port_name`) REFERENCES `CachedPVM` (`object_id`, `port_name`) ON DELETE CASCADE,
476 CONSTRAINT `CachedPAV-FK-vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `VLANValidID` (`vlan_id`)
477) ENGINE=InnoDB;
478
479CREATE TABLE `CachedPNV` (
480 `object_id` int(10) unsigned NOT NULL,
481 `port_name` char(255) NOT NULL,
482 `vlan_id` int(10) unsigned NOT NULL default '0',
483 PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
484 UNIQUE KEY `port_id` (`object_id`,`port_name`),
485 CONSTRAINT `CachedPNV-FK-compound` FOREIGN KEY (`object_id`, `port_name`, `vlan_id`) REFERENCES `CachedPAV` (`object_id`, `port_name`, `vlan_id`) ON DELETE CASCADE
486) ENGINE=InnoDB;
487
488CREATE TABLE `CachedPVM` (
489 `object_id` int(10) unsigned NOT NULL,
490 `port_name` char(255) NOT NULL,
491 `vlan_mode` enum('access','trunk') NOT NULL default 'access',
492 PRIMARY KEY (`object_id`,`port_name`),
9b8174d7 493 CONSTRAINT `CachedPVM-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
aa004b1a
DO
494) ENGINE=InnoDB;
495
bfbdd78b
DO
496CREATE TABLE `CactiGraph` (
497 `object_id` int(10) unsigned NOT NULL,
14a9812c 498 `server_id` int(10) unsigned NOT NULL,
bfbdd78b
DO
499 `graph_id` int(10) unsigned NOT NULL,
500 `caption` char(255) DEFAULT NULL,
14a9812c 501 PRIMARY KEY (`server_id`,`graph_id`),
bfbdd78b 502 KEY `object_id` (`object_id`),
14a9812c
DO
503 KEY `graph_id` (`graph_id`),
504 CONSTRAINT `CactiGraph-FK-server_id` FOREIGN KEY (`server_id`) REFERENCES `CactiServer` (`id`),
bfbdd78b
DO
505 CONSTRAINT `CactiGraph-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
506) ENGINE=InnoDB;
507
14a9812c
DO
508CREATE TABLE `CactiServer` (
509 `id` int(10) unsigned NOT NULL auto_increment,
510 `base_url` char(255) DEFAULT NULL,
511 `username` char(64) DEFAULT NULL,
512 `password` char(64) DEFAULT NULL,
513 PRIMARY KEY (`id`)
514) ENGINE=InnoDB;
515
aa004b1a
DO
516CREATE TABLE `Chapter` (
517 `id` int(10) unsigned NOT NULL auto_increment,
518 `sticky` enum('yes','no') default 'no',
519 `name` char(128) NOT NULL,
520 PRIMARY KEY (`id`),
521 UNIQUE KEY `name` (`name`)
c7968df3 522) ENGINE=InnoDB;
aa004b1a
DO
523
524CREATE TABLE `Config` (
525 `varname` char(32) NOT NULL,
1d5dd3a1 526 `varvalue` text NOT NULL,
aa004b1a
DO
527 `vartype` enum('string','uint') NOT NULL default 'string',
528 `emptyok` enum('yes','no') NOT NULL default 'no',
529 `is_hidden` enum('yes','no') NOT NULL default 'yes',
530 `is_userdefined` enum('yes','no') NOT NULL default 'no',
531 `description` text,
532 PRIMARY KEY (`varname`)
533) ENGINE=InnoDB;
534
535CREATE TABLE `Dictionary` (
536 `chapter_id` int(10) unsigned NOT NULL,
537 `dict_key` int(10) unsigned NOT NULL auto_increment,
27f631ea 538 `dict_sticky` enum('yes','no') DEFAULT 'no',
aa004b1a
DO
539 `dict_value` char(255) default NULL,
540 PRIMARY KEY (`dict_key`),
27f631ea 541 UNIQUE KEY `dict_unique` (`chapter_id`,`dict_value`,`dict_sticky`),
c7968df3 542 CONSTRAINT `Dictionary-FK-chapter_id` FOREIGN KEY (`chapter_id`) REFERENCES `Chapter` (`id`)
a03332f7 543) ENGINE=InnoDB;
aa004b1a 544
0682218d
AD
545CREATE TABLE `EntityLink` (
546 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
e1add254 547 `parent_entity_type` enum('ipv4net','ipv4rspool','ipv4vs','ipv6net','location','object','rack','row','user') NOT NULL,
0682218d 548 `parent_entity_id` int(10) unsigned NOT NULL,
e1add254 549 `child_entity_type` enum('file','location','object','rack','row') NOT NULL,
0682218d
AD
550 `child_entity_id` int(10) unsigned NOT NULL,
551 PRIMARY KEY (`id`),
bd7c95ce 552 UNIQUE KEY `EntityLink-unique` (`parent_entity_type`,`parent_entity_id`,`child_entity_type`,`child_entity_id`),
d6e7a8e7 553 KEY `EntityLink-compound` (`parent_entity_type`,`child_entity_type`,`child_entity_id`)
0682218d
AD
554) ENGINE=InnoDB;
555
aa004b1a
DO
556CREATE TABLE `File` (
557 `id` int(10) unsigned NOT NULL auto_increment,
558 `name` char(255) NOT NULL,
559 `type` char(255) NOT NULL,
560 `size` int(10) unsigned NOT NULL,
561 `ctime` datetime NOT NULL,
562 `mtime` datetime NOT NULL,
563 `atime` datetime NOT NULL,
564 `thumbnail` longblob,
565 `contents` longblob NOT NULL,
566 `comment` text,
567 PRIMARY KEY (`id`),
568 UNIQUE KEY `name` (`name`)
569) ENGINE=InnoDB;
570
571CREATE TABLE `FileLink` (
572 `id` int(10) unsigned NOT NULL auto_increment,
573 `file_id` int(10) unsigned NOT NULL,
e1add254 574 `entity_type` enum('ipv4net','ipv4rspool','ipv4vs','ipv6net','location','object','rack','user') NOT NULL default 'object',
aa004b1a
DO
575 `entity_id` int(10) NOT NULL,
576 PRIMARY KEY (`id`),
577 KEY `FileLink-file_id` (`file_id`),
578 UNIQUE KEY `FileLink-unique` (`file_id`,`entity_type`,`entity_id`),
579 CONSTRAINT `FileLink-File_fkey` FOREIGN KEY (`file_id`) REFERENCES `File` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
580) ENGINE=InnoDB;
581
582CREATE TABLE `IPv4Address` (
583 `ip` int(10) unsigned NOT NULL default '0',
584 `name` char(255) NOT NULL default '',
cc2fa820 585 `comment` char(255) NOT NULL default '',
aa004b1a
DO
586 `reserved` enum('yes','no') default NULL,
587 PRIMARY KEY (`ip`)
588) ENGINE=InnoDB;
589
590CREATE TABLE `IPv4Allocation` (
591 `object_id` int(10) unsigned NOT NULL default '0',
592 `ip` int(10) unsigned NOT NULL default '0',
593 `name` char(255) NOT NULL default '',
581e3b64 594 `type` enum('regular','shared','virtual','router') NOT NULL DEFAULT 'regular',
aa004b1a 595 PRIMARY KEY (`object_id`,`ip`),
f701420b 596 KEY `ip` (`ip`),
9b8174d7 597 CONSTRAINT `IPv4Allocation-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
aa004b1a
DO
598) ENGINE=InnoDB;
599
600CREATE TABLE `IPv4LB` (
601 `object_id` int(10) unsigned default NULL,
602 `rspool_id` int(10) unsigned default NULL,
603 `vs_id` int(10) unsigned default NULL,
6213dc9f 604 `prio` varchar(255) default NULL,
aa004b1a
DO
605 `vsconfig` text,
606 `rsconfig` text,
607 UNIQUE KEY `LB-VS` (`object_id`,`vs_id`),
608 KEY `IPv4LB-FK-rspool_id` (`rspool_id`),
609 KEY `IPv4LB-FK-vs_id` (`vs_id`),
610 CONSTRAINT `IPv4LB-FK-vs_id` FOREIGN KEY (`vs_id`) REFERENCES `IPv4VS` (`id`),
9b8174d7 611 CONSTRAINT `IPv4LB-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`),
aa004b1a
DO
612 CONSTRAINT `IPv4LB-FK-rspool_id` FOREIGN KEY (`rspool_id`) REFERENCES `IPv4RSPool` (`id`)
613) ENGINE=InnoDB;
614
68c91b9c
AA
615CREATE TABLE `IPv4Log` (
616 `id` int(10) NOT NULL AUTO_INCREMENT,
617 `ip` int(10) unsigned NOT NULL,
618 `date` datetime NOT NULL,
619 `user` varchar(64) NOT NULL,
620 `message` text NOT NULL,
621 PRIMARY KEY (`id`),
622 KEY `ip-date` (`ip`,`date`)
623) ENGINE=InnoDB;
624
4318ced5
AA
625CREATE TABLE `IPv6Log` (
626 `id` int(10) NOT NULL AUTO_INCREMENT,
627 `ip` binary(16) NOT NULL,
628 `date` datetime NOT NULL,
629 `user` varchar(64) NOT NULL,
630 `message` text NOT NULL,
631 PRIMARY KEY (`id`),
632 KEY `ip-date` (`ip`,`date`)
633) ENGINE=InnoDB;
634
aa004b1a
DO
635CREATE TABLE `IPv4NAT` (
636 `object_id` int(10) unsigned NOT NULL default '0',
637 `proto` enum('TCP','UDP') NOT NULL default 'TCP',
638 `localip` int(10) unsigned NOT NULL default '0',
639 `localport` smallint(5) unsigned NOT NULL default '0',
640 `remoteip` int(10) unsigned NOT NULL default '0',
641 `remoteport` smallint(5) unsigned NOT NULL default '0',
642 `description` char(255) default NULL,
643 PRIMARY KEY (`object_id`,`proto`,`localip`,`localport`,`remoteip`,`remoteport`),
644 KEY `localip` (`localip`),
645 KEY `remoteip` (`remoteip`),
646 KEY `object_id` (`object_id`),
9b8174d7 647 CONSTRAINT `IPv4NAT-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`)
aa004b1a
DO
648) ENGINE=InnoDB;
649
650CREATE TABLE `IPv4Network` (
651 `id` int(10) unsigned NOT NULL auto_increment,
652 `ip` int(10) unsigned NOT NULL default '0',
653 `mask` int(10) unsigned NOT NULL default '0',
654 `name` char(255) default NULL,
655 `comment` text,
656 PRIMARY KEY (`id`),
657 UNIQUE KEY `base-len` (`ip`,`mask`)
658) ENGINE=InnoDB;
659
660CREATE TABLE `IPv4RS` (
661 `id` int(10) unsigned NOT NULL auto_increment,
662 `inservice` enum('yes','no') NOT NULL default 'no',
71066ef1 663 `rsip` varbinary(16) NOT NULL,
aa004b1a
DO
664 `rsport` smallint(5) unsigned default NULL,
665 `rspool_id` int(10) unsigned default NULL,
666 `rsconfig` text,
4ed2310e 667 `comment` varchar(255) DEFAULT NULL,
aa004b1a 668 PRIMARY KEY (`id`),
f701420b 669 KEY `rsip` (`rsip`),
aa004b1a
DO
670 UNIQUE KEY `pool-endpoint` (`rspool_id`,`rsip`,`rsport`),
671 CONSTRAINT `IPv4RS-FK` FOREIGN KEY (`rspool_id`) REFERENCES `IPv4RSPool` (`id`) ON DELETE CASCADE
672) ENGINE=InnoDB;
673
674CREATE TABLE `IPv4RSPool` (
675 `id` int(10) unsigned NOT NULL auto_increment,
676 `name` char(255) default NULL,
677 `vsconfig` text,
678 `rsconfig` text,
679 PRIMARY KEY (`id`)
680) ENGINE=InnoDB;
681
682CREATE TABLE `IPv4VS` (
683 `id` int(10) unsigned NOT NULL auto_increment,
71066ef1 684 `vip` varbinary(16) NOT NULL,
aa004b1a 685 `vport` smallint(5) unsigned default NULL,
ed38c73c 686 `proto` enum('TCP','UDP','MARK') NOT NULL default 'TCP',
aa004b1a
DO
687 `name` char(255) default NULL,
688 `vsconfig` text,
689 `rsconfig` text,
f701420b
AA
690 PRIMARY KEY (`id`),
691 KEY `vip` (`vip`)
aa004b1a
DO
692) ENGINE=InnoDB;
693
694CREATE TABLE `IPv6Address` (
695 `ip` binary(16) NOT NULL,
696 `name` char(255) NOT NULL default '',
cc2fa820 697 `comment` char(255) NOT NULL default '',
aa004b1a
DO
698 `reserved` enum('yes','no') default NULL,
699 PRIMARY KEY (`ip`)
700) ENGINE=InnoDB;
701
702CREATE TABLE `IPv6Allocation` (
703 `object_id` int(10) unsigned NOT NULL default '0',
704 `ip` binary(16) NOT NULL,
705 `name` char(255) NOT NULL default '',
581e3b64 706 `type` enum('regular','shared','virtual','router') NOT NULL DEFAULT 'regular',
aa004b1a 707 PRIMARY KEY (`object_id`,`ip`),
f701420b 708 KEY `ip` (`ip`),
9b8174d7 709 CONSTRAINT `IPv6Allocation-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
aa004b1a
DO
710) ENGINE=InnoDB;
711
712CREATE TABLE `IPv6Network` (
713 `id` int(10) unsigned NOT NULL auto_increment,
714 `ip` binary(16) NOT NULL,
715 `mask` int(10) unsigned NOT NULL,
716 `last_ip` binary(16) NOT NULL,
717 `name` char(255) default NULL,
718 `comment` text,
719 PRIMARY KEY (`id`),
720 UNIQUE KEY `ip` (`ip`,`mask`)
721) ENGINE=InnoDB;
722
723CREATE TABLE `LDAPCache` (
724 `presented_username` char(64) NOT NULL,
725 `successful_hash` char(40) NOT NULL,
726 `first_success` timestamp NOT NULL default CURRENT_TIMESTAMP,
727 `last_retry` timestamp NOT NULL default '0000-00-00 00:00:00',
728 `displayed_name` char(128) default NULL,
729 `memberof` text,
730 UNIQUE KEY `presented_username` (`presented_username`),
731 KEY `scanidx` (`presented_username`,`successful_hash`)
732) ENGINE=InnoDB;
733
734CREATE TABLE `Link` (
735 `porta` int(10) unsigned NOT NULL default '0',
736 `portb` int(10) unsigned NOT NULL default '0',
737 `cable` char(64) DEFAULT NULL,
738 PRIMARY KEY (`porta`,`portb`),
739 UNIQUE KEY `porta` (`porta`),
740 UNIQUE KEY `portb` (`portb`),
741 CONSTRAINT `Link-FK-a` FOREIGN KEY (`porta`) REFERENCES `Port` (`id`) ON DELETE CASCADE,
742 CONSTRAINT `Link-FK-b` FOREIGN KEY (`portb`) REFERENCES `Port` (`id`) ON DELETE CASCADE
743) ENGINE=InnoDB;
744
745CREATE TABLE `Molecule` (
746 `id` int(10) unsigned NOT NULL auto_increment,
747 PRIMARY KEY (`id`)
748) ENGINE=InnoDB;
749
750CREATE TABLE `MountOperation` (
751 `id` int(10) unsigned NOT NULL auto_increment,
752 `object_id` int(10) unsigned NOT NULL default '0',
753 `ctime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
754 `user_name` char(64) default NULL,
755 `old_molecule_id` int(10) unsigned default NULL,
756 `new_molecule_id` int(10) unsigned default NULL,
757 `comment` text,
758 PRIMARY KEY (`id`),
759 KEY `object_id` (`object_id`),
6e5556bc
AD
760 CONSTRAINT `MountOperation-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE,
761 CONSTRAINT `MountOperation-FK-old_molecule_id` FOREIGN KEY (`old_molecule_id`) REFERENCES `Molecule` (`id`) ON DELETE CASCADE,
762 CONSTRAINT `MountOperation-FK-new_molecule_id` FOREIGN KEY (`new_molecule_id`) REFERENCES `Molecule` (`id`) ON DELETE CASCADE
aa004b1a
DO
763) ENGINE=InnoDB;
764
765CREATE TABLE `ObjectLog` (
766 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
767 `object_id` int(10) unsigned NOT NULL,
768 `user` char(64) NOT NULL,
769 `date` datetime NOT NULL,
770 `content` text NOT NULL,
771 PRIMARY KEY (`id`),
772 KEY `object_id` (`object_id`),
773 KEY `date` (`date`),
9b8174d7 774 CONSTRAINT `ObjectLog-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
aa004b1a
DO
775) ENGINE=InnoDB;
776
0682218d
AD
777CREATE TABLE `ObjectParentCompat` (
778 `parent_objtype_id` int(10) unsigned NOT NULL,
779 `child_objtype_id` int(10) unsigned NOT NULL,
780 UNIQUE KEY `parent_child` (`parent_objtype_id`,`child_objtype_id`)
781) ENGINE=InnoDB;
782
aa004b1a
DO
783CREATE TABLE `Port` (
784 `id` int(10) unsigned NOT NULL auto_increment,
785 `object_id` int(10) unsigned NOT NULL default '0',
786 `name` char(255) NOT NULL default '',
787 `iif_id` int(10) unsigned NOT NULL,
788 `type` int(10) unsigned NOT NULL default '0',
789 `l2address` char(64) default NULL,
790 `reservation_comment` char(255) default NULL,
791 `label` char(255) default NULL,
792 PRIMARY KEY (`id`),
793 UNIQUE KEY `object_iif_oif_name` (`object_id`,`iif_id`,`type`,`name`),
794 KEY `type` (`type`),
795 KEY `comment` (`reservation_comment`),
796 KEY `l2address` (`l2address`),
797 KEY `Port-FK-iif-oif` (`iif_id`,`type`),
798 CONSTRAINT `Port-FK-iif-oif` FOREIGN KEY (`iif_id`, `type`) REFERENCES `PortInterfaceCompat` (`iif_id`, `oif_id`),
9b8174d7 799 CONSTRAINT `Port-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
aa004b1a
DO
800) ENGINE=InnoDB;
801
802CREATE TABLE `PortAllowedVLAN` (
803 `object_id` int(10) unsigned NOT NULL,
804 `port_name` char(255) NOT NULL,
805 `vlan_id` int(10) unsigned NOT NULL default '0',
806 PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
807 KEY `vlan_id` (`vlan_id`),
808 CONSTRAINT `PortAllowedVLAN-FK-object-port` FOREIGN KEY (`object_id`, `port_name`) REFERENCES `PortVLANMode` (`object_id`, `port_name`) ON DELETE CASCADE,
809 CONSTRAINT `PortAllowedVLAN-FK-vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `VLANValidID` (`vlan_id`)
810) ENGINE=InnoDB;
811
812CREATE TABLE `PortCompat` (
813 `type1` int(10) unsigned NOT NULL default '0',
814 `type2` int(10) unsigned NOT NULL default '0',
815 UNIQUE KEY `type1_2` (`type1`,`type2`),
816 KEY `type2` (`type2`)
817) ENGINE=InnoDB;
818
819CREATE TABLE `PortInnerInterface` (
820 `id` int(10) unsigned NOT NULL,
821 `iif_name` char(16) NOT NULL,
822 PRIMARY KEY (`id`),
823 UNIQUE KEY `iif_name` (`iif_name`)
824) ENGINE=InnoDB;
825
826CREATE TABLE `PortInterfaceCompat` (
827 `iif_id` int(10) unsigned NOT NULL,
828 `oif_id` int(10) unsigned NOT NULL,
829 UNIQUE KEY `pair` (`iif_id`,`oif_id`),
830 CONSTRAINT `PortInterfaceCompat-FK-iif_id` FOREIGN KEY (`iif_id`) REFERENCES `PortInnerInterface` (`id`)
831) ENGINE=InnoDB;
832
5c6225b1
AA
833CREATE TABLE `PortLog` (
834 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
835 `port_id` int(10) unsigned NOT NULL,
5c6225b1 836 `date` datetime NOT NULL,
68c91b9c
AA
837 `user` varchar(64) NOT NULL,
838 `message` text NOT NULL,
5c6225b1
AA
839 PRIMARY KEY (`id`),
840 KEY `port_id-date` (`port_id`,`date`),
841 CONSTRAINT `PortLog_ibfk_1` FOREIGN KEY (`port_id`) REFERENCES `Port` (`id`) ON DELETE CASCADE
842) ENGINE=InnoDB;
843
aa004b1a
DO
844CREATE TABLE `PortNativeVLAN` (
845 `object_id` int(10) unsigned NOT NULL,
846 `port_name` char(255) NOT NULL,
847 `vlan_id` int(10) unsigned NOT NULL default '0',
848 PRIMARY KEY (`object_id`,`port_name`,`vlan_id`),
849 UNIQUE KEY `port_id` (`object_id`,`port_name`),
850 CONSTRAINT `PortNativeVLAN-FK-compound` FOREIGN KEY (`object_id`, `port_name`, `vlan_id`) REFERENCES `PortAllowedVLAN` (`object_id`, `port_name`, `vlan_id`) ON DELETE CASCADE
851) ENGINE=InnoDB;
852
853CREATE TABLE `PortVLANMode` (
854 `object_id` int(10) unsigned NOT NULL,
855 `port_name` char(255) NOT NULL,
856 `vlan_mode` enum('access','trunk') NOT NULL default 'access',
857 PRIMARY KEY (`object_id`,`port_name`),
858 CONSTRAINT `PortVLANMode-FK-object-port` FOREIGN KEY (`object_id`, `port_name`) REFERENCES `CachedPVM` (`object_id`, `port_name`)
859) ENGINE=InnoDB;
860
9b8174d7 861CREATE TABLE `Object` (
aa004b1a
DO
862 `id` int(10) unsigned NOT NULL auto_increment,
863 `name` char(255) default NULL,
864 `label` char(255) default NULL,
aa004b1a
DO
865 `objtype_id` int(10) unsigned NOT NULL default '1',
866 `asset_no` char(64) default NULL,
867 `has_problems` enum('yes','no') NOT NULL default 'no',
868 `comment` text,
869 PRIMARY KEY (`id`),
9b8174d7 870 UNIQUE KEY `asset_no` (`asset_no`),
7d68a0fb 871 KEY `id-tid` (`id`,`objtype_id`),
bd7c95ce 872 KEY `type_id` (`objtype_id`,`id`)
aa004b1a
DO
873) ENGINE=InnoDB;
874
9b8174d7 875CREATE TABLE `ObjectHistory` (
aa004b1a
DO
876 `id` int(10) unsigned default NULL,
877 `name` char(255) default NULL,
878 `label` char(255) default NULL,
aa004b1a
DO
879 `objtype_id` int(10) unsigned default NULL,
880 `asset_no` char(64) default NULL,
881 `has_problems` enum('yes','no') NOT NULL default 'no',
882 `comment` text,
883 `ctime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
884 `user_name` char(64) default NULL,
885 KEY `id` (`id`),
9b8174d7 886 CONSTRAINT `ObjectHistory-FK-object_id` FOREIGN KEY (`id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
aa004b1a
DO
887) ENGINE=InnoDB;
888
889CREATE TABLE `RackSpace` (
890 `rack_id` int(10) unsigned NOT NULL default '0',
891 `unit_no` int(10) unsigned NOT NULL default '0',
892 `atom` enum('front','interior','rear') NOT NULL default 'interior',
893 `state` enum('A','U','T','W') NOT NULL default 'A',
894 `object_id` int(10) unsigned default NULL,
895 PRIMARY KEY (`rack_id`,`unit_no`,`atom`),
896 KEY `RackSpace_object_id` (`object_id`),
9b8174d7
AD
897 CONSTRAINT `RackSpace-FK-rack_id` FOREIGN KEY (`rack_id`) REFERENCES `Object` (`id`),
898 CONSTRAINT `RackSpace-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
899) ENGINE=InnoDB;
900
901CREATE TABLE `RackThumbnail` (
902 `rack_id` int(10) unsigned NOT NULL,
903 `thumb_data` blob,
904 UNIQUE KEY `rack_id` (`rack_id`),
905 CONSTRAINT `RackThumbnail-FK-rack_id` FOREIGN KEY (`rack_id`) REFERENCES `Object` (`id`) ON DELETE CASCADE
aa004b1a
DO
906) ENGINE=InnoDB;
907
908CREATE TABLE `Script` (
909 `script_name` char(64) NOT NULL,
910 `script_text` longtext,
911 PRIMARY KEY (`script_name`)
912) ENGINE=InnoDB;
913
914CREATE TABLE `TagStorage` (
e1add254 915 `entity_realm` enum('file','ipv4net','ipv4rspool','ipv4vs','ipv6net','location','object','rack','user','vst') NOT NULL default 'object',
aa004b1a
DO
916 `entity_id` int(10) unsigned NOT NULL,
917 `tag_id` int(10) unsigned NOT NULL default '0',
6e58c2c4 918 `tag_is_assignable` enum('yes','no') NOT NULL DEFAULT 'yes',
30bb83bd
AA
919 `user` char(64) DEFAULT NULL,
920 `date` datetime DEFAULT NULL,
aa004b1a
DO
921 UNIQUE KEY `entity_tag` (`entity_realm`,`entity_id`,`tag_id`),
922 KEY `entity_id` (`entity_id`),
923 KEY `TagStorage-FK-tag_id` (`tag_id`),
6e58c2c4
DO
924 KEY `tag_id-tag_is_assignable` (`tag_id`,`tag_is_assignable`),
925 CONSTRAINT `TagStorage-FK-TagTree` FOREIGN KEY (`tag_id`, `tag_is_assignable`) REFERENCES `TagTree` (`id`, `is_assignable`)
aa004b1a
DO
926) ENGINE=InnoDB;
927
928CREATE TABLE `TagTree` (
929 `id` int(10) unsigned NOT NULL auto_increment,
930 `parent_id` int(10) unsigned default NULL,
6e58c2c4 931 `is_assignable` enum('yes','no') NOT NULL DEFAULT 'yes',
aa004b1a
DO
932 `tag` char(255) default NULL,
933 PRIMARY KEY (`id`),
934 UNIQUE KEY `tag` (`tag`),
935 KEY `TagTree-K-parent_id` (`parent_id`),
6e58c2c4 936 KEY `id-is_assignable` (`id`,`is_assignable`),
aa004b1a
DO
937 CONSTRAINT `TagTree-K-parent_id` FOREIGN KEY (`parent_id`) REFERENCES `TagTree` (`id`)
938) ENGINE=InnoDB;
939
940CREATE TABLE `UserAccount` (
941 `user_id` int(10) unsigned NOT NULL auto_increment,
942 `user_name` char(64) NOT NULL default '',
943 `user_password_hash` char(40) default NULL,
944 `user_realname` char(64) default NULL,
945 PRIMARY KEY (`user_id`),
946 UNIQUE KEY `user_name` (`user_name`)
c7968df3 947) ENGINE=InnoDB;
aa004b1a
DO
948
949CREATE TABLE `UserConfig` (
950 `varname` char(32) NOT NULL,
1d5dd3a1 951 `varvalue` text NOT NULL,
aa004b1a 952 `user` char(64) NOT NULL,
c7968df3
DO
953 UNIQUE KEY `user_varname` (`user`,`varname`),
954 KEY `varname` (`varname`),
955 CONSTRAINT `UserConfig-FK-varname` FOREIGN KEY (`varname`) REFERENCES `Config` (`varname`) ON DELETE CASCADE,
956 CONSTRAINT `UserConfig-FK-user` FOREIGN KEY (`user`) REFERENCES `UserAccount` (`user_name`) ON DELETE CASCADE
aa004b1a
DO
957) ENGINE=InnoDB;
958
959CREATE TABLE `VLANDescription` (
960 `domain_id` int(10) unsigned NOT NULL,
961 `vlan_id` int(10) unsigned NOT NULL default '0',
962 `vlan_type` enum('ondemand','compulsory','alien') NOT NULL default 'ondemand',
963 `vlan_descr` char(255) default NULL,
964 PRIMARY KEY (`domain_id`,`vlan_id`),
965 KEY `vlan_id` (`vlan_id`),
966 CONSTRAINT `VLANDescription-FK-domain_id` FOREIGN KEY (`domain_id`) REFERENCES `VLANDomain` (`id`) ON DELETE CASCADE,
967 CONSTRAINT `VLANDescription-FK-vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `VLANValidID` (`vlan_id`)
968) ENGINE=InnoDB;
969
970CREATE TABLE `VLANDomain` (
971 `id` int(10) unsigned NOT NULL auto_increment,
972 `description` char(255) default NULL,
973 PRIMARY KEY (`id`),
974 UNIQUE KEY `description` (`description`)
975) ENGINE=InnoDB;
976
977CREATE TABLE `VLANIPv4` (
978 `domain_id` int(10) unsigned NOT NULL,
979 `vlan_id` int(10) unsigned NOT NULL,
980 `ipv4net_id` int(10) unsigned NOT NULL,
981 UNIQUE KEY `network-domain` (`ipv4net_id`,`domain_id`),
982 KEY `VLANIPv4-FK-compound` (`domain_id`,`vlan_id`),
983 CONSTRAINT `VLANIPv4-FK-compound` FOREIGN KEY (`domain_id`, `vlan_id`) REFERENCES `VLANDescription` (`domain_id`, `vlan_id`) ON DELETE CASCADE,
984 CONSTRAINT `VLANIPv4-FK-ipv4net_id` FOREIGN KEY (`ipv4net_id`) REFERENCES `IPv4Network` (`id`) ON DELETE CASCADE
985) ENGINE=InnoDB;
986
987CREATE TABLE `VLANIPv6` (
988 `domain_id` int(10) unsigned NOT NULL,
989 `vlan_id` int(10) unsigned NOT NULL,
990 `ipv6net_id` int(10) unsigned NOT NULL,
991 UNIQUE KEY `network-domain` (`ipv6net_id`,`domain_id`),
992 KEY `VLANIPv6-FK-compound` (`domain_id`,`vlan_id`),
993 CONSTRAINT `VLANIPv6-FK-compound` FOREIGN KEY (`domain_id`, `vlan_id`) REFERENCES `VLANDescription` (`domain_id`, `vlan_id`) ON DELETE CASCADE,
994 CONSTRAINT `VLANIPv6-FK-ipv6net_id` FOREIGN KEY (`ipv6net_id`) REFERENCES `IPv6Network` (`id`) ON DELETE CASCADE
995) ENGINE=InnoDB;
996
997CREATE TABLE `VLANSTRule` (
998 `vst_id` int(10) unsigned NOT NULL,
999 `rule_no` int(10) unsigned NOT NULL,
1000 `port_pcre` char(255) NOT NULL,
1001 `port_role` enum('access','trunk','anymode','uplink','downlink','none') NOT NULL default 'none',
1002 `wrt_vlans` char(255) default NULL,
1003 `description` char(255) default NULL,
1004 UNIQUE KEY `vst-rule` (`vst_id`,`rule_no`),
1005 CONSTRAINT `VLANSTRule-FK-vst_id` FOREIGN KEY (`vst_id`) REFERENCES `VLANSwitchTemplate` (`id`) ON DELETE CASCADE
1006) ENGINE=InnoDB;
1007
1008CREATE TABLE `VLANSwitch` (
1009 `object_id` int(10) unsigned NOT NULL,
1010 `domain_id` int(10) unsigned NOT NULL,
1011 `template_id` int(10) unsigned NOT NULL,
1012 `mutex_rev` int(10) unsigned NOT NULL default '0',
1013 `out_of_sync` enum('yes','no') NOT NULL default 'yes',
1014 `last_errno` int(10) unsigned NOT NULL default '0',
1015 `last_change` timestamp NOT NULL default '0000-00-00 00:00:00',
1016 `last_push_started` timestamp NOT NULL default '0000-00-00 00:00:00',
1017 `last_push_finished` timestamp NOT NULL default '0000-00-00 00:00:00',
1018 `last_error_ts` timestamp NOT NULL default '0000-00-00 00:00:00',
1019 UNIQUE KEY `object_id` (`object_id`),
1020 KEY `domain_id` (`domain_id`),
1021 KEY `template_id` (`template_id`),
1022 KEY `out_of_sync` (`out_of_sync`),
1023 KEY `last_errno` (`last_errno`),
1024 CONSTRAINT `VLANSwitch-FK-domain_id` FOREIGN KEY (`domain_id`) REFERENCES `VLANDomain` (`id`),
9b8174d7 1025 CONSTRAINT `VLANSwitch-FK-object_id` FOREIGN KEY (`object_id`) REFERENCES `Object` (`id`),
aa004b1a
DO
1026 CONSTRAINT `VLANSwitch-FK-template_id` FOREIGN KEY (`template_id`) REFERENCES `VLANSwitchTemplate` (`id`)
1027) ENGINE=InnoDB;
1028
1029CREATE TABLE `VLANSwitchTemplate` (
1030 `id` int(10) unsigned NOT NULL auto_increment,
aa004b1a 1031 `mutex_rev` int(10) NOT NULL,
322ce490 1032 `description` char(255) default NULL,
aa004b1a
DO
1033 `saved_by` char(64) NOT NULL,
1034 PRIMARY KEY (`id`),
1035 UNIQUE KEY `description` (`description`)
1036) ENGINE=InnoDB;
1037
1038CREATE TABLE `VLANValidID` (
1039 `vlan_id` int(10) unsigned NOT NULL default '1',
1040 PRIMARY KEY (`vlan_id`)
1041) ENGINE=InnoDB;
1042
e1add254 1043CREATE VIEW `Location` AS SELECT O.id, O.name, O.has_problems, O.comment, P.id AS parent_id, P.name AS parent_name
69bd4a37
AA
1044FROM `Object` O
1045LEFT JOIN (
1046 `Object` P INNER JOIN `EntityLink` EL
1047 ON EL.parent_entity_id = P.id AND P.objtype_id = 1562 AND EL.parent_entity_type = 'location' AND EL.child_entity_type = 'location'
1048) ON EL.child_entity_id = O.id
1049WHERE O.objtype_id = 1562;
e1add254
AD
1050
1051CREATE VIEW `Row` AS SELECT O.id, O.name, L.id AS location_id, L.name AS location_name
1052 FROM `Object` O
1053 LEFT JOIN `EntityLink` EL ON O.id = EL.child_entity_id AND EL.parent_entity_type = 'location' AND EL.child_entity_type = 'row'
1054 LEFT JOIN `Object` L ON EL.parent_entity_id = L.id AND L.objtype_id = 1562
1055 WHERE O.objtype_id = 1561;
9b8174d7 1056
5545b0c7 1057CREATE VIEW `Rack` AS SELECT O.id, O.name AS name, O.asset_no, O.has_problems, O.comment,
42504426
AD
1058 AV_H.uint_value AS height,
1059 AV_S.uint_value AS sort_order,
1f02e311 1060 RT.thumb_data,
e1add254
AD
1061 R.id AS row_id,
1062 R.name AS row_name
1f02e311 1063 FROM `Object` O
42504426
AD
1064 LEFT JOIN `AttributeValue` AV_H ON O.id = AV_H.object_id AND AV_H.attr_id = 27
1065 LEFT JOIN `AttributeValue` AV_S ON O.id = AV_S.object_id AND AV_S.attr_id = 29
1f02e311 1066 LEFT JOIN `RackThumbnail` RT ON O.id = RT.rack_id
e1add254
AD
1067 LEFT JOIN `EntityLink` EL ON O.id = EL.child_entity_id AND EL.parent_entity_type = 'row' AND EL.child_entity_type = 'rack'
1068 INNER JOIN `Object` R ON R.id = EL.parent_entity_id
86cbb632 1069 WHERE O.objtype_id = 1560;
9b8174d7 1070
d7e9e25b 1071CREATE VIEW `RackObject` AS SELECT id, name, label, objtype_id, asset_no, has_problems, comment FROM `Object`
9b8174d7
AD
1072 WHERE `objtype_id` NOT IN (1560, 1561, 1562);
1073
aa004b1a
DO
1074SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
1075END_OF_FILE;
1076##########################################################################
1077 case 'dictbase':
72933f2a 1078 $db_version = CODE_VERSION;
aa004b1a 1079 return <<<END_OF_FILE
aa004b1a
DO
1080INSERT INTO `Attribute` (`id`, `type`, `name`) VALUES
1081(1,'string','OEM S/N 1'),
1082(2,'dict','HW type'),
1083(3,'string','FQDN'),
1084(4,'dict','SW type'),
1085(5,'string','SW version'),
1086(6,'uint','number of ports'),
1087(7,'float','max. current, Ampers'),
1088(8,'float','power load, percents'),
1089(14,'string','contact person'),
1090(13,'float','max power, Watts'),
1091(16,'uint','flash memory, MB'),
1092(17,'uint','DRAM, MB'),
1093(18,'uint','CPU, MHz'),
1094(20,'string','OEM S/N 2'),
86ff26ae
DO
1095(21,'date','support contract expiration'),
1096(22,'date','HW warranty expiration'),
1097(24,'date','SW warranty expiration'),
0682218d 1098(25,'string','UUID'),
9b8174d7 1099(26,'dict','Hypervisor'),
453cce7e
AD
1100(27,'uint','Height, units'),
1101(28,'string','Slot number'),
42504426 1102(29,'uint','Sort order'),
e9893a88 1103(30,'dict','Mgmt type'),
08aa9c0b
DO
1104-- ^^^^^ Any new "default" attributes must go above this line! ^^^^^
1105-- Primary key value 9999 makes sure, that AUTO_INCREMENT on server restart
1106-- doesn't drop below 10000 (other code relies on this, site-specific
1107-- attributes are assigned IDs starting from 10000).
1108(9999,'string','base MAC address');
aa004b1a 1109
038795f9
DO
1110INSERT INTO `Chapter` (`id`, `sticky`, `name`) VALUES
1111(1,'yes','ObjectType'),
1112(2,'yes','PortOuterInterface'),
1113(11,'no','server models'),
1114(12,'no','network switch models'),
1115(13,'no','server OS type'),
1116(14,'no','switch OS type'),
1117(16,'no','router OS type'),
1118(17,'no','router models'),
1119(18,'no','disk array models'),
1120(19,'no','tape library models'),
1121(21,'no','KVM switch models'),
1122(23,'no','console models'),
1123(24,'no','network security models'),
1124(25,'no','wireless models'),
1125(26,'no','fibre channel switch models'),
1126(27,'no','PDU models'),
1127(28,'no','Voice/video hardware'),
1128(29,'no','Yes/No'),
1129(30,'no','network chassis models'),
1130(31,'no','server chassis models'),
1131(32,'no','virtual switch models'),
1132(33,'no','virtual switch OS type'),
1133(34,'no','power supply chassis models'),
1134(35,'no','power supply models'),
faa027d6 1135(36,'no','serial console server models'),
0c652e58 1136(37,'no','wireless OS type'),
e9893a88 1137(38,'no','management interface type'),
038795f9
DO
1138-- Default chapters must have ID less than 10000, add them above this line.
1139(9999,'no','multiplexer models');
1140
aa004b1a
DO
1141INSERT INTO `AttributeMap` (`objtype_id`, `attr_id`, `chapter_id`) VALUES
1142(2,1,NULL),
1143(2,2,27),
1144(2,3,NULL),
1145(2,5,NULL),
1146(4,1,NULL),
1147(4,2,11),
1148(4,3,NULL),
1149(4,4,13),
1150(4,14,NULL),
1151(4,21,NULL),
1152(4,22,NULL),
aa004b1a 1153(4,24,NULL),
0682218d
AD
1154(4,25,NULL),
1155(4,26,29),
b507f36a 1156(4,28,NULL),
aa004b1a
DO
1157(5,1,NULL),
1158(5,2,18),
1159(6,1,NULL),
1160(6,2,19),
1161(6,20,NULL),
1162(7,1,NULL),
1163(7,2,17),
1164(7,3,NULL),
1165(7,4,16),
1166(7,5,NULL),
1167(7,14,NULL),
1168(7,16,NULL),
1169(7,17,NULL),
1170(7,18,NULL),
1171(7,21,NULL),
1172(7,22,NULL),
1173(7,24,NULL),
1174(8,1,NULL),
1175(8,2,12),
1176(8,3,NULL),
1177(8,4,14),
1178(8,5,NULL),
1179(8,14,NULL),
1180(8,16,NULL),
1181(8,17,NULL),
1182(8,18,NULL),
1183(8,20,NULL),
1184(8,21,NULL),
1185(8,22,NULL),
1186(8,24,NULL),
b507f36a 1187(8,28,NULL),
aa004b1a
DO
1188(9,6,NULL),
1189(12,1,NULL),
1190(12,3,NULL),
1191(12,7,NULL),
1192(12,8,NULL),
1193(12,13,NULL),
1194(12,20,NULL),
1195(445,1,NULL),
1196(445,2,21),
1197(445,3,NULL),
1198(445,5,NULL),
1199(445,14,NULL),
1200(445,22,NULL),
1201(447,1,NULL),
c7968df3 1202(447,2,9999),
aa004b1a
DO
1203(447,3,NULL),
1204(447,5,NULL),
1205(447,14,NULL),
1206(447,22,NULL),
1207(15,2,23),
1208(798,1,NULL),
1209(798,2,24),
1210(798,3,NULL),
1211(798,5,NULL),
1212(798,14,NULL),
1213(798,16,NULL),
1214(798,17,NULL),
1215(798,18,NULL),
1216(798,20,NULL),
1217(798,21,NULL),
1218(798,22,NULL),
1219(798,24,NULL),
b507f36a 1220(798,28,NULL),
aa004b1a
DO
1221(965,1,NULL),
1222(965,3,NULL),
1223(965,2,25),
0c652e58 1224(965,4,37),
aa004b1a 1225(1055,2,26),
b507f36a 1226(1055,28,NULL),
aa004b1a
DO
1227(1323,1,NULL),
1228(1323,2,28),
1229(1323,3,NULL),
0682218d 1230(1323,5,NULL),
ae67fa11
AD
1231(1397,1,NULL),
1232(1397,2,34),
1233(1397,14,NULL),
1234(1397,21,NULL),
1235(1397,22,NULL),
1236(1398,1,NULL),
1237(1398,2,35),
1238(1398,14,NULL),
1239(1398,21,NULL),
1240(1398,22,NULL),
0682218d
AD
1241(1502,1,NULL),
1242(1502,2,31),
1243(1502,3,NULL),
1244(1502,14,NULL),
1245(1502,20,NULL),
1246(1502,21,NULL),
1247(1502,22,NULL),
1248(1503,1,NULL),
1249(1503,2,30),
1250(1503,3,NULL),
588c98f8
AD
1251(1503,4,14),
1252(1503,5,NULL),
0682218d 1253(1503,14,NULL),
588c98f8
AD
1254(1503,16,NULL),
1255(1503,17,NULL),
1256(1503,18,NULL),
0682218d
AD
1257(1503,20,NULL),
1258(1503,21,NULL),
1259(1503,22,NULL),
588c98f8 1260(1503,24,NULL),
0682218d
AD
1261(1504,3,NULL),
1262(1504,4,13),
1263(1504,14,NULL),
1264(1504,24,NULL),
1265(1505,14,NULL),
1266(1506,14,NULL),
1267(1506,17,NULL),
1268(1506,18,NULL),
1269(1507,1,NULL),
1270(1507,2,32),
1271(1507,3,NULL),
1272(1507,4,33),
1273(1507,5,NULL),
1274(1507,14,NULL),
1275(1507,20,NULL),
1276(1507,21,NULL),
9b8174d7 1277(1507,22,NULL),
faa027d6 1278(1560,27,NULL),
42504426 1279(1560,29,NULL),
e1add254 1280(1562,14,NULL),
faa027d6
DO
1281(1644, 1, NULL),
1282(1644, 2, 36),
e9893a88
AD
1283(1644, 3, NULL),
1284(1787,3,NULL),
1285(1787,14,NULL),
1286(1787,30,38);
aa004b1a 1287
aa004b1a
DO
1288INSERT INTO `PortInnerInterface` VALUES
1289(1,'hardwired'),
1290(2,'SFP-100'),
1291(3,'GBIC'),
1292(4,'SFP-1000'),
1293(5,'XENPAK'),
1294(6,'X2'),
1295(7,'XPAK'),
1296(8,'XFP'),
44cbeb2e 1297(9,'SFP+'),
833583b5
DO
1298(10,'QSFP+'),
1299(11,'CFP');
aa004b1a 1300
0682218d
AD
1301INSERT INTO `ObjectParentCompat` VALUES
1302(3,13),
1303(4,1504),
1304(4,1507),
ae67fa11 1305(1397,1398),
0682218d
AD
1306(1502,4),
1307(1503,8),
1308(1505,4),
1309(1505,1504),
1310(1505,1506),
1311(1505,1507),
2265be00 1312(1506,4),
0682218d
AD
1313(1506,1504);
1314
aa004b1a
DO
1315INSERT INTO `PortInterfaceCompat` VALUES
1316(2,1208),(2,1195),(2,1196),(2,1197),(2,1198),(2,1199),(2,1200),(2,1201),
1317(3,1078),(3,24),(3,34),(3,1202),(3,1203),(3,1204),(3,1205),(3,1206),(3,1207),
34c3ab2a 1318(4,1077),(4,24),(4,34),(4,1202),(4,1203),(4,1204),(4,1205),(4,1206),(4,1207),
aa004b1a
DO
1319(5,1079),(5,30),(5,35),(5,36),(5,37),(5,38),(5,39),(5,40),
1320(6,1080),(6,30),(6,35),(6,36),(6,37),(6,38),(6,39),(6,40),
1321(7,1081),(7,30),(7,35),(7,36),(7,37),(7,38),(7,39),(7,40),
1322(8,1082),(8,30),(8,35),(8,36),(8,37),(8,38),(8,39),(8,40),
5a32ed6f 1323(9,1084),(9,30),(9,35),(9,36),(9,37),(9,38),(9,39),(9,40),
55732b46 1324(10,1588),(10,1663),(10,1664),
833583b5 1325(11,1668),(11,1669),(11,1670),(11,1671),
e1486971 1326(1,16),(1,19),(1,24),(1,29),(1,31),(1,33),(1,446),(1,681),(1,682),(1,1322),(1,1399),(1,1469);
aa004b1a
DO
1327
1328INSERT INTO `PortCompat` (`type1`, `type2`) VALUES
1329(17,17),
1330(18,18),
1331(19,19),
aa004b1a 1332(24,24),
aa004b1a
DO
1333(18,19),
1334(19,18),
1335(18,24),
1336(24,18),
1337(19,24),
1338(24,19),
1339(29,29),
aa004b1a
DO
1340(30,30),
1341(16,1322),
1342(1322,16),
1343(29,681),
1344(29,682),
1345(32,32),
1346(33,446),
1347(34,34),
1348(35,35),
1349(36,36),
1350(37,37),
1351(38,38),
1352(39,39),
1353(40,40),
1354(41,41),
1355(439,439),
1356(446,33),
1357(681,29),
1358(681,681),
1359(681,682),
1360(682,29),
1361(682,681),
1362(682,682),
1363(1077,1077),
aa004b1a
DO
1364(1084,1084),
1365(1087,1087),
aa004b1a 1366(1195,1195),
aa004b1a
DO
1367(1196,1196),
1368(1197,1197),
1369(1198,1199),
1370(1199,1198),
1371(1200,1200),
1372(1201,1201),
aa004b1a
DO
1373(1202,1202),
1374(1203,1203),
aa004b1a
DO
1375(1204,1204),
1376(1205,1205),
1377(1206,1207),
1378(1207,1206),
1379(1209,1209),
1380(1210,1210),
1381(1211,1211),
1382(1212,1212),
1383(1213,1213),
1384(1214,1214),
1385(1215,1215),
1386(1216,1216),
1387(1217,1217),
1388(1218,1218),
1389(1219,1219),
1390(1220,1220),
1391(1221,1221),
1392(1222,1222),
1393(1223,1223),
1394(1224,1224),
1395(1225,1225),
1396(1226,1226),
1397(1227,1227),
1398(1228,1228),
1399(1229,1229),
1400(1230,1230),
1401(1231,1231),
1402(1232,1232),
1403(1233,1233),
1404(1234,1234),
1405(1235,1235),
1406(1236,1236),
1407(1237,1237),
1408(1238,1238),
1409(1239,1239),
1410(1240,1240),
1411(1241,1241),
1412(1242,1242),
1413(1243,1243),
1414(1244,1244),
1415(1245,1245),
1416(1246,1246),
1417(1247,1247),
1418(1248,1248),
1419(1249,1249),
1420(1250,1250),
1421(1251,1251),
1422(1252,1252),
1423(1253,1253),
1424(1254,1254),
1425(1255,1255),
1426(1256,1256),
1427(1257,1257),
1428(1258,1258),
1429(1259,1259),
1430(1260,1260),
1431(1261,1261),
1432(1262,1262),
1433(1263,1263),
1434(1264,1264),
1435(1265,1265),
1436(1266,1266),
1437(1267,1267),
1438(1268,1268),
1439(1269,1269),
1440(1270,1270),
1441(1271,1271),
1442(1272,1272),
1443(1273,1273),
1444(1274,1274),
1445(1275,1275),
1446(1276,1276),
1447(1277,1277),
1448(1278,1278),
1449(1279,1279),
1450(1280,1280),
1451(1281,1281),
1452(1282,1282),
1453(1283,1283),
1454(1284,1284),
1455(1285,1285),
1456(1286,1286),
1457(1287,1287),
1458(1288,1288),
1459(1289,1289),
1460(1290,1290),
1461(1291,1291),
1462(1292,1292),
1463(1293,1293),
1464(1294,1294),
1465(1295,1295),
1466(1296,1296),
1467(1297,1297),
1468(1298,1298),
1469(1299,1299),
1470(1300,1300),
ae67fa11 1471(1316,1316),
85e868a0 1472(1424,1424),
52d31972
DO
1473(1425,1425),
1474(1426,1426),
1475(1427,1427),
1476(1428,1428),
1477(1429,1429),
1478(1430,1430),
1479(1431,1431),
1480(1432,1432),
1481(1433,1433),
1482(1434,1434),
1483(1435,1435),
1484(1436,1436),
1485(1437,1437),
1486(1438,1438),
1487(1439,1439),
1488(1440,1440),
1489(1441,1441),
1490(1442,1442),
1491(1443,1443),
1492(1444,1444),
1493(1445,1445),
1494(1446,1446),
1495(1447,1447),
1496(1448,1448),
1497(1449,1449),
1498(1450,1450),
1499(1451,1451),
1500(1452,1452),
1501(1453,1453),
1502(1454,1454),
1503(1455,1455),
1504(1456,1456),
1505(1457,1457),
1506(1458,1458),
1507(1459,1459),
1508(1460,1460),
1509(1461,1461),
1510(1462,1462),
1511(1463,1463),
1512(1464,1464),
1513(1465,1465),
1514(1466,1466),
e1486971 1515(1469,1469),
f7494e3c 1516(1399,1399),
e7311c79 1517(1588,1588),
18680729 1518(1603,1603),
e7311c79 1519(1661,1661),
e7311c79
DO
1520(1663,1663),
1521(1664,1664),
833583b5
DO
1522(1668,1668),
1523(1669,1669),
1524(1670,1670),
1525(1671,1671),
5a32ed6f 1526(1642,1642);
aa004b1a
DO
1527
1528INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, is_userdefined, description) VALUES
0682218d 1529('MASSCOUNT','8','uint','no','no','yes','&quot;Fast&quot; form is this many records tall'),
aa004b1a
DO
1530('MAXSELSIZE','30','uint','no','no','yes','&lt;SELECT&gt; lists height'),
1531('enterprise','MyCompanyName','string','no','no','no','Organization name'),
1532('ROW_SCALE','2','uint','no','no','yes','Picture scale for rack row display'),
1533('PORTS_PER_ROW','12','uint','no','no','yes','Ports per row in VLANs tab'),
1534('IPV4_ADDRS_PER_PAGE','256','uint','no','no','yes','IPv4 addresses per page'),
1535('DEFAULT_RACK_HEIGHT','42','uint','yes','no','yes','Default rack height'),
1536('DEFAULT_SLB_VS_PORT','','uint','yes','no','yes','Default port of SLB virtual service'),
1537('DEFAULT_SLB_RS_PORT','','uint','yes','no','yes','Default port of SLB real server'),
1538('DETECT_URLS','no','string','yes','no','yes','Detect URLs in text fields'),
1539('RACK_PRESELECT_THRESHOLD','1','uint','no','no','yes','Rack pre-selection threshold'),
1540('DEFAULT_IPV4_RS_INSERVICE','no','string','no','no','yes','Inservice status for new SLB real servers'),
1541('AUTOPORTS_CONFIG','4 = 1*33*kvm + 2*24*eth%u;15 = 1*446*kvm','string','yes','no','no','AutoPorts configuration'),
1542('DEFAULT_OBJECT_TYPE','4','uint','yes','no','yes','Default object type for new objects'),
1543('SHOW_EXPLICIT_TAGS','yes','string','no','no','yes','Show explicit tags'),
1544('SHOW_IMPLICIT_TAGS','yes','string','no','no','yes','Show implicit tags'),
1545('SHOW_AUTOMATIC_TAGS','no','string','no','no','yes','Show automatic tags'),
1546('IPV4_AUTO_RELEASE','1','uint','no','no','yes','Auto-release IPv4 addresses on allocation'),
9c64ccf8 1547('SHOW_LAST_TAB','yes','string','yes','no','yes','Remember last tab shown for each page'),
aa004b1a
DO
1548('EXT_IPV4_VIEW','yes','string','no','no','yes','Extended IPv4 view'),
1549('TREE_THRESHOLD','25','uint','yes','no','yes','Tree view auto-collapse threshold'),
1550('IPV4_JAYWALK','no','string','no','no','no','Enable IPv4 address allocations w/o covering network'),
1551('ADDNEW_AT_TOP','yes','string','no','no','yes','Render "add new" line at top of the list'),
9c64ccf8 1552('IPV4_TREE_SHOW_USAGE','no','string','no','no','yes','Show address usage in IPv4 tree'),
aa004b1a
DO
1553('PREVIEW_TEXT_MAXCHARS','10240','uint','yes','no','yes','Max chars for text file preview'),
1554('PREVIEW_TEXT_ROWS','25','uint','yes','no','yes','Rows for text file preview'),
1555('PREVIEW_TEXT_COLS','80','uint','yes','no','yes','Columns for text file preview'),
1556('PREVIEW_IMAGE_MAXPXS','320','uint','yes','no','yes','Max pixels per axis for image file preview'),
1557('VENDOR_SIEVE','','string','yes','no','yes','Vendor sieve configuration'),
9c64ccf8 1558('IPV4LB_LISTSRC','false','string','yes','no','no','List source: IPv4 load balancers'),
be91a564 1559('IPV4OBJ_LISTSRC','{\$typeid_4} or {\$typeid_7} or {\$typeid_8} or {\$typeid_12} or {\$typeid_445} or {\$typeid_447} or {\$typeid_798} or {\$typeid_1397} or {\$typeid_1502} or {\$typeid_1503} or {\$typeid_1504} or {\$typeid_1507} or {\$typeid_1787}','string','yes','no','no','List source: IPv4-enabled objects'),
aa004b1a
DO
1560('IPV4NAT_LISTSRC','{\$typeid_4} or {\$typeid_7} or {\$typeid_8} or {\$typeid_798}','string','yes','no','no','List source: IPv4 NAT performers'),
1561('ASSETWARN_LISTSRC','{\$typeid_4} or {\$typeid_7} or {\$typeid_8}','string','yes','no','no','List source: object, for which asset tag should be set'),
1562('NAMEWARN_LISTSRC','{\$typeid_4} or {\$typeid_7} or {\$typeid_8}','string','yes','no','no','List source: object, for which common name should be set'),
1563('RACKS_PER_ROW','12','uint','yes','no','yes','Racks per row'),
0ec44a91 1564('FILTER_PREDICATE_SIEVE','','string','yes','no','yes','Predicate sieve regex(7)'),
9c64ccf8 1565('FILTER_DEFAULT_ANDOR','and','string','no','no','yes','Default list filter boolean operation (or/and)'),
0ec44a91
AA
1566('FILTER_SUGGEST_ANDOR','yes','string','no','no','yes','Suggest and/or selector in list filter'),
1567('FILTER_SUGGEST_TAGS','yes','string','no','no','yes','Suggest tags in list filter'),
1568('FILTER_SUGGEST_PREDICATES','yes','string','no','no','yes','Suggest predicates in list filter'),
9c64ccf8 1569('FILTER_SUGGEST_EXTRA','yes','string','no','no','yes','Suggest extra expression in list filter'),
aa004b1a 1570('DEFAULT_SNMP_COMMUNITY','public','string','no','no','no','Default SNMP Community string'),
0ec44a91
AA
1571('IPV4_ENABLE_KNIGHT','yes','string','no','no','yes','Enable IPv4 knight feature'),
1572('TAGS_TOPLIST_SIZE','50','uint','yes','no','yes','Tags top list size'),
1573('TAGS_QUICKLIST_SIZE','20','uint','no','no','yes','Tags quick list size'),
1574('TAGS_QUICKLIST_THRESHOLD','50','uint','yes','no','yes','Tags quick list threshold'),
1575('ENABLE_MULTIPORT_FORM','no','string','no','no','yes','Enable "Add/update multiple ports" form'),
aa004b1a 1576('DEFAULT_PORT_IIF_ID','1','uint','no','no','no','Default port inner interface ID'),
833583b5 1577('DEFAULT_PORT_OIF_IDS','1=24; 3=1078; 4=1077; 5=1079; 6=1080; 8=1082; 9=1084; 10=1588; 11=1668','string','no','no','no','Default port outer interface IDs'),
9c64ccf8 1578('IPV4_TREE_RTR_AS_CELL','no','string','no','no','yes','Show full router info for each network in IPv4 tree view'),
76a7ec36 1579('PROXIMITY_RANGE','0','uint','yes','no','yes','Proximity range (0 is current rack only)'),
aa004b1a
DO
1580('VLANSWITCH_LISTSRC', '', 'string', 'yes', 'no', 'yes', 'List of VLAN running switches'),
1581('VLANIPV4NET_LISTSRC', '', 'string', 'yes', 'no', 'yes', 'List of VLAN-based IPv4 networks'),
1582('IPV4_TREE_SHOW_VLAN','yes','string','no','no','yes','Show VLAN for each network in IPv4 tree'),
1583('DEFAULT_VDOM_ID','','uint','yes','no','yes','Default VLAN domain ID'),
1584('DEFAULT_VST_ID','','uint','yes','no','yes','Default VLAN switch template ID'),
1585('8021Q_DEPLOY_MINAGE','300','uint','no','no','no','802.1Q deploy minimum age'),
1586('8021Q_DEPLOY_MAXAGE','3600','uint','no','no','no','802.1Q deploy maximum age'),
1587('8021Q_DEPLOY_RETRY','10800','uint','no','no','no','802.1Q deploy retry timer'),
1588('8021Q_WRI_AFTER_CONFT_LISTSRC','false','string','no','no','no','802.1Q: save device configuration after deploy (RackCode)'),
1589('8021Q_INSTANT_DEPLOY','no','string','no','no','yes','802.1Q: instant deploy'),
1590('STATIC_FILTER','yes','string','no','no','yes','Enable Filter Caching'),
1591('ENABLE_BULKPORT_FORM','yes','string','no','no','yes','Enable "Bulk Port" form'),
1592('CDP_RUNNERS_LISTSRC', '', 'string', 'yes', 'no', 'no', 'List of devices running CDP'),
1593('LLDP_RUNNERS_LISTSRC', '', 'string', 'yes', 'no', 'no', 'List of devices running LLDP'),
aa004b1a
DO
1594('SHRINK_TAG_TREE_ON_CLICK','yes','string','no','no','yes','Dynamically hide useless tags in tagtree'),
1595('MAX_UNFILTERED_ENTITIES','0','uint','no','no','yes','Max item count to display on unfiltered result page'),
1596('SYNCDOMAIN_MAX_PROCESSES','0','uint','yes','no', 'no', 'How many worker proceses syncdomain cron script should create'),
0682218d 1597('PORT_EXCLUSION_LISTSRC','{\$typeid_3} or {\$typeid_10} or {\$typeid_11} or {\$typeid_1505} or {\$typeid_1506}','string','yes','no','no','List source: objects without ports'),
6d42599c 1598('FILTER_RACKLIST_BY_TAGS','yes','string','yes','no','yes','Rackspace: show only racks matching the current object\'s tags'),
9c64ccf8
AA
1599('SSH_OBJS_LISTSRC','false','string','yes','no','yes','Rackcode filter for SSH-managed objects'),
1600('TELNET_OBJS_LISTSRC','false','string','yes','no','yes','Rackcode filter for telnet-managed objects'),
f1cdc9f1 1601('SYNC_802Q_LISTSRC','','string','yes','no','no','List of VLAN switches sync is enabled on'),
9c64ccf8 1602('QUICK_LINK_PAGES','depot,ipv4space,rackspace','string','yes','no','yes','List of pages to dislay in quick links'),
bfbdd78b 1603('CACTI_LISTSRC','false','string','yes','no','no','List of object with Cacti graphs'),
8dc2a6c8 1604('VIRTUAL_OBJ_LISTSRC','1504,1505,1506,1507','string','no','no','no','List source: virtual objects'),
0ec44a91
AA
1605('DATETIME_ZONE','UTC','string','yes','no','yes','Timezone to use for displaying/calculating dates'),
1606('DATETIME_FORMAT','m/d/Y','string','no','no','yes','PHP date() format to use for date output'),
2481e17e 1607('SEARCH_DOMAINS','','string','yes','no','yes','DNS domain list (comma-separated) to search in FQDN attributes'),
a30564d3 1608('8021Q_EXTSYNC_LISTSRC','false','string','yes','no','no','List source: objects with extended 802.1Q sync'),
72933f2a 1609('DB_VERSION','${db_version}','string','no','yes','no','Database version.');
aa004b1a
DO
1610
1611INSERT INTO `Script` VALUES ('RackCode','allow {\$userid_1}');
1612
1613INSERT INTO VLANValidID (vlan_id) VALUES
1614(1),
1615(2),
1616(3),
1617(4),
1618(5),
1619(6),
1620(7),
1621(8),
1622(9),
1623(10),
1624(11),
1625(12),
1626(13),
1627(14),
1628(15),
1629(16),
1630(17),
1631(18),
1632(19),
1633(20),
1634(21),
1635(22),
1636(23),
1637(24),
1638(25),
1639(26),
1640(27),
1641(28),
1642(29),
1643(30),
1644(31),
1645(32),
1646(33),
1647(34),
1648(35),
1649(36),
1650(37),
1651(38),
1652(39),
1653(40),
1654(41),
1655(42),
1656(43),
1657(44),
1658(45),
1659(46),
1660(47),
1661(48),
1662(49),
1663(50),
1664(51),
1665(52),
1666(53),
1667(54),
1668(55),
1669(56),
1670(57),
1671(58),
1672(59),
1673(60),
1674(61),
1675(62),
1676(63),
1677(64),
1678(65),
1679(66),
1680(67),
1681(68),
1682(69),
1683(70),
1684(71),
1685(72),
1686(73),
1687(74),
1688(75),
1689(76),
1690(77),
1691(78),
1692(79),
1693(80),
1694(81),
1695(82),
1696(83),
1697(84),
1698(85),
1699(86),
1700(87),
1701(88),
1702(89),
1703(90),
1704(91),
1705(92),
1706(93),
1707(94),
1708(95),
1709(96),
1710(97),
1711(98),
1712(99),
1713(100),
1714(101),
1715(102),
1716(103),
1717(104),
1718(105),
1719(106),
1720(107),
1721(108),
1722(109),
1723(110),
1724(111),
1725(112),
1726(113),
1727(114),
1728(115),
1729(116),
1730(117),
1731(118),
1732(119),
1733(120),
1734(121),
1735(122),
1736(123),
1737(124),
1738(125),
1739(126),
1740(127),
1741(128),
1742(129),
1743(130),
1744(131),
1745(132),
1746(133),
1747(134),
1748(135),
1749(136),
1750(137),
1751(138),
1752(139),
1753(140),
1754(141),
1755(142),
1756(143),
1757(144),
1758(145),
1759(146),
1760(147),
1761(148),
1762(149),
1763(150),
1764(151),
1765(152),
1766(153),
1767(154),
1768(155),
1769(156),
1770(157),
1771(158),
1772(159),
1773(160),
1774(161),
1775(162),
1776(163),
1777(164),
1778(165),
1779(166),
1780(167),
1781(168),
1782(169),
1783(170),
1784(171),
1785(172),
1786(173),
1787(174),
1788(175),
1789(176),
1790(177),
1791(178),
1792(179),
1793(180),
1794(181),
1795(182),
1796(183),
1797(184),
1798(185),
1799(186),
1800(187),
1801(188),
1802(189),
1803(190),
1804(191),
1805(192),
1806(193),
1807(194),
1808(195),
1809(196),
1810(197),
1811(198),
1812(199),
1813(200),
1814(201),
1815(202),
1816(203),
1817(204),
1818(205),
1819(206),
1820(207),
1821(208),
1822(209),
1823(210),
1824(211),
1825(212),
1826(213),
1827(214),
1828(215),
1829(216),
1830(217),
1831(218),
1832(219),
1833(220),
1834(221),
1835(222),
1836(223),
1837(224),
1838(225),
1839(226),
1840(227),
1841(228),
1842(229),
1843(230),
1844(231),
1845(232),
1846(233),
1847(234),
1848(235),
1849(236),
1850(237),
1851(238),
1852(239),
1853(240),
1854(241),
1855(242),
1856(243),
1857(244),
1858(245),
1859(246),
1860(247),
1861(248),
1862(249),
1863(250),
1864(251),
1865(252),
1866(253),
1867(254),
1868(255),
1869(256),
1870(257),
1871(258),
1872(259),
1873(260),
1874(261),
1875(262),
1876(263),
1877(264),
1878(265),
1879(266),
1880(267),
1881(268),
1882(269),
1883(270),
1884(271),
1885(272),
1886(273),
1887(274),
1888(275),
1889(276),
1890(277),
1891(278),
1892(279),
1893(280),
1894(281),
1895(282),
1896(283),
1897(284),
1898(285),
1899(286),
1900(287),
1901(288),
1902(289),
1903(290),
1904(291),
1905(292),
1906(293),
1907(294),
1908(295),
1909(296),
1910(297),
1911(298),
1912(299),
1913(300),
1914(301),
1915(302),
1916(303),
1917(304),
1918(305),
1919(306),
1920(307),
1921(308),
1922(309),
1923(310),
1924(311),
1925(312),
1926(313),
1927(314),
1928(315),
1929(316),
1930(317),
1931(318),
1932(319),
1933(320),
1934(321),
1935(322),
1936(323),
1937(324),
1938(325),
1939(326),
1940(327),
1941(328),
1942(329),
1943(330),
1944(331),
1945(332),
1946(333),
1947(334),
1948(335),
1949(336),
1950(337),
1951(338),
1952(339),
1953(340),
1954(341),
1955(342),
1956(343),
1957(344),
1958(345),
1959(346),
1960(347),
1961(348),
1962(349),
1963(350),
1964(351),
1965(352),
1966(353),
1967(354),
1968(355),
1969(356),
1970(357),
1971(358),
1972(359),
1973(360),
1974(361),
1975(362),
1976(363),
1977(364),
1978(365),
1979(366),
1980(367),
1981(368),
1982(369),
1983(370),
1984(371),
1985(372),
1986(373),
1987(374),
1988(375),
1989(376),
1990(377),
1991(378),
1992(379),
1993(380),
1994(381),
1995(382),
1996(383),
1997(384),
1998(385),
1999(386),
2000(387),
2001(388),
2002(389),
2003(390),
2004(391),
2005(392),
2006(393),
2007(394),
2008(395),
2009(396),
2010(397),
2011(398),
2012(399),
2013(400),
2014(401),
2015(402),
2016(403),
2017(404),
2018(405),
2019(406),
2020(407),
2021(408),
2022(409),
2023(410),
2024(411),
2025(412),
2026(413),
2027(414),
2028(415),
2029(416),
2030(417),
2031(418),
2032(419),
2033(420),
2034(421),
2035(422),
2036(423),
2037(424),
2038(425),
2039(426),
2040(427),
2041(428),
2042(429),
2043(430),
2044(431),
2045(432),
2046(433),
2047(434),
2048(435),
2049(436),
2050(437),
2051(438),
2052(439),
2053(440),
2054(441),
2055(442),
2056(443),
2057(444),
2058(445),
2059(446),
2060(447),
2061(448),
2062(449),
2063(450),
2064(451),
2065(452),
2066(453),
2067(454),
2068(455),
2069(456),
2070(457),
2071(458),
2072(459),
2073(460),
2074(461),
2075(462),
2076(463),
2077(464),
2078(465),
2079(466),
2080(467),
2081(468),
2082(469),
2083(470),
2084(471),
2085(472),
2086(473),
2087(474),
2088(475),
2089(476),
2090(477),
2091(478),
2092(479),
2093(480),
2094(481),
2095(482),
2096(483),
2097(484),
2098(485),
2099(486),
2100(487),
2101(488),
2102(489),
2103(490),
2104(491),
2105(492),
2106(493),
2107(494),
2108(495),
2109(496),
2110(497),
2111(498),
2112(499),
2113(500),
2114(501),
2115(502),
2116(503),
2117(504),
2118(505),
2119(506),
2120(507),
2121(508),
2122(509),
2123(510),
2124(511),
2125(512),
2126(513),
2127(514),
2128(515),
2129(516),
2130(517),
2131(518),
2132(519),
2133(520),
2134(521),
2135(522),
2136(523),
2137(524),
2138(525),
2139(526),
2140(527),
2141(528),
2142(529),
2143(530),
2144(531),
2145(532),
2146(533),
2147(534),
2148(535),
2149(536),
2150(537),
2151(538),
2152(539),
2153(540),
2154(541),
2155(542),
2156(543),
2157(544),
2158(545),
2159(546),
2160(547),
2161(548),
2162(549),
2163(550),
2164(551),
2165(552),
2166(553),
2167(554),
2168(555),
2169(556),
2170(557),
2171(558),
2172(559),
2173(560),
2174(561),
2175(562),
2176(563),
2177(564),
2178(565),
2179(566),
2180(567),
2181(568),
2182(569),
2183(570),
2184(571),
2185(572),
2186(573),
2187(574),
2188(575),
2189(576),
2190(577),
2191(578),
2192(579),
2193(580),
2194(581),
2195(582),
2196(583),
2197(584),
2198(585),
2199(586),
2200(587),
2201(588),
2202(589),
2203(590),
2204(591),
2205(592),
2206(593),
2207(594),
2208(595),
2209(596),
2210(597),
2211(598),
2212(599),
2213(600),
2214(601),
2215(602),
2216(603),
2217(604),
2218(605),
2219(606),
2220(607),
2221(608),
2222(609),
2223(610),
2224(611),
2225(612),
2226(613),
2227(614),
2228(615),
2229(616),
2230(617),
2231(618),
2232(619),
2233(620),
2234(621),
2235(622),
2236(623),
2237(624),
2238(625),
2239(626),
2240(627),
2241(628),
2242(629),
2243(630),
2244(631),
2245(632),
2246(633),
2247(634),
2248(635),
2249(636),
2250(637),
2251(638),
2252(639),
2253(640),
2254(641),
2255(642),
2256(643),
2257(644),
2258(645),
2259(646),
2260(647),
2261(648),
2262(649),
2263(650),
2264(651),
2265(652),
2266(653),
2267(654),
2268(655),
2269(656),
2270(657),
2271(658),
2272(659),
2273(660),
2274(661),
2275(662),
2276(663),
2277(664),
2278(665),
2279(666),
2280(667),
2281(668),
2282(669),
2283(670),
2284(671),
2285(672),
2286(673),
2287(674),
2288(675),
2289(676),
2290(677),
2291(678),
2292(679),
2293(680),
2294(681),
2295(682),
2296(683),
2297(684),
2298(685),
2299(686),
2300(687),
2301(688),
2302(689),
2303(690),
2304(691),
2305(692),
2306(693),
2307(694),
2308(695),
2309(696),
2310(697),
2311(698),
2312(699),
2313(700),
2314(701),
2315(702),
2316(703),
2317(704),
2318(705),
2319(706),
2320(707),
2321(708),
2322(709),
2323(710),
2324(711),
2325(712),
2326(713),
2327(714),
2328(715),
2329(716),
2330(717),
2331(718),
2332(719),
2333(720),
2334(721),
2335(722),
2336(723),
2337(724),
2338(725),
2339(726),
2340(727),
2341(728),
2342(729),
2343(730),
2344(731),
2345(732),
2346(733),
2347(734),
2348(735),
2349(736),
2350(737),
2351(738),
2352(739),
2353(740),
2354(741),
2355(742),
2356(743),
2357(744),
2358(745),
2359(746),
2360(747),
2361(748),
2362(749),
2363(750),
2364(751),
2365(752),
2366(753),
2367(754),
2368(755),
2369(756),
2370(757),
2371(758),
2372(759),
2373(760),
2374(761),
2375(762),
2376(763),
2377(764),
2378(765),
2379(766),
2380(767),
2381(768),
2382(769),
2383(770),
2384(771),
2385(772),
2386(773),
2387(774),
2388(775),
2389(776),
2390(777),
2391(778),
2392(779),
2393(780),
2394(781),
2395(782),
2396(783),
2397(784),
2398(785),
2399(786),
2400(787),
2401(788),
2402(789),
2403(790),
2404(791),
2405(792),
2406(793),
2407(794),
2408(795),
2409(796),
2410(797),
2411(798),
2412(799),
2413(800),
2414(801),
2415(802),
2416(803),
2417(804),
2418(805),
2419(806),
2420(807),
2421(808),
2422(809),
2423(810),
2424(811),
2425(812),
2426(813),
2427(814),
2428(815),
2429(816),
2430(817),
2431(818),
2432(819),
2433(820),
2434(821),
2435(822),
2436(823),
2437(824),
2438(825),
2439(826),
2440(827),
2441(828),
2442(829),
2443(830),
2444(831),
2445(832),
2446(833),
2447(834),
2448(835),
2449(836),
2450(837),
2451(838),
2452(839),
2453(840),
2454(841),
2455(842),
2456(843),
2457(844),
2458(845),
2459(846),
2460(847),
2461(848),
2462(849),
2463(850),
2464(851),
2465(852),
2466(853),
2467(854),
2468(855),
2469(856),
2470(857),
2471(858),
2472(859),
2473(860),
2474(861),
2475(862),
2476(863),
2477(864),
2478(865),
2479(866),
2480(867),
2481(868),
2482(869),
2483(870),
2484(871),
2485(872),
2486(873),
2487(874),
2488(875),
2489(876),
2490(877),
2491(878),
2492(879),
2493(880),
2494(881),
2495(882),
2496(883),
2497(884),
2498(885),
2499(886),
2500(887),
2501(888),
2502(889),
2503(890),
2504(891),
2505(892),
2506(893),
2507(894),
2508(895),
2509(896),
2510(897),
2511(898),
2512(899),
2513(900),
2514(901),
2515(902),
2516(903),
2517(904),
2518(905),
2519(906),
2520(907),
2521(908),
2522(909),
2523(910),
2524(911),
2525(912),
2526(913),
2527(914),
2528(915),
2529(916),
2530(917),
2531(918),
2532(919),
2533(920),
2534(921),
2535(922),
2536(923),
2537(924),
2538(925),
2539(926),
2540(927),
2541(928),
2542(929),
2543(930),
2544(931),
2545(932),
2546(933),
2547(934),
2548(935),
2549(936),
2550(937),
2551(938),
2552(939),
2553(940),
2554(941),
2555(942),
2556(943),
2557(944),
2558(945),
2559(946),
2560(947),
2561(948),
2562(949),
2563(950),
2564(951),
2565(952),
2566(953),
2567(954),
2568(955),
2569(956),
2570(957),
2571(958),
2572(959),
2573(960),
2574(961),
2575(962),
2576(963),
2577(964),
2578(965),
2579(966),
2580(967),
2581(968),
2582(969),
2583(970),
2584(971),
2585(972),
2586(973),
2587(974),
2588(975),
2589(976),
2590(977),
2591(978),
2592(979),
2593(980),
2594(981),
2595(982),
2596(983),
2597(984),
2598(985),
2599(986),
2600(987),
2601(988),
2602(989),
2603(990),
2604(991),
2605(992),
2606(993),
2607(994),
2608(995),
2609(996),
2610(997),
2611(998),
2612(999),
2613(1000),
2614(1001),
2615(1002),
2616(1003),
2617(1004),
2618(1005),
2619(1006),
2620(1007),
2621(1008),
2622(1009),
2623(1010),
2624(1011),
2625(1012),
2626(1013),
2627(1014),
2628(1015),
2629(1016),
2630(1017),
2631(1018),
2632(1019),
2633(1020),
2634(1021),
2635(1022),
2636(1023),
2637(1024),
2638(1025),
2639(1026),
2640(1027),
2641(1028),
2642(1029),
2643(1030),
2644(1031),
2645(1032),
2646(1033),
2647(1034),
2648(1035),
2649(1036),
2650(1037),
2651(1038),
2652(1039),
2653(1040),
2654(1041),
2655(1042),
2656(1043),
2657(1044),
2658(1045),
2659(1046),
2660(1047),
2661(1048),
2662(1049),
2663(1050),
2664(1051),
2665(1052),
2666(1053),
2667(1054),
2668(1055),
2669(1056),
2670(1057),
2671(1058),
2672(1059),
2673(1060),
2674(1061),
2675(1062),
2676(1063),
2677(1064),
2678(1065),
2679(1066),
2680(1067),
2681(1068),
2682(1069),
2683(1070),
2684(1071),
2685(1072),
2686(1073),
2687(1074),
2688(1075),
2689(1076),
2690(1077),
2691(1078),
2692(1079),
2693(1080),
2694(1081),
2695(1082),
2696(1083),
2697(1084),
2698(1085),
2699(1086),
2700(1087),
2701(1088),
2702(1089),
2703(1090),
2704(1091),
2705(1092),
2706(1093),
2707(1094),
2708(1095),
2709(1096),
2710(1097),
2711(1098),
2712(1099),
2713(1100),
2714(1101),
2715(1102),
2716(1103),
2717(1104),
2718(1105),
2719(1106),
2720(1107),
2721(1108),
2722(1109),
2723(1110),
2724(1111),
2725(1112),
2726(1113),
2727(1114),
2728(1115),
2729(1116),
2730(1117),
2731(1118),
2732(1119),
2733(1120),
2734(1121),
2735(1122),
2736(1123),
2737(1124),
2738(1125),
2739(1126),
2740(1127),
2741(1128),
2742(1129),
2743(1130),
2744(1131),
2745(1132),
2746(1133),
2747(1134),
2748(1135),
2749(1136),
2750(1137),
2751(1138),
2752(1139),
2753(1140),
2754(1141),
2755(1142),
2756(1143),
2757(1144),
2758(1145),
2759(1146),
2760(1147),
2761(1148),
2762(1149),
2763(1150),
2764(1151),
2765(1152),
2766(1153),
2767(1154),
2768(1155),
2769(1156),
2770(1157),
2771(1158),
2772(1159),
2773(1160),
2774(1161),
2775(1162),
2776(1163),
2777(1164),
2778(1165),
2779(1166),
2780(1167),
2781(1168),
2782(1169),
2783(1170),
2784(1171),
2785(1172),
2786(1173),
2787(1174),
2788(1175),
2789(1176),
2790(1177),
2791(1178),
2792(1179),
2793(1180),
2794(1181),
2795(1182),
2796(1183),
2797(1184),
2798(1185),
2799(1186),
2800(1187),
2801(1188),
2802(1189),
2803(1190),
2804(1191),
2805(1192),
2806(1193),
2807(1194),
2808(1195),
2809(1196),
2810(1197),
2811(1198),
2812(1199),
2813(1200),
2814(1201),
2815(1202),
2816(1203),
2817(1204),
2818(1205),
2819(1206),
2820(1207),
2821(1208),
2822(1209),
2823(1210),
2824(1211),
2825(1212),
2826(1213),
2827(1214),
2828(1215),
2829(1216),
2830(1217),
2831(1218),
2832(1219),
2833(1220),
2834(1221),
2835(1222),
2836(1223),
2837(1224),
2838(1225),
2839(1226),
2840(1227),
2841(1228),
2842(1229),
2843(1230),
2844(1231),
2845(1232),
2846(1233),
2847(1234),
2848(1235),
2849(1236),
2850(1237),
2851(1238),
2852(1239),
2853(1240),
2854(1241),
2855(1242),
2856(1243),
2857(1244),
2858(1245),
2859(1246),
2860(1247),
2861(1248),
2862(1249),
2863(1250),
2864(1251),
2865(1252),
2866(1253),
2867(1254),
2868(1255),
2869(1256),
2870(1257),
2871(1258),
2872(1259),
2873(1260),
2874(1261),
2875(1262),
2876(1263),
2877(1264),
2878(1265),
2879(1266),
2880(1267),
2881(1268),
2882(1269),
2883(1270),
2884(1271),
2885(1272),
2886(1273),
2887(1274),
2888(1275),
2889(1276),
2890(1277),
2891(1278),
2892(1279),
2893(1280),
2894(1281),
2895(1282),
2896(1283),
2897(1284),
2898(1285),
2899(1286),
2900(1287),
2901(1288),
2902(1289),
2903(1290),
2904(1291),
2905(1292),
2906(1293),
2907(1294),
2908(1295),
2909(1296),
2910(1297),
2911(1298),
2912(1299),
2913(1300),
2914(1301),
2915(1302),
2916(1303),
2917(1304),
2918(1305),
2919(1306),
2920(1307),
2921(1308),
2922(1309),
2923(1310),
2924(1311),
2925(1312),
2926(1313),
2927(1314),
2928(1315),
2929(1316),
2930(1317),
2931(1318),
2932(1319),
2933(1320),
2934(1321),
2935(1322),
2936(1323),
2937(1324),
2938(1325),
2939(1326),
2940(1327),
2941(1328),
2942(1329),
2943(1330),
2944(1331),
2945(1332),
2946(1333),
2947(1334),
2948(1335),
2949(1336),
2950(1337),
2951(1338),
2952(1339),
2953(1340),
2954(1341),
2955(1342),
2956(1343),
2957(1344),
2958(1345),
2959(1346),
2960(1347),
2961(1348),
2962(1349),
2963(1350),
2964(1351),
2965(1352),
2966(1353),
2967(1354),
2968(1355),
2969(1356),
2970(1357),
2971(1358),
2972(1359),
2973(1360),
2974(1361),
2975(1362),
2976(1363),
2977(1364),
2978(1365),
2979(1366),
2980(1367),
2981(1368),
2982(1369),
2983(1370),
2984(1371),
2985(1372),
2986(1373),
2987(1374),
2988(1375),
2989(1376),
2990(1377),
2991(1378),
2992(1379),
2993(1380),
2994(1381),
2995(1382),
2996(1383),
2997(1384),
2998(1385),
2999(1386),
3000(1387),
3001(1388),
3002(1389),
3003(1390),
3004(1391),
3005(1392),
3006(1393),
3007(1394),
3008(1395),
3009(1396),
3010(1397),
3011(1398),
3012(1399),
3013(1400),
3014(1401),
3015(1402),
3016(1403),
3017(1404),
3018(1405),
3019(1406),
3020(1407),
3021(1408),
3022(1409),
3023(1410),
3024(1411),
3025(1412),
3026(1413),
3027(1414),
3028(1415),
3029(1416),
3030(1417),
3031(1418),
3032(1419),
3033(1420),
3034(1421),
3035(1422),
3036(1423),
3037(1424),
3038(1425),
3039(1426),
3040(1427),
3041(1428),
3042(1429),
3043(1430),
3044(1431),
3045(1432),
3046(1433),
3047(1434),
3048(1435),
3049(1436),
3050(1437),
3051(1438),
3052(1439),
3053(1440),
3054(1441),
3055(1442),
3056(1443),
3057(1444),
3058(1445),
3059(1446),
3060(1447),
3061(1448),
3062(1449),
3063(1450),
3064(1451),
3065(1452),
3066(1453),
3067(1454),
3068(1455),
3069(1456),
3070(1457),
3071(1458),
3072(1459),
3073(1460),
3074(1461),
3075(1462),
3076(1463),
3077(1464),
3078(1465),
3079(1466),
3080(1467),
3081(1468),
3082(1469),
3083(1470),
3084(1471),
3085(1472),
3086(1473),
3087(1474),
3088(1475),
3089(1476),
3090(1477),
3091(1478),
3092(1479),
3093(1480),
3094(1481),
3095(1482),
3096(1483),
3097(1484),
3098(1485),
3099(1486),
3100(1487),
3101(1488),
3102(1489),
3103(1490),
3104(1491),
3105(1492),
3106(1493),
3107(1494),
3108(1495),
3109(1496),
3110(1497),
3111(1498),
3112(1499),
3113(1500),
3114(1501),
3115(1502),
3116(1503),
3117(1504),
3118(1505),
3119(1506),
3120(1507),
3121(1508),
3122(1509),
3123(1510),
3124(1511),
3125(1512),
3126(1513),
3127(1514),
3128(1515),
3129(1516),
3130(1517),
3131(1518),
3132(1519),
3133(1520),
3134(1521),
3135(1522),
3136(1523),
3137(1524),
3138(1525),
3139(1526),
3140(1527),
3141(1528),
3142(1529),
3143(1530),
3144(1531),
3145(1532),
3146(1533),
3147(1534),
3148(1535),
3149(1536),
3150(1537),
3151(1538),
3152(1539),
3153(1540),
3154(1541),
3155(1542),
3156(1543),
3157(1544),
3158(1545),
3159(1546),
3160(1547),
3161(1548),
3162(1549),
3163(1550),
3164(1551),
3165(1552),
3166(1553),
3167(1554),
3168(1555),
3169(1556),
3170(1557),
3171(1558),
3172(1559),
3173(1560),
3174(1561),
3175(1562),
3176(1563),
3177(1564),
3178(1565),
3179(1566),
3180(1567),
3181(1568),
3182(1569),
3183(1570),
3184(1571),
3185(1572),
3186(1573),
3187(1574),
3188(1575),
3189(1576),
3190(1577),
3191(1578),
3192(1579),
3193(1580),
3194(1581),
3195(1582),
3196(1583),
3197(1584),
3198(1585),
3199(1586),
3200(1587),
3201(1588),
3202(1589),
3203(1590),
3204(1591),
3205(1592),
3206(1593),
3207(1594),
3208(1595),
3209(1596),
3210(1597),
3211(1598),
3212(1599),
3213(1600),
3214(1601),
3215(1602),
3216(1603),
3217(1604),
3218(1605),
3219(1606),
3220(1607),
3221(1608),
3222(1609),
3223(1610),
3224(1611),
3225(1612),
3226(1613),
3227(1614),
3228(1615),
3229(1616),
3230(1617),
3231(1618),
3232(1619),
3233(1620),
3234(1621),
3235(1622),
3236(1623),
3237(1624),
3238(1625),
3239(1626),
3240(1627),
3241(1628),
3242(1629),
3243(1630),
3244(1631),
3245(1632),
3246(1633),
3247(1634),
3248(1635),
3249(1636),
3250(1637),
3251(1638),
3252(1639),
3253(1640),
3254(1641),
3255(1642),
3256(1643),
3257(1644),
3258(1645),
3259(1646),
3260(1647),
3261(1648),
3262(1649),
3263(1650),
3264(1651),
3265(1652),
3266(1653),
3267(1654),
3268(1655),
3269(1656),
3270(1657),
3271(1658),
3272(1659),
3273(1660),
3274(1661),
3275(1662),
3276(1663),
3277(1664),
3278(1665),
3279(1666),
3280(1667),
3281(1668),
3282(1669),
3283(1670),
3284(1671),
3285(1672),
3286(1673),
3287(1674),
3288(1675),
3289(1676),
3290(1677),
3291(1678),
3292(1679),
3293(1680),
3294(1681),
3295(1682),
3296(1683),
3297(1684),
3298(1685),
3299(1686),
3300(1687),
3301(1688),
3302(1689),
3303(1690),
3304(1691),
3305(1692),
3306(1693),
3307(1694),
3308(1695),
3309(1696),
3310(1697),
3311(1698),
3312(1699),
3313(1700),
3314(1701),
3315(1702),
3316(1703),
3317(1704),
3318(1705),
3319(1706),
3320(1707),
3321(1708),
3322(1709),
3323(1710),
3324(1711),
3325(1712),
3326(1713),
3327(1714),
3328(1715),
3329(1716),
3330(1717),
3331(1718),
3332(1719),
3333(1720),
3334(1721),
3335(1722),
3336(1723),
3337(1724),
3338(1725),
3339(1726),
3340(1727),
3341(1728),
3342(1729),
3343(1730),
3344(1731),
3345(1732),
3346(1733),
3347(1734),
3348(1735),
3349(1736),
3350(1737),
3351(1738),
3352(1739),
3353(1740),
3354(1741),
3355(1742),
3356(1743),
3357(1744),
3358(1745),
3359(1746),
3360(1747),
3361(1748),
3362(1749),
3363(1750),
3364(1751),
3365(1752),
3366(1753),
3367(1754),
3368(1755),
3369(1756),
3370(1757),
3371(1758),
3372(1759),
3373(1760),
3374(1761),
3375(1762),
3376(1763),
3377(1764),
3378(1765),
3379(1766),
3380(1767),
3381(1768),
3382(1769),
3383(1770),
3384(1771),
3385(1772),
3386(1773),
3387(1774),
3388(1775),
3389(1776),
3390(1777),
3391(1778),
3392(1779),
3393(1780),
3394(1781),
3395(1782),
3396(1783),
3397(1784),
3398(1785),
3399(1786),
3400(1787),
3401(1788),
3402(1789),
3403(1790),
3404(1791),
3405(1792),
3406(1793),
3407(1794),
3408(1795),
3409(1796),
3410(1797),
3411(1798),
3412(1799),
3413(1800),
3414(1801),
3415(1802),
3416(1803),
3417(1804),
3418(1805),
3419(1806),
3420(1807),
3421(1808),
3422(1809),
3423(1810),
3424(1811),
3425(1812),
3426(1813),
3427(1814),
3428(1815),
3429(1816),
3430(1817),
3431(1818),
3432(1819),
3433(1820),
3434(1821),
3435(1822),
3436(1823),
3437(1824),
3438(1825),
3439(1826),
3440(1827),
3441(1828),
3442(1829),
3443(1830),
3444(1831),
3445(1832),
3446(1833),
3447(1834),
3448(1835),
3449(1836),
3450(1837),
3451(1838),
3452(1839),
3453(1840),
3454(1841),
3455(1842),
3456(1843),
3457(1844),
3458(1845),
3459(1846),
3460(1847),
3461(1848),
3462(1849),
3463(1850),
3464(1851),
3465(1852),
3466(1853),
3467(1854),
3468(1855),
3469(1856),
3470(1857),
3471(1858),
3472(1859),
3473(1860),
3474(1861),
3475(1862),
3476(1863),
3477(1864),
3478(1865),
3479(1866),
3480(1867),
3481(1868),
3482(1869),
3483(1870),
3484(1871),
3485(1872),
3486(1873),
3487(1874),
3488(1875),
3489(1876),
3490(1877),
3491(1878),
3492(1879),
3493(1880),
3494(1881),
3495(1882),
3496(1883),
3497(1884),
3498(1885),
3499(1886),
3500(1887),
3501(1888),
3502(1889),
3503(1890),
3504(1891),
3505(1892),
3506(1893),
3507(1894),
3508(1895),
3509(1896),
3510(1897),
3511(1898),
3512(1899),
3513(1900),
3514(1901),
3515(1902),
3516(1903),
3517(1904),
3518(1905),
3519(1906),
3520(1907),
3521(1908),
3522(1909),
3523(1910),
3524(1911),
3525(1912),
3526(1913),
3527(1914),
3528(1915),
3529(1916),
3530(1917),
3531(1918),
3532(1919),
3533(1920),
3534(1921),
3535(1922),
3536(1923),
3537(1924),
3538(1925),
3539(1926),
3540(1927),
3541(1928),
3542(1929),
3543(1930),
3544(1931),
3545(1932),
3546(1933),
3547(1934),
3548(1935),
3549(1936),
3550(1937),
3551(1938),
3552(1939),
3553(1940),
3554(1941),
3555(1942),
3556(1943),
3557(1944),
3558(1945),
3559(1946),
3560(1947),
3561(1948),
3562(1949),
3563(1950),
3564(1951),
3565(1952),
3566(1953),
3567(1954),
3568(1955),
3569(1956),
3570(1957),
3571(1958),
3572(1959),
3573(1960),
3574(1961),
3575(1962),
3576(1963),
3577(1964),
3578(1965),
3579(1966),
3580(1967),
3581(1968),
3582(1969),
3583(1970),
3584(1971),
3585(1972),
3586(1973),
3587(1974),
3588(1975),
3589(1976),
3590(1977),
3591(1978),
3592(1979),
3593(1980),
3594(1981),
3595(1982),
3596(1983),
3597(1984),
3598(1985),
3599(1986),
3600(1987),
3601(1988),
3602(1989),
3603(1990),
3604(1991),
3605(1992),
3606(1993),
3607(1994),
3608(1995),
3609(1996),
3610(1997),
3611(1998),
3612(1999),
3613(2000),
3614(2001),
3615(2002),
3616(2003),
3617(2004),
3618(2005),
3619(2006),
3620(2007),
3621(2008),
3622(2009),
3623(2010),
3624(2011),
3625(2012),
3626(2013),
3627(2014),
3628(2015),
3629(2016),
3630(2017),
3631(2018),
3632(2019),
3633(2020),
3634(2021),
3635(2022),
3636(2023),
3637(2024),
3638(2025),
3639(2026),
3640(2027),
3641(2028),
3642(2029),
3643(2030),
3644(2031),
3645(2032),
3646(2033),
3647(2034),
3648(2035),
3649(2036),
3650(2037),
3651(2038),
3652(2039),
3653(2040),
3654(2041),
3655(2042),
3656(2043),
3657(2044),
3658(2045),
3659(2046),
3660(2047),
3661(2048),
3662(2049),
3663(2050),
3664(2051),
3665(2052),
3666(2053),
3667(2054),
3668(2055),
3669(2056),
3670(2057),
3671(2058),
3672(2059),
3673(2060),
3674(2061),
3675(2062),
3676(2063),
3677(2064),
3678(2065),
3679(2066),
3680(2067),
3681(2068),
3682(2069),
3683(2070),
3684(2071),
3685(2072),
3686(2073),
3687(2074),
3688(2075),
3689(2076),
3690(2077),
3691(2078),
3692(2079),
3693(2080),
3694(2081),
3695(2082),
3696(2083),
3697(2084),
3698(2085),
3699(2086),
3700(2087),
3701(2088),
3702(2089),
3703(2090),
3704(2091),
3705(2092),
3706(2093),
3707(2094),
3708(2095),
3709(2096),
3710(2097),
3711(2098),
3712(2099),
3713(2100),
3714(2101),
3715(2102),
3716(2103),
3717(2104),
3718(2105),
3719(2106),
3720(2107),
3721(2108),
3722(2109),
3723(2110),
3724(2111),
3725(2112),
3726(2113),
3727(2114),
3728(2115),
3729(2116),
3730(2117),
3731(2118),
3732(2119),
3733(2120),
3734(2121),
3735(2122),
3736(2123),
3737(2124),
3738(2125),
3739(2126),
3740(2127),
3741(2128),
3742(2129),
3743(2130),
3744(2131),
3745(2132),
3746(2133),
3747(2134),
3748(2135),
3749(2136),
3750(2137),
3751(2138),
3752(2139),
3753(2140),
3754(2141),
3755(2142),
3756(2143),
3757(2144),
3758(2145),
3759(2146),
3760(2147),
3761(2148),
3762(2149),
3763(2150),
3764(2151),
3765(2152),
3766(2153),
3767(2154),
3768(2155),
3769(2156),
3770(2157),
3771(2158),
3772(2159),
3773(2160),
3774(2161),
3775(2162),
3776(2163),
3777(2164),
3778(2165),
3779(2166),
3780(2167),
3781(2168),
3782(2169),
3783(2170),
3784(2171),
3785(2172),
3786(2173),
3787(2174),
3788(2175),
3789(2176),
3790(2177),
3791(2178),
3792(2179),
3793(2180),
3794(2181),
3795(2182),
3796(2183),
3797(2184),
3798(2185),
3799(2186),
3800(2187),
3801(2188),
3802(2189),
3803(2190),
3804(2191),
3805(2192),
3806(2193),
3807(2194),
3808(2195),
3809(2196),
3810(2197),
3811(2198),
3812(2199),
3813(2200),
3814(2201),
3815(2202),
3816(2203),
3817(2204),
3818(2205),
3819(2206),
3820(2207),
3821(2208),
3822(2209),
3823(2210),
3824(2211),
3825(2212),
3826(2213),
3827(2214),
3828(2215),
3829(2216),
3830(2217),
3831(2218),
3832(2219),
3833(2220),
3834(2221),
3835(2222),
3836(2223),
3837(2224),
3838(2225),
3839(2226),
3840(2227),
3841(2228),
3842(2229),
3843(2230),
3844(2231),
3845(2232),
3846(2233),
3847(2234),
3848(2235),
3849(2236),
3850(2237),
3851(2238),
3852(2239),
3853(2240),
3854(2241),
3855(2242),
3856(2243),
3857(2244),
3858(2245),
3859(2246),
3860(2247),
3861(2248),
3862(2249),
3863(2250),
3864(2251),
3865(2252),
3866(2253),
3867(2254),
3868(2255),
3869(2256),
3870(2257),
3871(2258),
3872(2259),
3873(2260),
3874(2261),
3875(2262),
3876(2263),
3877(2264),
3878(2265),
3879(2266),
3880(2267),
3881(2268),
3882(2269),
3883(2270),
3884(2271),
3885(2272),
3886(2273),
3887(2274),
3888(2275),
3889(2276),
3890(2277),
3891(2278),
3892(2279),
3893(2280),
3894(2281),
3895(2282),
3896(2283),
3897(2284),
3898(2285),
3899(2286),
3900(2287),
3901(2288),
3902(2289),
3903(2290),
3904(2291),
3905(2292),
3906(2293),
3907(2294),
3908(2295),
3909(2296),
3910(2297),
3911(2298),
3912(2299),
3913(2300),
3914(2301),
3915(2302),
3916(2303),
3917(2304),
3918(2305),
3919(2306),
3920(2307),
3921(2308),
3922(2309),
3923(2310),
3924(2311),
3925(2312),
3926(2313),
3927(2314),
3928(2315),
3929(2316),
3930(2317),
3931(2318),
3932(2319),
3933(2320),
3934(2321),
3935(2322),
3936(2323),
3937(2324),
3938(2325),
3939(2326),
3940(2327),
3941(2328),
3942(2329),
3943(2330),
3944(2331),
3945(2332),
3946(2333),
3947(2334),
3948(2335),
3949(2336),
3950(2337),
3951(2338),
3952(2339),
3953(2340),
3954(2341),
3955(2342),
3956(2343),
3957(2344),
3958(2345),
3959(2346),
3960(2347),
3961(2348),
3962(2349),
3963(2350),
3964(2351),
3965(2352),
3966(2353),
3967(2354),
3968(2355),
3969(2356),
3970(2357),
3971(2358),
3972(2359),
3973(2360),
3974(2361),
3975(2362),
3976(2363),
3977(2364),
3978(2365),
3979(2366),
3980(2367),
3981(2368),
3982(2369),
3983(2370),
3984(2371),
3985(2372),
3986(2373),
3987(2374),
3988(2375),
3989(2376),
3990(2377),
3991(2378),
3992(2379),
3993(2380),
3994(2381),
3995(2382),
3996(2383),
3997(2384),
3998(2385),
3999(2386),
4000(2387),
4001(2388),
4002(2389),
4003(2390),
4004(2391),
4005(2392),
4006(2393),
4007(2394),
4008(2395),
4009(2396),
4010(2397),
4011(2398),
4012(2399),
4013(2400),
4014(2401),
4015(2402),
4016(2403),
4017(2404),
4018(2405),
4019(2406),
4020(2407),
4021(2408),
4022(2409),
4023(2410),
4024(2411),
4025(2412),
4026(2413),
4027(2414),
4028(2415),
4029(2416),
4030(2417),
4031(2418),
4032(2419),
4033(2420),
4034(2421),
4035(2422),
4036(2423),
4037(2424),
4038(2425),
4039(2426),
4040(2427),
4041(2428),
4042(2429),
4043(2430),
4044(2431),
4045(2432),
4046(2433),
4047(2434),
4048(2435),
4049(2436),
4050(2437),
4051(2438),
4052(2439),
4053(2440),
4054(2441),
4055(2442),
4056(2443),
4057(2444),
4058(2445),
4059(2446),
4060(2447),
4061(2448),
4062(2449),
4063(2450),
4064(2451),
4065(2452),
4066(2453),
4067(2454),
4068(2455),
4069(2456),
4070(2457),
4071(2458),
4072(2459),
4073(2460),
4074(2461),
4075(2462),
4076(2463),
4077(2464),
4078(2465),
4079(2466),
4080(2467),
4081(2468),
4082(2469),
4083(2470),
4084(2471),
4085(2472),
4086(2473),
4087(2474),
4088(2475),
4089(2476),
4090(2477),
4091(2478),
4092(2479),
4093(2480),
4094(2481),
4095(2482),
4096(2483),
4097(2484),
4098(2485),
4099(2486),
4100(2487),
4101(2488),
4102(2489),
4103(2490),
4104(2491),
4105(2492),
4106(2493),
4107(2494),
4108(2495),
4109(2496),
4110(2497),
4111(2498),
4112(2499),
4113(2500),
4114(2501),
4115(2502),
4116(2503),
4117(2504),
4118(2505),
4119(2506),
4120(2507),
4121(2508),
4122(2509),
4123(2510),
4124(2511),
4125(2512),
4126(2513),
4127(2514),
4128(2515),
4129(2516),
4130(2517),
4131(2518),
4132(2519),
4133(2520),
4134(2521),
4135(2522),
4136(2523),
4137(2524),
4138(2525),
4139(2526),
4140(2527),
4141(2528),
4142(2529),
4143(2530),
4144(2531),
4145(2532),
4146(2533),
4147(2534),
4148(2535),
4149(2536),
4150(2537),
4151(2538),
4152(2539),
4153(2540),
4154(2541),
4155(2542),
4156(2543),
4157(2544),
4158(2545),
4159(2546),
4160(2547),
4161(2548),
4162(2549),
4163(2550),
4164(2551),
4165(2552),
4166(2553),
4167(2554),
4168(2555),
4169(2556),
4170(2557),
4171(2558),
4172(2559),
4173(2560),
4174(2561),
4175(2562),
4176(2563),
4177(2564),
4178(2565),
4179(2566),
4180(2567),
4181(2568),
4182(2569),
4183(2570),
4184(2571),
4185(2572),
4186(2573),
4187(2574),
4188(2575),
4189(2576),
4190(2577),
4191(2578),
4192(2579),
4193(2580),
4194(2581),
4195(2582),
4196(2583),
4197(2584),
4198(2585),
4199(2586),
4200(2587),
4201(2588),
4202(2589),
4203(2590),
4204(2591),
4205(2592),
4206(2593),
4207(2594),
4208(2595),
4209(2596),
4210(2597),
4211(2598),
4212(2599),
4213(2600),
4214(2601),
4215(2602),
4216(2603),
4217(2604),
4218(2605),
4219(2606),
4220(2607),
4221(2608),
4222(2609),
4223(2610),
4224(2611),
4225(2612),
4226(2613),
4227(2614),
4228(2615),
4229(2616),
4230(2617),
4231(2618),
4232(2619),
4233(2620),
4234(2621),
4235(2622),
4236(2623),
4237(2624),
4238(2625),
4239(2626),
4240(2627),
4241(2628),
4242(2629),
4243(2630),
4244(2631),
4245(2632),
4246(2633),
4247(2634),
4248(2635),
4249(2636),
4250(2637),
4251(2638),
4252(2639),
4253(2640),
4254(2641),
4255(2642),
4256(2643),
4257(2644),
4258(2645),
4259(2646),
4260(2647),
4261(2648),
4262(2649),
4263(2650),
4264(2651),
4265(2652),
4266(2653),
4267(2654),
4268(2655),
4269(2656),
4270(2657),
4271(2658),
4272(2659),
4273(2660),
4274(2661),
4275(2662),
4276(2663),
4277(2664),
4278(2665),
4279(2666),
4280(2667),
4281(2668),
4282(2669),
4283(2670),
4284(2671),
4285(2672),
4286(2673),
4287(2674),
4288(2675),
4289(2676),
4290(2677),
4291(2678),
4292(2679),
4293(2680),
4294(2681),
4295(2682),
4296(2683),
4297(2684),
4298(2685),
4299(2686),
4300(2687),
4301(2688),
4302(2689),
4303(2690),
4304(2691),
4305(2692),
4306(2693),
4307(2694),
4308(2695),
4309(2696),
4310(2697),
4311(2698),
4312(2699),
4313(2700),
4314(2701),
4315(2702),
4316(2703),
4317(2704),
4318(2705),
4319(2706),
4320(2707),
4321(2708),
4322(2709),
4323(2710),
4324(2711),
4325(2712),
4326(2713),
4327(2714),
4328(2715),
4329(2716),
4330(2717),
4331(2718),
4332(2719),
4333(2720),
4334(2721),
4335(2722),
4336(2723),
4337(2724),
4338(2725),
4339(2726),
4340(2727),
4341(2728),
4342(2729),
4343(2730),
4344(2731),
4345(2732),
4346(2733),
4347(2734),
4348(2735),
4349(2736),
4350(2737),
4351(2738),
4352(2739),
4353(2740),
4354(2741),
4355(2742),
4356(2743),
4357(2744),
4358(2745),
4359(2746),
4360(2747),
4361(2748),
4362(2749),
4363(2750),
4364(2751),
4365(2752),
4366(2753),
4367(2754),
4368(2755),
4369(2756),
4370(2757),
4371(2758),
4372(2759),
4373(2760),
4374(2761),
4375(2762),
4376(2763),
4377(2764),
4378(2765),
4379(2766),
4380(2767),
4381(2768),
4382(2769),
4383(2770),
4384(2771),
4385(2772),
4386(2773),
4387(2774),
4388(2775),
4389(2776),
4390(2777),
4391(2778),
4392(2779),
4393(2780),
4394(2781),
4395(2782),
4396(2783),
4397(2784),
4398(2785),
4399(2786),
4400(2787),
4401(2788),
4402(2789),
4403(2790),
4404(2791),
4405(2792),
4406(2793),
4407(2794),
4408(2795),
4409(2796),
4410(2797),
4411(2798),
4412(2799),
4413(2800),
4414(2801),
4415(2802),
4416(2803),
4417(2804),
4418(2805),
4419(2806),
4420(2807),
4421(2808),
4422(2809),
4423(2810),
4424(2811),
4425(2812),
4426(2813),
4427(2814),
4428(2815),
4429(2816),
4430(2817),
4431(2818),
4432(2819),
4433(2820),
4434(2821),
4435(2822),
4436(2823),
4437(2824),
4438(2825),
4439(2826),
4440(2827),
4441(2828),
4442(2829),
4443(2830),
4444(2831),
4445(2832),
4446(2833),
4447(2834),
4448(2835),
4449(2836),
4450(2837),
4451(2838),
4452(2839),
4453(2840),
4454(2841),
4455(2842),
4456(2843),
4457(2844),
4458(2845),
4459(2846),
4460(2847),
4461(2848),
4462(2849),
4463(2850),
4464(2851),
4465(2852),
4466(2853),
4467(2854),
4468(2855),
4469(2856),
4470(2857),
4471(2858),
4472(2859),
4473(2860),
4474(2861),
4475(2862),
4476(2863),
4477(2864),
4478(2865),
4479(2866),
4480(2867),
4481(2868),
4482(2869),
4483(2870),
4484(2871),
4485(2872),
4486(2873),
4487(2874),
4488(2875),
4489(2876),
4490(2877),
4491(2878),
4492(2879),
4493(2880),
4494(2881),
4495(2882),
4496(2883),
4497(2884),
4498(2885),
4499(2886),
4500(2887),
4501(2888),
4502(2889),
4503(2890),
4504(2891),
4505(2892),
4506(2893),
4507(2894),
4508(2895),
4509(2896),
4510(2897),
4511(2898),
4512(2899),
4513(2900),
4514(2901),
4515(2902),
4516(2903),
4517(2904),
4518(2905),
4519(2906),
4520(2907),
4521(2908),
4522(2909),
4523(2910),
4524(2911),
4525(2912),
4526(2913),
4527(2914),
4528(2915),
4529(2916),
4530(2917),
4531(2918),
4532(2919),
4533(2920),
4534(2921),
4535(2922),
4536(2923),
4537(2924),
4538(2925),
4539(2926),
4540(2927),
4541(2928),
4542(2929),
4543(2930),
4544(2931),
4545(2932),
4546(2933),
4547(2934),
4548(2935),
4549(2936),
4550(2937),
4551(2938),
4552(2939),
4553(2940),
4554(2941),
4555(2942),
4556(2943),
4557(2944),
4558(2945),