support for performing DB upgrades from a console using contrib code
[racktables] / wwwroot / inc / snmp.php
CommitLineData
2ffd5a2a
DO
1<?php
2
cddbb9fd
DO
3# This file is a part of RackTables, a datacenter and server room management
4# framework. See accompanying file "COPYING" for the full copyright and
5# licensing information.
6
536e7323 7global $iftable_processors;
74aee2dc 8$iftable_processors = array();
6be06cbb 9
b0021c43
AD
10$iftable_processors['generic-fa-any-100TX'] = array
11(
12 'pattern' => '@^fa(\d+)$@',
13 'replacement' => 'fa\\1',
14 'dict_key' => 19,
869d4ff4 15 'label' => '\\1',
b0021c43
AD
16 'try_next_proc' => FALSE,
17);
18
8595dfd0
AD
19$iftable_processors['generic-g45-to-g48-combo-1000SFP'] = array
20(
21 'pattern' => '@^g(45|46|47|48)$@',
22 'replacement' => 'g\\1',
23 'dict_key' => '4-1077',
24 'label' => 'g\\1',
25 'try_next_proc' => TRUE,
26);
27
28$iftable_processors['generic-g-any-1000T'] = array
29(
30 'pattern' => '@^g(\d+)$@',
31 'replacement' => 'g\\1',
32 'dict_key' => 24,
33 'label' => 'g\\1',
34 'try_next_proc' => FALSE,
35);
36
b0021c43
AD
37$iftable_processors['generic-gi-1-to-2-1000T'] = array
38(
39 'pattern' => '@^gi(\d+)$@',
40 'replacement' => 'gi\\1',
41 'dict_key' => 24,
869d4ff4 42 'label' => 'G\\1',
b0021c43
AD
43 'try_next_proc' => FALSE,
44);
45
46$iftable_processors['generic-gi-3-to-4-combo-1000SFP'] = array
47(
48 'pattern' => '@^gi(3|4)$@',
49 'replacement' => 'gi\\1',
50 'dict_key' => '4-1077',
869d4ff4 51 'label' => 'G\\1',
b0021c43
AD
52 'try_next_proc' => TRUE,
53);
54
55$iftable_processors['generic-gi-3-to-4-combo-1000T'] = array
56(
57 'pattern' => '@^gi(3|4)$@',
58 'replacement' => 'gi\\1',
59 'dict_key' => '1-24',
869d4ff4 60 'label' => 'G\\1',
b0021c43
AD
61 'try_next_proc' => FALSE,
62);
63
78cfe89b
AD
64$iftable_processors['generic-port-any-1000T'] = array
65(
66 'pattern' => '@^port([[:digit:]]+)$@',
67 'replacement' => '\\1',
68 'dict_key' => 24,
69 'label' => '\\1',
70 'try_next_proc' => FALSE,
71);
72
47a523af
AD
73$iftable_processors['catalyst-any-100TX'] = array
74(
75 'pattern' => '@^FastEthernet(\d+)$@',
76 'replacement' => 'fa\\1',
77 'dict_key' => 19,
78 'label' => 'fa\\1',
79 'try_next_proc' => FALSE,
80);
81
82$iftable_processors['catalyst-any-1000T'] = array
83(
84 'pattern' => '@^GigabitEthernet(\d+)$@',
85 'replacement' => 'gi\\1',
86 'dict_key' => 24,
87 'label' => 'gi\\1',
88 'try_next_proc' => FALSE,
89);
90
bc8b21f0
AD
91$iftable_processors['catalyst-9-to-12-1000SFP'] = array
92(
93 'pattern' => '@^GigabitEthernet(9|10|11|12)$@',
94 'replacement' => 'gi\\1',
95 'dict_key' => '4-1077',
96 'label' => 'gi\\1',
97 'try_next_proc' => TRUE,
98);
99
100$iftable_processors['catalyst-9-to-12-1000T'] = array
101(
102 'pattern' => '@^GigabitEthernet(9|10|11|12)$@',
103 'replacement' => 'gi\\1',
104 'dict_key' => 24,
105 'label' => 'gi\\1',
106 'try_next_proc' => FALSE,
107);
108
cbc30061 109$iftable_processors['catalyst-chassis-mgmt'] = array
6be06cbb 110(
cbc30061
DO
111 'pattern' => '@^FastEthernet([[:digit:]])$@',
112 'replacement' => 'fa\\1',
113 'dict_key' => '1-19',
6be06cbb
DO
114 'label' => 'mgmt',
115 'try_next_proc' => FALSE,
116);
117
38bd461c
AA
118$iftable_processors['catalyst-chassis-25-to-26-1000SFP'] = array
119(
120 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(25|26)$@',
121 'replacement' => 'gi\\1\\2',
122 'dict_key' => '4-1077',
123 'label' => '\\2X',
124 'try_next_proc' => FALSE,
125);
126
6be06cbb 127$iftable_processors['catalyst-chassis-any-100TX'] = array
74aee2dc 128(
6be06cbb
DO
129 'pattern' => '@^FastEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
130 'replacement' => 'fa\\1\\2',
74aee2dc 131 'dict_key' => 19,
6be06cbb 132 'label' => '\\2X',
56a797ef
DO
133 'try_next_proc' => FALSE,
134);
135
6be06cbb 136$iftable_processors['catalyst-chassis-25-to-26-100FX/MT-RJ'] = array
56a797ef 137(
6be06cbb
DO
138 'pattern' => '@^FastEthernet([[:digit:]]+/)?(25|26)$@',
139 'replacement' => 'fa\\1\\2',
8920f7f5 140 'dict_key' => 1195,
6be06cbb
DO
141 'label' => '\\2',
142 'try_next_proc' => FALSE,
143);
144
145$iftable_processors['catalyst-chassis-any-1000T'] = array
146(
f0255d01 147 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
6be06cbb
DO
148 'replacement' => 'gi\\1\\2',
149 'dict_key' => 24,
150 'label' => '\\2X',
56a797ef 151 'try_next_proc' => FALSE,
74aee2dc
DO
152);
153
6be06cbb 154$iftable_processors['catalyst-chassis-uplinks-1000T'] = array
74aee2dc 155(
6be06cbb
DO
156 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
157 'replacement' => 'gi\\1\\2',
74aee2dc 158 'dict_key' => 24,
6be06cbb 159 'label' => '\\2',
56a797ef
DO
160 'try_next_proc' => FALSE,
161);
162
8a4bee49
DO
163$iftable_processors['catalyst-chassis-uplinks-1000SX'] = array
164(
165 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
166 'replacement' => 'gi\\1\\2',
167 'dict_key' => '1-1202', // Gig-SX hardwired
168 'label' => '\\2',
169 'try_next_proc' => FALSE,
170);
171
6be06cbb 172$iftable_processors['catalyst-chassis-any-1000SFP'] = array
74aee2dc 173(
6be06cbb
DO
174 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
175 'replacement' => 'gi\\1\\2',
8536e20a 176 'dict_key' => '4-1077',
6be06cbb 177 'label' => '\\2',
56a797ef
DO
178 'try_next_proc' => FALSE,
179);
180
6be06cbb 181$iftable_processors['catalyst-chassis-any-1000GBIC'] = array
56a797ef 182(
6be06cbb
DO
183 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
184 'replacement' => 'gi\\1\\2',
8536e20a 185 'dict_key' => '3-1078',
6be06cbb 186 'label' => '\\2',
56a797ef
DO
187 'try_next_proc' => FALSE,
188);
189
7e87a291
DO
190$iftable_processors['catalyst-chassis-1-to-2-combo-1000SFP'] = array
191(
192 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2)$@',
193 'replacement' => 'gi\\1\\2',
194 'dict_key' => '4-1077',
195 'label' => '\\2',
196 'try_next_proc' => TRUE,
197);
198
712010be
AA
199$iftable_processors['catalyst-chassis-1-to-2-1000SFP'] = array
200(
201 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2)$@',
202 'replacement' => 'gi\\1\\2',
203 'dict_key' => '4-1077',
204 'label' => '\\2',
205 'try_next_proc' => FALSE,
206);
207
a048e8fc
DO
208$iftable_processors['catalyst-chassis-8-combo-1000SFP'] = array
209(
210 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(8)$@',
211 'replacement' => 'gi\\1\\2',
212 'dict_key' => '4-1077',
213 'label' => '\\2',
214 'try_next_proc' => TRUE,
215);
216
6be06cbb 217$iftable_processors['catalyst-chassis-21-to-24-combo-1000SFP'] = array
56a797ef 218(
6be06cbb
DO
219 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(21|22|23|24)$@',
220 'replacement' => 'gi\\1\\2',
8536e20a 221 'dict_key' => '4-1077',
6be06cbb 222 'label' => '\\2',
56a797ef
DO
223 'try_next_proc' => TRUE,
224);
225
6be06cbb 226$iftable_processors['catalyst-chassis-45-to-48-combo-1000SFP'] = array
56a797ef 227(
6be06cbb
DO
228 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(45|46|47|48)$@',
229 'replacement' => 'gi\\1\\2',
8536e20a 230 'dict_key' => '4-1077',
6be06cbb 231 'label' => '\\2',
56a797ef
DO
232 'try_next_proc' => TRUE,
233);
234
6be06cbb 235$iftable_processors['catalyst-chassis-uplinks-10000X2'] = array
56a797ef 236(
6be06cbb
DO
237 'pattern' => '@^TenGigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
238 'replacement' => 'te\\1\\2',
8536e20a 239 'dict_key' => '6-1080',
6be06cbb 240 'label' => '\\2',
56a797ef 241 'try_next_proc' => FALSE,
74aee2dc
DO
242);
243
b475f795
DO
244$iftable_processors['catalyst-chassis-uplinks-10000SFP+'] = array
245(
246 'pattern' => '@^TenGigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
247 'replacement' => 'te\\1\\2',
248 'dict_key' => '9-1084',
249 'label' => '\\2',
250 'try_next_proc' => FALSE,
251);
252
6be06cbb 253$iftable_processors['catalyst-chassis-25-to-28-1000SFP'] = array
74aee2dc 254(
6be06cbb
DO
255 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(25|26|27|28)$@',
256 'replacement' => 'gi\\1\\2',
8536e20a 257 'dict_key' => '4-1077',
6be06cbb 258 'label' => '\\2',
56a797ef 259 'try_next_proc' => FALSE,
74aee2dc
DO
260);
261
6be06cbb 262$iftable_processors['catalyst-chassis-49-to-52-1000SFP'] = array
74aee2dc 263(
6be06cbb
DO
264 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(49|50|51|52)$@',
265 'replacement' => 'gi\\1\\2',
8536e20a 266 'dict_key' => '4-1077',
6be06cbb 267 'label' => '\\2',
56a797ef 268 'try_next_proc' => FALSE,
74aee2dc
DO
269);
270
71d6b313 271$iftable_processors['catalyst-blade-13-to-16-1000SFP'] = array
74aee2dc 272(
6be06cbb
DO
273 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(13|14|15|16)$@',
274 'replacement' => 'gi\\1\\2',
8536e20a 275 'dict_key' => '4-1077',
6be06cbb 276 'label' => '\\2',
56a797ef 277 'try_next_proc' => FALSE,
74aee2dc
DO
278);
279
71d6b313 280$iftable_processors['catalyst-blade-21-to-24-1000SFP'] = array
74aee2dc 281(
6be06cbb
DO
282 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(21|22|23|24)$@',
283 'replacement' => 'gi\\1\\2',
8536e20a 284 'dict_key' => '4-1077',
6be06cbb 285 'label' => '\\2',
56a797ef 286 'try_next_proc' => FALSE,
74aee2dc
DO
287);
288
71d6b313
DO
289$iftable_processors['catalyst-blade-11-to-12-1000T'] = array
290(
291 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
292 'replacement' => 'gi\\1\\2',
293 'dict_key' => '1-24',
294 'label' => '\\2',
295 'try_next_proc' => FALSE,
296);
297
298$iftable_processors['catalyst-blade-17-to-20-1000T'] = array
299(
300 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(17|18|19|20)$@',
301 'replacement' => 'gi\\1\\2',
302 'dict_key' => '1-24',
303 'label' => '\\2',
304 'try_next_proc' => FALSE,
305);
306
307$iftable_processors['catalyst-blade-any-bp/1000T'] = array
308(
309 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
310 'replacement' => 'gi\\1\\2',
311 'dict_key' => '1-1087',
312 'label' => '',
313 'try_next_proc' => FALSE,
314);
315
86d614c3
DO
316$iftable_processors['catalyst-11-to-12-1000T'] = array
317(
318 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
319 'replacement' => 'gi\\1\\2',
320 'dict_key' => '1-24',
321 'label' => '\\2',
322 'try_next_proc' => FALSE,
323);
324
7e87a291
DO
325$iftable_processors['catalyst-1-to-10-1000T'] = array
326(
327 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2|3|4|5|6|7|8|9|10)$@',
328 'replacement' => 'gi\\1\\2',
329 'dict_key' => '1-24',
330 'label' => '\\2',
331 'try_next_proc' => FALSE,
332);
333
334$iftable_processors['catalyst-11-to-12-GBIC'] = array
335(
336 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
337 'replacement' => 'gi\\1\\2',
338 'dict_key' => '3-1078',
339 'label' => '\\2',
340 'try_next_proc' => FALSE,
341);
342
38c9bb20
DO
343$iftable_processors['catalyst-stack-any-1000T'] = array
344(
345 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(\d+)$@',
346 'replacement' => 'gi\\1/\\2/\\3',
347 'dict_key' => '1-24',
348 'label' => 'unit \\1 port \\3',
349 'try_next_proc' => FALSE,
350);
351
352$iftable_processors['catalyst-stack-25-to-28-SFP'] = array
353(
354 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(25|26|27|28)$@',
355 'replacement' => 'gi\\1/\\2/\\3',
356 'dict_key' => '4-1077',
357 'label' => 'unit \\1 port \\3',
358 'try_next_proc' => FALSE,
359);
360
74aee2dc
DO
361$iftable_processors['nexus-any-10000SFP+'] = array
362(
56a797ef 363 'pattern' => '@^Ethernet([[:digit:]]/[[:digit:]]+)$@',
74aee2dc 364 'replacement' => 'e\\1',
8536e20a 365 'dict_key' => '9-1084',
56a797ef
DO
366 'label' => '\\1',
367 'try_next_proc' => FALSE,
74aee2dc
DO
368);
369
8acd246d
DO
370$iftable_processors['ftos-any-1000T'] = array
371(
372 'pattern' => '@^GigabitEthernet 0/(\d+)$@',
373 'replacement' => 'gi0/\\1',
374 'dict_key' => '1-24',
375 'label' => '\\1',
376 'try_next_proc' => FALSE,
377);
378
379$iftable_processors['ftos-44-to-47-1000SFP'] = array
380(
381 'pattern' => '@^GigabitEthernet 0/(44|45|46|47)$@',
382 'replacement' => 'gi0/\\1',
383 'dict_key' => '4-1077',
384 'label' => '\\1',
385 'try_next_proc' => FALSE,
386);
387
388$iftable_processors['ftos-any-10000SFP+'] = array
389(
390 'pattern' => '@^TenGigabitEthernet 0/(\d+)$@',
391 'replacement' => 'te0/\\1',
392 'dict_key' => '9-1084',
393 'label' => '\\1',
394 'try_next_proc' => FALSE,
395);
396
1e5a92d8
DO
397$iftable_processors['ftos-any-QSFP+'] = array
398(
399 'pattern' => '@^fortyGigE 0/(\d+)$@',
400 'replacement' => 'fo0/\\1',
401 'dict_key' => '10-1588',
402 'label' => '\\1',
403 'try_next_proc' => FALSE,
404);
405
406$iftable_processors['ftos-mgmt'] = array
407(
408 'pattern' => '@^ManagementEthernet 0/0$@',
409 'replacement' => 'ma0/0',
410 'dict_key' => '1-19',
411 'label' => 'ethernet',
412 'try_next_proc' => FALSE,
413);
414
e7662d90
DO
415$iftable_processors['nexus-mgmt'] = array
416(
417 'pattern' => '@^(mgmt[[:digit:]]+)$@',
418 'replacement' => '\\1',
419 'dict_key' => '1-24',
420 'label' => '\\1',
421 'try_next_proc' => FALSE,
422);
423
56a797ef 424$iftable_processors['procurve-chassis-100TX'] = array
74aee2dc 425(
56a797ef 426 'pattern' => '@^([[:digit:]]+)$@',
74aee2dc
DO
427 'replacement' => '\\1',
428 'dict_key' => 19,
56a797ef
DO
429 'label' => '\\1',
430 'try_next_proc' => FALSE,
431);
432
433$iftable_processors['procurve-chassis-1000T'] = array
434(
435 'pattern' => '@^([[:digit:]]+)$@',
436 'replacement' => '\\1',
437 'dict_key' => 24,
438 'label' => '\\1',
439 'try_next_proc' => FALSE,
440);
441
4b43f713
DO
442$iftable_processors['procurve-45-to-48-combo-1000SFP'] = array
443(
444 'pattern' => '@^(45|46|47|48)$@',
445 'replacement' => '\\1',
446 'dict_key' => '4-1077',
447 'label' => '\\1',
448 'try_next_proc' => TRUE,
449);
450
13b28c20
DO
451$iftable_processors['procurve-21-to-24-combo-1000SFP'] = array
452(
453 'pattern' => '@^(21|22|23|24)$@',
454 'replacement' => '\\1',
455 'dict_key' => '4-1077',
456 'label' => '\\1',
457 'try_next_proc' => TRUE,
458);
459
93c0a7b9
DO
460$iftable_processors['procurve-23-to-24-combo-1000SFP'] = array
461(
462 'pattern' => '@^(23|24)$@',
463 'replacement' => '\\1',
464 'dict_key' => '4-1077',
465 'label' => '\\1',
466 'try_next_proc' => TRUE,
467);
468
56a797ef
DO
469$iftable_processors['procurve-modular-100TX'] = array
470(
471 'pattern' => '@^([A-Z][[:digit:]]+)$@',
472 'replacement' => '\\1',
473 'dict_key' => 19,
474 'label' => '\\1',
475 'try_next_proc' => FALSE,
74aee2dc
DO
476);
477
4bbb87a3
AD
478$iftable_processors['procurve-modular-1000T'] = array
479(
480 'pattern' => '@^([A-Z][[:digit:]]+)$@',
481 'replacement' => '\\1',
482 'dict_key' => 24,
483 'label' => '\\1',
484 'try_next_proc' => FALSE,
485);
486
74aee2dc
DO
487$iftable_processors['procurve-25-to-26-1000T'] = array
488(
56a797ef 489 'pattern' => '@^(25|26)$@',
74aee2dc
DO
490 'replacement' => '\\1',
491 'dict_key' => 24,
56a797ef
DO
492 'label' => '\\1',
493 'try_next_proc' => FALSE,
74aee2dc
DO
494);
495
83aedacd
AD
496$iftable_processors['procurve-27-to-28-1000SFP'] = array
497(
498 'pattern' => '@^(27|28)$@',
499 'replacement' => '\\1',
500 'dict_key' => '4-1077',
501 'label' => '\\1',
502 'try_next_proc' => FALSE,
503);
504
74aee2dc
DO
505$iftable_processors['procurve-49-to-50-1000T'] = array
506(
56a797ef 507 'pattern' => '@^(49|50)$@',
74aee2dc
DO
508 'replacement' => '\\1',
509 'dict_key' => 24,
56a797ef
DO
510 'label' => '\\1',
511 'try_next_proc' => FALSE,
74aee2dc
DO
512);
513
13b28c20
DO
514$iftable_processors['procurve-51-to-52-1000SFP'] = array
515(
516 'pattern' => '@^(51|52)$@',
517 'replacement' => '\\1',
518 'dict_key' => '4-1077',
519 'label' => '\\1',
520 'try_next_proc' => FALSE,
521);
522
5d930daf
AD
523$iftable_processors['procurve-49-to-52-10000SFP+'] = array
524(
525 'pattern' => '@^(49|50|51|52)$@',
526 'replacement' => '\\1',
527 'dict_key' => '9-1084',
528 'label' => '\\1',
529 'try_next_proc' => FALSE,
530);
531
4a2358b3
DO
532$iftable_processors['gbe2csfp-1-to-16'] = array
533(
534 'pattern' => '@^Downlink(\d+)$@',
535 'replacement' => '\\0',
536 'dict_key' => '1-1603',
537 'label' => '\\1',
538 'try_next_proc' => FALSE,
539);
540
541$iftable_processors['gbe2csfp-17'] = array
542(
543 'pattern' => '@^Xconnect1$@',
544 'replacement' => '\\0',
545 'dict_key' => '1-1603',
546 'label' => '17',
547 'try_next_proc' => FALSE,
548);
549
550$iftable_processors['gbe2csfp-18'] = array
551(
552 'pattern' => '@^Xconnect2$@',
553 'replacement' => '\\0',
554 'dict_key' => '1-1603',
555 'label' => '18',
556 'try_next_proc' => FALSE,
557);
558
559$iftable_processors['gbe2csfp-19'] = array
560(
561 'pattern' => '@^Mgmt$@',
562 'replacement' => '\\0',
563 'dict_key' => '1-1604',
564 'label' => '19',
565 'try_next_proc' => FALSE,
566);
567
568$iftable_processors['gbe2csfp-20'] = array
569(
570 'pattern' => '@^Uplink1$@',
571 'replacement' => '\\0',
572 'dict_key' => '1-24',
573 'label' => '20',
574 'try_next_proc' => FALSE,
575);
576
577$iftable_processors['gbe2csfp-21sfp'] = array
578(
579 'pattern' => '@^Uplink2$@',
580 'replacement' => '\\0',
581 'dict_key' => '4-1077',
582 'label' => '21',
583 'try_next_proc' => TRUE,
584);
585
586$iftable_processors['gbe2csfp-21'] = array
587(
588 'pattern' => '@^Uplink2$@',
589 'replacement' => '\\0',
590 'dict_key' => '1-24',
591 'label' => '21',
592 'try_next_proc' => FALSE,
593);
594
595$iftable_processors['gbe2csfp-22sfp'] = array
596(
597 'pattern' => '@^Uplink3$@',
598 'replacement' => '\\0',
599 'dict_key' => '4-1077',
600 'label' => '22',
601 'try_next_proc' => TRUE,
602);
603
604$iftable_processors['gbe2csfp-22'] = array
605(
606 'pattern' => '@^Uplink3$@',
607 'replacement' => '\\0',
608 'dict_key' => '1-24',
609 'label' => '22',
610 'try_next_proc' => FALSE,
611);
612
613$iftable_processors['gbe2csfp-23sfp'] = array
614(
615 'pattern' => '@^Uplink4$@',
616 'replacement' => '\\0',
617 'dict_key' => '4-1077',
618 'label' => '23',
619 'try_next_proc' => TRUE,
620);
621
622$iftable_processors['gbe2csfp-23'] = array
623(
624 'pattern' => '@^Uplink4$@',
625 'replacement' => '\\0',
626 'dict_key' => '1-24',
627 'label' => '23',
628 'try_next_proc' => FALSE,
629);
630
631$iftable_processors['gbe2csfp-24sfp'] = array
632(
633 'pattern' => '@^Uplink5$@',
634 'replacement' => '\\0',
635 'dict_key' => '4-1077',
636 'label' => '24',
637 'try_next_proc' => TRUE,
638);
639
640$iftable_processors['gbe2csfp-24'] = array
641(
642 'pattern' => '@^Uplink5$@',
643 'replacement' => '\\0',
644 'dict_key' => '1-24',
645 'label' => '24',
646 'try_next_proc' => FALSE,
647);
648
6be06cbb 649$iftable_processors['netgear-chassis-any-1000T'] = array
74aee2dc 650(
32fae2ee
DO
651 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) Gigabit - Level$@',
652 'replacement' => '\\1/\\2/\\3',
56a797ef 653 'dict_key' => 24,
32fae2ee 654 'label' => '\\3',
56a797ef
DO
655 'try_next_proc' => FALSE,
656);
657
e326551d
AD
658$iftable_processors['netgear-chassis-any-1000SFP'] = array
659(
660 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) Gigabit - Level$@',
661 'replacement' => '\\1/\\2/\\3',
662 'dict_key' => '4-1077',
663 'label' => '\\3',
664 'try_next_proc' => FALSE,
665);
666
6be06cbb
DO
667$iftable_processors['netgear-chassis-21-to-24-1000Tcombo'] = array
668(
32fae2ee
DO
669 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (21|22|23|24) Gigabit - Level$@',
670 'replacement' => '\\1/\\2/\\3',
6be06cbb 671 'dict_key' => 24,
32fae2ee 672 'label' => '\\3T',
6be06cbb
DO
673 'try_next_proc' => FALSE,
674);
675
676$iftable_processors['netgear-chassis-21-to-24-1000SFP'] = array
677(
32fae2ee
DO
678 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (21|22|23|24) Gigabit - Level$@',
679 'replacement' => '\\1/\\2/\\3',
8536e20a 680 'dict_key' => '4-1077',
32fae2ee 681 'label' => '\\3F',
6be06cbb
DO
682 'try_next_proc' => TRUE,
683);
684
3e8ad42f
DO
685$iftable_processors['netgear-chassis-any-1000SFPcombo'] = array
686(
32fae2ee
DO
687 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) Gigabit - Level$@',
688 'replacement' => '\\1/\\2/\\3',
3e8ad42f 689 'dict_key' => '4-1077',
32fae2ee 690 'label' => '\\3F',
3e8ad42f
DO
691 'try_next_proc' => TRUE,
692);
693
fc807353
DO
694$iftable_processors['netgear-chassis-any-100TX'] = array
695(
32fae2ee
DO
696 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) 10/100 Copper - Level$@',
697 'replacement' => '\\1/\\2/\\3',
fc807353 698 'dict_key' => 19,
32fae2ee 699 'label' => '\\3',
fc807353
DO
700 'try_next_proc' => FALSE,
701);
702
ac02ab69
AD
703$iftable_processors['netgear-49-to-50-combo-1000SFP'] = array
704(
705 'pattern' => '@^GbE_(49|50)$@',
706 'replacement' => '\\1',
707 'dict_key' => '4-1077',
708 'label' => '\\1F',
709 'try_next_proc' => TRUE,
710);
711
712$iftable_processors['netgear-49-to-50-combo-1000T'] = array
713(
714 'pattern' => '@^GbE_(49|50)$@',
715 'replacement' => '\\1',
716 'dict_key' => '1-24',
717 'label' => '\\1T',
718 'try_next_proc' => FALSE,
719);
720
721$iftable_processors['netgear-any-100TX'] = array
722(
723 'pattern' => '@^FE_(\d+)$@',
724 'replacement' => '\\1',
725 'dict_key' => 19,
726 'label' => '\\1',
727 'try_next_proc' => FALSE,
728);
729
56a797ef
DO
730$iftable_processors['nortel-any-1000T'] = array
731(
732 'pattern' => '@^Ethernet Port on unit 1, port ([[:digit:]]+)$@',
74aee2dc
DO
733 'replacement' => '\\1',
734 'dict_key' => 24,
56a797ef
DO
735 'label' => '\\1',
736 'try_next_proc' => FALSE,
74aee2dc
DO
737);
738
fb3e70de
DO
739$iftable_processors['smc-combo-45-to-48'] = array
740(
741 'pattern' => '@^Ethernet Port on unit 1, port (45|46|47|48)$@',
742 'replacement' => '\\1',
743 'dict_key' => '4-1077',
744 'label' => '\\1',
745 'try_next_proc' => TRUE,
746);
747
13b28c20
DO
748$iftable_processors['smc2-combo-21-to-24'] = array
749(
750 'pattern' => '@^Port #(21|22|23|24)$@',
751 'replacement' => '\\1',
752 'dict_key' => '4-1077',
753 'label' => '\\1',
754 'try_next_proc' => TRUE,
755);
756
757$iftable_processors['smc2-combo-23-to-24'] = array
758(
759 'pattern' => '@^Port #(23|24)$@',
760 'replacement' => '\\1',
761 'dict_key' => '4-1077',
762 'label' => '\\1',
763 'try_next_proc' => TRUE,
764);
765
766$iftable_processors['smc2-combo-25-to-28'] = array
767(
768 'pattern' => '@^Port #(25|26|27|28)$@',
769 'replacement' => '\\1',
770 'dict_key' => '4-1077',
771 'label' => '\\1',
772 'try_next_proc' => TRUE,
773);
774
775$iftable_processors['smc2-1000T-25-to-28'] = array
776(
777 'pattern' => '@^Port #(25|26|27|28)$@',
778 'replacement' => '\\1',
779 'dict_key' => '1-24',
780 'label' => '\\1',
781 'try_next_proc' => FALSE,
782);
783
784$iftable_processors['smc2-any-1000T'] = array
785(
786 'pattern' => '@^Port #(\d+)$@',
787 'replacement' => '\\1',
788 'dict_key' => '1-24',
789 'label' => '\\1',
790 'try_next_proc' => FALSE,
791);
792
793$iftable_processors['smc2-any-100TX'] = array
794(
795 'pattern' => '@^Port #(\d+)$@',
796 'replacement' => '\\1',
797 'dict_key' => '1-19',
798 'label' => '\\1',
799 'try_next_proc' => FALSE,
800);
801
91389980
DO
802$iftable_processors['juniper-DPCE-R-4XGE-XFP'] = array
803(
7d69a266
DO
804 'pattern' => '@^xe-([[:digit:]]+)/([[:digit:]]+/[[:digit:]]+)$@',
805 'replacement' => '\\0',
91389980 806 'dict_key' => '8-1082', // XFP/empty
7d69a266
DO
807 'label' => 'slot \\1 port \\2',
808 'try_next_proc' => FALSE,
809);
810
1f54e1ba
DO
811$iftable_processors['juniper-ex-pic0-1000T'] = array
812(
813 'pattern' => '@^ge-([[:digit:]]+)/0/([[:digit:]]+)$@',
814 'replacement' => '\\0',
815 'dict_key' => '1-24',
816 'label' => 'unit \\1 port \\2',
817 'try_next_proc' => FALSE,
818);
819
820$iftable_processors['juniper-ex-mgmt'] = array
821(
822 'pattern' => '/^me0$/',
823 'replacement' => 'me0',
824 'dict_key' => '1-24',
825 'label' => 'MGMT',
826 'try_next_proc' => FALSE,
827);
828
7d69a266
DO
829$iftable_processors['quidway-21-to-24-comboT'] = array
830(
831 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)(21|22|23|24)$@',
832 'replacement' => 'gi\\1\\2',
833 'dict_key' => '1-24',
834 'label' => '\\2',
835 'try_next_proc' => TRUE,
836);
837
24c3e444
DO
838$iftable_processors['quidway-21-to-24-comboSFP'] = array
839(
840 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)(21|22|23|24)$@',
841 'replacement' => 'gi\\1\\2',
842 'dict_key' => '4-1077',
843 'label' => '\\2',
844 'try_next_proc' => TRUE,
845);
846
b55f8de3
DO
847$iftable_processors['quidway-slot1-SFP'] = array
848(
849 'pattern' => '@^GigabitEthernet0/1/([[:digit:]]+)$@',
850 'replacement' => 'gi0/1/\\1',
851 'dict_key' => '4-1077',
852 'label' => 'SFP\\1',
853 'try_next_proc' => FALSE,
854);
855
7d69a266
DO
856$iftable_processors['quidway-any-1000SFP'] = array
857(
858 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
859 'replacement' => 'gi\\1\\2',
860 'dict_key' => '4-1077', // empty SFP-1000
861 'label' => '\\2',
862 'try_next_proc' => FALSE,
863);
864
24c3e444
DO
865$iftable_processors['quidway-any-1000T'] = array
866(
867 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
868 'replacement' => 'gi\\1\\2',
869 'dict_key' => '1-24',
870 'label' => '\\2',
871 'try_next_proc' => FALSE,
872);
873
7d69a266
DO
874$iftable_processors['quidway-XFP'] = array
875(
876 'pattern' => '@^XGigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
877 'replacement' => 'xg\\1\\2',
878 'dict_key' => '8-1082',
879 'label' => '\\2',
880 'try_next_proc' => FALSE,
881);
882
883$iftable_processors['quidway-mgmt'] = array
884(
885 'pattern' => '@^MEth([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
886 'replacement' => 'me\\1\\2',
887 'dict_key' => '1-19',
888 'label' => 'eth',
91389980
DO
889 'try_next_proc' => FALSE,
890);
891
661b3fdb
DO
892$iftable_processors['fgs-1-to-4-comboSFP'] = array
893(
894 # only 4 first copper ports of 1st unit of a stack
895 'pattern' => '@^GigabitEthernet1/1/(1|2|3|4)$@',
896 'replacement' => 'e1/1/\\1',
897 'dict_key' => '4-1077',
898 'label' => '\\1F',
899 'try_next_proc' => TRUE,
900);
901
902$iftable_processors['fgs-any-1000T'] = array
903(
6c32c3ff
AA
904 'pattern' => '@^GigabitEthernet(0|1)/1/([[:digit:]]+)$@',
905 'replacement' => 'e\\1/1/\\2',
661b3fdb 906 'dict_key' => '1-24',
6c32c3ff
AA
907 'label' => '\\2',
908 'try_next_proc' => FALSE,
909);
910
911$iftable_processors['fls624-combo'] = array
912(
913 'pattern' => '@^GigabitEthernet0/1/(21|22|23|24)$@',
914 'replacement' => 'e0/1/\\1',
915 'dict_key' => '4-1077',
661b3fdb 916 'label' => '\\1',
6c32c3ff
AA
917 'try_next_proc' => TRUE,
918);
919
920$iftable_processors['fls648-combo'] = array
921(
922 'pattern' => '@^GigabitEthernet0/1/(45|46|47|48)$@',
923 'replacement' => 'e0/1/\\1',
924 'dict_key' => '4-1077',
925 'label' => '\\1',
926 'try_next_proc' => TRUE,
927);
928
929# These can be CX4, but that is not handled here.
930$iftable_processors['fls-uplinks'] = array
931(
932 'pattern' => '@^10GigabitEthernet0/([234])/1$@',
933 'replacement' => 'e0/\\1/1',
934 'dict_key' => '8-1082',
935 'label' => 'Slot \\1',
661b3fdb
DO
936 'try_next_proc' => FALSE,
937);
938
939$iftable_processors['fgs-uplinks'] = array
940(
941 'pattern' => '@^10GigabitEthernet1/2/([[:digit:]]+)$@',
942 'replacement' => 'e1/2/\\1',
943 'dict_key' => '8-1082', // default is XFP, but may be overridden to CX4
944 'label' => 'Slot2 \\1',
945 'try_next_proc' => FALSE,
946);
947
ec523868
DO
948$iftable_processors['fcx-uplinks'] = array
949(
950 'pattern' => '@^10GigabitEthernet1/2/([[:digit:]]+)$@',
951 'replacement' => 'e1/2/\\1',
952 'dict_key' => '9-1084',
953 'label' => 'X\\1',
954 'try_next_proc' => FALSE,
955);
956
957$iftable_processors['fcx-management'] = array
958(
959 'pattern' => '@^Management$@',
960 'replacement' => 'management1',
961 'dict_key' => '1-24',
962 'label' => 'Management',
963 'try_next_proc' => FALSE,
964);
965
4eeadb79
DO
966$iftable_processors['summit-25-to-26-XFP-uplinks'] = array
967(
968 'pattern' => '@^.+ Port (25|26)$@',
969 'replacement' => '\\1',
970 'dict_key' => '8-1082',
971 'label' => '\\1',
972 'try_next_proc' => FALSE,
973);
974
dbcf1931
DO
975$iftable_processors['summit-27-to-30-XFP-uplinks'] = array
976(
977 'pattern' => '@^.+ Port (27|28|29|30)$@',
978 'replacement' => '\\1',
979 'dict_key' => '8-1082',
980 'label' => '\\1',
981 'try_next_proc' => FALSE,
982);
983
4eeadb79
DO
984$iftable_processors['summit-21-to-24-comboSFP'] = array
985(
986 'pattern' => '@^.+ Port (21|22|23|24)$@',
987 'replacement' => '\\1',
988 'dict_key' => '4-1077',
989 'label' => '\\1',
990 'try_next_proc' => TRUE,
991);
992
dbcf1931
DO
993$iftable_processors['summit-13-to-24-comboT'] = array
994(
995 'pattern' => '@^.+ Port (1[3456789]|2[01234])$@',
996 'replacement' => '\\1',
997 'dict_key' => '1-24',
998 'label' => '\\1',
999 'try_next_proc' => TRUE,
1000);
1001
4eeadb79
DO
1002$iftable_processors['summit-any-1000T'] = array
1003(
1004 'pattern' => '@^.+ Port ([[:digit:]]+)$@',
1005 'replacement' => '\\1',
1006 'dict_key' => '1-24',
1007 'label' => '\\1',
1008 'try_next_proc' => FALSE,
1009);
1010
dbcf1931
DO
1011$iftable_processors['summit-any-SFP'] = array
1012(
1013 'pattern' => '@^.+ Port ([[:digit:]]+)$@',
1014 'replacement' => '\\1',
1015 'dict_key' => '4-1077',
1016 'label' => '\\1',
1017 'try_next_proc' => FALSE,
1018);
1019
4eeadb79
DO
1020$iftable_processors['summit-management'] = array
1021(
1022 'pattern' => '@^Management Port$@',
1023 'replacement' => 'mgmt',
1024 'dict_key' => '1-19',
21d38e6b 1025 'label' => 'management',
4eeadb79
DO
1026 'try_next_proc' => FALSE,
1027);
1028
13b28c20
DO
1029$iftable_processors['C3KX-NM-10000'] = array
1030(
1031 'pattern' => '@^TenGigabitEthernet1/(\d+)$@',
1032 'replacement' => 'te1/\\1',
1033 'dict_key' => '9-1084',
1034 'label' => 'NM TE\\1',
1035 'try_next_proc' => FALSE,
1036);
1037
1038$iftable_processors['C3KX-NM-1000'] = array
1039(
1040 'pattern' => '@^GigabitEthernet1/(\d+)$@',
1041 'replacement' => 'gi1/\\1',
1042 'dict_key' => '4-1077',
1043 'label' => 'NM G\\1',
1044 'try_next_proc' => FALSE,
1045);
1046
fe8f91c0 1047$iftable_processors['arista-any-SFP+'] = array
06a03a99 1048(
92df4b0e 1049 'pattern' => '@^Ethernet([[:digit:]]+)$@',
1b3176ac 1050 'replacement' => 'e\\1',
92df4b0e
AD
1051 'dict_key' => '9-1084',
1052 'label' => '\\1',
1053 'try_next_proc' => FALSE,
06a03a99
AD
1054);
1055
1056$iftable_processors['arista-management'] = array
1057(
92df4b0e 1058 'pattern' => '@^Management(1|2)$@',
ec2907cf 1059 'replacement' => 'Ma\\1',
92df4b0e 1060 'dict_key' => '1-24',
ec2907cf 1061 'label' => '\\0',
92df4b0e
AD
1062 'try_next_proc' => FALSE,
1063);
1064
1065$iftable_processors['dell-33xx-any-combo-1000SFP'] = array
1066(
1067 'pattern' => '@^1/g(\d+)$@',
1068 'replacement' => 'g\\1',
1069 'dict_key' => '4-1077',
1070 'label' => 'g\\1',
1071 'try_next_proc' => TRUE,
1072);
1073
1074$iftable_processors['dell-33xx-any-1000T'] = array
1075(
1076 'pattern' => '@^1/g(\d+)$@',
1077 'replacement' => 'g\\1',
1078 'dict_key' => '1-24',
1079 'label' => 'g\\1',
1080 'try_next_proc' => FALSE,
1081);
1082
8595dfd0
AD
1083$iftable_processors['dell-33xx-any-100TX'] = array
1084(
1085 'pattern' => '@^1/e(\d+)$@',
1086 'replacement' => 'e\\1',
1087 'dict_key' => 19,
1088 'label' => 'e\\1',
1089 'try_next_proc' => FALSE,
1090);
1091
1ce6a44d
AD
1092$iftable_processors['dell-5224-21-to-24-combo-1000SFP'] = array
1093(
1094 'pattern' => '@^EtherNet Port on unit 1, port:(21|22|23|24)$@',
1095 'replacement' => 'g\\1',
1096 'dict_key' => '4-1077',
1097 'label' => 'g\\1',
1098 'try_next_proc' => TRUE,
1099);
1100
1101$iftable_processors['dell-52xx-any-1000T'] = array
1102(
1103 'pattern' => '@^EtherNet Port on unit 1, port:(\d+)$@',
1104 'replacement' => 'g\\1',
1105 'dict_key' => 24,
1106 'label' => 'g\\1',
1107 'try_next_proc' => FALSE,
1108);
1109
92df4b0e
AD
1110$iftable_processors['dell-g1-to-g2-1000SFP'] = array
1111(
1112 'pattern' => '@^g(1|2)$@',
1113 'replacement' => 'g\\1',
1114 'dict_key' => '4-1077',
1115 'label' => 'g\\1',
1116 'try_next_proc' => FALSE,
1117);
1118
1119$iftable_processors['dell-g3-to-g4-1000T'] = array
1120(
1121 'pattern' => '@^g(3|4)$@',
1122 'replacement' => 'g\\1',
1123 'dict_key' => '1-24',
1124 'label' => 'g\\1',
1125 'try_next_proc' => FALSE,
1126);
1127
1b10e7cf
AD
1128$iftable_processors['dell-g17-to-g24-combo-1000T'] = array
1129(
1130 'pattern' => '@^g(17|18|19|20|21|22|23|24)$@',
1131 'replacement' => 'g\\1',
1132 'dict_key' => '1-24',
1133 'label' => 'g\\1',
92df4b0e
AD
1134 'try_next_proc' => TRUE,
1135);
1136
8595dfd0 1137$iftable_processors['dell-g21-to-g24-combo-1000SFP'] = array
92df4b0e
AD
1138(
1139 'pattern' => '@^g(21|22|23|24)$@',
1140 'replacement' => 'g\\1',
92df4b0e
AD
1141 'dict_key' => '4-1077',
1142 'label' => 'g\\1',
1143 'try_next_proc' => TRUE,
1144);
1145
92df4b0e
AD
1146$iftable_processors['dell-any-100TX'] = array
1147(
1148 'pattern' => '@^e(\d+)$@',
1149 'replacement' => 'e\\1',
1150 'dict_key' => 19,
1151 'label' => 'e\\1',
1152 'try_next_proc' => FALSE,
1153);
1154
1b10e7cf
AD
1155$iftable_processors['dell-any-1000SFP'] = array
1156(
1157 'pattern' => '@^g(\d+)$@',
1158 'replacement' => 'g\\1',
1159 'dict_key' => '4-1077',
1160 'label' => 'g\\1',
1161 'try_next_proc' => FALSE,
1162);
1163
1cd6eca3
AD
1164$iftable_processors['3com-49-to-52-1000SFP'] = array
1165(
1166 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(49|50|51|52)$@',
1167 'replacement' => '\\1/\\2/\\3',
1168 'dict_key' => '4-1077',
1169 'label' => '\\3',
1170 'try_next_proc' => FALSE,
1171);
1172
1173$iftable_processors['3com-any-1000T'] = array
1174(
1175 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(\d+)$@',
1176 'replacement' => '\\1/\\2/\\3',
1177 'dict_key' => 24,
1178 'label' => '\\3',
1179 'try_next_proc' => FALSE,
1180);
1181
536e7323 1182global $known_switches;
74aee2dc
DO
1183$known_switches = array // key is system OID w/o "enterprises" prefix
1184(
feee5e5a
DO
1185 '9.1.217' => array
1186 (
1187 'dict_key' => 124,
1188 'text' => 'WS-C2924-XL: 24 RJ-45/10-100TX',
1189 'processors' => array ('catalyst-chassis-any-100TX'),
10e81331
AD
1190 ),
1191 '9.1.220' => array
1192 (
1193 'dict_key' => 1719,
1194 'text' => 'WS-C2924M-XL: 24 RJ-45/10-100TX',
1195 'processors' => array ('catalyst-chassis-any-100TX'),
feee5e5a 1196 ),
462e65ac
DO
1197 '9.1.246' => array
1198 (
1199 'dict_key' => 391,
1200 'text' => 'WS-C3508G-XL: 8 GBIC/1000',
1201 'processors' => array ('catalyst-chassis-any-1000GBIC'),
1202 ),
d7466acb
DO
1203 '9.1.248' => array
1204 (
1205 'dict_key' => 393,
1206 'text' => 'WS-C3524-XL: 24 RJ-45/10-100TX + 2 GBIC/1000',
1207 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1208 ),
cfd07952
DO
1209 '9.1.278' => array
1210 (
1211 'dict_key' => 395,
1212 'text' => 'WS-C3548-XL: 48 RJ-45/10-100TX + 2 GBIC/1000',
1213 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1214 ),
74aee2dc
DO
1215 '9.1.324' => array
1216 (
1217 'dict_key' => 380,
1218 'text' => 'WS-C2950-24: 24 RJ-45/10-100TX',
6be06cbb 1219 'processors' => array ('catalyst-chassis-any-100TX'),
74aee2dc
DO
1220 ),
1221 '9.1.325' => array
1222 (
1223 'dict_key' => 382,
1224 'text' => 'WS-C2950C-24: 24 RJ-45/10-100TX + 2 MT-RJ/100FX fiber',
6be06cbb 1225 'processors' => array ('catalyst-chassis-25-to-26-100FX/MT-RJ', 'catalyst-chassis-any-100TX'),
74aee2dc 1226 ),
a3432267
DO
1227 '9.1.359' => array
1228 (
1229 'dict_key' => 386,
1230 'text' => 'WS-C2950T-24: 24 RJ-45/10-100TX + 2 1000T uplinks',
1231 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
1232 ),
8fe7aefe
AD
1233 '9.1.366' => array
1234 (
1235 'dict_key' => 400,
1236 'text' => 'WS-C3550-24: 24 RJ-45/10-100TX + 2 GBIC/1000',
1237 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1238 ),
13b28c20
DO
1239 '9.1.559' => array
1240 (
1241 'dict_key' => 387,
1242 'text' => 'WS-C2950T-48: 48 RJ-45/10-100TX + 2 1000T uplinks',
1243 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
1244 ),
e41fafef
AD
1245 '9.1.694' => array
1246 (
1247 'dict_key' => 1710,
1248 'text' => 'WS-C2960-24TC-L: 24 RJ-45/10-100TX + 2 combo-gig',
1249 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1250 ),
7e87a291
DO
1251 '9.1.695' => array
1252 (
2b512043 1253 'dict_key' => 1590,
7e87a291
DO
1254 'text' => 'WS-C2960-48TC-L: 48 RJ-45/10-100TX + 2 combo-gig',
1255 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1256 ),
e8ea3f02
AD
1257 '9.1.930' => array
1258 (
aca86e3f 1259 'dict_key' => 1607,
e8ea3f02
AD
1260 'text' => 'WS-C3560E-12D-S: 12 X2/10000 w/TwinGig + OOBM',
1261 'processors' => array
1262 (
1263 'catalyst-chassis-any-1000SFP',
1264 'catalyst-chassis-uplinks-10000X2',
1265 'catalyst-chassis-mgmt',
1266 ),
1267 ),
da273595
AD
1268 '9.1.956' => array
1269 (
1270 'dict_key' => 1721,
1271 'text' => 'WS-C3560E-12SD: 12 SFP/1000 +2 X2/10000 + OOBM',
1272 'processors' => array
1273 (
1274 'catalyst-chassis-any-1000SFP',
1275 'catalyst-chassis-uplinks-10000X2',
1276 'catalyst-chassis-mgmt',
1277 ),
1278 ),
13b28c20
DO
1279 '9.1.793' => array
1280 (
1281 'dict_key' => 1575,
1282 'text' => 'WS-C3560E-24TD: 24 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig + OOBM',
1283 'processors' => array
1284 (
1285 'catalyst-chassis-25-to-28-1000SFP', // TwinGig
1286 'catalyst-chassis-any-1000T',
1287 'catalyst-chassis-uplinks-10000X2',
1288 'catalyst-chassis-mgmt',
1289 ),
1290 ),
1291 '9.1.794' => array
1292 (
1293 'dict_key' => 1574,
1294 'text' => 'WS-C3560E-48TD: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig + OOBM',
1295 'processors' => array
1296 (
1297 'catalyst-chassis-49-to-52-1000SFP', // TwinGig
1298 'catalyst-chassis-any-1000T',
1299 'catalyst-chassis-uplinks-10000X2',
1300 'catalyst-chassis-mgmt',
1301 ),
1302 ),
38bd461c
AA
1303 '9.1.1257' => array
1304 (
1305 'dict_key' => 167,
1306 'text' => 'WS-C2960G-24TS-S: 24 RJ-45/10-100-1000T(X)',
1307 'processors' => array ('catalyst-chassis-25-to-26-1000SFP', 'catalyst-chassis-mgmt', 'catalyst-chassis-any-1000T'),
1308 ),
a048e8fc
DO
1309 '9.1.799' => array
1310 (
1311 'dict_key' => 168,
1312 'text' => 'WS-C2960G-8TC-L: 7 RJ-45/10-100-1000T(X) + 1 combo-gig',
1313 'processors' => array ('catalyst-chassis-8-combo-1000SFP', 'catalyst-chassis-any-1000T'),
1314 ),
74aee2dc
DO
1315 '9.1.696' => array
1316 (
1317 'dict_key' => 167,
1318 'text' => 'WS-C2960G-24TC-L: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
6be06cbb 1319 'processors' => array ('catalyst-chassis-21-to-24-combo-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1320 ),
1321 '9.1.697' => array
1322 (
1323 'dict_key' => 166,
1324 'text' => 'WS-C2960G-48TC-L: 44 RJ-45/10-100-1000T(X) + 4 combo-gig',
6be06cbb 1325 'processors' => array ('catalyst-chassis-45-to-48-combo-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc 1326 ),
38bd461c
AA
1327 '9.1.928' => array
1328 (
1329 'dict_key' => 163,
1330 'text' => 'WS-C2960-24TC-S: 24 RJ-45/10-100TX + 2 combo-gig',
1331 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-100TX'),
1332 ),
74aee2dc
DO
1333 '9.1.716' => array
1334 (
1335 'dict_key' => 164,
1336 'text' => 'WS-C2960-24TT-L: 24 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1337 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1338 ),
1339 '9.1.717' => array
1340 (
13b28c20 1341 'dict_key' => 1572,
74aee2dc 1342 'text' => 'WS-C2960-48TT-L: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1343 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
74aee2dc 1344 ),
47a523af
AD
1345 '9.1.724' => array
1346 (
1347 'dict_key' => 160,
1348 'text' => 'WS-CE500-24TT: 24 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1349 'processors' => array ('catalyst-any-100TX', 'catalyst-any-1000T'),
1350 ),
bc8b21f0
AD
1351 '9.1.727' => array
1352 (
1353 'dict_key' => 161,
1354 'text' => 'WS-CE500G-12TC: 8 RJ-45/10-100/1000T(X) + 4 combo',
1355 'processors' => array ('catalyst-9-to-12-1000SFP', 'catalyst-9-to-12-1000T', 'catalyst-any-1000T'),
1356 ),
ec523868
DO
1357 '9.1.950' => array
1358 (
1359 'dict_key' => 1347,
1360 'text' => 'WS-C2960-24PC: 44 RJ-45/10-100TX + 2 combo-gig',
1361 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1362 ),
4d043be1
AA
1363 '9.1.927' => array
1364 (
1365 'dict_key' => 140,
2b512043
DO
1366 'text' => 'WS-C2960-48TC-S: 48 RJ-45/10-100TX + 2 combo-gig',
1367 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
4d043be1 1368 ),
13b28c20
DO
1369 '9.1.1005' => array
1370 (
1371 'dict_key' => 1573,
1372 'text' => 'WS-C2960-48TT-S: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1373 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
1374 ),
74aee2dc
DO
1375 '9.1.527' => array
1376 (
1377 'dict_key' => 210,
1378 'text' => 'WS-C2970G-24T: 24 RJ-45/10-100-1000T(X)',
6be06cbb 1379 'processors' => array ('catalyst-chassis-any-1000T'),
74aee2dc
DO
1380 ),
1381 '9.1.561' => array
1382 (
1383 'dict_key' => 115,
1384 'text' => 'WS-C2970G-24TS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1385 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1386 ),
1387 '9.1.633' => array
1388 (
1389 'dict_key' => 169,
1390 'text' => 'WS-C3560-24TS: 24 RJ-45/10-100TX + 2 SFP/1000',
6be06cbb 1391 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1392 ),
1393 '9.1.634' => array
1394 (
1395 'dict_key' => 170,
1396 'text' => 'WS-C3560-48TS: 48 RJ-45/10-100TX + 4 SFP/1000',
6be06cbb 1397 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1398 ),
1399 '9.1.563' => array
1400 (
1401 'dict_key' => 171,
1402 'text' => 'WS-C3560-24PS: 24 RJ-45/10-100TX + 2 SFP/1000',
6be06cbb 1403 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1404 ),
1405 '9.1.564' => array
1406 (
1407 'dict_key' => 172,
1408 'text' => 'WS-C3560-48PS: 48 RJ-45/10-100TX + 4 SFP/1000',
6be06cbb 1409 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1410 ),
1411 '9.1.614' => array
1412 (
1413 'dict_key' => 175,
1414 'text' => 'WS-C3560G-24PS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1415 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1416 ),
1417 '9.1.615' => array
1418 (
1419 'dict_key' => 173,
1420 'text' => 'WS-C3560G-24TS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1421 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1422 ),
1423 '9.1.616' => array
1424 (
1425 'dict_key' => 176,
1426 'text' => 'WS-C3560G-48PS: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1427 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1428 ),
1429 '9.1.617' => array
1430 (
1431 'dict_key' => 174,
1432 'text' => 'WS-C3560G-48TS: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1433 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1434 ),
1435 '9.1.626' => array
1436 (
1437 'dict_key' => 147,
56a797ef 1438 'text' => 'WS-C4948: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000 + 1 RJ-45/100TX (OOB mgmt)',
cbc30061 1439 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-uplinks-1000T', 'catalyst-chassis-mgmt'),
74aee2dc
DO
1440 ),
1441 '9.1.659' => array
1442 (
1443 'dict_key' => 377,
56a797ef 1444 'text' => 'WS-C4948-10GE: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 + 1 RJ-45/100TX (OOB mgmt)',
cbc30061 1445 'processors' => array ('catalyst-chassis-uplinks-10000X2', 'catalyst-chassis-uplinks-1000T', 'catalyst-chassis-mgmt'),
74aee2dc
DO
1446 ),
1447 '9.1.428' => array
1448 (
1449 'dict_key' => 389,
1450 'text' => 'WS-C2950G-24: 24 RJ-45/10-100TX + 2 GBIC/1000',
6be06cbb 1451 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1452 ),
1453 '9.1.429' => array
1454 (
1455 'dict_key' => 390,
1456 'text' => 'WS-C2950G-48: 48 RJ-45/10-100TX + 2 GBIC/1000',
6be06cbb 1457 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
74aee2dc 1458 ),
b3f84e8e
AD
1459 '9.1.471' => array
1460 (
1461 'dict_key' => 270,
1462 'text' => '2651XM: 2 RJ-45/10-100TX',
1463 'processors' => array ('catalyst-chassis-any-100TX'),
1464 ),
74aee2dc
DO
1465 '9.1.559' => array
1466 (
1467 'dict_key' => 387,
1468 'text' => 'WS-C2950T-48: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1469 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
74aee2dc 1470 ),
8a4bee49
DO
1471 '9.1.560' => array
1472 (
1473 'dict_key' => 384,
1474 'text' => 'WS-C2950SX-48: 48 RJ-45/10-100TX + 2 1000Base-SX',
1475 'processors' => array ('catalyst-chassis-uplinks-1000SX', 'catalyst-chassis-any-100TX'),
1476 ),
74aee2dc
DO
1477 '9.1.749' => array
1478 (
1479 'dict_key' => 989,
1480 'text' => 'WS-CBS3030-DEL: 10 internal/10-100-1000T(X) + 2 RJ-45/10-100-1000T(X) + 4 SFP/1000',
71d6b313 1481 'processors' => array ('catalyst-blade-11-to-12-1000T', 'catalyst-blade-13-to-16-1000SFP', 'catalyst-blade-any-bp/1000T'),
74aee2dc
DO
1482 ),
1483 '9.1.920' => array
1484 (
1485 'dict_key' => 795,
1486 'text' => 'WS-CBS3032-DEL: 16 internal/10-100-1000T(X) + 4 RJ-45/10-100-1000T(X) + 4 SFP/1000',
71d6b313 1487 'processors' => array ('catalyst-blade-17-to-20-1000T', 'catalyst-blade-21-to-24-1000SFP', 'catalyst-blade-any-bp/1000T'),
74aee2dc 1488 ),
2217e284
DO
1489 '9.1.367' => array
1490 (
1491 'dict_key' => 404,
1492 'text' => 'WS-C3550-48: 48 RJ-45/10-100TX + 2 GBIC/1000',
1493 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000GBIC'),
1494 ),
7e87a291
DO
1495 '9.1.368' => array
1496 (
1497 'dict_key' => 398,
1498 'text' => 'WS-C3550-12T: 10 RJ-45/10-100-1000T(X) + 2 GBIC/1000',
1499 'processors' => array ('catalyst-1-to-10-1000T', 'catalyst-11-to-12-GBIC'),
1500 ),
86d614c3
DO
1501 '9.1.431' => array
1502 (
1503 'dict_key' => 399,
1504 'text' => 'WS-C3550-12G: 10 GBIC/1000 + 2 RJ-45/10-100-1000T(X)',
1505 'processors' => array ('catalyst-11-to-12-1000T', 'catalyst-chassis-any-1000GBIC'),
1506 ),
a9bd9e98
DO
1507 '9.1.282' => array
1508 (
1509 'dict_key' => 154,
1510 'text' => 'WS-C6506: modular device (INCOMPLETE!)',
1511 'processors' => array ('catalyst-chassis-any-1000T'),
1512 ),
65b4b21a
DO
1513 '9.1.1104' => array
1514 (
1515 'dict_key' => 1348,
1516 'text' => 'WS-C2350-48TD: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig option',
1517 'processors' => array
1518 (
1519 'catalyst-chassis-49-to-52-1000SFP', // TwinGig actually
1520 'catalyst-chassis-any-1000T',
1521 'catalyst-chassis-uplinks-10000X2',
1522 'catalyst-chassis-mgmt',
1523 ),
1524 ),
712010be
AA
1525 '9.1.1016' => array
1526 (
1527 'dict_key' => 1370,
1528 'text' => 'WS-C2960-48PST-L: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X)',
1529 'processors' => array
1530 (
1531 'catalyst-chassis-any-100TX',
1532 'catalyst-chassis-1-to-2-1000SFP',
1533 'catalyst-chassis-uplinks-1000T',
1534 ),
1535 ),
38c9bb20
DO
1536 '9.1.1208' => array
1537 (
1538 'dict_key' => 1394,
1539 'text' => 'WS-C2960S-24PS-L: 24 RJ-45/10-100-1000T(X) PoE+ + 4 SFP/1000',
1540 'processors' => array
1541 (
1542 'catalyst-chassis-mgmt',
1543 'catalyst-stack-25-to-28-SFP',
1544 'catalyst-stack-any-1000T',
1545 ),
1546 ),
13b28c20
DO
1547 '9.1.1227' => array
1548 (
1549 'dict_key' => 1577,
1550 'text' => 'WS-C3560X-48T: 48 RJ-45/10-100-1000T(X) + network module + OOBM',
1551 'processors' => array
1552 (
1553 'C3KX-NM-10000',
1554 'C3KX-NM-1000',
1555 'catalyst-chassis-any-1000T',
1556 'catalyst-chassis-mgmt',
1557 ),
1558 ),
b475f795
DO
1559 '9.1.1292' => array
1560 (
b0021c43 1561 'dict_key' => 1606,
b475f795
DO
1562 'text' => 'WS-C2360-48TD: 48 RJ-45 GigE + 4 SFP+/10000',
1563 'processors' => array ('catalyst-chassis-any-1000T', 'catalyst-chassis-mgmt', 'catalyst-chassis-uplinks-10000SFP+'),
1564 ),
b0021c43
AD
1565 '9.6.1.82.48.1' => array
1566 (
1567 'dict_key' => 1612,
1568 'text' => 'SF 300-48: 48 RJ-45/10/100 + 2 RJ-45/10-100-1000T(X) + 2 combo-gig',
1569 'processors' => array
1570 (
1571 'generic-gi-3-to-4-combo-1000SFP',
1572 'generic-gi-3-to-4-combo-1000T',
1573 'generic-gi-1-to-2-1000T',
1574 'generic-fa-any-100TX',
1575 ),
1576 'ifDescrOID' => 'ifName',
1577 ),
74aee2dc
DO
1578 '9.12.3.1.3.719' => array
1579 (
1580 'dict_key' => 960,
1581 'text' => 'N5K-C5020: 40 SFP+/10000',
e7662d90 1582 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
74aee2dc 1583 ),
bc45a3a4
DO
1584 '9.12.3.1.3.798' => array
1585 (
1586 'dict_key' => 959,
1587 'text' => 'N5K-C5010: 20 SFP+/10000',
1588 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1589 ),
0533b64d
DO
1590 '9.12.3.1.3.1008' => array
1591 (
1592 'dict_key' => 1412,
1593 'text' => 'N5K-C5548P: 32 SFP+/10000',
1594 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1595 ),
473dd02e
JT
1596 '9.12.3.1.3.1084' => array
1597 (
1598 'dict_key' => 1412,
1599 'text' => 'N5K-C5548P: 32 SFP+/10000',
1600 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1601 ),
13b28c20
DO
1602 '11.2.3.7.11.19' => array
1603 (
1604 'dict_key' => 859,
1605 'text' => 'J4813A: 24 RJ-45/10-100TX + 2 modules of varying type',
1606 'processors' => array ('procurve-chassis-100TX'),
1607 ),
6249647d
AD
1608 '11.2.3.7.11.29' => array
1609 (
1610 'dict_key' => 866,
1611 'text' => 'J4899A: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1612 'processors' => array ('procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
1613 ),
4bbb87a3
AD
1614 '11.2.3.7.11.31' => array
1615 (
1616 'dict_key' => 870,
1617 'text' => 'J4903A: 24 RJ-45/10-100-1000T(X)',
1618 'processors' => array ('procurve-chassis-1000T'),
1619 ),
56a797ef
DO
1620 '11.2.3.7.11.32' => array
1621 (
1622 'dict_key' => 871,
1623 'text' => 'J4904A: 48 RJ-45/10-100-1000T(X)',
1624 'processors' => array ('procurve-chassis-1000T'),
1625 ),
4bbb87a3
AD
1626 '11.2.3.7.11.34' => array
1627 (
1628 'dict_key' => 864,
1629 'text' => 'J8164A: 24 RJ-45/10-100TX POE + 2 RJ-45/10-100-1000T(X)',
1630 'processors' => array ('procurve-25-to-26-1000T', 'procurve-chassis-100TX'),
1631 ),
74aee2dc
DO
1632 '11.2.3.7.11.36' => array
1633 (
1634 'dict_key' => 865,
4bbb87a3 1635 'text' => 'J8164A: 24 RJ-45/10-100TX PoE + 2 RJ-45/10-100-1000T(X)',
56a797ef 1636 'processors' => array ('procurve-25-to-26-1000T', 'procurve-chassis-100TX'),
74aee2dc
DO
1637 ),
1638 '11.2.3.7.11.35' => array
1639 (
1640 'dict_key' => 867,
4bbb87a3 1641 'text' => 'J8165A: 48 RJ-45/10-100TX PoE + 2 RJ-45/10-100-1000T(X)',
56a797ef
DO
1642 'processors' => array ('procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
1643 ),
1644 '11.2.3.7.11.9' => array
1645 (
1646 'dict_key' => 1086,
1647 'text' => 'J4121A: modular system',
1648 'processors' => array ('procurve-modular-100TX'),
74aee2dc 1649 ),
4bbb87a3
AD
1650 '11.2.3.7.11.53' => array
1651 (
1652 'dict_key' => 881,
1653 'text' => 'J8773A: modular system',
1654 'processors' => array ('procurve-modular-1000T'),
1655 ),
13b28c20
DO
1656 '11.2.3.7.11.63' => array
1657 (
1658 'dict_key' => 868,
1659 'text' => 'J9021A: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1660 'processors' => array ('procurve-21-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1661 ),
1662 '11.2.3.7.11.65' => array
1663 (
1664 'dict_key' => 850,
1665 'text' => 'J9028A: 22 RJ-45/10-100-1000T(X) + 2 combo-gig',
1666 'processors' => array ('smc2-combo-23-to-24', 'smc2-any-1000T'),
1667 ),
83aedacd
AD
1668 '11.2.3.7.11.78' => array
1669 (
1670 'dict_key' => 861,
1671 'text' => 'J9087A: 24 RJ-45/10-100TX PoE + 2 1000T + 2 SFP-1000',
1672 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
1673 ),
1674 '11.2.3.7.11.80' => array
1675 (
1676 'dict_key' => 1570,
1677 'text' => 'J9086A: 24 RJ-45/10-100TX 12 PoE + 2 1000T + 2 SFP-1000',
1678 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
1679 ),
13b28c20
DO
1680 '11.2.3.7.11.86' => array
1681 (
1682 'dict_key' => 1571,
1683 'text' => 'J9145A: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1684 'processors' => array ('procurve-21-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1685 ),
4b43f713
DO
1686 '11.2.3.7.11.87' => array
1687 (
1688 'dict_key' => 1349,
13b28c20 1689 'text' => 'J9147A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
4b43f713
DO
1690 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1691 ),
f8de6305
DO
1692 '11.2.3.7.11.85' => array
1693 (
1694 'dict_key' => 1600,
1695 'text' => 'J9148A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1696 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1697 ),
db5d7da5
AD
1698 '11.2.3.7.11.88' => array
1699 (
1700 'dict_key' => 1349,
1701 'text' => 'J9279A: 22 RJ-45/10-100-1000T(X) + 2 combo-gig + varying uplinks',
1702 'processors' => array ('procurve-23-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1703 ),
13b28c20
DO
1704 '11.2.3.7.11.79' => array
1705 (
1706 'dict_key' => 863,
1707 'text' => 'J9089A: 48 RJ-45/10-100TX PoE + 2 1000T + 2 SFP-1000',
1708 'processors' => array ('procurve-49-to-50-1000T', 'procurve-51-to-52-1000SFP', 'procurve-chassis-100TX'),
4bbb87a3
AD
1709 ),
1710 '11.2.3.7.11.95' => array
1711 (
1712 'dict_key' => 1711,
1713 'text' => 'J9138A: 24 RJ-45/10-100TX PoE + 2 1000T + 2 combo-gig',
1714 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
13b28c20 1715 ),
5d930daf
AD
1716 '11.2.3.7.11.105' => array
1717 (
1718 'dict_key' => 1641,
1719 'text' => 'J9452A: 48 RJ-45/10-100-1000T + 2 SFP-10000+',
1720 'processors' => array ('procurve-49-to-52-10000SFP+', 'procurve-chassis-1000T'),
1721 ),
4a2358b3
DO
1722 '11.2.3.7.11.33.4.1.1' => array
1723 (
1724 'dict_key' => 1605,
1725 'text' => 'HP GbE2c w/SFP',
1726 'processors' => array
1727 (
1728 'gbe2csfp-1-to-16',
1729 'gbe2csfp-17',
1730 'gbe2csfp-18',
1731 'gbe2csfp-19',
1732 'gbe2csfp-20',
1733 'gbe2csfp-21sfp',
1734 'gbe2csfp-22sfp',
1735 'gbe2csfp-23sfp',
1736 'gbe2csfp-24sfp',
1737 'gbe2csfp-21',
1738 'gbe2csfp-22',
1739 'gbe2csfp-23',
1740 'gbe2csfp-24',
1741 ),
1742 ),
1cd6eca3
AD
1743 '43.1.16.4.3.29' => array
1744 (
1745 'dict_key' => 758,
1746 'text' => '4200G: 44 RJ-45/10-100-1000T(X) + 4 combo-gig',
1747 'processors' => array ('3com-49-to-52-1000SFP', '3com-any-1000T'),
1748 ),
78cfe89b
AD
1749 '45.3.68.5' => array
1750 (
1751 'dict_key' => 1085,
1752 'text' => 'BES50GE-12T PWR: 12 RJ-45/10-100-1000T(X)',
1753 'processors' => array ('nortel-any-1000T'),
1754 ),
1755 '202.20.59' => array
1756 (
1757 'dict_key' => 1371,
1758 'text' => 'SMC8124L2: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
1759 'processors' => array ('smc2-combo-21-to-24', 'smc2-any-1000T'),
1760 ),
1761 '202.20.66' => array
1762 (
1763 'dict_key' => 1567,
1764 'text' => 'SMC6128L2: 24 RJ-45/10-100TX + 4 combo-gig ports',
1765 'processors' => array ('smc2-combo-25-to-28', 'smc2-1000T-25-to-28', 'smc2-any-100TX'),
1766 ),
1767 '202.20.68' => array
1768 (
1769 'dict_key' => 1374,
1770 'text' => 'SMC8150L2: 46 RJ-45/10-100-1000T(X) + 4 combo ports',
1771 'processors' => array ('smc-combo-45-to-48', 'nortel-any-1000T'),
1772 ),
1773 '207.1.14.53' => array
1774 (
1775 'dict_key' => 1720,
1776 'text' => 'AT9924T: 24 RJ-45/10-100-1000T(X) ports',
1777 'processors' => array ('generic-port-any-1000T'),
1778 ),
fc807353
DO
1779 '4526.100.1.1' => array
1780 (
1781 'dict_key' => 587,
1782 'text' => 'FSM7328S: 24 RJ-45/10-100TX + 4 combo-gig',
1783 'processors' => array ('netgear-chassis-any-100TX', 'netgear-chassis-any-1000SFPcombo', 'netgear-chassis-any-1000T'),
1784 ),
74aee2dc
DO
1785 '4526.100.2.2' => array
1786 (
1787 'dict_key' => 562,
6be06cbb
DO
1788 'text' => 'GSM7224: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1789 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
74aee2dc 1790 ),
3e8ad42f
DO
1791 '4526.100.2.3' => array
1792 (
1793 'dict_key' => 559,
1794 'text' => 'GSM7212: 12 combo-gig',
1795 'processors' => array ('netgear-chassis-any-1000SFPcombo', 'netgear-chassis-any-1000T'),
1796 ),
1b24b8ae
DO
1797 '4526.100.11.1' => array
1798 (
1799 'dict_key' => 557,
1800 'text' => 'GSM7224R: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1801 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1802 ),
12af10b8
DO
1803 '4526.100.11.5' => array
1804 (
1805 'dict_key' => 1602,
1806 'text' => 'GSM7224v2: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1807 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1808 ),
e34faed3
DO
1809 '4526.100.1.13' => array
1810 (
1811 'dict_key' => 1601,
1812 'text' => 'GSM7328Sv2: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1813 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1814 ),
91389980
DO
1815 '2636.1.1.1.2.29' => array
1816 (
1817 'dict_key' => 925,
1818 'text' => 'MX240 modular router',
1819 'processors' => array ('juniper-DPCE-R-4XGE-XFP'),
1820 ),
1f54e1ba
DO
1821 // Juniper Networks assigns single SNMP OID per series:
1822 // EX2200 2636.1.1.1.1.43
1823 // EX3200 2636.1.1.1.2.30
1824 // EX4200 2636.1.1.1.2.31
1825 // EX4500 2636.1.1.1.1.44
1826 // There is a special workaround in code below to derive specific
1827 // product number from sysDescr string.
e68824f6
AD
1828 '2636.1.1.1.2.30' => array
1829 (
8595dfd0 1830 'dict_key' => 900,
e68824f6
AD
1831 'text' => 'Juniper EX3200 series',
1832 'processors' => array ('juniper-ex-pic0-1000T', 'juniper-ex-mgmt'),
1833 ),
1f54e1ba
DO
1834 '2636.1.1.1.2.31' => array
1835 (
1836 'dict_key' => 905,
1837 'text' => 'Juniper EX4200 series',
1838 'processors' => array ('juniper-ex-pic0-1000T', 'juniper-ex-mgmt'),
1839 ),
7d69a266
DO
1840 '2011.2.23.96' => array
1841 (
1842 'dict_key' => 1321,
24c3e444 1843 'text' => 'S5328C-EI-24S: 20 SFP-1000 + 4 combo-gig + 2 XFP slots',
7d69a266
DO
1844 'processors' => array ('quidway-21-to-24-comboT', 'quidway-any-1000SFP', 'quidway-XFP', 'quidway-mgmt'),
1845 ),
b55f8de3
DO
1846 '2011.2.23.103' => array
1847 (
1848 'dict_key' => 1341,
1849 'text' => 'S5352C-SI: 48 RJ-45/10-100-1000T(X) + optional 2xXFP/4xSFP slots',
1850 'processors' => array ('quidway-slot1-SFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1851 ),
38bd461c
AA
1852 '2011.2.23.97' => array
1853 (
1854 'dict_key' => 1337,
1855 'text' => 'S5352C-EI: 48 RJ-45/10-100-1000T(X) + optional 2xXFP/4xSFP slots',
1856 'processors' => array ('quidway-slot1-SFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1857 ),
1858 '2011.2.23.95' => array
1859 (
1860 'dict_key' => 1335,
1861 'text' => 'S5328C-EI: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 XFP slots',
1862 'processors' => array ('quidway-21-to-24-comboSFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1863 ),
24c3e444
DO
1864 '2011.2.23.102' => array
1865 (
1866 'dict_key' => 1339,
1867 'text' => 'S5328C-SI: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 XFP slots',
1868 'processors' => array ('quidway-21-to-24-comboSFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1869 ),
661b3fdb
DO
1870 '1991.1.3.45.2.1.1.1' => array
1871 (
1872 'dict_key' => 127,
1873 'text' => 'FGS648P: 48 RJ-45/10-100-1000T(X) + 4 combo-gig + uplink slot',
1874 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T', 'fgs-uplinks'),
1875 ),
1876 '1991.1.3.45.2.2.1.1' => array
1877 (
1878 'dict_key' => 131,
1879 'text' => 'FGS648P-POE: 48 RJ-45/10-100-1000T(X) + 4 combo-gig + uplink slot',
1880 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T', 'fgs-uplinks'),
1881 ),
ec523868
DO
1882 '1991.1.3.54.2.4.1.1' => array
1883 (
1884 'dict_key' => 1362,
1885 'text' => 'FCX 648: 48 RJ-45/10-100-1000T(X) + uplink slot with 4 SFP+',
1886 'processors' => array ('fgs-any-1000T', 'fcx-uplinks', 'fcx-management'),
1887 ),
6c32c3ff
AA
1888 '1991.1.3.46.1.1.1.1' => array
1889 (
1890 'dict_key' => 413,
1891 'text' => 'FLS 624: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 3 optional 10G modules',
1892 'processors' => array ('fls624-combo', 'fgs-any-1000T', 'fls-uplinks'),
1893 ),
1894 '1991.1.3.46.2.1.1.1' => array
1895 (
1896 'dict_key' => 414,
1897 'text' => 'FLS 648: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 optional 10G modules',
1898 'processors' => array ('fls648-combo', 'fgs-any-1000T', 'fls-uplinks'),
1899 ),
13b28c20
DO
1900 '1991.1.3.52.2.2.1.1' => array
1901 (
1902 'dict_key' => 1032,
1903 'text' => 'FWS648G: 4 combo-gig + 44 RJ-45/10-100-1000T(X)',
1904 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T'),
1905 ),
4eeadb79
DO
1906 '1916.2.71' => array
1907 (
1908 'dict_key' => 694,
1909 'text' => 'X450a-24t: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + XFP uplinks slot',
1910 'processors' => array ('summit-25-to-26-XFP-uplinks', 'summit-21-to-24-comboSFP', 'summit-any-1000T', 'summit-management'),
1911 ),
dbcf1931
DO
1912 '1916.2.139' => array
1913 (
1914 'dict_key' => 1353,
1915 'text' => 'X480-24x: 12 SFP-1000 + 12 combo-gig + 2 XFP + VIM slot',
1916 'processors' => array
1917 (
1918 'summit-27-to-30-XFP-uplinks',
1919 'summit-25-to-26-XFP-uplinks',
1920 'summit-13-to-24-comboT',
1921 'summit-any-SFP',
1922 'summit-management'
1923 ),
1924 ),
8acd246d
DO
1925 '6027.1.3.12' => array
1926 (
1927 'dict_key' => 1471,
1928 'text' => 'Force10 S60: 44 RJ-45/10-100-1000T(X) + 4 SFP-1000 ports + 0/2/4 SFP+ ports',
1e5a92d8
DO
1929 'processors' => array ('ftos-44-to-47-1000SFP', 'ftos-any-1000T', 'ftos-any-10000SFP+', 'ftos-mgmt'),
1930 ),
84ea7e6e
DO
1931 '6027.1.3.13' => array
1932 (
1933 'dict_key' => 1470,
1934 'text' => 'Force10 S55: 44 RJ-45/10-100-1000T(X) + 4 SFP-1000 ports + 0/2/4 SFP+ ports',
1935 'processors' => array ('ftos-44-to-47-1000SFP', 'ftos-any-1000T', 'ftos-any-10000SFP+', 'ftos-mgmt'),
1936 ),
1e5a92d8
DO
1937 '6027.1.3.14' => array
1938 (
1939 'dict_key' => 1472,
1940 'text' => 'Force10 S4810: 48 SFP+-1000/10000 + 4 QSFP-40000 ports',
1941 'processors' => array ('ftos-any-10000SFP+', 'ftos-any-QSFP+', 'ftos-mgmt'),
8acd246d 1942 ),
a28aee72
AD
1943 '12356.101.1.3002'=> array
1944 (
1945 'dict_key' => 1609,
1946 'text' => 'FG310B: 10 RJ-45/10-1000T',
78cfe89b 1947 'processors' => array('generic-port-any-1000T'),
a28aee72 1948 ),
06a03a99
AD
1949 '30065.1.3011.7124.3282' => array
1950 (
92df4b0e
AD
1951 'dict_key' => 1610,
1952 'text' => 'DCS-7124S: 24 SFP+/10000',
1953 'processors' => array ('arista-any-SFP+', 'arista-management'),
1954 ),
1ce6a44d
AD
1955 '674.10895.4' => array
1956 (
1957 'dict_key' => 1622,
1958 'text' => 'PowerConnect 5224: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
1959 'processors' => array ('dell-5224-21-to-24-combo-1000SFP', 'dell-52xx-any-1000T'),
1960 ),
1b10e7cf
AD
1961 '674.10895.3000' => array
1962 (
1963 'dict_key' => 1623,
1964 'text' => 'PowerConnect 6024F: 16 SFP + 8 combo ports',
8595dfd0 1965 'processors' => array ('dell-g17-to-g24-combo-1000T', 'dell-any-1000SFP'),
1b10e7cf
AD
1966 'ifDescrOID' => 'ifName',
1967 ),
92df4b0e
AD
1968 '674.10895.3003' => array
1969 (
1970 'dict_key' => 1611,
1971 'text' => 'PowerConnect 3348: 48 RJ-45/10-100TX + 2 combo ports',
1972 'processors' => array ('dell-33xx-any-combo-1000SFP', 'dell-33xx-any-1000T', 'dell-33xx-any-100TX'),
1973 'ifDescrOID' => 'entPhysicalName',
1974 ),
1b10e7cf
AD
1975 '674.10895.3004' => array
1976 (
1977 'dict_key' => 349,
1978 'text' => 'PowerConnect 5324: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 1979 'processors' => array ('dell-g21-to-g24-combo-1000SFP', 'generic-g-any-1000T'),
1b10e7cf
AD
1980 'ifDescrOID' => 'ifName',
1981 ),
92df4b0e
AD
1982 '674.10895.3007' => array
1983 (
1984 'dict_key' => 347,
1985 'text' => 'PowerConnect 3448: 48 RJ-45/10-100TX + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
1986 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
1987 'ifDescrOID' => 'ifName',
1988 ),
1989 '674.10895.3009' => array
1990 (
1991 'dict_key' => 348,
1992 'text' => 'PowerConnect 3448P: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
1993 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
1994 'ifDescrOID' => 'ifName',
1995 ),
367fcba0
AD
1996 '674.10895.3010' => array
1997 (
1998 'dict_key' => 350,
1999 'text' => 'PowerConnect 6224: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
2000 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
2001 ),
e326551d
AD
2002 '674.10895.3014' => array
2003 (
2004 'dict_key' => 352,
2005 'text' => 'PowerConnect 6224F: 20 SFP + 4 combo-gig',
2006 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000SFP'),
2007 ),
92df4b0e
AD
2008 '674.10895.3017' => array
2009 (
2010 'dict_key' => 1067,
2011 'text' => 'PowerConnect 3548: 48 RJ-45/10-100TX + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
2012 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
2013 ),
2014 '674.10895.3019' => array
2015 (
2016 'dict_key' => 1068,
2017 'text' => 'PowerConnect 3548P: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
2018 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
2019 ),
92df4b0e
AD
2020 '674.10895.3020' => array
2021 (
2022 'dict_key' => 1069,
2023 'text' => 'PowerConnect 5424: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 2024 'processors' => array ('dell-g21-to-g24-combo-1000SFP', 'generic-g-any-1000T'),
92df4b0e
AD
2025 'ifDescrOID' => 'ifName',
2026 ),
2027 '674.10895.3021' => array
2028 (
2029 'dict_key' => 1070,
2030 'text' => 'PowerConnect 5448: 44 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 2031 'processors' => array ('generic-g45-to-g48-combo-1000SFP', 'generic-g-any-1000T'),
92df4b0e 2032 'ifDescrOID' => 'ifName',
06a03a99 2033 ),
ac02ab69
AD
2034 '10977.11825.11833.97.25451.12800.100.4.4' => array
2035 (
2036 'dict_key' => 577,
2037 'text' => 'FS750T2: 48 RJ-45/10-100TX + 2 combo-gig',
2038 'processors' => array ('netgear-49-to-50-combo-1000SFP', 'netgear-49-to-50-combo-1000T', 'netgear-any-100TX'),
2039 ),
8595dfd0
AD
2040 '3955.6.1.2048.1' => array
2041 (
2042 'dict_key' => 1624,
2043 'text' => 'Linksys SRW2048: 44 RJ-45/10-100-1000T(X) + 4 combo ports',
2044 'processors' => array ('generic-g45-to-g48-combo-1000SFP', 'generic-g-any-1000T'),
2045 'ifDescrOID' => 'ifName',
2046 ),
74aee2dc
DO
2047);
2048
536e7323 2049global $swtype_pcre;
1f54e1ba
DO
2050$swtype_pcre = array
2051(
2052 '/Huawei Versatile Routing Platform Software.+VRP.+Software, Version 5.30 /s' => 1360,
2053 '/Huawei Versatile Routing Platform Software.+VRP.+Software, Version 5.50 /s' => 1361,
8732faac 2054 '/Huawei Versatile Routing Platform Software.+VRP.+Software,\s*Version 5.70 /is' => 1369,
1f54e1ba
DO
2055 // FIXME: get sysDescr for IronWare 5 and add a pattern
2056 '/^Brocade Communications Systems.+, IronWare Version 07\./' => 1364,
2057 '/^Juniper Networks,.+JUNOS 9\./' => 1366,
2058 '/^Juniper Networks,.+JUNOS 10\./' => 1367,
2059);
2060
74aee2dc
DO
2061function updateStickerForCell ($cell, $attr_id, $new_value)
2062{
472510e7
AA
2063 if
2064 (
2065 isset ($cell['attrs'][$attr_id])
2066 and !strlen ($cell['attrs'][$attr_id]['value'])
2067 and strlen ($new_value)
2068 )
74aee2dc
DO
2069 commitUpdateAttrValue ($cell['id'], $attr_id, $new_value);
2070}
2071
bdc91a5c
DO
2072// Accept "X-Y" on input and make sure, that PortInterfaceCompat contains
2073// a record with IIF id = X and OIF id = Y.
2074function checkPIC ($port_type_id)
2075{
f2005400
AA
2076 // cache PortInterfaceCompat
2077 static $compat_array = NULL;
2078 if (! isset ($compat_array))
bdc91a5c 2079 {
f2005400
AA
2080 $compat_array = array();
2081 foreach (getPortInterfaceCompat() as $record)
2082 {
2083 $key = $record['iif_id'] . '-' . $record['oif_id'];
2084 $compat_array[$key] = 1;
2085 }
2086 }
92df4b0e 2087
f2005400
AA
2088 if (preg_match ('/^(\d+-)?(\d+)$/', $port_type_id, $m))
2089 {
2090 $iif_id = $m[1];
2091 $oif_id = $m[2];
2092 if (empty ($iif_id[1]))
2093 {
2094 $iif_id = 1;
2095 $port_type_id = $iif_id . '-' . $port_type_id;
2096 }
2097 if (! array_key_exists ($port_type_id, $compat_array))
2098 {
2099 commitSupplementPIC ($iif_id, $oif_id);
2100 $compat_array[$port_type_id] = 1;
2101 }
bdc91a5c 2102 }
bdc91a5c
DO
2103}
2104
8536e20a
DO
2105$msgcode['doSNMPmining']['ERR1'] = 161;
2106$msgcode['doSNMPmining']['ERR2'] = 162;
8228bdb4 2107function doSNMPmining ($object_id, $snmpsetup)
74aee2dc 2108{
74aee2dc
DO
2109 $objectInfo = spotEntity ('object', $object_id);
2110 $objectInfo['attrs'] = getAttrValues ($object_id);
2111 $endpoints = findAllEndpoints ($object_id, $objectInfo['name']);
2112 if (count ($endpoints) == 0)
8ab645cf 2113 return showFuncMessage (__FUNCTION__, 'ERR1'); // endpoint not found
74aee2dc 2114 if (count ($endpoints) > 1)
8ab645cf 2115 return showFuncMessage (__FUNCTION__, 'ERR2'); // can't pick an address
4848a7e3
DO
2116
2117 switch ($objectInfo['objtype_id'])
2118 {
24a6e3a2 2119 case 7:
4848a7e3 2120 case 8:
7b2a1a90 2121 $device = new RTSNMPDevice ($endpoints[0], $snmpsetup);
8228bdb4 2122 return doSwitchSNMPmining ($objectInfo, $device);
4848a7e3 2123 case 2:
7b2a1a90 2124 $device = new APCPowerSwitch ($endpoints[0], $snmpsetup);
8228bdb4 2125 return doPDUSNMPmining ($objectInfo, $device);
92df4b0e 2126 }
4848a7e3
DO
2127}
2128
24a6e3a2 2129$msgcode['doSwitchSNMPmining']['ERR3'] = 188;
e22f9600 2130$msgcode['doSwitchSNMPmining']['ERR4'] = 189;
8228bdb4 2131function doSwitchSNMPmining ($objectInfo, $device)
4848a7e3 2132{
4848a7e3 2133 global $known_switches, $iftable_processors;
92df4b0e 2134
8228bdb4 2135 if (FALSE === ($sysObjectID = $device->snmpget ('sysObjectID.0')))
8ab645cf 2136 return showFuncMessage (__FUNCTION__, 'ERR3'); // // fatal SNMP failure
ac02ab69 2137 $sysObjectID = preg_replace ('/^.*(enterprises\.|joint-iso-ccitt\.)([\.[:digit:]]+)$/', '\\2', $sysObjectID);
8228bdb4
DO
2138 $sysName = substr ($device->snmpget ('sysName.0'), strlen ('STRING: '));
2139 $sysDescr = substr ($device->snmpget ('sysDescr.0'), strlen ('STRING: '));
74aee2dc 2140 $sysDescr = str_replace (array ("\n", "\r"), " ", $sysDescr); // Make it one line
92df4b0e 2141 $ifDescr_tablename = (isset($known_switches[$sysObjectID]['ifDescrOID'])) ? $known_switches[$sysObjectID]['ifDescrOID'] : 'ifDescr';
74aee2dc 2142 if (!isset ($known_switches[$sysObjectID]))
8ab645cf 2143 return showFuncMessage (__FUNCTION__, 'ERR4', array ($sysObjectID)); // unknown OID
7e577e27 2144 showSuccess ($known_switches[$sysObjectID]['text']);
5e193b67
DO
2145 foreach (array_keys ($known_switches[$sysObjectID]['processors']) as $pkey)
2146 if (!array_key_exists ($known_switches[$sysObjectID]['processors'][$pkey], $iftable_processors))
2147 {
8ab645cf 2148 showWarning ('processor "' . $known_switches[$sysObjectID]['processors'][$pkey] . '" not found');
5e193b67
DO
2149 unset ($known_switches[$sysObjectID]['processors'][$pkey]);
2150 }
56a797ef 2151 updateStickerForCell ($objectInfo, 2, $known_switches[$sysObjectID]['dict_key']);
74aee2dc
DO
2152 updateStickerForCell ($objectInfo, 3, $sysName);
2153 switch (1)
2154 {
da273595 2155 case preg_match ('/^9\.1\./', $sysObjectID): // Catalyst w/one AC port
84986395
DO
2156 $exact_release = preg_replace ('/^.*, Version ([^ ]+), .*$/', '\\1', $sysDescr);
2157 $major_line = preg_replace ('/^([[:digit:]]+\.[[:digit:]]+)[^[:digit:]].*/', '\\1', $exact_release);
74aee2dc
DO
2158 $ios_codes = array
2159 (
2160 '12.0' => 244,
2161 '12.1' => 251,
2162 '12.2' => 252,
2163 );
2164 updateStickerForCell ($objectInfo, 5, $exact_release);
6be06cbb
DO
2165 if (array_key_exists ($major_line, $ios_codes))
2166 updateStickerForCell ($objectInfo, 4, $ios_codes[$major_line]);
8228bdb4 2167 $sysChassi = $device->snmpget ('1.3.6.1.4.1.9.3.6.3.0');
74aee2dc
DO
2168 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2169 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
bdc91a5c
DO
2170 checkPIC ('1-29');
2171 commitAddPort ($objectInfo['id'], 'con0', '1-29', 'console', ''); // RJ-45 RS-232 console
b3f84e8e
AD
2172 if (preg_match ('/Cisco IOS Software, C2600/', $sysDescr))
2173 commitAddPort ($objectInfo['id'], 'aux0', '1-29', 'auxillary', ''); // RJ-45 RS-232 aux port
da273595
AD
2174 if ($sysObjectID == '9.1.956')
2175 {
2176 // models with two AC inputs
2177 checkPIC ('1-16');
2178 commitAddPort ($objectInfo['id'], 'AC-in-1', '1-16', 'AC1', '');
2179 commitAddPort ($objectInfo['id'], 'AC-in-2', '1-16', 'AC2', '');
2180 }
2181 elseif ($sysObjectID != '9.1.749' and $sysObjectID != '9.1.920')
facd0235 2182 {
da273595 2183 // assume the rest have one AC input, but exclude blade devices
facd0235
DO
2184 checkPIC ('1-16'); // AC input
2185 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2186 }
74aee2dc 2187 break;
869d4ff4
DO
2188 case preg_match ('/^9\.6\.1\./', $sysObjectID): // Cisco SF series
2189 checkPIC ('1-681');
2190 commitAddPort ($objectInfo['id'], 'con0', '1-681', 'console', ''); // DB-9 RS-232 console
b0021c43
AD
2191 checkPIC ('1-16');
2192 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2193 break;
56a797ef 2194 case preg_match ('/^9\.12\.3\.1\.3\./', $sysObjectID): // Nexus
84986395
DO
2195 $exact_release = preg_replace ('/^.*, Version ([^ ]+), .*$/', '\\1', $sysDescr);
2196 $major_line = preg_replace ('/^([[:digit:]]+\.[[:digit:]]+)[^[:digit:]].*/', '\\1', $exact_release);
74aee2dc
DO
2197 $nxos_codes = array
2198 (
2199 '4.0' => 963,
2200 '4.1' => 964,
2201 );
6be06cbb
DO
2202 if (array_key_exists ($major_line, $nxos_codes))
2203 updateStickerForCell ($objectInfo, 4, $nxos_codes[$major_line]);
74aee2dc 2204 updateStickerForCell ($objectInfo, 5, $exact_release);
0533b64d
DO
2205 $sysChassi = $device->snmpget ('1.3.6.1.2.1.47.1.1.1.1.11.149');
2206 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2207 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
bdc91a5c 2208 checkPIC ('1-29');
24a6e3a2 2209 commitAddPort ($objectInfo['id'], 'con0', '1-29', 'console', ''); // RJ-45 RS-232 console
dcfa87d7
DO
2210 checkPIC ('1-16'); // AC input
2211 commitAddPort ($objectInfo['id'], 'AC-in-1', '1-16', 'AC1', '');
2212 commitAddPort ($objectInfo['id'], 'AC-in-2', '1-16', 'AC2', '');
74aee2dc 2213 break;
13b28c20
DO
2214 case preg_match ('/^11\.2\.3\.7\.11\.(\d+)$/', $sysObjectID, $matches): // ProCurve
2215 $console_per_product = array
2216 (
5d930daf
AD
2217 33 => '1-29', # RJ-45 RS-232
2218 63 => '1-29',
83aedacd
AD
2219 78 => '1-29',
2220 79 => '1-29',
2221 80 => '1-29',
13b28c20
DO
2222 86 => '1-29',
2223 87 => '1-29',
13b28c20
DO
2224 19 => '1-681', # DB-9 RS-232
2225 );
2226 if (array_key_exists ($matches[1], $console_per_product))
2227 {
2228 checkPIC ($console_per_product[$matches[1]]);
5d930daf 2229 commitAddPort ($objectInfo['id'], 'console', $console_per_product[$matches[1]], 'console', '');
13b28c20 2230 }
5d930daf
AD
2231 $oom_per_product = array
2232 (
2233 33 => '1-24', # RJ-45 100Mb
2234 );
2235 if (array_key_exists ($matches[1], $oom_per_product))
2236 {
2237 checkPIC ($oom_per_product[$matches[1]]);
2238 commitAddPort ($objectInfo['id'], 'mgmt', $oom_per_product[$matches[1]], 'mgmt', '');
2239 }
2240 checkPIC ('1-16');
2241 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
84986395 2242 $exact_release = preg_replace ('/^.* revision ([^ ]+), .*$/', '\\1', $sysDescr);
74aee2dc
DO
2243 updateStickerForCell ($objectInfo, 5, $exact_release);
2244 break;
5f2354ce 2245 case preg_match ('/^4526\.100\./', $sysObjectID): // NETGEAR
bdc91a5c
DO
2246 checkPIC ('1-681');
2247 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
6be06cbb 2248 break;
7d69a266 2249 case preg_match ('/^2011\.2\.23\./', $sysObjectID): // Huawei
1f54e1ba 2250 detectSoftwareType ($objectInfo, $sysDescr);
bdc91a5c 2251 checkPIC ('1-681');
b55f8de3 2252 commitAddPort ($objectInfo['id'], 'con0', '1-681', 'console', ''); // DB-9 RS-232 console
7d69a266 2253 break;
e68824f6 2254 case preg_match ('/^2636\.1\.1\.1\.2\.3(0|1)/', $sysObjectID): // Juniper EX3200/EX4200
1f54e1ba 2255 detectSoftwareType ($objectInfo, $sysDescr);
e68824f6
AD
2256 $sw_version = preg_replace ('/^.*, kernel JUNOS ([^ ]+).*$/', '\\1', $sysDescr);
2257 updateStickerForCell ($objectInfo, 5, $sw_version);
2258 // one RJ-45 RS-232 and one AC port (it could be DC, but chances are it's AC)
1f54e1ba
DO
2259 checkPIC ('1-29');
2260 commitAddPort ($objectInfo['id'], 'con', '1-29', 'CON', ''); // RJ-45 RS-232 console
e68824f6
AD
2261 checkPIC ('1-16');
2262 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2263 // Juniper uses the same sysObjectID for multiple HW models, override if necessary
2264 if (preg_match ('/^Juniper Networks, Inc. ex3200-48t internet router/', $sysDescr))
2265 updateStickerForCell ($objectInfo, 2, 902);
1f54e1ba
DO
2266 if (preg_match ('/^Juniper Networks, Inc. ex4200-48t internet router/', $sysDescr))
2267 updateStickerForCell ($objectInfo, 2, 907);
1f54e1ba 2268 break;
7d69a266 2269 case preg_match ('/^2636\.1\.1\.1\.2\./', $sysObjectID): // Juniper
1f54e1ba 2270 detectSoftwareType ($objectInfo, $sysDescr);
bdc91a5c
DO
2271 checkPIC ('1-681');
2272 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
661b3fdb
DO
2273 break;
2274 case preg_match ('/^1991\.1\.3\.45\./', $sysObjectID): // snFGSFamily
6c32c3ff 2275 case preg_match ('/^1991\.1\.3\.46\./', $sysObjectID): // snFLSFamily
ec523868 2276 case preg_match ('/^1991\.1\.3\.54\.2\.4\.1\.1$/', $sysObjectID): // FCX 648
1f54e1ba 2277 detectSoftwareType ($objectInfo, $sysDescr);
84986395 2278 $exact_release = preg_replace ('/^.*, IronWare Version ([^ ]+) .*$/', '\\1', $sysDescr);
661b3fdb
DO
2279 updateStickerForCell ($objectInfo, 5, $exact_release);
2280 # FOUNDRY-SN-AGENT-MIB::snChasSerNum.0
8228bdb4 2281 $sysChassi = $device->snmpget ('enterprises.1991.1.1.1.1.2.0');
661b3fdb
DO
2282 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2283 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
2284
2285 # Type of uplink module installed.
2286 # table: FOUNDRY-SN-AGENT-MIB::snAgentBrdMainBrdDescription
2287 # Possible part numbers are:
2288 # FGS-1XG1XGC (one fixed CX4 port)
2289 # FGS-2XGC (two fixed CX4 ports)
2290 # FGS-2XG (two XFP slots)
6c32c3ff
AA
2291 # And for FLS result (which is not handled here) would be:
2292 # 1991.1.1.2.2.1.1.2.1 = STRING: "FLS-24G 24-port Management Module"
2293 # 1991.1.1.2.2.1.1.2.3 = STRING: "FLS-1XG 1-port 10G Module (1-XFP)"
2294 # 1991.1.1.2.2.1.1.2.4 = STRING: "FLS-1XG 1-port 10G Module (1-XFP)"
2295 # (assuming, that the device has 2 XFP modules in slots 3 and 4).
2296
8228bdb4 2297 foreach ($device->snmpwalkoid ('enterprises.1991.1.1.2.2.1.1.2') as $module_raw)
661b3fdb
DO
2298 if (preg_match ('/^STRING: "(FGS-1XG1XGC|FGS-2XGC) /i', $module_raw))
2299 {
2300 $iftable_processors['fgs-uplinks']['dict_key'] = '1-40'; // CX4
2301 break;
2302 }
2303
2304 # AC inputs
2305 # table: FOUNDRY-SN-AGENT-MIB::snChasPwrSupplyDescription
2306 # "Power supply 1 "
2307 # "Power supply 2 "
8228bdb4 2308 foreach ($device->snmpwalkoid ('enterprises.1991.1.1.1.2.1.1.2') as $PSU_raw)
661b3fdb
DO
2309 {
2310 $count = 0;
2311 $PSU_cooked = trim (preg_replace ('/^string: "(.+)"$/i', '\\1', $PSU_raw, 1, $count));
2312 if ($count)
2313 {
2314 checkPIC ('1-16');
2315 commitAddPort ($objectInfo['id'], $PSU_cooked, '1-16', '', '');
2316 }
2317 }
2318 # fixed console port
2319 checkPIC ('1-681');
2320 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
661b3fdb 2321 break;
4eeadb79
DO
2322 case preg_match ('/^1916\.2\./', $sysObjectID): // Extreme Networks Summit
2323 $xos_release = preg_replace ('/^ExtremeXOS version ([[:digit:]]+)\..*$/', '\\1', $sysDescr);
2324 $xos_codes = array
2325 (
2326 '10' => 1350,
2327 '11' => 1351,
2328 '12' => 1352,
2329 );
2330 if (array_key_exists ($xos_release, $xos_codes))
2331 updateStickerForCell ($objectInfo, 4, $xos_codes[$xos_release]);
2332 checkPIC ('1-681');
2333 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232
2334 checkPIC ('1-16');
2335 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
4eeadb79 2336 break;
8acd246d 2337 case preg_match ('/^6027\.1\./', $sysObjectID): # Force10
1e5a92d8 2338 commitAddPort ($objectInfo['id'], 'aux0', '1-29', 'RS-232', ''); // RJ-45 RS-232 console
8acd246d
DO
2339 $m = array();
2340 if (preg_match ('/Force10 Application Software Version: ([\d\.]+)/', $sysDescr, $m))
6dd5c55c 2341 {
8acd246d 2342 updateStickerForCell ($objectInfo, 5, $m[1]);
241db860 2343 $ftos_release = preg_replace ('/^([678])\..+$/', '\\1', $m[1]);
6dd5c55c
DO
2344 $ftos_codes = array
2345 (
2346 '6' => 1592,
2347 '7' => 1593,
2348 '8' => 1594,
2349 );
2350 if (array_key_exists ($ftos_release, $ftos_codes))
2351 updateStickerForCell ($objectInfo, 4, $ftos_codes[$ftos_release]);
2352 }
8acd246d
DO
2353 # F10-S-SERIES-CHASSIS-MIB::chStackUnitSerialNumber.1
2354 $serialNo = $device->snmpget ('enterprises.6027.3.10.1.2.2.1.12.1');
84ea7e6e
DO
2355 # F10-S-SERIES-CHASSIS-MIB::chSysPowerSupplyType.1.1
2356 if ($device->snmpget ('enterprises.6027.3.10.1.2.3.1.3.1.1') == 'INTEGER: 1')
2357 {
2358 checkPIC ('1-16');
2359 commitAddPort ($objectInfo['id'], 'PSU0', '1-16', 'PSU0', '');
2360 }
2361 # F10-S-SERIES-CHASSIS-MIB::chSysPowerSupplyType.1.2
2362 if ($device->snmpget ('enterprises.6027.3.10.1.2.3.1.3.1.2') == 'INTEGER: 1')
2363 {
2364 checkPIC ('1-16');
2365 commitAddPort ($objectInfo['id'], 'PSU1', '1-16', 'PSU1', '');
2366 }
8acd246d
DO
2367 if (strlen ($serialNo))
2368 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($serialNo, strlen ('STRING: '))));
2369 break;
13b28c20 2370 case preg_match ('/^202\.20\./', $sysObjectID): // SMC TigerSwitch
1ce6a44d
AD
2371 case preg_match ('/^674\.10895\.4/', $sysObjectID): // Dell PowerConnect
2372 case preg_match ('/^674\.10895\.300(3|4|7|9)/', $sysObjectID):
e326551d 2373 case preg_match ('/^674\.10895\.301(0|4|7|9)/', $sysObjectID):
92df4b0e 2374 case preg_match ('/^674\.10895\.302(0|1)/', $sysObjectID):
8595dfd0
AD
2375 case preg_match ('/^3955\.6\.1\.2048\.1/', $sysObjectID): // Linksys
2376 // one DB-9 RS-232 and one AC port
13b28c20
DO
2377 checkPIC ('1-681');
2378 commitAddPort ($objectInfo['id'], 'console', '1-681', '', ''); // DB-9 RS-232
2379 checkPIC ('1-16');
2380 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
13b28c20 2381 break;
78cfe89b
AD
2382 case preg_match ('/^207\.1\.14\./', $sysObjectID): // Allied Telesyn
2383 // one RJ-45 RS-232 and two AC ports
2384 checkPIC ('1-29');
2385 commitAddPort ($objectInfo['id'], 'console', '1-29', 'console', '');
2386 checkPIC ('1-16');
2387 commitAddPort ($objectInfo['id'], 'AC-in-1', '1-16', 'AC1', '');
2388 commitAddPort ($objectInfo['id'], 'AC-in-2', '1-16', 'AC2', '');
2389 break;
1b10e7cf
AD
2390 case preg_match ('/^674\.10895\.3000/', $sysObjectID):
2391 // one DB-9 RS-232, one 100Mb OOB mgmt, and one AC port
2392 checkPIC ('1-681');
2393 commitAddPort ($objectInfo['id'], 'console', '1-681', '', ''); // DB-9 RS-232
2394 checkPIC ('1-19');
2395 commitAddPort ($objectInfo['id'], 'mgmt', '1-19', '', '');
2396 checkPIC ('1-16');
2397 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2398 break;
1cd6eca3
AD
2399 case preg_match ('/^43\.1\.16\.4\.3\.29/', $sysObjectID): // 3Com
2400 $sw_version = preg_replace('/^.* Version 3Com OS ([^ ]+).*$/', '\\1', $sysDescr);
2401 updateStickerForCell ($objectInfo, 5, $sw_version);
2402
2403 // one RJ-45 RS-232 and one AC port
2404 checkPIC ('1-29');
2405 commitAddPort ($objectInfo['id'], 'console', '1-29', '', ''); // RJ-45 RS-232 console
2406 checkPIC ('1-16');
2407 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2408 break;
ac02ab69
AD
2409 case preg_match ('/^10977\.11825\.11833\.97\.25451\.12800\.100\.4\.4/', $sysObjectID): // Netgear
2410 $sw_version = preg_replace('/^.* V([^ ]+).*$/', '\\1', $sysDescr);
2411 updateStickerForCell ($objectInfo, 5, $sw_version);
2412
2413 // one AC port, no console
2414 checkPIC ('1-16');
2415 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2416 break;
7d69a266 2417 default: // Nortel...
74aee2dc
DO
2418 break;
2419 }
56a797ef 2420 $ifInfo = array();
92df4b0e 2421 foreach ($device->snmpwalkoid ($ifDescr_tablename) as $oid => $value)
56a797ef 2422 {
92df4b0e 2423 $randomindex = preg_replace ("/^.*${ifDescr_tablename}\.(.+)\$/", '\\1', $oid);
5f2354ce 2424 $value = trim (preg_replace ('/^[^:]+: (.+)$/', '\\1', $value), '"');
92df4b0e 2425 $ifInfo[$randomindex]['ifDescr'] = $value;
56a797ef 2426 }
92df4b0e 2427 foreach ($device->snmpwalkoid ('ifPhysAddress') as $oid => $value)
56a797ef 2428 {
92df4b0e 2429 $randomindex = preg_replace ("/^.*ifPhysAddress\.(.+)\$/", '\\1', $oid);
56a797ef
DO
2430 $value = trim ($value);
2431 // NET-SNMP may return MAC addresses in one of two (?) formats depending on
2432 // DISPLAY-HINT internal database. The best we can do about it is to accept both.
2433 // Bug originally reported by Walery Wysotsky against openSUSE 11.0.
6a845dce 2434 if (preg_match ('/^string: [0-9a-f]{1,2}(:[0-9a-f]{1,2}){5}/i', $value)) // STRING: x:yy:z:xx:y:zz
56a797ef
DO
2435 {
2436 list ($dummy, $value) = explode (' ', $value);
2437 $addrbytes = explode (':', $value);
2438 foreach ($addrbytes as $bidx => $bytestr)
2439 if (strlen ($bytestr) == 1)
2440 $addrbytes[$bidx] = '0' . $bytestr;
2441 }
6a845dce 2442 elseif (preg_match ('/^hex-string:( [0-9a-f]{2}){6}/i', $value)) // Hex-STRING: xx yy zz xx yy zz
56a797ef 2443 $addrbytes = explode (' ', substr ($value, -17));
6a845dce
DO
2444 elseif (preg_match ('/22[0-9a-f]{12}22$/', bin2hex ($value))) // STRING: "??????"
2445 $addrbytes = array (substr (bin2hex ($value), -14, 12));
56a797ef
DO
2446 else
2447 continue; // martian format
92df4b0e 2448 $ifInfo[$randomindex]['ifPhysAddress'] = implode ('', $addrbytes);
56a797ef
DO
2449 }
2450 // process each interface only once regardless of how many processors we have to run
2451 foreach ($ifInfo as $iface)
2452 foreach ($known_switches[$sysObjectID]['processors'] as $processor_name)
2453 {
56a797ef 2454 $newname = preg_replace ($iftable_processors[$processor_name]['pattern'], $iftable_processors[$processor_name]['replacement'], $iface['ifDescr'], 1, $count);
1f54e1ba
DO
2455 if ($newname === NULL)
2456 {
8ab645cf 2457 showError ('PCRE pattern error, terminating');
1f54e1ba
DO
2458 break 2;
2459 }
56a797ef
DO
2460 if (!$count)
2461 continue; // try next processor on current port
2462 $newlabel = preg_replace ($iftable_processors[$processor_name]['pattern'], $iftable_processors[$processor_name]['label'], $iface['ifDescr'], 1, $count);
bdc91a5c 2463 checkPIC ($iftable_processors[$processor_name]['dict_key']);
73a9a0a0 2464 commitAddPort ($objectInfo['id'], $newname, $iftable_processors[$processor_name]['dict_key'], $newlabel, $iface['ifPhysAddress']);
56a797ef
DO
2465 if (!$iftable_processors[$processor_name]['try_next_proc']) // done with this port
2466 continue 2;
2467 }
8536e20a 2468 // No failure up to this point, thus leave current tab for the "Ports" one.
8ab645cf 2469 return buildRedirectURL (NULL, 'ports');
74aee2dc
DO
2470}
2471
7b2a1a90 2472function doPDUSNMPmining ($objectInfo, $switch)
38e05b77 2473{
29de85b6 2474 global $known_APC_SKUs;
29de85b6
DO
2475 if (FALSE !== ($dict_key = array_search ($switch->getHWModel(), $known_APC_SKUs)))
2476 updateStickerForCell ($objectInfo, 2, $dict_key);
2477 updateStickerForCell ($objectInfo, 1, $switch->getHWSerial());
4848a7e3 2478 updateStickerForCell ($objectInfo, 3, $switch->getName());
29de85b6 2479 updateStickerForCell ($objectInfo, 5, $switch->getFWRev());
bdc91a5c 2480 checkPIC ('1-16');
29de85b6 2481 commitAddPort ($objectInfo['id'], 'input', '1-16', 'input', '');
4848a7e3
DO
2482 $portno = 1;
2483 foreach ($switch->getPorts() as $name => $port)
29de85b6
DO
2484 {
2485 $label = mb_strlen ($port[0]) ? $port[0] : $portno;
bdc91a5c 2486 checkPIC ('1-1322');
29de85b6
DO
2487 commitAddPort ($objectInfo['id'], $portno, '1-1322', $port[0], '');
2488 $portno++;
2489 }
8ab645cf
AA
2490 showSuccess ("Added ${portno} port(s)");
2491 return buildRedirectURL (NULL, 'ports');
38e05b77
DO
2492}
2493
4848a7e3 2494// APC SNMP code by Russ Garrett
38e05b77
DO
2495define('APC_STATUS_ON', 1);
2496define('APC_STATUS_OFF', 2);
2497define('APC_STATUS_REBOOT', 3);
2498
db5d7da5
AD
2499class RTSNMPDevice
2500{
2501 protected $snmp;
2502
2503 function __construct($hostname, $snmpsetup)
2504 {
2505 switch($snmpsetup['version']) {
2506 case 1:
2507 default:
2508 $this->snmp = new RTSNMPv1($hostname, $snmpsetup);
2509 break;
2510 case 2:
2511 $this->snmp = new RTSNMPv2($hostname, $snmpsetup);
2512 break;
2513 case 3:
2514 $this->snmp = new RTSNMPv3($hostname, $snmpsetup);
2515 break;
2516 }
8228bdb4 2517 }
38e05b77 2518
db5d7da5
AD
2519 function getName()
2520 {
2521 return $this->getString('sysName.0');
2522 }
92cfa92a 2523
db5d7da5
AD
2524 function getDescription()
2525 {
2526 return $this->getString('sysDescr.0');
2527 }
92cfa92a 2528
db5d7da5
AD
2529 function snmpget($oid)
2530 {
2531 return $this->snmp->snmpget($oid);
2532 }
92cfa92a 2533
db5d7da5
AD
2534 function snmpwalkoid($oid)
2535 {
2536 return $this->snmp->snmpwalkoid($oid);
2537 }
2538
2539 protected function snmpSet($oid, $type, $value)
2540 {
2541 return $this->snmp->snmpset($oid, $type, $value);
2542 }
2543
2544 protected function getString($oid)
2545 {
2546 return trim(str_replace('STRING: ', '', $this->snmp->snmpget($oid)), '"');
2547 }
8228bdb4
DO
2548}
2549
db5d7da5
AD
2550abstract class RTSNMP
2551{
2552 protected $hostname;
2553 protected $snmpsetup;
2554
2555 function __construct($hostname, $snmpsetup)
2556 {
2557 $this->hostname = $hostname;
2558 $this->snmpsetup = $snmpsetup;
2559 }
92cfa92a 2560
db5d7da5
AD
2561 abstract function snmpget($oid);
2562 abstract function snmpset($oid, $type, $value);
2563 abstract function snmpwalkoid($oid);
8228bdb4
DO
2564}
2565
db5d7da5
AD
2566class RTSNMPv1 extends RTSNMP
2567{
2568 function snmpget($oid)
2569 {
2570 return snmpget($this->hostname, $this->snmpsetup['community'], $oid);
2571 }
2572
2573 function snmpset($oid, $type, $value)
2574 {
2575 return snmpset($this->hostname, $this->snmpsetup['community'], $oid, $type, $value);
2576 }
92cfa92a 2577
db5d7da5
AD
2578 function snmpwalkoid($oid)
2579 {
2580 return snmpwalkoid($this->hostname, $this->snmpsetup['community'], $oid);
2581 }
8228bdb4
DO
2582}
2583
db5d7da5
AD
2584class RTSNMPv2 extends RTSNMP
2585{
2586 function snmpget($oid)
2587 {
2588 return snmp2_get($this->hostname, $this->snmpsetup['community'], $oid);
2589 }
2590
2591 function snmpset($oid, $type, $value)
2592 {
2593 return snmp2_set($this->hostname, $this->snmpsetup['community'], $oid, $type, $value);
2594 }
92cfa92a 2595
db5d7da5
AD
2596 function snmpwalkoid($oid)
2597 {
2598 return snmp2_real_walk($this->hostname, $this->snmpsetup['community'], $oid);
2599 }
047d6ee5
DO
2600}
2601
db5d7da5
AD
2602class RTSNMPv3 extends RTSNMP
2603{
2604 function snmpget($oid)
2605 {
2606 return snmp3_get($this->hostname, $this->snmpsetup['sec_name'], $this->snmpsetup['sec_level'], $this->snmpsetup['auth_protocol'], $this->snmpsetup['auth_passphrase'], $this->snmpsetup['priv_protocol'], $this->snmpsetup['priv_passphrase'], $oid);
2607 }
2608
2609 function snmpset($oid, $type, $value)
2610 {
2611 return snmp3_set($this->hostname, $this->snmpsetup['sec_name'], $this->snmpsetup['sec_level'], $this->snmpsetup['auth_protocol'], $this->snmpsetup['auth_passphrase'], $this->snmpsetup['priv_protocol'], $this->snmpsetup['priv_passphrase'], $oid, $type, $value);
2612 }
92cfa92a 2613
db5d7da5
AD
2614 function snmpwalkoid($oid)
2615 {
2616 return snmp3_real_walk($this->hostname, $this->snmpsetup['sec_name'], $this->snmpsetup['sec_level'], $this->snmpsetup['auth_protocol'], $this->snmpsetup['auth_passphrase'], $this->snmpsetup['priv_protocol'], $this->snmpsetup['priv_passphrase'], $oid);
2617 }
38e05b77
DO
2618}
2619
db5d7da5
AD
2620class APCPowerSwitch extends RTSNMPDevice
2621{
2622 protected $snmpMib = 'SNMPv2-SMI::enterprises.318';
2623
2624 function getPorts()
2625 {
92cfa92a
AD
2626 $data = $this->snmpwalkoid("{$this->snmpMib}.1.1.12.3.3.1.1.2");
2627 $status = $this->snmpwalkoid("{$this->snmpMib}.1.1.12.3.3.1.1.4");
db5d7da5
AD
2628 $out = array();
2629 foreach ($data as $id => $d)
3e847fc8 2630 $out[] = array(trim(str_replace('STRING: ', '', $d), '"'), str_replace('INTEGER: ', '', $status[$id]));
db5d7da5
AD
2631 return $out;
2632 }
92cfa92a 2633
db5d7da5
AD
2634 function getPortStatus($id)
2635 {
2636 return trim($this->snmpget("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id"), 'INTEGER: ');
2637 }
2638
2639 function getPortName($id)
2640 {
2641 return trim(str_replace('STRING: ', '', $this->snmpget("{$this->snmpMib}.1.1.12.3.3.1.1.2.$id")), '"');
2642 }
2643
2644 function setPortName($id, $name)
2645 {
2646 return $this->snmpset("{$this->snmpMib}.1.1.4.5.2.1.3.$id", 's', $name);
2647 }
2648
2649 function portOff($id)
2650 {
2651 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_OFF);
2652 }
2653
2654 function portOn($id)
2655 {
2656 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_ON);
2657 }
2658
2659 function portReboot($id)
2660 {
2661 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_REBOOT);
2662 }
2663
30ad8bc4
DO
2664 // rPDUIdentFirmwareRev.0 == .1.3.6.1.4.1.318.1.1.12.1.3.0 = STRING: "vN.N.N"
2665 function getFWRev()
2666 {
8228bdb4 2667 return preg_replace ('/^STRING: "(.+)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.3.0"));
30ad8bc4 2668 }
db5d7da5 2669
30ad8bc4
DO
2670 // rPDUIdentSerialNumber.0 == .1.3.6.1.4.1.318.1.1.12.1.6.0 = STRING: "XXXXXXXXXXX"
2671 function getHWSerial()
2672 {
8228bdb4 2673 return preg_replace ('/^STRING: "(.+)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.6.0"));
30ad8bc4 2674 }
db5d7da5 2675
30ad8bc4
DO
2676 // rPDUIdentModelNumber.0 == .1.3.6.1.4.1.318.1.1.12.1.5.0 = STRING: "APnnnn"
2677 function getHWModel()
2678 {
8228bdb4 2679 return preg_replace ('/^STRING: "(.*)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.5.0"));
30ad8bc4 2680 }
38e05b77 2681}
367fcba0 2682
2d511052
DO
2683// Take address in the form XX:XX:XX:XX:XX:XX and return the next
2684// address in the same form.
2685function nextMACAddress ($addr)
2686{
cc000fab
DO
2687 if ($addr == '')
2688 return '';
2d511052
DO
2689 $bytes = array();
2690 foreach (explode (':', $addr) as $hex)
2691 $bytes[] = hexdec ($hex);
2692 for ($i = 5; $i >= 0; $i--)
2693 {
2694 $bytes[$i] += 1;
2695 if ($bytes[$i] <= 255) // FF
2696 break; // no roll over
2697 $bytes[$i] = 0;
2698 }
2699 foreach (array_keys ($bytes) as $key)
2700 $bytes[$key] = sprintf ('%02X', $bytes[$key]);
2701 return implode (':', $bytes);
2702}
2703
2704function generatePortsForCatModule ($object_id, $slotno = 1, $mtype = 'X6748', $mac_address = '')
2705{
2706 global $dbxlink;
2707 $mac_address = l2addressFromDatabase (l2addressForDatabase ($mac_address));
2708 switch ($mtype)
2709 {
cc000fab 2710 case 'WS-X6748-GE-TX':
2d511052
DO
2711 $dbxlink->beginTransaction();
2712 for ($i = 1; $i <= 48; $i++)
2713 {
73a9a0a0 2714 commitAddPort ($object_id, "gi${slotno}/${i}", '1-24', "slot ${slotno} port ${i}", $mac_address);
cc000fab 2715 $mac_address = nextMACAddress ($mac_address);
2d511052
DO
2716 }
2717 $dbxlink->commit();
2718 break;
cc000fab
DO
2719 case 'WS-X6708-10GE':
2720 for ($i = 1; $i <= 8; $i++)
2721 {
2722 commitAddPort ($object_id, "te${slotno}/${i}", '6-1080', "slot ${slotno} port ${i}", $mac_address);
2723 $mac_address = nextMACAddress ($mac_address);
2724 }
2725 break;
8fe2d6f0
DO
2726 case 'WS-X6704-10GE':
2727 for ($i = 1; $i <= 4; $i++)
2728 {
2729 commitAddPort ($object_id, "te${slotno}/${i}", '5-1079', "slot ${slotno} port ${i}", $mac_address);
2730 $mac_address = nextMACAddress ($mac_address);
2731 }
2732 break;
cc000fab
DO
2733 case 'VS-S720-10G':
2734 commitAddPort ($object_id, "gi${slotno}/1", '4-1077', "slot ${slotno} port 1", $mac_address);
2735 $mac_address = nextMACAddress ($mac_address);
2736 commitAddPort ($object_id, "gi${slotno}/2", '4-1077', "slot ${slotno} port 2", $mac_address);
2737 $mac_address = nextMACAddress ($mac_address);
2738 commitAddPort ($object_id, "gi${slotno}/3", '1-24', "slot ${slotno} port 3", $mac_address);
2739 $mac_address = nextMACAddress ($mac_address);
2740 commitAddPort ($object_id, "te${slotno}/4", '6-1080', "slot ${slotno} port 4", $mac_address);
2741 $mac_address = nextMACAddress ($mac_address);
2742 commitAddPort ($object_id, "te${slotno}/5", '6-1080', "slot ${slotno} port 5", $mac_address);
2743 break;
3e34adae
DO
2744 case '3750G-24TS':
2745 // MAC address of 1st port is the next one after switch's address
cc000fab 2746 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
2747 for ($i = 1; $i <= 24; $i++)
2748 {
2749 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
cc000fab 2750 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
2751 }
2752 for ($i = 25; $i <= 28; $i++)
2753 {
2754 commitAddPort ($object_id, "gi${slotno}/0/${i}", '4-1077', "unit ${slotno} port ${i}", $mac_address);
abd1e9ac
DO
2755 $mac_address = nextMACAddress ($mac_address);
2756 }
2757 break;
2758 case '3750G-24T':
2759 $mac_address = nextMACAddress ($mac_address);
2760 for ($i = 1; $i <= 24; $i++)
2761 {
2762 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
cc000fab 2763 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
2764 }
2765 break;
d423bb7d
DO
2766 case '3750G-16TD':
2767 $mac_address = nextMACAddress ($mac_address);
2768 for ($i = 1; $i <= 16; $i++)
2769 {
2770 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
2771 $mac_address = nextMACAddress ($mac_address);
2772 }
2773 commitAddPort ($object_id, "te${slotno}/0/1", '5-1079', "unit ${slotno} port ${i}", $mac_address);
2774 break;
c5553818
DO
2775 case 'LE02G48TA':
2776 for ($i = 0; $i <= 47; $i++)
2777 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "slot ${slotno} port ${i}", $mac_address);
2778 break;
2779 case 'LE02X12SA':
2780 for ($i = 0; $i <= 11; $i++)
2781 commitAddPort ($object_id, "gi${slotno}/0/${i}", '9-1084', "slot ${slotno} port ${i}", $mac_address);
2782 break;
2d511052
DO
2783 }
2784}
2785
1f54e1ba
DO
2786function detectSoftwareType ($objectInfo, $sysDescr)
2787{
2788 global $swtype_pcre;
2789 foreach ($swtype_pcre as $pattern => $dict_key)
2790 if (preg_match ($pattern, $sysDescr))
2791 {
2792 updateStickerForCell ($objectInfo, 4, $dict_key);
2793 return;
2794 }
2795}
2ffd5a2a 2796?>