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