-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathguifi.install
1813 lines (1737 loc) · 161 KB
/
guifi.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* @file
* Install, update and uninstall functions for the guifi module.
*/
function guifi_uninstall() {
drupal_uninstall_schema('guifi');
variable_del('guifi_license');
variable_del('guifi_title');
variable_del('guifi_root');
variable_del('guifi_forums');
variable_del('guifi_contact');
variable_del('hotspot_ssid');
variable_del('guifi_loglevel');
variable_del('guifi_maps');
variable_del('guifi_decimal');
variable_del('guifi_thousand');
}
function guifi_schema() {
$schema['guifi_notify'] = array(
'fields' => array(
'id' => array('type' => 'int', 'size' => 'small', 'unsigned' => TRUE, 'not null' => TRUE),
'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
'who_id' => array('type' => 'int', 'size' => 'medium', 'unsigned' => TRUE, 'not null' => TRUE),
'who_name' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE),
'to_array' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'subject' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE),
'body' => array('type' => 'text', 'size' => 'big', 'not null' => TRUE)
),
'primary key' => array('id'),
);
$schema['guifi_location'] = array(
'fields' => array(
'id' => array('type' => 'serial', 'size' => 'medium', 'not null' => TRUE),
'nick' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => ''),
'zone_id' => array('type' => 'int', 'size' => 'medium', 'not null' => FALSE, 'comment' => 'foreign key to guifi_zone(id)'),
'zone_description' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'location_type' => array('type' => 'varchar', 'length' => '10', 'not null' => 'TRUE', 'default' => 'node'),
'lat' => array('type' => 'numeric', 'precision' => '10', 'scale' => '6', 'not null' => FALSE),
'lon' => array('type' => 'numeric', 'precision' => '10', 'scale' => '6', 'not null' => FALSE),
'elevation' => array('type' => 'int', 'size' => 'tiny', 'not null' => FALSE),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'status_flag' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => 'Planned'),
'project_id' => array('type' => 'int', 'size' => 'medium', 'not null' => 'FALSE'),
'stable' => array('type' => 'varchar', 'length' => '25', 'not null' => TRUE, 'default' => 'Yes', 'comment' => 'Yes,No'),
'graph_server' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0, 'comment' => 'FK to guifi_services (SNPGraphs)'),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'size' => 'medium',' not null' => FALSE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => FALSE)),
'primary key' => array('id'),
'indexes' => array(
'lat_index' => array('lat'),
'lon_index' => array('lon'),
'zcs_index' => array('zone_id', 'timestamp_created', 'status_flag'),
'year_index' => array('timestamp_created'),
'status_index' => array('status_flag'),
'project_index' => array('project_id'),
),
);
$schema['guifi_networks'] = array(
'comment' => 'allocates ipv4 address ranges to zones',
'fields' => array(
'id' => array('type' => 'serial', 'size' => 'small', 'unsigned' => TRUE, 'not null' => TRUE),
'base' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
'mask' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '255.255.255.0'),
'zone' => array('type' => 'int', 'size' => 'medium', 'unsigned' => TRUE, 'not null' => TRUE),
'network_type' => array('type' => 'varchar', 'length' => '10', 'not null' => TRUE, 'default' => 'public', 'comment' => 'public, backbone'),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)),
'primary key' => array('id'),
'unique keys' => array(
'networks' => array(array('base', 16), array('mask', 16))),
'indexes' => array(
'net_zone' => array('zone')),
);
$schema['guifi_zone'] = array(
'comment' => 'zone information, zones have a self hierarchy and group node locations',
'fields' => array(
'id' => array('type' => 'serial', 'size' => 'medium', 'unsigned' => TRUE, 'not null' => TRUE),
'title' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
'nick' => array('type' => 'varchar', 'length' => '10', 'not null' => FALSE),
'body' => array('type' => 'text', 'size' => 'big', 'not null' => TRUE),
'master' => array('type' => 'int', 'size' => 'medium', 'unsigned' => TRUE, 'not null' => TRUE, 'comment' => 'references parent zone guifi_zone(id)'),
// 'zone_mode' => array('type' => 'varchar', 'length' => 25, 'not null' => TRUE, 'default' => 'infrastructure', 'comment' => 'infrastructure/ad-hoc'),
'graph_server' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => '0', 'comment' => 'FK to guifi_services (SNPGraphs)'),
'proxy_id' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => '0', 'comment' => 'FK to guifi_services (proxy)'),
'voip_id' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => '0', 'comment' => 'FK to guifi_services (VoIP)'),
'time_zone' => array('type' => 'varchar', 'length' => '15', 'not null' => TRUE),
'dns_servers' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'ntp_servers' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'graph_server' => array('type' => 'varchar', 'length' => '40', 'not null' => FALSE),
'homepage' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'ospf_zone' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'minx' => array('type' => 'numeric', 'precision' => '10', 'scale' => '6', 'not null' => FALSE),
'miny' => array('type' => 'numeric', 'precision' => '10', 'scale' => '6', 'not null' => FALSE),
'maxx' => array('type' => 'numeric', 'precision' => '10', 'scale' => '6', 'not null' => FALSE),
'maxy' => array('type' => 'numeric', 'precision' => '10', 'scale' => '6', 'not null' => FALSE),
'local' => array('comment' => 'Yes, No', 'type' => 'varchar', 'length' => '5', 'not null' => TRUE, 'default' => 'Yes'),
'nodexchange_url' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
'refresh' => array('type' => 'int', 'not null' => FALSE),
'remote_server_id' => array('type' => 'int', 'size' => 'medium', 'not null' => FALSE),
'host_nodes' => array('type' => 'int','size' => 'small', 'not null' => FALSE,'default'=>0,'comment'=>'The zone can host nodes? (TRUE=1, FALSE=0)'),
'weight' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)),
'primary key' => array('id'),
'indexes' => array(
'name' => array(array('title', 10)),
'master_index' => array('master'),
),
);
$schema['guifi_devices'] = array(
'fields' => array(
'id' => array('type' => 'serial', 'size' => 'medium', 'not null' => TRUE),
'nid' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'comment' => 'foreign key to guifi_location(id)'),
'nick' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE),
'type' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'mac' => array('type' => 'varchar', 'length' => '20', 'not null' => TRUE, 'default' => '00:00:00:00:00:00'),
'mainipv4' => array('type' => 'varchar', 'length' => '20'),
'comment' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
'flag' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => 'Planned'),
'extra' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE, 'comment' => 'store variable data depending on guifi_devices(type)'),
'usc_id' => array('type' => 'int', 'not null' => TRUE, 'comment' => 'UnSolClic template id'),
'mid' => array('type' => 'int', 'not null' => TRUE, 'comment' => 'Model Id'),
'fid' => array('type' => 'int', 'not null' => TRUE, '' => 'Firmware Id'),
'graph_server' => array('type' => 'int', 'size' => 'medium' , 'not null' => TRUE, 'default' => 0, 'comment' => 'FK to guifi_services (SNPGraphs)'),
'logserver' => array('type' => 'varchar','length' => '60', 'not null' => TRUE, 'comment' => 'Ip Server Logs'),
'last_online' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'comment' => 'Last time that this device has been seen online'),
'last_flag' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => 'N/A', 'comment' => 'N/A, Online, Offline...'),
'ly_availability' => array('type' => 'numeric', 'precision' => '11', 'scale' => '2', 'not null' => FALSE, 'default' => NULL),
'last_stats' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'comment' => 'Last time that this device has been loaded with statistics'),
'latency_avg' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0, 'comment' => 'Average latency'),
'latency_max' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0, 'comment' => 'Maximum latency'),
'user_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)),
'primary key' => array('id'),
'unique keys' => array(
'nick' => array('nick')),
'indexes' => array(
'nid_index' => array('nid'),
),
);
$schema['guifi_links'] = array(
'comment' => 'devices/interfaces linked, one row per peer joined by guifi_links(id)',
'fields' => array(
'id' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'nid' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'device_id' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'interface_id' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'ipv4_id' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE),
'link_type' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE),
'routing' => array('type' => 'varchar', 'length' => '40', 'not null' => FALSE),
'flag' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => 'Planned'),
'hybrid' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0)),
'primary key' => array('device_id', 'id'),
'indexes' => array(
'id' => array('id'),
'device_index' => array('device_id'),
'nid_index' => array('nid'),
),
);
$schema['guifi_interfaces'] = array(
'comment' => 'describes interfaces (network connectors) at the devices',
'fields' => array(
'id' => array('type' => 'serial', 'size' => 'medium', 'not null' => TRUE),
'device_id' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'comment' => 'foreign key to guifi_devices(id)'),
'radiodev_counter' => array('type' => 'int', 'size' => 'tiny', 'not null' => FALSE, 'comment' => 'if not NULL, foreign key to guifi_radios(radiodev_counter)'),
'etherdev_counter' => array('type' => 'int', 'size' => 'tiny', 'not null' => FALSE, 'comment' => 'if not NULL, foreign key to guifi_radios(etherdev_counter)'),
'interface_class' => array('type' => 'varchar', 'length' => 40, 'NOT NULL' => FALSE, 'comment' => 'radio, ethernet, bridge, bonding, vlan, wds/p2p, virtualAP, tunnels ...'),
'interface_type' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE),
'related_interfaces' => array('type' => 'varchar', 'length' => 120, 'NOT NULL' => FALSE, 'comment' => 'FK to parent interfaces (vlans, bondings, bridges...'),
'mac' => array('type' => 'varchar', 'length' => '20', 'not null' => TRUE, 'default' => '00:00:00:00:00:00'),
'connector_type' => array('type' => 'varchar', 'length' => 10, 'comment' => 'connector type (RJ45,FO LX,SC...)'),
'vlan' => array('type' => 'varchar', 'length' => 10, 'comment' => 'vlan (if have)'),
'comments' => array('type' => 'varchar', 'length' => 64, 'comment' => 'Additional info/comments'),
'connto_did' => array('type' => 'int', 'size' => 'medium', 'not null' => FALSE, 'comment' => 'connected to (device)'),
'connto_iid' => array('type' => 'int', 'size' => 'medium', 'not null' => FALSE, 'comment' => 'connected to (interface)')),
'primary key' => array('device_id', 'id'),
'indexes' => array(
'id' => array('id'),
),
);
$schema['guifi_radios'] = array(
'comment' => 'describes wireless radios available on the guifi_devices',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE,'comment' => 'primary key 1st column and foreign key to guifi_devices(id)'),
'radiodev_counter' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, 'comment' => 'primary key 2nd column'),
'etherdev_counter' => array('type' => 'int', 'size' => 'tiny', 'not null' => FALSE, 'comment' => ''),
'nid' => array('comment' => 'foreign key to guifi_location(id)', 'type' => 'int', 'not null' => TRUE),
'model_id' => array('type' => 'int', 'not null' => TRUE),
'ssid' => array('type' => 'varchar', 'length' => '128', 'not null' => TRUE, 'default' => ''),
'mode' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE),
'protocol' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => '802.11bg'),
'channel' => array('type' => 'int', 'not null' => FALSE),
'chbandwith' => array('comment' => 'Channel Bandwith', 'type' => 'varchar', 'length' => '8', 'not null' => TRUE, 'default' => '20Mhz'),
'antenna_angle' => array('type' => 'int', 'not null' => FALSE, 'default' => 0),
'antenna_gain' => array('type' => 'int', 'not null' => FALSE),
'antenna_azimuth' => array('type' => 'int', 'not null' => FALSE, 'default' => 360),
'antenna_mode' => array('type' => 'varchar', 'length' => '5', 'not null' => TRUE),
'mac' => array('type' => 'varchar', 'length' => '20'),
'ly_mb_in' => array('type' => 'numeric', 'precision' => '10', 'scale' => '0', 'not null' => FALSE, 'default' => NULL),
'ly_mb_out' => array('type' => 'numeric', 'precision' => '10', 'scale' => '0', 'not null' => FALSE, 'default' => NULL),
'clients_accepted' => array('comment' => 'Yes, No', 'type' => 'varchar', 'length' => '5', 'not null' => FALSE, 'default' => 'Yes'),
'fund_required' => array('comment' => 'Null n/d, free, yes', 'type' => 'varchar', 'length' => '5', 'not null' => FALSE),
'fund_amount' => array('type' => 'numeric', 'not null' => TRUE, 'default' => 0, 'precision' => '10', 'scale' => '2'),
'fund_currency' => array('type' => 'varchar', 'length' => '10', 'not null' => TRUE, 'default' => 'Euros'),
),
'primary key' => array('id', 'radiodev_counter'),
'indexes' => array(
'nid' => array('nid')),
);
$schema['guifi_types'] = array(
'comment' => 'used on web dialogs to decode values or validate values',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'type' => array('type' => 'varchar', 'length' => '15', 'not null' => TRUE),
'text' => array('type' => 'varchar', 'length' => '24', 'not null' => TRUE),
'description' => array('type' => 'text', 'size' => 'big', 'not null' => TRUE),
'relations' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE)),
'primary key' => array('id', 'type'),
'indexes' => array(
'text' => array('text')),
);
$schema['guifi_services'] = array(
'comment' => 'store guifi services',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'nick' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => ''),
'service_type' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => ''),
'zone_id' => array('type' => 'int', 'not null' => FALSE, 'comment' => 'foreign key to guifi_zone(id)'),
'device_id' => array('type' => 'int', 'not null' => FALSE, 'comment' => 'foreign key to guifi_device(id)'),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => FALSE),
'status_flag' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => 'Planned'),
'extra' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
'user_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'not null' => FALSE, 'default' => 0),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => FALSE)),
'primary key' => array('id'),
'indexes' => array(
'zone_index' => array('zone_id'),
),
);
$schema['guifi_users'] = array(
'comment' => 'stores user credentials assigned to nodes for proxy servers, or any other service',
'fields' => array(
'id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'comment' => 'foreign key to guifi_location(id)'),
'services' => array('type' => 'text', 'size' => 'big', 'not null' => TRUE),
'firstname' => array('type' => 'varchar', 'length' => '60', 'not null' => TRUE, 'default' => ''),
'lastname' => array('type' => 'varchar', 'length' => '60', 'not null' => TRUE, 'default' => ''),
'username' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => ''),
'password' => array('type' => 'varchar', 'length' => '128', 'not null' => TRUE, 'default' => ''),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => FALSE),
'extra' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
'user_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'status' => array('type' => 'varchar', 'length' => 25, 'not null' => TRUE, 'default' => 'new', 'comment' => 'pending/approved/rejected'),
'content_filters' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE, 'default' => NULL)),
'primary key' => array('id'),
'unique keys' => array(
'username' => array('username')),
);
$schema['guifi_ipv4'] = array(
'fields' => array(
'id' => array('type' => 'int', 'not null' => TRUE, 'comment' => 'primary key 1st column, numbers the sequential order of each address into the same interface'),
'interface_id' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'comment' => 'primary key 2nd column and foreign key to guifi_interfaces(id)'),
'ipv4' => array('type' => 'varchar', 'length' => '16', 'not null' => FALSE),
'netmask' => array('type' => 'varchar', 'length' => '16', 'not null' => TRUE, 'default' => '255.255.255.0'),
'ipv4_type' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'zone_id' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)),
'primary key' => array('interface_id', 'id'),
'unique keys' => array(
'ipv4' => array('ipv4')),
);
$schema['guifi_manufacturer'] = array(
'comment' => 'device manufacturers',
'fields' => array(
'fid' => array('type' => 'serial', 'not null' => TRUE),
'name' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => ''),
'url' => array('type' => 'varchar', 'length' => '40', 'not null' => FALSE),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)),
'primary key' => array('fid'),
);
$schema['guifi_model_specs'] = array(
'comment' => 'device models',
'fields' => array(
'mid' => array('type' => 'serial', 'not null' => TRUE),
'fid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'comment' => 'foreign key to guifi_manufacturer(fid)'),
'model' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE, 'default' => ''),
'model_class' => array('type' => 'varchar', 'length' => '240', 'not null' => TRUE, 'default' => 'wireless|router','comment'=>'device category (radio, router, switch...)'),
'type' => array('type' => 'varchar', 'length' => '10', 'not null' => FALSE, 'comment' => 'Extern, PCI, PCMCIA'),
'radiodev_max' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 1),
'etherdev_max' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 1),
'optoports_max' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0),
'rackeable' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0,'comment'=> 'Rackeable (>0 true, # of Us)'),
'AP' => array('type' => 'varchar', 'length' => '5', 'not null' => FALSE, 'comment' => 'Si, No'),
'virtualAP' => array('type' => 'varchar', 'length' => '5', 'not null' => TRUE, 'default' => 'No', 'comment' => 'Yes, No'),
'client' => array('type' => 'varchar', 'length' => '5', 'not null' => FALSE, 'comment' => 'Si, No, Hack'),
'interfaces' => array('type' => 'varchar', 'length' => '240', 'not null' => FALSE,'comment' => 'Cable Interfaces'),
'winterfaces' => array('type' => 'varchar', 'length' => '240', 'not null' => FALSE,'comment' => 'Wireless Interfaces'),
'opto_interfaces' => array('type' => 'varchar', 'length' => '240', 'not null' => FALSE,'comment'=> 'map to ethernet interafaces'),
'url' => array('type' => 'varchar', 'length' => '240', 'not null' => FALSE),
'comments' => array('type' => 'varchar', 'length' => '240', 'not null' => FALSE),
'supported' => array('type' => 'varchar', 'length' => '25', 'not null' => TRUE, 'default' => 'Yes', 'comment' => 'Yes, No'),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE)),
'primary key' => array('mid'),
);
$schema['guifi_dns_domains'] = array(
'comment' => 'store guifi dns domains',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'sid' => array('type' => 'int', 'not null' => TRUE),
'name' => array('type' => 'varchar', 'length' => '40', 'not null' => TRUE),
'type' => array('type' => 'varchar', 'length' => '16', 'not null' => TRUE),
'public' => array('type' => 'varchar', 'length' => '5', 'not null' => TRUE, 'default' => 'yes'),
'ipv4' => array('type' => 'varchar', 'length' => '16', 'not null' => TRUE),
'defipv4' => array('type' => 'varchar', 'length' => '16', 'not null' => TRUE),
'defipv6' => array('type' => 'varchar', 'length' => '128', 'not null' => TRUE),
'mname' => array('type' => 'varchar', 'length' => '32', 'not null' => TRUE),
'scope' => array('type' => 'varchar', 'length' => '16', 'not null' => TRUE),
'management' => array('type' => 'varchar', 'length' => '16', 'not null' => TRUE),
'allow' => array('type' => 'varchar', 'length' => '24', 'not null' => TRUE),
'externalmx' => array('type' => 'varchar', 'length' => '128', 'not null' => TRUE),
'externalns' => array('type' => 'varchar', 'length' => '128', 'not null' => TRUE),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'comment' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
'user_created' => array('type' => 'int', 'not null' => TRUE),
'user_changed' => array('type' => 'int', 'not null' => TRUE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE)),
'primary key' => array('id'),
);
$schema['guifi_dns_hosts'] = array(
'comment' => 'store guifi dns hosts',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'counter' => array('type' => 'int', 'not null' => TRUE),
'host' => array('type' => 'varchar', 'length' => '128', 'not null' => TRUE),
'ipv4' => array('type' => 'varchar', 'length' => '16', 'not null' => TRUE),
'ipv6' => array('type' => 'varchar', 'length' => '128', 'not null' => TRUE),
'aliases' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'options' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'user_created' => array('type' => 'int', 'not null' => TRUE),
'user_changed' => array('type' => 'int', 'not null' => TRUE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE)),
'primary key' => array('id', 'counter'),
);
$schema['guifi_api_tokens'] = array(
'comment' => 'store guifi api tokens',
'fields' => array(
'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE),
'token' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE),
'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'rand_key' => array('type' => 'int', 'not null' => TRUE)),
'primary key' => array('uid'),
);
$schema['guifi_firmware'] = array (
'comment' => 'have the supported firmwares, status and describes their capabilities',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'nom' => array('type' => 'varchar', 'length' => '45', 'not null' => TRUE),
'descripcio'=>array('type' => 'varchar', 'length' => '45', 'not null' => TRUE),
'relations' => array('type' => 'varchar', 'length' => '45'),
'managed' => array('type' => 'varchar', 'length' => '100'),
'enabled' => array('type' => 'int', 'size' => 'tiny','not null' => FALSE, 'default' => 0),
'notification' => array('type' => 'varchar', 'length' => '1024', 'not null' => TRUE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE)),
'primary key' => array('id'),
);
$schema['guifi_maintainers'] = array(
'comment' => 'device maintainers',
'fields' => array(
'id' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'supplier_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '11', 'default' => 0, 'comment' => 'Foreign key to supplier'),
'subject_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '11', 'default' => 0, 'comment' => 'Foreign key to subject maintained (zone/node/device...)'),
'subject_type' => array('type' => 'varchar', 'length' => 15, 'not null' => TRUE, 'default' => '', 'comment' => 'subject type (values zone, node, device....)'),
'commitment' => array('type' => 'varchar', 'length' => 15, 'not null' => TRUE, 'default' => '', 'comment' => 'type of commitment: volunteer, FO, Wireless...'),
'sla' => array('type' => 'varchar', 'length' => 15, 'not null' => TRUE, 'default' => '', 'comment' => 'SLA: bone, 24x7, 8x5...'),
'sla_resp' => array('type' => 'int', 'size'=>'small','not null' => FALSE, 'comment' => 'Objective for response time' ),
'sla_fix' => array('type' => 'int', 'size'=>'small','not null' => FALSE, 'comment' => 'Objective for solving time' ),
'weight' => array('type' => 'int', 'size'=>'small','not null' => FALSE),
'comment' => array('type' => 'text', 'not null' => false),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'size' => 'medium',' not null' => FALSE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => FALSE),
),
'primary key' => array('id'),
);
$schema['guifi_funders'] = array(
'comment' => 'device funders',
'fields' => array(
'id' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
'supplier_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => false, 'disp-width' => '11', 'default' => 0, 'comment' => 'Foreign key to supplier'),
'user_id' => array('type' => 'int', 'size' => 'medium', 'unsigned' => TRUE, 'not null' => false, 'disp-width' => '11', 'default' => 0, 'comment' => 'Foreign key to userid'),
'comment' => array('type' => 'text', 'not null' => TRUE),
// 'removed' => array('type' => 'int', 'size'=>'small','not null' => TRUE, 'default' => FALSE),
'subject_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '11', 'default' => 0, 'comment' => 'Foreign key to subject maintained (node/device...)'),
'subject_type' => array('type' => 'varchar', 'length' => 15, 'not null' => TRUE, 'default' => '', 'comment' => 'subject type (values node, device....)'),
'weight' => array('type' => 'int', 'size'=>'small','not null' => FALSE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'size' => 'medium',' not null' => FALSE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => FALSE),
),
'primary key' => array('id'),
);
$schema['guifi_caracteristica'] = array(
'comment' => 'Caracteristiques',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'nom' => array('type' => 'varchar', 'length' => 45, 'not null' => TRUE),
'tipus' => array('type' => 'varchar', 'length' => 11, 'not null' => TRUE),
'notification' => array('type' => 'varchar', 'length' => 1024, 'not null' => TRUE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE),
),
'primary key' => array('id'),
);
$schema['guifi_configuracioUnSolclic'] = array(
'comment' => 'UnSolclic Configurations',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'mid' => array('type' => 'int', 'not null' => TRUE),
'fid' => array('type' => 'int', 'not null' => TRUE),
'enabled' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'default' => 0),
'snmp_id' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => 0),
'plantilla' => array('type' => 'text'),
'tipologia' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'notification' => array('type' => 'varchar', 'length' => 1024, 'not null' => TRUE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE, 'default' => 0),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'template_file' => array('type' => 'varchar', 'length' => 45),
),
'primary key' => array('id'),
);
$schema['guifi_parametresConfiguracioUnsolclic'] = array(
'comment' => 'Parameters forUnSolclic Configurations',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'pid' => array('type' => 'int', 'not null' => TRUE),
'uscid' => array('type' => 'int', 'not null' => TRUE),
'valor' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE),
'dinamic' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'notification' => array('type' => 'varchar', 'length' => 1024, 'not null' => TRUE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'user_changed' => array('type' => 'int', 'size' => 'medium'),
'timestamp_created' => array('type' => 'int'),
'timestamp_changed' => array('type' => 'int'),
),
'primary key' => array('id'),
);
$schema['guifi_parametres'] = array(
'comment' => 'Parameters forUnSolclic',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'nom' => array('type' => 'varchar', 'length' => 45, 'not null' => FALSE),
'default_value' => array('type' => 'varchar', 'length' => 45, 'not null' => FALSE),
'origen' => array('type' => 'varchar', 'length' => 80, 'not null' => FALSE),
'dinamic' => array('type' => 'int', 'size' => 'tiny', 'not null' => FALSE, 'default' => 0),
'notification' => array('type' => 'varchar', 'length' => 1024, 'not null' => TRUE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE),
),
'primary key' => array('id'),
);
$schema['guifi_parametresFirmware'] = array(
'comment' => 'Parameters firmware',
'fields' => array(
'id' => array('type' => 'serial', 'not null' => TRUE),
'fid' => array('type' => 'int', 'not null' => FALSE),
'pid' => array('type' => 'int', 'not null' => FALSE),
'notification' => array('type' => 'varchar', 'length' => 1024, 'not null' => TRUE),
'user_created' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'user_changed' => array('type' => 'int', 'size' => 'medium', 'not null' => TRUE),
'timestamp_created' => array('type' => 'int', 'not null' => TRUE),
'timestamp_changed' => array('type' => 'int', 'not null' => TRUE),
),
'primary key' => array('id'),
);
return $schema;
}
function guifi_install() {
drupal_install_schema('guifi');
// --
// -- interface types
// -- relation describes MAC (related to base MAC)
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('1', 'interface', 'Lan', 'Device base address (Lan)', '0');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('2', 'interface', 'wLan/Lan', 'Device lan & wlan (bridged)', '2');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('3', 'interface', 'wLan', 'wireless lan', '2');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('4', 'interface', 'Wan', 'Wan', '1');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('5', 'interface', 'wds/p2p', 'P2P Wds', '2');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('6', 'interface', 'vlan', 'Virtual network over Lan', '0');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('7', 'interface', 'vwan', 'Virtual network over Wan', '1');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('8', 'interface', 'vwlan', 'Virtual network over wLan', '2');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('9', 'interface', 'vlan2', 'vlan #2 (plugged into port #2)', '4');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('10', 'interface', 'vlan3', 'vlan #3 (plugged into port #3)', '5');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('11', 'interface', 'vlan4', 'vlan #4 (plugged into port #4)', '6');");
//db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('9999', 'interface', 'vlan1', 'vlan #1 (plugged into port #1)', '3');");
// --
// -- IPv4 types
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('1', 'ipv4_types', '1', 'public', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('2', 'ipv4_types', '2', 'backbone', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('3', 'ipv4_types', '3', 'ad-hoc mesh - OLSR', 'kamikaze|freifunk-OLSR');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('4', 'ipv4_types', '4', 'ad-hoc mesh - BATMAN', 'kamikaze|freifunk-BATMAN');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('5', 'ipv4_types', '5', 'ad-hoc mesh - BMX', 'kamikaze');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('6', 'ipv4_types', '6', 'ad-hoc mesh - RouterOS', 'RouterOSv3.x');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('7', 'ipv4_types', '7', 'mesh', NULL);");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('8', 'ipv4_types', '8', 'reserved', NULL);");
// --
// -- radio mode types
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('1', 'mode', 'ap', 'AP or AP with WDS', 'ap|client');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('2', 'mode', 'client', 'Wireless client', 'ap');");
//db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('3', 'mode', 'bridge', 'Wireless Bridge', 'bridge');");
//db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('4', 'mode', 'routedclient', 'Routed client', 'ap');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('5', 'mode', 'mesh', 'Mesh radio', NULL);");
//db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('9999', 'mode', 'NAT Client', 'NAT Client', 'ap|client');");
//db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('8888', 'mode', 'Routed Client', 'Routed Client', 'ap|client');");
//db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('7777', 'mode', 'Bridged Client', 'Bridged Client', 'ap|client');");
// --
// -- link types
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('1', 'link', 'cable', 'Cable', 'vlan|vwan|vwlan|vlan1|vlan2|vlan3|vlan4|Lan|wLan/Lan|Wan');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('2', 'link', 'tunnel', 'Tunnel', 'tunnel');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('3', 'link', 'bridge', 'Wireless Bridge', 'wLan/Lan|Lan');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('4', 'link', 'wds', 'Wireless WDS', 'wds/p2p');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('5', 'link', 'ap/client', 'Wireless AP/Client', 'Wan/wLan|wLan/Lan');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('6', 'link', 'xPON', 'Passive Splitted Fibre Optics (xPON)', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('7', 'link', 'DuplexFO', 'Duplex P2P', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('8', 'link', 'SimplexFO', 'Simplex P2P', '');");
// --
// -- device types
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('1', 'device', 'radio', 'Wireless device, like a router, bridge, AP...');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('2', 'device', 'phone', 'Voip handset, telephone');");
db_query("-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('3', 'device', 'mobile', 'Mobile device. like a laptop or pda');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('4', 'device', 'server', 'Server computer');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('5', 'device', 'nat', 'Firewall, private Network behind a NAT');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('6', 'device', 'ADSL', 'ADSL router or device providing internet access');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('7', 'device', 'cam', 'Network camera. Live view.');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('8', 'device', 'generic', 'Any device that uses a public IP (PC, game console, laptop, pda..)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('9', 'device', 'confine', 'Node Confine/Clommunity');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('10', 'device', 'onu', 'xPON ONU User Unit (Final)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('11', 'device', 'olt', 'xPON OLT Concentrator (Terminal)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('12', 'device', 'splitter', 'xPON Splitter');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('13', 'device', 'fomconv', 'FO Media Converter');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('14', 'device', 'torpedo', 'Torpedo - Joint enclosure');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('15', 'device', 'switch', 'Switch');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('16', 'device', 'rack', 'Rack');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('17', 'device', 'ppanel','patch panel');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('18', 'device', 'ups', 'Uninterrumpible Power Supply (UPS)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('19', 'device', 'generator', 'Power generator source');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('20', 'device', 'solar', 'Solar Panel');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('21', 'device', 'battery', 'Battery');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('22', 'device', 'breaker','Circuit breakers / Surge protectors');");
// --
// -- service types
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('1', 'service', 'AP', 'Wireless connectivity for end users');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('2', 'service', 'ADSL', 'Open ADSL-type internet access');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('3', 'service', 'Proxy', 'Internet access trough a proxy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('4', 'service', 'DNS', 'Domain Name Server service');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('5', 'service', 'NTP', 'Network Time Protocol service');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('6', 'service', 'mail', 'Mail server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('7', 'service', 'web', 'Web server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('8', 'service', 'ftp', 'FTP or shared disk server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('9', 'service', 'p2p', 'Peer 2 Peer server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('10', 'service', 'asterisk', 'Asterisk VoIP PBX server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('11', 'service', 'radio', 'Radio broadcast');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('12', 'service', 'tv', 'TV broadcast');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('13', 'service', 'irc', 'IRC (chat) server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('14', 'service', 'IM', 'Instant Messaging, jabber server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('15', 'service', 'cam', 'Network camera with live view.');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('16', 'service', 'svn', 'Subversion/CVS repository.');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('17', 'service', 'meteo', 'Weather station.');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('18', 'service', 'apt-cache', 'Linux distribution cache.');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('19', 'service', 'wol', 'Wake-on-lan');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('20', 'service', 'iperf', 'iperf bandwidth test');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('21', 'service', 'teamspeak', 'TeamSpeak Server - Voice conference');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('22', 'service', 'games', 'Generic games server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('23', 'service', 'SNPgraphs', 'SNP graph server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('24', 'service', 'Streaming', 'Videoconferènia i/o Streaming');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('25', 'service', 'VPN', 'Virtual Private Network');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('26', 'service', 'LDAP', 'LDAP Server');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('27', 'service', 'LogServer', 'Ip log Server');");
// --
// -- status flag types
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('1', 'status', 'Planned', 'Planned');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('2', 'status', 'Reserved', 'Reserved');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('3', 'status', 'Building', 'Building');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('4', 'status', 'Testing', 'Testing');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('5', 'status', 'Working', 'Online');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('6', 'status', 'Dropped', 'Dropped');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('7', 'status', 'Inactive', 'Inactive');");
// --
// -- protocol types
// --
update_sql("DELETE FROM `guifi_types` WHERE `type` = 'protocol'");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('1', 'protocol', '802.11a', '802.11a (1-54Mbps - 5Ghz)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('2', 'protocol', '802.11b', '802.11b (1-11Mbps - 2.4Ghz)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('3', 'protocol', '802.11g', '802.11g (2-54Mbps - 2.4Ghz)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('4', 'protocol', '802.11n', '802.11n - MIMO (1-125Mbps - 2.4/5Ghz)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('5', 'protocol', 'WiMAX', '802.16a - WiMAX (1-125Mbps - 2-8Ghz)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('6', 'protocol', 'legacy', 'legacy/proprietary protocol');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('7', 'protocol', '802.11ac', '802.11ac - MIMO (1-125Mbps - Ghz)');");
// --
// -- firmware types
// --
update_sql("DELETE FROM `guifi_types` WHERE `type` = 'firmware'");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('1', 'firmware', 'n/a', 'not available', NULL);");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('2', 'firmware', 'Alchemy', 'Alchemy from sveasoft', 'WRT54Gv1-4|WRT54GSv1-2');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('3', 'firmware', 'Talisman', 'Talisman from sveasoft', 'WRT54Gv1-4|WRT54GL|WRT54GSv1-2|WRT54GSv4');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('4', 'firmware', 'DD-WRTv23', 'DD-WRTv23Beta2 from BrainSlayer', 'WRT54Gv1-4|WRT54GL|WRT54GSv1-2|WRT54GSv4|Asus WL-500xx|WHR-HP-G54, WHR-G54S|NanoStation2|NanoStation5|NanoStation Loco2|NanoStation Loco5|Bullet2|Bullet5|RouterStation|RouterStationPro|Avila GW2348-4');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('5', 'firmware', 'DD-guifi', 'DD-guifi from Miquel Martos', 'WRT54Gv1-4|WRT54GL|WRT54GSv1-2|WRT54GSv4|WHR-HP-G54, WHR-G54S');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('6', 'firmware', 'RouterOSv2.9', 'RouterOS 2.9 from Mikrotik', 'Routerboard 532|Routerboard 133C|Routerboard 133|Routerboard 112|Routerboard 153|Supertrasto guifiBUS guifi.net');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('7', 'firmware', 'whiterussian', 'OpenWRT-whiterussian', 'WRT54Gv1-4|WRT54GL|WRT54GSv1-2|WRT54GSv4|Wrap|Routerboard 532|Routerboard 133C|Routerboard 133|Routerboard 112|Routerboard 153');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('8', 'firmware', 'kamikaze', 'OpenWRT kamikaze','WRT54Gv1-4|WRT54GL|WRT54GSv1-2|WRT54GSv4|Meraki/Fonera|Wrap|Routerboard 532|Routerboard 133C|Routerboard 133|Routerboard 112|Routerboard 153|Supertrasto guifiBUS guifi.net|NanoStation2|NanoStation5|NanoStation Loco2|NanoStation Loco5|Bullet2|Bullet5|RouterStation|RouterStationPro|Avila GW2348-4|Asus WL-500xx|Alix1|Alix2|Alix3');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('9', 'firmware', 'Freifunk-BATMAN', 'OpenWRT-Freifunk-v1.6.16 with B.A.T.M.A.N', 'WRT54Gv1-4|WRT54GL|WRT54GSv1-2|WRT54GSv4|WHR-HP-G54, WHR-G54S');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('10', 'firmware', 'RouterOSv3.x', 'RouterOS 3.x from Mikrotik', 'Routerboard 532|Routerboard 133C|Routerboard 133|Routerboard 112|Routerboard 153|Supertrasto guifiBUS guifi.net|Routerboard 600|Routerboard 411|Routerboard 333|Routerboard 433');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('11', 'firmware', 'AirOsv221', 'Ubiquti AirOs 2.2.1', 'NanoStation2|NanoStation5|NanoStation Loco2|NanoStation Loco5|Bullet2|Bullet5')");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('12', 'firmware', 'Freifunk-OLSR', 'OpenWRT-Freifunk-v1.6.16 with OLSR', 'WRT54Gv1-4|WRT54GL|WRT54GSv1-2|WRT54GSv4|WHR-HP-G54, WHR-G54S');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('13', 'firmware', 'AirOsv30', 'Ubiquti AirOs 3.0', 'NanoStation2|NanoStation5|NanoStation Loco2|NanoStation Loco5|Bullet2|Bullet5')");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('14', 'firmware', 'RouterOSv4.0+', 'RouterOS 4.0 to 4.6 from Mikrotik', 'Routerboard 532|Routerboard 133C|Routerboard 133|Routerboard 112|Routerboard 153|Supertrasto guifiBUS guifi.net|Routerboard 600|Routerboard 411|Routerboard 333|Routerboard 433|Routerboard 800');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('15', 'firmware', 'AirOsv52', 'Ubiquti AirOs 5.2', 'AirMaxM2 Rocket/Nano/Loco|AirMaxM5 Rocket/Nano/Loco|AirMaxM2 Bullet/PwBrg/AirGrd/NanoBr|AirMaxM5 Bullet/PwBrg/AirGrd/NanoBr');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('16', 'firmware', 'RouterOSv4.7+', 'RouterOS 4.7 or newer from Mikrotik', 'Routerboard 532|Routerboard 133C|Routerboard 133|Routerboard 112|Routerboard 153|Supertrasto guifiBUS guifi.net|Routerboard 600|Routerboard 411|Routerboard 333|Routerboard 433|Routerboard 800|Routerboard 750/750G');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('17', 'firmware', 'GuifiStationOS1.0', 'GuifiStationOS v1.0 from Setup Informatica', 'GuifiStation2|GuifiStation5');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('18', 'firmware', 'gsffirm', 'Firmware de GràciaSenseFils MANET', 'Alix2|Alix3|WRT54Gv1-4|WRT54GL|WRT54GSv1-2|WRT54GSv4|Asus WL-500xx|WHR-HP-G54, WHR-G54S|NanoStation2|NanoStation5|NanoStation Loco2|NanoStation Loco5|Bullet2|Bullet5|RouterStation|RouterStationPro|Meraki/Fonera');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('19', 'firmware', 'RouterOSv5.x', 'RouterOS 5.x or newer from Mikrotik', 'Routerboard 532|Routerboard 133C|Routerboard 133|Routerboard 112|Routerboard 153|Supertrasto guifiBUS guifi.net|Routerboard 600|Routerboard 411|Routerboard 333|Routerboard 433|Routerboard 800|Routerboard 750/750G');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('20', 'firmware', 'AirOsv3.6+', 'Ubiquti AirOs 3.6+', 'NanoStation2|NanoStation5|NanoStation Loco2|NanoStation Loco5|Bullet2|Bullet5')");
// --
// -- antenna types
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('1', 'antenna', '0', 'original/integrated');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('2', 'antenna', '360', 'omnidirectional');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('3', 'antenna', '6', 'yagi/directive');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('4', 'antenna', '90', 'sector 90 degrees');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('5', 'antenna', '120', 'sector 120 degrees');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('6', 'antenna', '90', 'patch 90 degrees');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('7', 'antenna', '60', 'patch 60 degrees');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('8', 'antenna', '30', 'patch 30 degrees');");
// --
// -- orientation (bearing) types
// --
/*
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'N', 'North');
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'NE', 'North east');
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'E', 'East');
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'SE', 'South east');
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'S', 'South');
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'SW', 'South west');
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'W', 'West');
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'NW', 'North east');
-- INSERT INTO {guifi_types} (id, type, text, description) VALUES ('bearing', 'all', '360 degrees');
*/
// --
// -- Time zones
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('1', 'tz', '-12 1 0', '(GMT-12:00) Kwajalein');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('2', 'tz', '-11 1 0', '(GMT-11:00) Midway Island, Samoa');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('3', 'tz', '-10 1 0', '(GMT-10:00) Hawaii');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('4', 'tz', '-09 1 1', '(GMT-09:00) Alaska');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('5', 'tz', '-08 1 1', '(GMT-08:00) Pacific Time (USA & Canada)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('6', 'tz', '-07 1 0', '(GMT-07:00) Arizona');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('7', 'tz', '-07 2 1', '(GMT-07:00) Mountain Time (USA & Canada)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('8', 'tz', '-06 1 0', '(GMT-06:00) Mexico');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('9', 'tz', '-06 2 1', '(GMT-06:00) Central Time (USA & Canada)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('10', 'tz', '-05 1 0', '(GMT-05:00) Indiana East, Colombia, Panama');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('11', 'tz', '-05 2 1', '(GMT-05:00) Eastern Time (USA & Canada)');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('12', 'tz', '-04 1 0', '(GMT-04:00) Bolivia, Venezuela');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('13', 'tz', '-04 2 1', '(GMT-04:00) Atlantic Time (Canada), Brazil West');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('14', 'tz', '-03.5 1 1', '(GMT-03:30) Newfoundland');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('15', 'tz', '-03 1 0', '(GMT-03:00) Guyana');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('16', 'tz', '-03 2 1', '(GMT-03:00) Brazil East, Greenland');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('17', 'tz', '-02 1 0', '(GMT-02:00) Mid-Atlantic');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('18', 'tz', '-01 1 2', '(GMT-01:00) Azores');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('19', 'tz', '+00 1 0', '(GMT) Gambia, Liberia, Morocco');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('20', 'tz', '+00 2 2', '(GMT) England');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('21', 'tz', '+01 1 0', '(GMT+01:00) Tunisia');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('22', 'tz', '+01 2 2', '(GMT+01:00) Gurb, France, Germany, Italy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('23', 'tz', '+02 1 0', '(GMT+02:00) South Africa');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('24', 'tz', '+02 2 2', '(GMT+02:00) Greece, Ukraine, Romania, Turkey');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('25', 'tz', '+03 1 0', '(GMT+03:00) Iraq, Jordan, Kuwait');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('26', 'tz', '+04 1 0', '(GMT+04:00) Armenia');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('27', 'tz', '+05 1 0', '(GMT+05:00) Pakistan, Russia');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('28', 'tz', '+06 1 0', '(GMT+06:00) Bangladesh, Russia');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('29', 'tz', '+07 1 0', '(GMT+07:00) Thailand, Russia');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('30', 'tz', '+08 1 0', '(GMT+08:00) China, Hong Kong, Australia Western');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('31', 'tz', '+08 2 0', '(GMT+08:00) Singapore, Taiwan, Russia');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('32', 'tz', '+09 1 0', '(GMT+09:00) Japan, Korea');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('33', 'tz', '+09.5 1 4', '(GMT+09:30) Australia Central');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('34', 'tz', '+10 1 0', '(GMT+10:00) Guam, Russia');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('35', 'tz', '+10 2 4', '(GMT+10:00) Australia Eastern');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('36', 'tz', '+11 1 0', '(GMT+11:00) Solomon Islands');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('37', 'tz', '+12 1 0', '(GMT+12:00) Fiji');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('38', 'tz', '+12 2 4', '(GMT+12:00) New Zealand');");
// --
// -- Wireless Channels
// --
update_sql("DELETE FROM `guifi_types` WHERE `type` = 'channel'");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('1', 'channel', '0', 'Auto 2.4GHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('2', 'channel', '1', '1 - 2412 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('3', 'channel', '2', '2 - 2417 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('4', 'channel', '3', '3 - 2422 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('5', 'channel', '4', '4 - 2427 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('6', 'channel', '5', '5 - 2432 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('7', 'channel', '6', '6 - 2437 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('8', 'channel', '7', '7 - 2442 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('9', 'channel', '8', '8 - 2447 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('10', 'channel', '9', '9 - 2452 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('11', 'channel', '10', '10 - 2457 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('12', 'channel', '11', '11 - 2462 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('13', 'channel', '12', '12 - 2467 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('14', 'channel', '13', '13 - 2472 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('15', 'channel', '14', '14 - 2477 MHz', '802.11b|802.11g|802.11n');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('16', 'channel', '5000', 'Auto 5GHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('17', 'channel', '5180', '36 - 5180MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('18', 'channel', '5200', '40 - 5200MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('19', 'channel', '5220', '44 - 5220MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('20', 'channel', '5240', '48 - 5240MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('21', 'channel', '5260', '52 - 5260MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('22', 'channel', '5280', '56 - 5280MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('23', 'channel', '5300', '60 - 5300MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('24', 'channel', '5320', '64 - 5320MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('25', 'channel', '5500', '100 - 5500MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('26', 'channel', '5520', '104 - 5520MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('27', 'channel', '5540', '108 - 5540MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('28', 'channel', '5560', '112 - 5560MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('29', 'channel', '5580', '116 - 5580MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('30', 'channel', '5600', '120 - 5600MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('31', 'channel', '5620', '124 - 5620MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('32', 'channel', '5640', '128 - 5640MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('33', 'channel', '5660', '132 - 5660MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('34', 'channel', '5680', '136 - 5680MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('35', 'channel', '5700', '140 - 5700MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('36', 'channel', '5185', '37 - 5185MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('37', 'channel', '5190', '38 - 5190MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('38', 'channel', '5195', '39 - 5195MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('39', 'channel', '5205', '41 - 5205MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('40', 'channel', '5210', '42 - 5210MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('41', 'channel', '5215', '43 - 5215MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('42', 'channel', '5225', '45 - 5225MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('43', 'channel', '5230', '46 - 5230MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('44', 'channel', '5235', '47 - 5235MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('45', 'channel', '5245', '49 - 5245MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('46', 'channel', '5250', '50 - 5250MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('47', 'channel', '5255', '51 - 5255MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('48', 'channel', '5265', '53 - 5265MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('49', 'channel', '5270', '54 - 5270MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('50', 'channel', '5275', '55 - 5275MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('51', 'channel', '5285', '57 - 5285MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('52', 'channel', '5290', '58 - 5290MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('53', 'channel', '5295', '59 - 5295MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('54', 'channel', '5305', '61 - 5305MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('55', 'channel', '5310', '62 - 5310MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('56', 'channel', '5315', '63 - 5315MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('57', 'channel', '5505', '101 - 5505MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('58', 'channel', '5510', '102 - 5510MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('59', 'channel', '5515', '103 - 5515MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('60', 'channel', '5525', '105 - 5525MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('61', 'channel', '5530', '106 - 5530MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('62', 'channel', '5535', '107 - 5535MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('63', 'channel', '5545', '109 - 5545MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('64', 'channel', '5550', '110 - 5550MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('65', 'channel', '5555', '111 - 5555MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('66', 'channel', '5565', '113 - 5565MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('67', 'channel', '5570', '114 - 5570MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('68', 'channel', '5575', '115 - 5575MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('69', 'channel', '5585', '117 - 5585MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('70', 'channel', '5590', '118 - 5590MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('71', 'channel', '5595', '119 - 5595MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('72', 'channel', '5605', '121 - 5605MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('73', 'channel', '5610', '122 - 5610MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('74', 'channel', '5615', '123 - 5615MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('75', 'channel', '5625', '125 - 5625MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('76', 'channel', '5630', '126 - 5630MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('77', 'channel', '5635', '127 - 5635MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('78', 'channel', '5645', '129 - 5645MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('79', 'channel', '5650', '130 - 5650MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('80', 'channel', '5655', '131 - 5655MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('81', 'channel', '5665', '133 - 5665MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('82', 'channel', '5670', '134 - 5670MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('83', 'channel', '5675', '135 - 5675MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('84', 'channel', '5685', '137 - 5685MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('85', 'channel', '5690', '138 - 5690MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('86', 'channel', '5695', '139 - 5695MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('87', 'channel', '0000', 'Auto 2-8GHz', 'WiMAX');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('88', 'channel', '0', '10Ghz auto', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('89', 'channel', '10308', '48 - 10308MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('90', 'channel', '10322', '51 - 10322MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('91', 'channel', '10336', '54 - 10336MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('92', 'channel', '10350', '57 - 10350MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('93', 'channel', '10364', '59 - 10364MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('94', 'channel', '10378', '62 - 10378MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('95', 'channel', '10392', '65 - 10392MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('96', 'channel', '10406', '68 - 10406MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('97', 'channel', '10490', '85 - 10490MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('98', 'channel', '10504', '87 - 10504MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('99', 'channel', '10518', '90 - 10518MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('100', 'channel', '10532', '93 - 10532MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('101', 'channel', '10546', '96 - 10546MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('102', 'channel', '10560', '99 - 10560MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('103', 'channel', '10574', '101 - 10574MHz', 'Legacy');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('104', 'channel', '5745', '149 - 5745MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('105', 'channel', '5765', '153 - 5765MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('106', 'channel', '5785', '157 - 5785MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('107', 'channel', '5805', '161 - 5805MHz', '802.11a|802.11n|802.11ac');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('108', 'channel', '5825', '165 - 5825MHz', '802.11a|802.11n|802.11ac');");
// --
// -- Wireless channel bandwith
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES " .
"('1', 'chbandwith', '5Mhz', '5Mhz')," .
"('2', 'chbandwith', '7Mhz', '7Mhz')," .
"('3', 'chbandwith', '8Mhz', '8Mhz')," .
"('4', 'chbandwith', '10Mhz', '10Mhz')," .
"('5', 'chbandwith', '14Mhz', '14Mhz')," .
"('6', 'chbandwith', '20Mhz', '20Mhz')," .
"('7', 'chbandwith', '28Mhz', '28Mhz')," .
"('8', 'chbandwith', '30Mhz', '30Mhz')," .
"('9', 'chbandwith', '40Mhz', '40Mhz')," .
"('10', 'chbandwith', '50Mhz', '50Mhz')," .
"('11', 'chbandwith', '60Mhz', '60Mhz')," .
"('12', 'chbandwith', '70Mhz', '70Mhz')," .
"('13', 'chbandwith', '80Mhz', '80Mhz')," .
"('14', 'chbandwith', '160Mhz', '160Mhz');");
// --
// -- Routing methods
// -- Relations contains supported firmwares
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('1', 'routing', 'n/a', 'None', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('2', 'routing', 'Static', 'Static routing', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('3', 'routing', 'Gateway', 'Gateway to AP', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('4', 'routing', 'OSPF', 'OSPF', 'Alchemy|Talisman|DD-WRTv23|DD-guifi|RouterOSv2.9|RouterOSv3.x');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('5', 'routing', 'BGP', 'BGP', 'Alchemy|Talisman|DD-WRTv23|DD-guifi|RouterOSv2.9|RouterOSv3.x');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('6', 'routing', 'OLSR', 'OLSR', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('7', 'routing', 'OLSR-NG', 'OLSR-NG', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('8', 'routing', 'BATMAN', 'BATMAN', '');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('9', 'routing', 'RIP', 'RIP', '');");
// --
// -- ad-hoc dynamic protocols
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('1', 'adhoc', 'OLSR', 'ad-hoc mesh - OLSR', 'kamikaze|freifunk-OLSR');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('2', 'adhoc', 'OLSR-NG', 'ad-hoc mesh - OLSR-NG', 'kamikaze');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('3', 'adhoc', 'BATMAN', 'ad-hoc mesh - BATMAN', 'kamikaze|freifunk-BATMAN');");
db_query("INSERT INTO {guifi_types} (id, type, text, description, relations) VALUES ('4', 'adhoc', 'RouterOS', 'ad-hoc mesh - RouterOS', 'RouterOSv3.x');");
// Antenna Gain Types
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('1', 'antenna_gain', '5', '5', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('2', 'antenna_gain', '6', '6', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('3', 'antenna_gain', '7', '7', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('4', 'antenna_gain', '8', '8', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('5', 'antenna_gain', '9', '9', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('6', 'antenna_gain', '10', '10', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('7', 'antenna_gain', '11', '11', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('8', 'antenna_gain', '12', '12', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('9', 'antenna_gain', '13', '13', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('10', 'antenna_gain', '14', '14', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('11', 'antenna_gain', '15', '15', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('12', 'antenna_gain', '16', '16', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('13', 'antenna_gain', '17', '17', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('14', 'antenna_gain', '18', '18', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('15', 'antenna_gain', '19', '19', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('16', 'antenna_gain', '20', '20', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('17', 'antenna_gain', '21', '21', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('18', 'antenna_gain', '22', '22', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('19', 'antenna_gain', '23', '23', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('20', 'antenna_gain', '24', '24', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('21', 'antenna_gain', '25', '25', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('22', 'antenna_gain', '26', '26', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('23', 'antenna_gain', '27', '27', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('24', 'antenna_gain', '28', '28', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('25', 'antenna_gain', '29', '29', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('26', 'antenna_gain', '30', '30', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('27', 'antenna_gain', '31', '31', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('28', 'antenna_gain', '32', '32', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('29', 'antenna_gain', '33', '33', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('30', 'antenna_gain', '34', '34', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('31', 'antenna_gain', '35', '35', NULL);");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('32', 'antenna_gain', '36', '36', '');");
db_query("INSERT INTO `guifi_types` (`id`, `type`, `text`, `description`, `relations`) VALUES ('33', 'antenna_gain', 'more...', 'more...', NULL);");
// --
// -- Contribution types
// --
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('1', 'contribution', '', 'Not defined, contact admins');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('2', 'contribution', 'free', 'Free - No funding required');");
db_query("INSERT INTO {guifi_types} (id, type, text, description) VALUES ('3', 'contribution', 'yes', 'Funding required');");
// --
// -- Volcant dades de la taula guifi_manufacturer
// --
update_sql("TRUNCATE guifi_manufacturer");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (1, 'Other', NULL, '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (2, 'Linksys', 'http://www.linksys.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (8, 'Mikrotik', 'http://mikrotik.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (9, 'Buffalo', 'http://www.buffalotech.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (10, 'Ubiquiti', 'http://www.ubnt.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (11, 'Meraki', 'http://meraki.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (12, 'Gateworks', 'http://www.gateworks.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (13, 'Asus', 'http://asus.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (14, 'Pccengines', 'http://www.pcengines.ch', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (15, 'Setup Informatica', 'http://www.setup.cat', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (100, 'DLink', 'http://www.dlink.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (101, 'Deliberant', 'http://www.deliberant.com', '[email protected]');");
db_query("INSERT INTO `guifi_manufacturer` (`fid`, `name`, `url`, `notification` ) VALUES (102, 'TP-Link', 'http://www.tp-link.com', '[email protected]');");
// --
// -- guifi_model_specs
// --
update_sql("TRUNCATE guifi_model_specs");
db_query("INSERT INTO `guifi_model_specs` (`mid`, `fid`, `model`, `model_class`, `type`, `radiodev_max`, `etherdev_max`, `optoports_max`, `rackeable`, `AP`, `virtualAP`, `client`, `interfaces`, `winterfaces`, `opto_interfaces`, `url`, `comments`, `supported`, `notification`, `user_created`, `user_changed`, `timestamp_created`, `timestamp_changed`) VALUES
(47, 10, 'AirMaxM2 Bullet/PwBrg/AirGrd/NanoBr', 'wireless|router', 'Extern', 1, 1, 0, 0, 'Yes', 'Yes', 'Yes', 'eth0', NULL, NULL, 'http://ubnt.com/airmax', 'Permet Firmwares de tercers', 'Yes', '[email protected]', 0, 1, 0, 1415288717),
(46, 10, 'AirMaxM5 Rocket/Nano/Loco', 'wireless|router', 'Extern', 1, 1, 0, 0, 'Yes', 'Yes', 'Yes', 'eth0', NULL, NULL, 'http://ubnt.com/airmax', 'Permet Firmwares de tercers', 'Yes', '[email protected]', 0, 1, 0, 1415288737),
(45, 10, 'AirMaxM2 Rocket/Nano/Loco', 'wireless|router', 'Extern', 1, 1, 0, 0, 'Yes', 'Yes', 'Yes', 'eth0', NULL, NULL, 'http://ubnt.com/airmax', 'Permet Firmwares de tercers', 'Yes', '[email protected]', 0, 1, 0, 1415288752),
(43, 14, 'Alix3', 'wireless|router', 'Extern', 2, 3, 0, 0, 'Yes', 'Yes', 'Yes', 'eth0|eth1|eth2', 'wlan0|wlan1', NULL, 'http://www.pcengines.ch/alix3d.htm', 'Permet Firmwares de tercers', 'Yes', '[email protected]', 0, 1, 0, 1450279561),
(44, 8, 'Routerboard 800', 'wireless|router', NULL, 8, 3, 0, 0, 'Yes', 'Yes', 'No', 'ether1|ether2|ether3', 'wlan1|wlan2|wlan3|wlan4|wlan5|wlan6|wlan7|wlan8', NULL, 'http://www.routerboard.com', NULL, 'Yes', '[email protected]', 0, 1, 0, 1426627537),