WS-C2960-24PC-S SNMP support
[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
536e7323 1389global $known_switches;
74aee2dc
DO
1390$known_switches = array // key is system OID w/o "enterprises" prefix
1391(
feee5e5a
DO
1392 '9.1.217' => array
1393 (
1394 'dict_key' => 124,
1395 'text' => 'WS-C2924-XL: 24 RJ-45/10-100TX',
1396 'processors' => array ('catalyst-chassis-any-100TX'),
10e81331
AD
1397 ),
1398 '9.1.220' => array
1399 (
1400 'dict_key' => 1719,
1401 'text' => 'WS-C2924M-XL: 24 RJ-45/10-100TX',
1402 'processors' => array ('catalyst-chassis-any-100TX'),
feee5e5a 1403 ),
462e65ac
DO
1404 '9.1.246' => array
1405 (
1406 'dict_key' => 391,
1407 'text' => 'WS-C3508G-XL: 8 GBIC/1000',
1408 'processors' => array ('catalyst-chassis-any-1000GBIC'),
1409 ),
d7466acb
DO
1410 '9.1.248' => array
1411 (
1412 'dict_key' => 393,
1413 'text' => 'WS-C3524-XL: 24 RJ-45/10-100TX + 2 GBIC/1000',
1414 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1415 ),
cfd07952
DO
1416 '9.1.278' => array
1417 (
1418 'dict_key' => 395,
1419 'text' => 'WS-C3548-XL: 48 RJ-45/10-100TX + 2 GBIC/1000',
1420 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1421 ),
74aee2dc
DO
1422 '9.1.324' => array
1423 (
1424 'dict_key' => 380,
1425 'text' => 'WS-C2950-24: 24 RJ-45/10-100TX',
6be06cbb 1426 'processors' => array ('catalyst-chassis-any-100TX'),
74aee2dc
DO
1427 ),
1428 '9.1.325' => array
1429 (
1430 'dict_key' => 382,
1431 'text' => 'WS-C2950C-24: 24 RJ-45/10-100TX + 2 MT-RJ/100FX fiber',
6be06cbb 1432 'processors' => array ('catalyst-chassis-25-to-26-100FX/MT-RJ', 'catalyst-chassis-any-100TX'),
74aee2dc 1433 ),
a3432267
DO
1434 '9.1.359' => array
1435 (
1436 'dict_key' => 386,
1437 'text' => 'WS-C2950T-24: 24 RJ-45/10-100TX + 2 1000T uplinks',
1438 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
1439 ),
8fe7aefe
AD
1440 '9.1.366' => array
1441 (
1442 'dict_key' => 400,
1443 'text' => 'WS-C3550-24: 24 RJ-45/10-100TX + 2 GBIC/1000',
1444 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1445 ),
13b28c20
DO
1446 '9.1.559' => array
1447 (
1448 'dict_key' => 387,
1449 'text' => 'WS-C2950T-48: 48 RJ-45/10-100TX + 2 1000T uplinks',
1450 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
1451 ),
e41fafef
AD
1452 '9.1.694' => array
1453 (
1454 'dict_key' => 1710,
1455 'text' => 'WS-C2960-24TC-L: 24 RJ-45/10-100TX + 2 combo-gig',
1456 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1457 ),
7e87a291
DO
1458 '9.1.695' => array
1459 (
2b512043 1460 'dict_key' => 1590,
7e87a291
DO
1461 'text' => 'WS-C2960-48TC-L: 48 RJ-45/10-100TX + 2 combo-gig',
1462 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1463 ),
e8ea3f02
AD
1464 '9.1.930' => array
1465 (
aca86e3f 1466 'dict_key' => 1607,
e8ea3f02
AD
1467 'text' => 'WS-C3560E-12D-S: 12 X2/10000 w/TwinGig + OOBM',
1468 'processors' => array
1469 (
1470 'catalyst-chassis-any-1000SFP',
1471 'catalyst-chassis-uplinks-10000X2',
1472 'catalyst-chassis-mgmt',
1473 ),
1474 ),
da273595
AD
1475 '9.1.956' => array
1476 (
1477 'dict_key' => 1721,
1478 'text' => 'WS-C3560E-12SD: 12 SFP/1000 +2 X2/10000 + OOBM',
1479 'processors' => array
1480 (
1481 'catalyst-chassis-any-1000SFP',
1482 'catalyst-chassis-uplinks-10000X2',
1483 'catalyst-chassis-mgmt',
1484 ),
1485 ),
13b28c20
DO
1486 '9.1.793' => array
1487 (
1488 'dict_key' => 1575,
1489 'text' => 'WS-C3560E-24TD: 24 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig + OOBM',
1490 'processors' => array
1491 (
1492 'catalyst-chassis-25-to-28-1000SFP', // TwinGig
1493 'catalyst-chassis-any-1000T',
1494 'catalyst-chassis-uplinks-10000X2',
1495 'catalyst-chassis-mgmt',
1496 ),
1497 ),
1498 '9.1.794' => array
1499 (
1500 'dict_key' => 1574,
1501 'text' => 'WS-C3560E-48TD: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig + OOBM',
1502 'processors' => array
1503 (
1504 'catalyst-chassis-49-to-52-1000SFP', // TwinGig
1505 'catalyst-chassis-any-1000T',
1506 'catalyst-chassis-uplinks-10000X2',
1507 'catalyst-chassis-mgmt',
1508 ),
1509 ),
38bd461c
AA
1510 '9.1.1257' => array
1511 (
1512 'dict_key' => 167,
1513 'text' => 'WS-C2960G-24TS-S: 24 RJ-45/10-100-1000T(X)',
1514 'processors' => array ('catalyst-chassis-25-to-26-1000SFP', 'catalyst-chassis-mgmt', 'catalyst-chassis-any-1000T'),
1515 ),
a048e8fc
DO
1516 '9.1.799' => array
1517 (
1518 'dict_key' => 168,
1519 'text' => 'WS-C2960G-8TC-L: 7 RJ-45/10-100-1000T(X) + 1 combo-gig',
1520 'processors' => array ('catalyst-chassis-8-combo-1000SFP', 'catalyst-chassis-any-1000T'),
1521 ),
74aee2dc
DO
1522 '9.1.696' => array
1523 (
1524 'dict_key' => 167,
1525 'text' => 'WS-C2960G-24TC-L: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
6be06cbb 1526 'processors' => array ('catalyst-chassis-21-to-24-combo-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1527 ),
1528 '9.1.697' => array
1529 (
1530 'dict_key' => 166,
1531 'text' => 'WS-C2960G-48TC-L: 44 RJ-45/10-100-1000T(X) + 4 combo-gig',
6be06cbb 1532 'processors' => array ('catalyst-chassis-45-to-48-combo-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc 1533 ),
38bd461c
AA
1534 '9.1.928' => array
1535 (
1536 'dict_key' => 163,
1537 'text' => 'WS-C2960-24TC-S: 24 RJ-45/10-100TX + 2 combo-gig',
1538 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-100TX'),
1539 ),
74aee2dc
DO
1540 '9.1.716' => array
1541 (
1542 'dict_key' => 164,
1543 'text' => 'WS-C2960-24TT-L: 24 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1544 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1545 ),
1546 '9.1.717' => array
1547 (
13b28c20 1548 'dict_key' => 1572,
74aee2dc 1549 'text' => 'WS-C2960-48TT-L: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1550 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
74aee2dc 1551 ),
47a523af
AD
1552 '9.1.724' => array
1553 (
1554 'dict_key' => 160,
1555 'text' => 'WS-CE500-24TT: 24 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1556 'processors' => array ('catalyst-any-100TX', 'catalyst-any-1000T'),
1557 ),
bc8b21f0
AD
1558 '9.1.727' => array
1559 (
1560 'dict_key' => 161,
1561 'text' => 'WS-CE500G-12TC: 8 RJ-45/10-100/1000T(X) + 4 combo',
1562 'processors' => array ('catalyst-9-to-12-1000SFP', 'catalyst-9-to-12-1000T', 'catalyst-any-1000T'),
1563 ),
ec523868
DO
1564 '9.1.950' => array
1565 (
1566 'dict_key' => 1347,
8a6a7c3c
AA
1567 'text' => 'WS-C2960-24PC-L: 24 RJ-45/10-100TX + 2 combo-gig',
1568 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1569 ),
1570 '9.1.1147' => array
1571 (
1572 'dict_key' => 1347,
1573 'text' => 'WS-C2960-24PC-S: 24 RJ-45/10-100TX + 2 combo-gig',
ec523868
DO
1574 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1575 ),
4d043be1
AA
1576 '9.1.927' => array
1577 (
1578 'dict_key' => 140,
2b512043
DO
1579 'text' => 'WS-C2960-48TC-S: 48 RJ-45/10-100TX + 2 combo-gig',
1580 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
4d043be1 1581 ),
13b28c20
DO
1582 '9.1.1005' => array
1583 (
1584 'dict_key' => 1573,
1585 'text' => 'WS-C2960-48TT-S: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1586 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
1587 ),
74aee2dc
DO
1588 '9.1.527' => array
1589 (
1590 'dict_key' => 210,
1591 'text' => 'WS-C2970G-24T: 24 RJ-45/10-100-1000T(X)',
6be06cbb 1592 'processors' => array ('catalyst-chassis-any-1000T'),
74aee2dc
DO
1593 ),
1594 '9.1.561' => array
1595 (
1596 'dict_key' => 115,
1597 'text' => 'WS-C2970G-24TS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1598 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1599 ),
1600 '9.1.633' => array
1601 (
1602 'dict_key' => 169,
1603 'text' => 'WS-C3560-24TS: 24 RJ-45/10-100TX + 2 SFP/1000',
6be06cbb 1604 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1605 ),
1606 '9.1.634' => array
1607 (
1608 'dict_key' => 170,
1609 'text' => 'WS-C3560-48TS: 48 RJ-45/10-100TX + 4 SFP/1000',
6be06cbb 1610 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1611 ),
1612 '9.1.563' => array
1613 (
1614 'dict_key' => 171,
1615 'text' => 'WS-C3560-24PS: 24 RJ-45/10-100TX + 2 SFP/1000',
6be06cbb 1616 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1617 ),
1618 '9.1.564' => array
1619 (
1620 'dict_key' => 172,
1621 'text' => 'WS-C3560-48PS: 48 RJ-45/10-100TX + 4 SFP/1000',
6be06cbb 1622 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
74aee2dc 1623 ),
7774b149
AA
1624 '9.1.1025' => array
1625 (
1626 'dict_key' => 1807,
1627 'text' => 'WS-C3560V2-48PS: 48 RJ-45/10-100TX + 4 SFP/1000',
1628 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
1629 ),
74aee2dc
DO
1630 '9.1.614' => array
1631 (
1632 'dict_key' => 175,
1633 'text' => 'WS-C3560G-24PS: 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.615' => array
1637 (
1638 'dict_key' => 173,
1639 'text' => 'WS-C3560G-24TS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1640 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1641 ),
1642 '9.1.616' => array
1643 (
1644 'dict_key' => 176,
1645 'text' => 'WS-C3560G-48PS: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1646 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1647 ),
1648 '9.1.617' => array
1649 (
1650 'dict_key' => 174,
1651 'text' => 'WS-C3560G-48TS: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000',
6be06cbb 1652 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-any-1000T'),
74aee2dc
DO
1653 ),
1654 '9.1.626' => array
1655 (
1656 'dict_key' => 147,
56a797ef 1657 'text' => 'WS-C4948: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000 + 1 RJ-45/100TX (OOB mgmt)',
cbc30061 1658 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-uplinks-1000T', 'catalyst-chassis-mgmt'),
74aee2dc
DO
1659 ),
1660 '9.1.659' => array
1661 (
1662 'dict_key' => 377,
56a797ef 1663 'text' => 'WS-C4948-10GE: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 + 1 RJ-45/100TX (OOB mgmt)',
cbc30061 1664 'processors' => array ('catalyst-chassis-uplinks-10000X2', 'catalyst-chassis-uplinks-1000T', 'catalyst-chassis-mgmt'),
74aee2dc
DO
1665 ),
1666 '9.1.428' => array
1667 (
1668 'dict_key' => 389,
1669 'text' => 'WS-C2950G-24: 24 RJ-45/10-100TX + 2 GBIC/1000',
6be06cbb 1670 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
74aee2dc
DO
1671 ),
1672 '9.1.429' => array
1673 (
1674 'dict_key' => 390,
1675 'text' => 'WS-C2950G-48: 48 RJ-45/10-100TX + 2 GBIC/1000',
6be06cbb 1676 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
74aee2dc 1677 ),
b3f84e8e
AD
1678 '9.1.471' => array
1679 (
1680 'dict_key' => 270,
1681 'text' => '2651XM: 2 RJ-45/10-100TX',
1682 'processors' => array ('catalyst-chassis-any-100TX'),
1683 ),
74aee2dc
DO
1684 '9.1.559' => array
1685 (
1686 'dict_key' => 387,
1687 'text' => 'WS-C2950T-48: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
6be06cbb 1688 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
74aee2dc 1689 ),
8a4bee49
DO
1690 '9.1.560' => array
1691 (
1692 'dict_key' => 384,
1693 'text' => 'WS-C2950SX-48: 48 RJ-45/10-100TX + 2 1000Base-SX',
1694 'processors' => array ('catalyst-chassis-uplinks-1000SX', 'catalyst-chassis-any-100TX'),
1695 ),
74aee2dc
DO
1696 '9.1.749' => array
1697 (
1698 'dict_key' => 989,
1699 'text' => 'WS-CBS3030-DEL: 10 internal/10-100-1000T(X) + 2 RJ-45/10-100-1000T(X) + 4 SFP/1000',
71d6b313 1700 'processors' => array ('catalyst-blade-11-to-12-1000T', 'catalyst-blade-13-to-16-1000SFP', 'catalyst-blade-any-bp/1000T'),
74aee2dc
DO
1701 ),
1702 '9.1.920' => array
1703 (
1704 'dict_key' => 795,
1705 'text' => 'WS-CBS3032-DEL: 16 internal/10-100-1000T(X) + 4 RJ-45/10-100-1000T(X) + 4 SFP/1000',
71d6b313 1706 'processors' => array ('catalyst-blade-17-to-20-1000T', 'catalyst-blade-21-to-24-1000SFP', 'catalyst-blade-any-bp/1000T'),
74aee2dc 1707 ),
2217e284
DO
1708 '9.1.367' => array
1709 (
1710 'dict_key' => 404,
1711 'text' => 'WS-C3550-48: 48 RJ-45/10-100TX + 2 GBIC/1000',
1712 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000GBIC'),
1713 ),
7e87a291
DO
1714 '9.1.368' => array
1715 (
1716 'dict_key' => 398,
1717 'text' => 'WS-C3550-12T: 10 RJ-45/10-100-1000T(X) + 2 GBIC/1000',
1718 'processors' => array ('catalyst-1-to-10-1000T', 'catalyst-11-to-12-GBIC'),
1719 ),
86d614c3
DO
1720 '9.1.431' => array
1721 (
1722 'dict_key' => 399,
1723 'text' => 'WS-C3550-12G: 10 GBIC/1000 + 2 RJ-45/10-100-1000T(X)',
1724 'processors' => array ('catalyst-11-to-12-1000T', 'catalyst-chassis-any-1000GBIC'),
1725 ),
a9bd9e98
DO
1726 '9.1.282' => array
1727 (
1728 'dict_key' => 154,
1729 'text' => 'WS-C6506: modular device (INCOMPLETE!)',
1730 'processors' => array ('catalyst-chassis-any-1000T'),
1731 ),
65b4b21a
DO
1732 '9.1.1104' => array
1733 (
1734 'dict_key' => 1348,
1735 'text' => 'WS-C2350-48TD: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig option',
1736 'processors' => array
1737 (
1738 'catalyst-chassis-49-to-52-1000SFP', // TwinGig actually
1739 'catalyst-chassis-any-1000T',
1740 'catalyst-chassis-uplinks-10000X2',
1741 'catalyst-chassis-mgmt',
1742 ),
1743 ),
712010be
AA
1744 '9.1.1016' => array
1745 (
1746 'dict_key' => 1370,
1747 'text' => 'WS-C2960-48PST-L: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X)',
1748 'processors' => array
1749 (
1750 'catalyst-chassis-any-100TX',
1751 'catalyst-chassis-1-to-2-1000SFP',
1752 'catalyst-chassis-uplinks-1000T',
1753 ),
1754 ),
38c9bb20
DO
1755 '9.1.1208' => array
1756 (
1757 'dict_key' => 1394,
1758 'text' => 'WS-C2960S-24PS-L: 24 RJ-45/10-100-1000T(X) PoE+ + 4 SFP/1000',
1759 'processors' => array
1760 (
1761 'catalyst-chassis-mgmt',
1762 'catalyst-stack-25-to-28-SFP',
1763 'catalyst-stack-any-1000T',
1764 ),
1765 ),
13b28c20
DO
1766 '9.1.1227' => array
1767 (
1768 'dict_key' => 1577,
1769 'text' => 'WS-C3560X-48T: 48 RJ-45/10-100-1000T(X) + network module + OOBM',
1770 'processors' => array
1771 (
1772 'C3KX-NM-10000',
1773 'C3KX-NM-1000',
1774 'catalyst-chassis-any-1000T',
1775 'catalyst-chassis-mgmt',
1776 ),
1777 ),
b475f795
DO
1778 '9.1.1292' => array
1779 (
b0021c43 1780 'dict_key' => 1606,
b475f795
DO
1781 'text' => 'WS-C2360-48TD: 48 RJ-45 GigE + 4 SFP+/10000',
1782 'processors' => array ('catalyst-chassis-any-1000T', 'catalyst-chassis-mgmt', 'catalyst-chassis-uplinks-10000SFP+'),
1783 ),
65e11216
AD
1784 '9.5.42' => array
1785 (
1786 'dict_key' => 1796,
1787 'text' => 'WS-C2948G-L3: 48 RJ-45/10-100TX + 2 SFP/1000 ports',
1788 'processors' => array ('catalyst-2948-49-to-50-SFP', 'catalyst-2948-any-100TX'),
1789 'ifDescrOID' => 'entPhysicalName',
1790 ),
40b1e115
AD
1791 '9.6.1.82.24.2' => array
1792 (
1793 'dict_key' => 1784,
1794 'text' => 'SF 300-24P: RJ-45/10/100 + 2 RJ-45/10/100/1000T(X) + 2 combo-gig',
1795 'processors' => array
1796 (
1797 'generic-gi-3-to-4-combo-1000SFP',
1798 'generic-gi-3-to-4-combo-1000T',
1799 'generic-gi-1-to-2-1000T',
1800 'generic-fa-any-100TX',
1801 ),
1802 'ifDescrOID' => 'ifName',
1803 ),
b0021c43
AD
1804 '9.6.1.82.48.1' => array
1805 (
1806 'dict_key' => 1612,
1807 'text' => 'SF 300-48: 48 RJ-45/10/100 + 2 RJ-45/10-100-1000T(X) + 2 combo-gig',
1808 'processors' => array
1809 (
1810 'generic-gi-3-to-4-combo-1000SFP',
1811 'generic-gi-3-to-4-combo-1000T',
1812 'generic-gi-1-to-2-1000T',
1813 'generic-fa-any-100TX',
1814 ),
1815 'ifDescrOID' => 'ifName',
1816 ),
40b1e115
AD
1817 '9.6.1.83.10.1' => array
1818 (
1819 'dict_key' => 1785,
1820 'text' => 'SG 300-10: 8 RJ-45/10/100/1000T(X) + 2 combo-gig',
1821 'processors' => array
1822 (
1823 'generic-gi-9-to-10-combo-1000SFP',
1824 'generic-gi-9-to-10-combo-1000T',
1825 'generic-gi-any-1000T',
1826 ),
1827 'ifDescrOID' => 'ifName',
1828 ),
1829 '9.6.1.83.52.1' => array
1830 (
1831 'dict_key' => 1783,
1832 'text' => 'SG 300-52: 50 RJ-45/10/100/1000T(X) + 2 combo-gig',
1833 'processors' => array
1834 (
1835 'generic-gi-51-to-52-combo-1000SFP',
1836 'generic-gi-51-to-52-combo-1000T',
1837 'generic-gi-any-1000T',
1838 ),
1839 'ifDescrOID' => 'ifName',
1840 ),
74aee2dc
DO
1841 '9.12.3.1.3.719' => array
1842 (
1843 'dict_key' => 960,
1844 'text' => 'N5K-C5020: 40 SFP+/10000',
e7662d90 1845 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
74aee2dc 1846 ),
bc45a3a4
DO
1847 '9.12.3.1.3.798' => array
1848 (
1849 'dict_key' => 959,
1850 'text' => 'N5K-C5010: 20 SFP+/10000',
1851 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1852 ),
0533b64d
DO
1853 '9.12.3.1.3.1008' => array
1854 (
1855 'dict_key' => 1412,
1856 'text' => 'N5K-C5548P: 32 SFP+/10000',
1857 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1858 ),
473dd02e
JT
1859 '9.12.3.1.3.1084' => array
1860 (
1861 'dict_key' => 1412,
1862 'text' => 'N5K-C5548P: 32 SFP+/10000',
1863 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1864 ),
a5e2273a
AD
1865 '11.2.3.7.11.9' => array
1866 (
1867 'dict_key' => 1086,
1868 'text' => 'J4121A: modular system',
1869 'processors' => array ('procurve-modular-100TX'),
1870 ),
13b28c20
DO
1871 '11.2.3.7.11.19' => array
1872 (
1873 'dict_key' => 859,
1874 'text' => 'J4813A: 24 RJ-45/10-100TX + 2 modules of varying type',
1875 'processors' => array ('procurve-chassis-100TX'),
1876 ),
6249647d
AD
1877 '11.2.3.7.11.29' => array
1878 (
1879 'dict_key' => 866,
1880 'text' => 'J4899A: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1881 'processors' => array ('procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
1882 ),
4bbb87a3
AD
1883 '11.2.3.7.11.31' => array
1884 (
1885 'dict_key' => 870,
1886 'text' => 'J4903A: 24 RJ-45/10-100-1000T(X)',
1887 'processors' => array ('procurve-chassis-1000T'),
1888 ),
56a797ef
DO
1889 '11.2.3.7.11.32' => array
1890 (
1891 'dict_key' => 871,
1892 'text' => 'J4904A: 48 RJ-45/10-100-1000T(X)',
1893 'processors' => array ('procurve-chassis-1000T'),
1894 ),
4bbb87a3
AD
1895 '11.2.3.7.11.34' => array
1896 (
1897 'dict_key' => 864,
1898 'text' => 'J8164A: 24 RJ-45/10-100TX POE + 2 RJ-45/10-100-1000T(X)',
1899 'processors' => array ('procurve-25-to-26-1000T', 'procurve-chassis-100TX'),
1900 ),
74aee2dc
DO
1901 '11.2.3.7.11.36' => array
1902 (
1903 'dict_key' => 865,
4bbb87a3 1904 'text' => 'J8164A: 24 RJ-45/10-100TX PoE + 2 RJ-45/10-100-1000T(X)',
56a797ef 1905 'processors' => array ('procurve-25-to-26-1000T', 'procurve-chassis-100TX'),
74aee2dc
DO
1906 ),
1907 '11.2.3.7.11.35' => array
1908 (
1909 'dict_key' => 867,
4bbb87a3 1910 'text' => 'J8165A: 48 RJ-45/10-100TX PoE + 2 RJ-45/10-100-1000T(X)',
56a797ef
DO
1911 'processors' => array ('procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
1912 ),
a5e2273a 1913 '11.2.3.7.11.44' => array
56a797ef 1914 (
a5e2273a
AD
1915 'dict_key' => 866,
1916 'text' => 'J4899B: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1917 'processors' => array ('procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
74aee2dc 1918 ),
4bbb87a3
AD
1919 '11.2.3.7.11.53' => array
1920 (
1921 'dict_key' => 881,
1922 'text' => 'J8773A: modular system',
1923 'processors' => array ('procurve-modular-1000T'),
1924 ),
10ab4841
AD
1925 '11.2.3.7.11.62' => array
1926 (
1927 'dict_key' => 855,
1928 'text' => 'J9020A: 48 RJ-45/10-100TX + 2 RJ-45/10-1000-1000T(x) + 2 SFP-1000',
1929 'processors' => array ('procurve-51-to-52-1000SFP', 'procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
1930 ),
13b28c20
DO
1931 '11.2.3.7.11.63' => array
1932 (
1933 'dict_key' => 868,
1934 'text' => 'J9021A: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1935 'processors' => array ('procurve-21-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1936 ),
1937 '11.2.3.7.11.65' => array
1938 (
1939 'dict_key' => 850,
1940 'text' => 'J9028A: 22 RJ-45/10-100-1000T(X) + 2 combo-gig',
1941 'processors' => array ('smc2-combo-23-to-24', 'smc2-any-1000T'),
1942 ),
a5e2273a
AD
1943 '11.2.3.7.11.68' => array
1944 (
1945 'dict_key' => 873,
1946 'text' => 'J9050A: 48 RJ-45/10-100-1000T',
1947 'processors' => array ('procurve-chassis-1000T'),
1948 ),
83aedacd
AD
1949 '11.2.3.7.11.78' => array
1950 (
1951 'dict_key' => 861,
1952 'text' => 'J9087A: 24 RJ-45/10-100TX PoE + 2 1000T + 2 SFP-1000',
1953 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
1954 ),
1955 '11.2.3.7.11.80' => array
1956 (
1957 'dict_key' => 1570,
1958 'text' => 'J9086A: 24 RJ-45/10-100TX 12 PoE + 2 1000T + 2 SFP-1000',
1959 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
1960 ),
13b28c20
DO
1961 '11.2.3.7.11.86' => array
1962 (
1963 'dict_key' => 1571,
1964 'text' => 'J9145A: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1965 'processors' => array ('procurve-21-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1966 ),
4b43f713
DO
1967 '11.2.3.7.11.87' => array
1968 (
1969 'dict_key' => 1349,
13b28c20 1970 'text' => 'J9147A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
4b43f713
DO
1971 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1972 ),
f8de6305
DO
1973 '11.2.3.7.11.85' => array
1974 (
1975 'dict_key' => 1600,
1976 'text' => 'J9148A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1977 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1978 ),
db5d7da5
AD
1979 '11.2.3.7.11.88' => array
1980 (
1981 'dict_key' => 1349,
1982 'text' => 'J9279A: 22 RJ-45/10-100-1000T(X) + 2 combo-gig + varying uplinks',
1983 'processors' => array ('procurve-23-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1984 ),
10ab4841
AD
1985 '11.2.3.7.11.89' => array
1986 (
1987 'dict_key' => 857,
1988 'text' => 'J9280A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1989 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1990 ),
13b28c20
DO
1991 '11.2.3.7.11.79' => array
1992 (
1993 'dict_key' => 863,
1994 'text' => 'J9089A: 48 RJ-45/10-100TX PoE + 2 1000T + 2 SFP-1000',
1995 'processors' => array ('procurve-49-to-50-1000T', 'procurve-51-to-52-1000SFP', 'procurve-chassis-100TX'),
4bbb87a3
AD
1996 ),
1997 '11.2.3.7.11.95' => array
1998 (
1999 'dict_key' => 1711,
2000 'text' => 'J9138A: 24 RJ-45/10-100TX PoE + 2 1000T + 2 combo-gig',
2001 'processors' => array ('procurve-25-to-26-1000T', 'procurve-27-to-28-1000SFP', 'procurve-chassis-100TX'),
13b28c20 2002 ),
5d930daf
AD
2003 '11.2.3.7.11.105' => array
2004 (
2005 'dict_key' => 1641,
2006 'text' => 'J9452A: 48 RJ-45/10-100-1000T + 2 SFP-10000+',
2007 'processors' => array ('procurve-49-to-52-10000SFP+', 'procurve-chassis-1000T'),
2008 ),
4a2358b3
DO
2009 '11.2.3.7.11.33.4.1.1' => array
2010 (
2011 'dict_key' => 1605,
2012 'text' => 'HP GbE2c w/SFP',
2013 'processors' => array
2014 (
2015 'gbe2csfp-1-to-16',
2016 'gbe2csfp-17',
2017 'gbe2csfp-18',
2018 'gbe2csfp-19',
2019 'gbe2csfp-20',
2020 'gbe2csfp-21sfp',
2021 'gbe2csfp-22sfp',
2022 'gbe2csfp-23sfp',
2023 'gbe2csfp-24sfp',
2024 'gbe2csfp-21',
2025 'gbe2csfp-22',
2026 'gbe2csfp-23',
2027 'gbe2csfp-24',
2028 ),
2029 ),
1cd6eca3
AD
2030 '43.1.16.4.3.29' => array
2031 (
2032 'dict_key' => 758,
2033 'text' => '4200G: 44 RJ-45/10-100-1000T(X) + 4 combo-gig',
2034 'processors' => array ('3com-49-to-52-1000SFP', '3com-any-1000T'),
2035 ),
78cfe89b
AD
2036 '45.3.68.5' => array
2037 (
2038 'dict_key' => 1085,
2039 'text' => 'BES50GE-12T PWR: 12 RJ-45/10-100-1000T(X)',
2040 'processors' => array ('nortel-any-1000T'),
2041 ),
49055269
AD
2042 '171.10.76.10' => array
2043 (
2044 'dict_key' => 1799,
2045 'text' => 'DGS-1210-24: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
2046 'processors' => array ('dlink-21-to-24-comboSFP', 'dlink-21-to-24-comboT', 'dlink-any-1000T'),
2047 'ifDescrOID' => 'ifName',
2048 ),
78cfe89b
AD
2049 '202.20.59' => array
2050 (
2051 'dict_key' => 1371,
2052 'text' => 'SMC8124L2: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
2053 'processors' => array ('smc2-combo-21-to-24', 'smc2-any-1000T'),
2054 ),
2055 '202.20.66' => array
2056 (
2057 'dict_key' => 1567,
2058 'text' => 'SMC6128L2: 24 RJ-45/10-100TX + 4 combo-gig ports',
2059 'processors' => array ('smc2-combo-25-to-28', 'smc2-1000T-25-to-28', 'smc2-any-100TX'),
2060 ),
2061 '202.20.68' => array
2062 (
2063 'dict_key' => 1374,
2064 'text' => 'SMC8150L2: 46 RJ-45/10-100-1000T(X) + 4 combo ports',
2065 'processors' => array ('smc-combo-45-to-48', 'nortel-any-1000T'),
2066 ),
2067 '207.1.14.53' => array
2068 (
2069 'dict_key' => 1720,
2070 'text' => 'AT9924T: 24 RJ-45/10-100-1000T(X) ports',
2071 'processors' => array ('generic-port-any-1000T'),
2072 ),
f60a9008
AD
2073 '388.18' => array
2074 (
2075 'dict_key' => 1795,
2076 'text' => 'RFS 4000: 5 RJ-45/10-100-1000T(X) + 1 combo uplink ports',
2077 'processors' => array ('motorola-rfs-uplink-comboSFP', 'motorola-rfs-uplink-comboT', 'motorola-rfs-any-1000T'),
2078 ),
fc807353
DO
2079 '4526.100.1.1' => array
2080 (
2081 'dict_key' => 587,
2082 'text' => 'FSM7328S: 24 RJ-45/10-100TX + 4 combo-gig',
2083 'processors' => array ('netgear-chassis-any-100TX', 'netgear-chassis-any-1000SFPcombo', 'netgear-chassis-any-1000T'),
2084 ),
74aee2dc
DO
2085 '4526.100.2.2' => array
2086 (
2087 'dict_key' => 562,
6be06cbb
DO
2088 'text' => 'GSM7224: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
2089 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
74aee2dc 2090 ),
3e8ad42f
DO
2091 '4526.100.2.3' => array
2092 (
2093 'dict_key' => 559,
2094 'text' => 'GSM7212: 12 combo-gig',
2095 'processors' => array ('netgear-chassis-any-1000SFPcombo', 'netgear-chassis-any-1000T'),
2096 ),
1b24b8ae
DO
2097 '4526.100.11.1' => array
2098 (
2099 'dict_key' => 557,
2100 'text' => 'GSM7224R: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
2101 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
2102 ),
12af10b8
DO
2103 '4526.100.11.5' => array
2104 (
2105 'dict_key' => 1602,
2106 'text' => 'GSM7224v2: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
2107 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
2108 ),
e34faed3
DO
2109 '4526.100.1.13' => array
2110 (
2111 'dict_key' => 1601,
2112 'text' => 'GSM7328Sv2: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
2113 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
2114 ),
7e1ab7dc
DO
2115 '4526.100.1.14' => array
2116 (
2117 'dict_key' => 1794,
2118 'text' => 'GSM7352Sv2: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + SFP+ uplinks',
2119 'processors' => array ('netgear-chassis-45-to-48-1000SFPcombo', 'netgear-chassis-any-1000T', 'netgear-chassis-any-SFP+'),
2120 ),
91389980
DO
2121 '2636.1.1.1.2.29' => array
2122 (
2123 'dict_key' => 925,
2124 'text' => 'MX240 modular router',
2125 'processors' => array ('juniper-DPCE-R-4XGE-XFP'),
2126 ),
1f54e1ba
DO
2127 // Juniper Networks assigns single SNMP OID per series:
2128 // EX2200 2636.1.1.1.1.43
2129 // EX3200 2636.1.1.1.2.30
2130 // EX4200 2636.1.1.1.2.31
2131 // EX4500 2636.1.1.1.1.44
2132 // There is a special workaround in code below to derive specific
2133 // product number from sysDescr string.
e68824f6
AD
2134 '2636.1.1.1.2.30' => array
2135 (
8595dfd0 2136 'dict_key' => 900,
e68824f6
AD
2137 'text' => 'Juniper EX3200 series',
2138 'processors' => array ('juniper-ex-pic0-1000T', 'juniper-ex-mgmt'),
2139 ),
1f54e1ba
DO
2140 '2636.1.1.1.2.31' => array
2141 (
2142 'dict_key' => 905,
2143 'text' => 'Juniper EX4200 series',
2144 'processors' => array ('juniper-ex-pic0-1000T', 'juniper-ex-mgmt'),
2145 ),
4d6aad51
DO
2146 '2011.2.23.94' => array
2147 (
2148 'dict_key' => 1619,
2149 'text' => 'S2352P-EI: 48 RJ-45/10-100TX + 4 SFP-1000',
2150 'processors' => array ('quidway-any-100TX', 'quidway-any-1000SFP'),
2151 ),
7d69a266
DO
2152 '2011.2.23.96' => array
2153 (
2154 'dict_key' => 1321,
24c3e444 2155 'text' => 'S5328C-EI-24S: 20 SFP-1000 + 4 combo-gig + 2 XFP slots',
7d69a266
DO
2156 'processors' => array ('quidway-21-to-24-comboT', 'quidway-any-1000SFP', 'quidway-XFP', 'quidway-mgmt'),
2157 ),
b55f8de3
DO
2158 '2011.2.23.103' => array
2159 (
2160 'dict_key' => 1341,
2161 'text' => 'S5352C-SI: 48 RJ-45/10-100-1000T(X) + optional 2xXFP/4xSFP slots',
2162 'processors' => array ('quidway-slot1-SFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
2163 ),
38bd461c
AA
2164 '2011.2.23.97' => array
2165 (
2166 'dict_key' => 1337,
2167 'text' => 'S5352C-EI: 48 RJ-45/10-100-1000T(X) + optional 2xXFP/4xSFP slots',
2168 'processors' => array ('quidway-slot1-SFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
2169 ),
2170 '2011.2.23.95' => array
2171 (
2172 'dict_key' => 1335,
2173 'text' => 'S5328C-EI: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 XFP slots',
2174 'processors' => array ('quidway-21-to-24-comboSFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
2175 ),
24c3e444
DO
2176 '2011.2.23.102' => array
2177 (
2178 'dict_key' => 1339,
2179 'text' => 'S5328C-SI: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 XFP slots',
2180 'processors' => array ('quidway-21-to-24-comboSFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
2181 ),
661b3fdb
DO
2182 '1991.1.3.45.2.1.1.1' => array
2183 (
2184 'dict_key' => 127,
2185 'text' => 'FGS648P: 48 RJ-45/10-100-1000T(X) + 4 combo-gig + uplink slot',
2186 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T', 'fgs-uplinks'),
2187 ),
2188 '1991.1.3.45.2.2.1.1' => array
2189 (
2190 'dict_key' => 131,
2191 'text' => 'FGS648P-POE: 48 RJ-45/10-100-1000T(X) + 4 combo-gig + uplink slot',
2192 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T', 'fgs-uplinks'),
2193 ),
e9c42863
DO
2194 '1991.1.3.54.2.4.1.1' => array # L2 software
2195 (
2196 'dict_key' => 1362,
2197 'text' => 'FCX 648: 48 RJ-45/10-100-1000T(X) + uplink slot with 4 SFP+',
2198 'processors' => array ('fgs-any-1000T', 'fcx-uplinks', 'fcx-management'),
2199 ),
2200 '1991.1.3.54.2.4.1.3' => array # L3 software
ec523868
DO
2201 (
2202 'dict_key' => 1362,
2203 'text' => 'FCX 648: 48 RJ-45/10-100-1000T(X) + uplink slot with 4 SFP+',
2204 'processors' => array ('fgs-any-1000T', 'fcx-uplinks', 'fcx-management'),
2205 ),
6c32c3ff
AA
2206 '1991.1.3.46.1.1.1.1' => array
2207 (
2208 'dict_key' => 413,
2209 'text' => 'FLS 624: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 3 optional 10G modules',
2210 'processors' => array ('fls624-combo', 'fgs-any-1000T', 'fls-uplinks'),
2211 ),
2212 '1991.1.3.46.2.1.1.1' => array
2213 (
2214 'dict_key' => 414,
2215 'text' => 'FLS 648: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 optional 10G modules',
2216 'processors' => array ('fls648-combo', 'fgs-any-1000T', 'fls-uplinks'),
2217 ),
13b28c20
DO
2218 '1991.1.3.52.2.2.1.1' => array
2219 (
2220 'dict_key' => 1032,
2221 'text' => 'FWS648G: 4 combo-gig + 44 RJ-45/10-100-1000T(X)',
2222 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T'),
2223 ),
4eeadb79
DO
2224 '1916.2.71' => array
2225 (
2226 'dict_key' => 694,
2227 'text' => 'X450a-24t: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + XFP uplinks slot',
2228 'processors' => array ('summit-25-to-26-XFP-uplinks', 'summit-21-to-24-comboSFP', 'summit-any-1000T', 'summit-management'),
2229 ),
dbcf1931
DO
2230 '1916.2.139' => array
2231 (
2232 'dict_key' => 1353,
2233 'text' => 'X480-24x: 12 SFP-1000 + 12 combo-gig + 2 XFP + VIM slot',
2234 'processors' => array
2235 (
2236 'summit-27-to-30-XFP-uplinks',
2237 'summit-25-to-26-XFP-uplinks',
2238 'summit-13-to-24-comboT',
2239 'summit-any-SFP',
2240 'summit-management'
2241 ),
2242 ),
8acd246d
DO
2243 '6027.1.3.12' => array
2244 (
2245 'dict_key' => 1471,
2246 'text' => 'Force10 S60: 44 RJ-45/10-100-1000T(X) + 4 SFP-1000 ports + 0/2/4 SFP+ ports',
1e5a92d8
DO
2247 'processors' => array ('ftos-44-to-47-1000SFP', 'ftos-any-1000T', 'ftos-any-10000SFP+', 'ftos-mgmt'),
2248 ),
84ea7e6e
DO
2249 '6027.1.3.13' => array
2250 (
2251 'dict_key' => 1470,
2252 'text' => 'Force10 S55: 44 RJ-45/10-100-1000T(X) + 4 SFP-1000 ports + 0/2/4 SFP+ ports',
2253 'processors' => array ('ftos-44-to-47-1000SFP', 'ftos-any-1000T', 'ftos-any-10000SFP+', 'ftos-mgmt'),
2254 ),
1e5a92d8
DO
2255 '6027.1.3.14' => array
2256 (
2257 'dict_key' => 1472,
2258 'text' => 'Force10 S4810: 48 SFP+-1000/10000 + 4 QSFP-40000 ports',
2259 'processors' => array ('ftos-any-10000SFP+', 'ftos-any-QSFP+', 'ftos-mgmt'),
8acd246d 2260 ),
a28aee72
AD
2261 '12356.101.1.3002'=> array
2262 (
2263 'dict_key' => 1609,
2264 'text' => 'FG310B: 10 RJ-45/10-1000T',
78cfe89b 2265 'processors' => array('generic-port-any-1000T'),
a28aee72 2266 ),
2ea5fd28
DO
2267 '30065.1.3011.7048.427.3648' => array
2268 (
2269 'dict_key' => 1726,
2270 'text' => 'DCS-7048T-A: 48 1000T + 4 SFP+/10000',
2271 'processors' => array ('arista-49-to-52-SFP+', 'arista-any-1000T', 'arista-management'),
2272 ),
9d223b3e
DO
2273 '30065.1.3011.7050.3282.52' => array
2274 (
2275 'dict_key' => 1731,
2276 'text' => 'DCS-7050S-52: 52 SFP+',
2277 'processors' => array ('arista-any-SFP+', 'arista-management'),
2278 ),
06a03a99
AD
2279 '30065.1.3011.7124.3282' => array
2280 (
92df4b0e
AD
2281 'dict_key' => 1610,
2282 'text' => 'DCS-7124S: 24 SFP+/10000',
2283 'processors' => array ('arista-any-SFP+', 'arista-management'),
2284 ),
1ce6a44d
AD
2285 '674.10895.4' => array
2286 (
2287 'dict_key' => 1622,
2288 'text' => 'PowerConnect 5224: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
2289 'processors' => array ('dell-5224-21-to-24-combo-1000SFP', 'dell-52xx-any-1000T'),
2290 ),
1b10e7cf
AD
2291 '674.10895.3000' => array
2292 (
2293 'dict_key' => 1623,
2294 'text' => 'PowerConnect 6024F: 16 SFP + 8 combo ports',
8595dfd0 2295 'processors' => array ('dell-g17-to-g24-combo-1000T', 'dell-any-1000SFP'),
1b10e7cf
AD
2296 'ifDescrOID' => 'ifName',
2297 ),
92df4b0e
AD
2298 '674.10895.3003' => array
2299 (
2300 'dict_key' => 1611,
2301 'text' => 'PowerConnect 3348: 48 RJ-45/10-100TX + 2 combo ports',
2302 'processors' => array ('dell-33xx-any-combo-1000SFP', 'dell-33xx-any-1000T', 'dell-33xx-any-100TX'),
2303 'ifDescrOID' => 'entPhysicalName',
2304 ),
1b10e7cf
AD
2305 '674.10895.3004' => array
2306 (
2307 'dict_key' => 349,
2308 'text' => 'PowerConnect 5324: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 2309 'processors' => array ('dell-g21-to-g24-combo-1000SFP', 'generic-g-any-1000T'),
1b10e7cf
AD
2310 'ifDescrOID' => 'ifName',
2311 ),
92df4b0e
AD
2312 '674.10895.3007' => array
2313 (
2314 'dict_key' => 347,
2315 'text' => 'PowerConnect 3448: 48 RJ-45/10-100TX + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
2316 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
2317 'ifDescrOID' => 'ifName',
2318 ),
2319 '674.10895.3009' => array
2320 (
2321 'dict_key' => 348,
2322 'text' => 'PowerConnect 3448P: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
2323 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
2324 'ifDescrOID' => 'ifName',
2325 ),
367fcba0
AD
2326 '674.10895.3010' => array
2327 (
2328 'dict_key' => 350,
2329 'text' => 'PowerConnect 6224: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
2330 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
2331 ),
0d456a22
DO
2332 '674.10895.3011' => array
2333 (
2334 'dict_key' => 353,
2335 'text' => 'PowerConnect 6248: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + optional uplinks',
2336 # 10G uplinks actually may be SFP+, T, CX4 or XFP
2337 'processors' => array ('netgear-chassis-45-to-48-1000SFPcombo', 'netgear-chassis-any-1000T', 'netgear-chassis-any-SFP+'),
2338 ),
e326551d
AD
2339 '674.10895.3014' => array
2340 (
2341 'dict_key' => 352,
2342 'text' => 'PowerConnect 6224F: 20 SFP + 4 combo-gig',
2343 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000SFP'),
2344 ),
92df4b0e
AD
2345 '674.10895.3017' => array
2346 (
2347 'dict_key' => 1067,
2348 'text' => 'PowerConnect 3548: 48 RJ-45/10-100TX + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
2349 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
2350 ),
2351 '674.10895.3019' => array
2352 (
2353 'dict_key' => 1068,
2354 'text' => 'PowerConnect 3548P: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X) ports',
2355 'processors' => array ('dell-g1-to-g2-1000SFP', 'dell-g3-to-g4-1000T', 'dell-any-100TX'),
2356 ),
92df4b0e
AD
2357 '674.10895.3020' => array
2358 (
2359 'dict_key' => 1069,
2360 'text' => 'PowerConnect 5424: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 2361 'processors' => array ('dell-g21-to-g24-combo-1000SFP', 'generic-g-any-1000T'),
92df4b0e
AD
2362 'ifDescrOID' => 'ifName',
2363 ),
2364 '674.10895.3021' => array
2365 (
2366 'dict_key' => 1070,
2367 'text' => 'PowerConnect 5448: 44 RJ-45/10-100-1000T(X) + 4 combo ports',
8595dfd0 2368 'processors' => array ('generic-g45-to-g48-combo-1000SFP', 'generic-g-any-1000T'),
92df4b0e 2369 'ifDescrOID' => 'ifName',
06a03a99 2370 ),
ac02ab69
AD
2371 '10977.11825.11833.97.25451.12800.100.4.4' => array
2372 (
2373 'dict_key' => 577,
2374 'text' => 'FS750T2: 48 RJ-45/10-100TX + 2 combo-gig',
2375 'processors' => array ('netgear-49-to-50-combo-1000SFP', 'netgear-49-to-50-combo-1000T', 'netgear-any-100TX'),
2376 ),
8595dfd0
AD
2377 '3955.6.1.2048.1' => array
2378 (
2379 'dict_key' => 1624,
2380 'text' => 'Linksys SRW2048: 44 RJ-45/10-100-1000T(X) + 4 combo ports',
2381 'processors' => array ('generic-g45-to-g48-combo-1000SFP', 'generic-g-any-1000T'),
2382 'ifDescrOID' => 'ifName',
2383 ),
c4acc30b
AD
2384 '11863.6.10.58' => array
2385 (
2386 'dict_key' => 1793,
2387 'text' => 'TL-SG5426: 22 RJ-45/10-100-1000T(X) + 4 combo ports',
2388 'processors' => array ('tplink-21-to-24-combo-1000SFP', 'tplink-any-1000T'),
2389 ),
a3520e4c
DO
2390 '119.1.203.2.2.41' => array
2391 (
2392 'dict_key' => 1810,
2393 'text' => 'PF5240: 48 RJ-45/10-100-1000T(X) + 4 SFP+',
2394 'processors' => array ('nec-any-1000T', 'nec-any-SFP+', 'nec-mgmt'),
2395 ),
74aee2dc
DO
2396);
2397
536e7323 2398global $swtype_pcre;
1f54e1ba
DO
2399$swtype_pcre = array
2400(
2401 '/Huawei Versatile Routing Platform Software.+VRP.+Software, Version 5.30 /s' => 1360,
2402 '/Huawei Versatile Routing Platform Software.+VRP.+Software, Version 5.50 /s' => 1361,
8732faac 2403 '/Huawei Versatile Routing Platform Software.+VRP.+Software,\s*Version 5.70 /is' => 1369,
1f54e1ba
DO
2404 // FIXME: get sysDescr for IronWare 5 and add a pattern
2405 '/^Brocade Communications Systems.+, IronWare Version 07\./' => 1364,
2406 '/^Juniper Networks,.+JUNOS 9\./' => 1366,
2407 '/^Juniper Networks,.+JUNOS 10\./' => 1367,
2ea5fd28 2408 '/^Arista Networks EOS version 4\./' => 1675,
1f54e1ba
DO
2409);
2410
74aee2dc
DO
2411function updateStickerForCell ($cell, $attr_id, $new_value)
2412{
dec748f6 2413 if
472510e7 2414 (
dec748f6
MH
2415 isset ($cell['attrs'][$attr_id])
2416 and !strlen ($cell['attrs'][$attr_id]['value'])
472510e7
AA
2417 and strlen ($new_value)
2418 )
74aee2dc
DO
2419 commitUpdateAttrValue ($cell['id'], $attr_id, $new_value);
2420}
2421
bdc91a5c
DO
2422// Accept "X-Y" on input and make sure, that PortInterfaceCompat contains
2423// a record with IIF id = X and OIF id = Y.
2424function checkPIC ($port_type_id)
2425{
f2005400
AA
2426 // cache PortInterfaceCompat
2427 static $compat_array = NULL;
2428 if (! isset ($compat_array))
bdc91a5c 2429 {
f2005400
AA
2430 $compat_array = array();
2431 foreach (getPortInterfaceCompat() as $record)
2432 {
2433 $key = $record['iif_id'] . '-' . $record['oif_id'];
2434 $compat_array[$key] = 1;
2435 }
2436 }
92df4b0e 2437
f2005400
AA
2438 if (preg_match ('/^(\d+-)?(\d+)$/', $port_type_id, $m))
2439 {
2440 $iif_id = $m[1];
2441 $oif_id = $m[2];
2442 if (empty ($iif_id[1]))
2443 {
2444 $iif_id = 1;
2445 $port_type_id = $iif_id . '-' . $port_type_id;
2446 }
2447 if (! array_key_exists ($port_type_id, $compat_array))
2448 {
2449 commitSupplementPIC ($iif_id, $oif_id);
2450 $compat_array[$port_type_id] = 1;
2451 }
bdc91a5c 2452 }
bdc91a5c
DO
2453}
2454
8536e20a
DO
2455$msgcode['doSNMPmining']['ERR1'] = 161;
2456$msgcode['doSNMPmining']['ERR2'] = 162;
8228bdb4 2457function doSNMPmining ($object_id, $snmpsetup)
74aee2dc 2458{
74aee2dc
DO
2459 $objectInfo = spotEntity ('object', $object_id);
2460 $objectInfo['attrs'] = getAttrValues ($object_id);
2461 $endpoints = findAllEndpoints ($object_id, $objectInfo['name']);
2462 if (count ($endpoints) == 0)
8ab645cf 2463 return showFuncMessage (__FUNCTION__, 'ERR1'); // endpoint not found
74aee2dc 2464 if (count ($endpoints) > 1)
8ab645cf 2465 return showFuncMessage (__FUNCTION__, 'ERR2'); // can't pick an address
4848a7e3
DO
2466
2467 switch ($objectInfo['objtype_id'])
2468 {
24a6e3a2 2469 case 7:
4848a7e3 2470 case 8:
7b2a1a90 2471 $device = new RTSNMPDevice ($endpoints[0], $snmpsetup);
8228bdb4 2472 return doSwitchSNMPmining ($objectInfo, $device);
4848a7e3 2473 case 2:
7b2a1a90 2474 $device = new APCPowerSwitch ($endpoints[0], $snmpsetup);
8228bdb4 2475 return doPDUSNMPmining ($objectInfo, $device);
92df4b0e 2476 }
4848a7e3
DO
2477}
2478
24a6e3a2 2479$msgcode['doSwitchSNMPmining']['ERR3'] = 188;
e22f9600 2480$msgcode['doSwitchSNMPmining']['ERR4'] = 189;
8228bdb4 2481function doSwitchSNMPmining ($objectInfo, $device)
4848a7e3 2482{
4848a7e3 2483 global $known_switches, $iftable_processors;
92df4b0e 2484
8228bdb4 2485 if (FALSE === ($sysObjectID = $device->snmpget ('sysObjectID.0')))
8ab645cf 2486 return showFuncMessage (__FUNCTION__, 'ERR3'); // // fatal SNMP failure
ac02ab69 2487 $sysObjectID = preg_replace ('/^.*(enterprises\.|joint-iso-ccitt\.)([\.[:digit:]]+)$/', '\\2', $sysObjectID);
8228bdb4
DO
2488 $sysName = substr ($device->snmpget ('sysName.0'), strlen ('STRING: '));
2489 $sysDescr = substr ($device->snmpget ('sysDescr.0'), strlen ('STRING: '));
74aee2dc 2490 $sysDescr = str_replace (array ("\n", "\r"), " ", $sysDescr); // Make it one line
92df4b0e 2491 $ifDescr_tablename = (isset($known_switches[$sysObjectID]['ifDescrOID'])) ? $known_switches[$sysObjectID]['ifDescrOID'] : 'ifDescr';
74aee2dc 2492 if (!isset ($known_switches[$sysObjectID]))
8ab645cf 2493 return showFuncMessage (__FUNCTION__, 'ERR4', array ($sysObjectID)); // unknown OID
7e577e27 2494 showSuccess ($known_switches[$sysObjectID]['text']);
5e193b67
DO
2495 foreach (array_keys ($known_switches[$sysObjectID]['processors']) as $pkey)
2496 if (!array_key_exists ($known_switches[$sysObjectID]['processors'][$pkey], $iftable_processors))
2497 {
8ab645cf 2498 showWarning ('processor "' . $known_switches[$sysObjectID]['processors'][$pkey] . '" not found');
5e193b67
DO
2499 unset ($known_switches[$sysObjectID]['processors'][$pkey]);
2500 }
56a797ef 2501 updateStickerForCell ($objectInfo, 2, $known_switches[$sysObjectID]['dict_key']);
74aee2dc
DO
2502 updateStickerForCell ($objectInfo, 3, $sysName);
2503 switch (1)
2504 {
da273595 2505 case preg_match ('/^9\.1\./', $sysObjectID): // Catalyst w/one AC port
84986395
DO
2506 $exact_release = preg_replace ('/^.*, Version ([^ ]+), .*$/', '\\1', $sysDescr);
2507 $major_line = preg_replace ('/^([[:digit:]]+\.[[:digit:]]+)[^[:digit:]].*/', '\\1', $exact_release);
74aee2dc
DO
2508 $ios_codes = array
2509 (
2510 '12.0' => 244,
2511 '12.1' => 251,
2512 '12.2' => 252,
2513 );
2514 updateStickerForCell ($objectInfo, 5, $exact_release);
6be06cbb
DO
2515 if (array_key_exists ($major_line, $ios_codes))
2516 updateStickerForCell ($objectInfo, 4, $ios_codes[$major_line]);
8228bdb4 2517 $sysChassi = $device->snmpget ('1.3.6.1.4.1.9.3.6.3.0');
74aee2dc
DO
2518 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2519 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
bdc91a5c
DO
2520 checkPIC ('1-29');
2521 commitAddPort ($objectInfo['id'], 'con0', '1-29', 'console', ''); // RJ-45 RS-232 console
b3f84e8e
AD
2522 if (preg_match ('/Cisco IOS Software, C2600/', $sysDescr))
2523 commitAddPort ($objectInfo['id'], 'aux0', '1-29', 'auxillary', ''); // RJ-45 RS-232 aux port
da273595
AD
2524 if ($sysObjectID == '9.1.956')
2525 {
2526 // models with two AC inputs
2527 checkPIC ('1-16');
2528 commitAddPort ($objectInfo['id'], 'AC-in-1', '1-16', 'AC1', '');
2529 commitAddPort ($objectInfo['id'], 'AC-in-2', '1-16', 'AC2', '');
2530 }
2531 elseif ($sysObjectID != '9.1.749' and $sysObjectID != '9.1.920')
facd0235 2532 {
da273595 2533 // assume the rest have one AC input, but exclude blade devices
facd0235
DO
2534 checkPIC ('1-16'); // AC input
2535 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2536 }
74aee2dc 2537 break;
65e11216 2538 case preg_match ('/^9\.5\.42/', $sysObjectID): // Catalyst 2948 running CatOS
869d4ff4
DO
2539 case preg_match ('/^9\.6\.1\./', $sysObjectID): // Cisco SF series
2540 checkPIC ('1-681');
2541 commitAddPort ($objectInfo['id'], 'con0', '1-681', 'console', ''); // DB-9 RS-232 console
b0021c43
AD
2542 checkPIC ('1-16');
2543 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2544 break;
56a797ef 2545 case preg_match ('/^9\.12\.3\.1\.3\./', $sysObjectID): // Nexus
84986395
DO
2546 $exact_release = preg_replace ('/^.*, Version ([^ ]+), .*$/', '\\1', $sysDescr);
2547 $major_line = preg_replace ('/^([[:digit:]]+\.[[:digit:]]+)[^[:digit:]].*/', '\\1', $exact_release);
74aee2dc
DO
2548 $nxos_codes = array
2549 (
2550 '4.0' => 963,
2551 '4.1' => 964,
2552 );
6be06cbb
DO
2553 if (array_key_exists ($major_line, $nxos_codes))
2554 updateStickerForCell ($objectInfo, 4, $nxos_codes[$major_line]);
74aee2dc 2555 updateStickerForCell ($objectInfo, 5, $exact_release);
0533b64d
DO
2556 $sysChassi = $device->snmpget ('1.3.6.1.2.1.47.1.1.1.1.11.149');
2557 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2558 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
bdc91a5c 2559 checkPIC ('1-29');
24a6e3a2 2560 commitAddPort ($objectInfo['id'], 'con0', '1-29', 'console', ''); // RJ-45 RS-232 console
dcfa87d7
DO
2561 checkPIC ('1-16'); // AC input
2562 commitAddPort ($objectInfo['id'], 'AC-in-1', '1-16', 'AC1', '');
2563 commitAddPort ($objectInfo['id'], 'AC-in-2', '1-16', 'AC2', '');
74aee2dc 2564 break;
13b28c20
DO
2565 case preg_match ('/^11\.2\.3\.7\.11\.(\d+)$/', $sysObjectID, $matches): // ProCurve
2566 $console_per_product = array
2567 (
5d930daf
AD
2568 33 => '1-29', # RJ-45 RS-232
2569 63 => '1-29',
83aedacd
AD
2570 78 => '1-29',
2571 79 => '1-29',
2572 80 => '1-29',
13b28c20
DO
2573 86 => '1-29',
2574 87 => '1-29',
13b28c20
DO
2575 19 => '1-681', # DB-9 RS-232
2576 );
2577 if (array_key_exists ($matches[1], $console_per_product))
2578 {
2579 checkPIC ($console_per_product[$matches[1]]);
5d930daf 2580 commitAddPort ($objectInfo['id'], 'console', $console_per_product[$matches[1]], 'console', '');
13b28c20 2581 }
5d930daf
AD
2582 $oom_per_product = array
2583 (
2584 33 => '1-24', # RJ-45 100Mb
2585 );
2586 if (array_key_exists ($matches[1], $oom_per_product))
2587 {
2588 checkPIC ($oom_per_product[$matches[1]]);
2589 commitAddPort ($objectInfo['id'], 'mgmt', $oom_per_product[$matches[1]], 'mgmt', '');
2590 }
2591 checkPIC ('1-16');
2592 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
84986395 2593 $exact_release = preg_replace ('/^.* revision ([^ ]+), .*$/', '\\1', $sysDescr);
74aee2dc
DO
2594 updateStickerForCell ($objectInfo, 5, $exact_release);
2595 break;
5f2354ce 2596 case preg_match ('/^4526\.100\./', $sysObjectID): // NETGEAR
bdc91a5c
DO
2597 checkPIC ('1-681');
2598 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
6be06cbb 2599 break;
7d69a266 2600 case preg_match ('/^2011\.2\.23\./', $sysObjectID): // Huawei
1f54e1ba 2601 detectSoftwareType ($objectInfo, $sysDescr);
bdc91a5c 2602 checkPIC ('1-681');
b55f8de3 2603 commitAddPort ($objectInfo['id'], 'con0', '1-681', 'console', ''); // DB-9 RS-232 console
7d69a266 2604 break;
e68824f6 2605 case preg_match ('/^2636\.1\.1\.1\.2\.3(0|1)/', $sysObjectID): // Juniper EX3200/EX4200
1f54e1ba 2606 detectSoftwareType ($objectInfo, $sysDescr);
e68824f6
AD
2607 $sw_version = preg_replace ('/^.*, kernel JUNOS ([^ ]+).*$/', '\\1', $sysDescr);
2608 updateStickerForCell ($objectInfo, 5, $sw_version);
2609 // one RJ-45 RS-232 and one AC port (it could be DC, but chances are it's AC)
1f54e1ba
DO
2610 checkPIC ('1-29');
2611 commitAddPort ($objectInfo['id'], 'con', '1-29', 'CON', ''); // RJ-45 RS-232 console
e68824f6
AD
2612 checkPIC ('1-16');
2613 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2614 // Juniper uses the same sysObjectID for multiple HW models, override if necessary
2615 if (preg_match ('/^Juniper Networks, Inc. ex3200-48t internet router/', $sysDescr))
2616 updateStickerForCell ($objectInfo, 2, 902);
1f54e1ba
DO
2617 if (preg_match ('/^Juniper Networks, Inc. ex4200-48t internet router/', $sysDescr))
2618 updateStickerForCell ($objectInfo, 2, 907);
1f54e1ba 2619 break;
7d69a266 2620 case preg_match ('/^2636\.1\.1\.1\.2\./', $sysObjectID): // Juniper
1f54e1ba 2621 detectSoftwareType ($objectInfo, $sysDescr);
bdc91a5c
DO
2622 checkPIC ('1-681');
2623 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
661b3fdb
DO
2624 break;
2625 case preg_match ('/^1991\.1\.3\.45\./', $sysObjectID): // snFGSFamily
6c32c3ff 2626 case preg_match ('/^1991\.1\.3\.46\./', $sysObjectID): // snFLSFamily
ec523868 2627 case preg_match ('/^1991\.1\.3\.54\.2\.4\.1\.1$/', $sysObjectID): // FCX 648
1f54e1ba 2628 detectSoftwareType ($objectInfo, $sysDescr);
84986395 2629 $exact_release = preg_replace ('/^.*, IronWare Version ([^ ]+) .*$/', '\\1', $sysDescr);
661b3fdb
DO
2630 updateStickerForCell ($objectInfo, 5, $exact_release);
2631 # FOUNDRY-SN-AGENT-MIB::snChasSerNum.0
8228bdb4 2632 $sysChassi = $device->snmpget ('enterprises.1991.1.1.1.1.2.0');
661b3fdb
DO
2633 if ($sysChassi !== FALSE or $sysChassi !== NULL)
2634 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
2635
2636 # Type of uplink module installed.
2637 # table: FOUNDRY-SN-AGENT-MIB::snAgentBrdMainBrdDescription
2638 # Possible part numbers are:
2639 # FGS-1XG1XGC (one fixed CX4 port)
2640 # FGS-2XGC (two fixed CX4 ports)
2641 # FGS-2XG (two XFP slots)
6c32c3ff
AA
2642 # And for FLS result (which is not handled here) would be:
2643 # 1991.1.1.2.2.1.1.2.1 = STRING: "FLS-24G 24-port Management Module"
2644 # 1991.1.1.2.2.1.1.2.3 = STRING: "FLS-1XG 1-port 10G Module (1-XFP)"
2645 # 1991.1.1.2.2.1.1.2.4 = STRING: "FLS-1XG 1-port 10G Module (1-XFP)"
2646 # (assuming, that the device has 2 XFP modules in slots 3 and 4).
2647
8228bdb4 2648 foreach ($device->snmpwalkoid ('enterprises.1991.1.1.2.2.1.1.2') as $module_raw)
661b3fdb
DO
2649 if (preg_match ('/^STRING: "(FGS-1XG1XGC|FGS-2XGC) /i', $module_raw))
2650 {
2651 $iftable_processors['fgs-uplinks']['dict_key'] = '1-40'; // CX4
2652 break;
2653 }
2654
2655 # AC inputs
2656 # table: FOUNDRY-SN-AGENT-MIB::snChasPwrSupplyDescription
2657 # "Power supply 1 "
2658 # "Power supply 2 "
8228bdb4 2659 foreach ($device->snmpwalkoid ('enterprises.1991.1.1.1.2.1.1.2') as $PSU_raw)
661b3fdb
DO
2660 {
2661 $count = 0;
2662 $PSU_cooked = trim (preg_replace ('/^string: "(.+)"$/i', '\\1', $PSU_raw, 1, $count));
2663 if ($count)
2664 {
2665 checkPIC ('1-16');
2666 commitAddPort ($objectInfo['id'], $PSU_cooked, '1-16', '', '');
2667 }
2668 }
2669 # fixed console port
2670 checkPIC ('1-681');
2671 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
661b3fdb 2672 break;
4eeadb79
DO
2673 case preg_match ('/^1916\.2\./', $sysObjectID): // Extreme Networks Summit
2674 $xos_release = preg_replace ('/^ExtremeXOS version ([[:digit:]]+)\..*$/', '\\1', $sysDescr);
2675 $xos_codes = array
2676 (
2677 '10' => 1350,
2678 '11' => 1351,
2679 '12' => 1352,
2680 );
2681 if (array_key_exists ($xos_release, $xos_codes))
2682 updateStickerForCell ($objectInfo, 4, $xos_codes[$xos_release]);
2683 checkPIC ('1-681');
2684 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232
2685 checkPIC ('1-16');
2686 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
4eeadb79 2687 break;
8acd246d 2688 case preg_match ('/^6027\.1\./', $sysObjectID): # Force10
1e5a92d8 2689 commitAddPort ($objectInfo['id'], 'aux0', '1-29', 'RS-232', ''); // RJ-45 RS-232 console
8acd246d
DO
2690 $m = array();
2691 if (preg_match ('/Force10 Application Software Version: ([\d\.]+)/', $sysDescr, $m))
6dd5c55c 2692 {
8acd246d 2693 updateStickerForCell ($objectInfo, 5, $m[1]);
241db860 2694 $ftos_release = preg_replace ('/^([678])\..+$/', '\\1', $m[1]);
6dd5c55c
DO
2695 $ftos_codes = array
2696 (
2697 '6' => 1592,
2698 '7' => 1593,
2699 '8' => 1594,
2700 );
2701 if (array_key_exists ($ftos_release, $ftos_codes))
2702 updateStickerForCell ($objectInfo, 4, $ftos_codes[$ftos_release]);
2703 }
8acd246d
DO
2704 # F10-S-SERIES-CHASSIS-MIB::chStackUnitSerialNumber.1
2705 $serialNo = $device->snmpget ('enterprises.6027.3.10.1.2.2.1.12.1');
84ea7e6e
DO
2706 # F10-S-SERIES-CHASSIS-MIB::chSysPowerSupplyType.1.1
2707 if ($device->snmpget ('enterprises.6027.3.10.1.2.3.1.3.1.1') == 'INTEGER: 1')
2708 {
2709 checkPIC ('1-16');
2710 commitAddPort ($objectInfo['id'], 'PSU0', '1-16', 'PSU0', '');
2711 }
2712 # F10-S-SERIES-CHASSIS-MIB::chSysPowerSupplyType.1.2
2713 if ($device->snmpget ('enterprises.6027.3.10.1.2.3.1.3.1.2') == 'INTEGER: 1')
2714 {
2715 checkPIC ('1-16');
2716 commitAddPort ($objectInfo['id'], 'PSU1', '1-16', 'PSU1', '');
2717 }
8acd246d
DO
2718 if (strlen ($serialNo))
2719 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($serialNo, strlen ('STRING: '))));
2720 break;
13b28c20 2721 case preg_match ('/^202\.20\./', $sysObjectID): // SMC TigerSwitch
1ce6a44d
AD
2722 case preg_match ('/^674\.10895\.4/', $sysObjectID): // Dell PowerConnect
2723 case preg_match ('/^674\.10895\.300(3|4|7|9)/', $sysObjectID):
e326551d 2724 case preg_match ('/^674\.10895\.301(0|4|7|9)/', $sysObjectID):
92df4b0e 2725 case preg_match ('/^674\.10895\.302(0|1)/', $sysObjectID):
8595dfd0 2726 case preg_match ('/^3955\.6\.1\.2048\.1/', $sysObjectID): // Linksys
c4acc30b 2727 case preg_match ('/^11863\.6\.10\.58/', $sysObjectID): // TPLink
8595dfd0 2728 // one DB-9 RS-232 and one AC port
13b28c20
DO
2729 checkPIC ('1-681');
2730 commitAddPort ($objectInfo['id'], 'console', '1-681', '', ''); // DB-9 RS-232
2731 checkPIC ('1-16');
2732 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
13b28c20 2733 break;
f60a9008
AD
2734 case preg_match ('/^388\.18/', $sysObjectID): // Motorola RFS 4000
2735 // one RJ-45 RS-232 and one AC port
2736 checkPIC ('1-29');
2737 commitAddPort ($objectInfo['id'], 'console', '1-29', 'console', '');
2738 checkPIC ('1-16');
2739 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2740 break;
78cfe89b
AD
2741 case preg_match ('/^207\.1\.14\./', $sysObjectID): // Allied Telesyn
2742 // one RJ-45 RS-232 and two AC ports
2743 checkPIC ('1-29');
2744 commitAddPort ($objectInfo['id'], 'console', '1-29', 'console', '');
2745 checkPIC ('1-16');
2746 commitAddPort ($objectInfo['id'], 'AC-in-1', '1-16', 'AC1', '');
2747 commitAddPort ($objectInfo['id'], 'AC-in-2', '1-16', 'AC2', '');
2748 break;
1b10e7cf
AD
2749 case preg_match ('/^674\.10895\.3000/', $sysObjectID):
2750 // one DB-9 RS-232, one 100Mb OOB mgmt, and one AC port
2751 checkPIC ('1-681');
2752 commitAddPort ($objectInfo['id'], 'console', '1-681', '', ''); // DB-9 RS-232
2753 checkPIC ('1-19');
2754 commitAddPort ($objectInfo['id'], 'mgmt', '1-19', '', '');
2755 checkPIC ('1-16');
2756 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2757 break;
1cd6eca3
AD
2758 case preg_match ('/^43\.1\.16\.4\.3\.29/', $sysObjectID): // 3Com
2759 $sw_version = preg_replace('/^.* Version 3Com OS ([^ ]+).*$/', '\\1', $sysDescr);
2760 updateStickerForCell ($objectInfo, 5, $sw_version);
2761
2762 // one RJ-45 RS-232 and one AC port
2763 checkPIC ('1-29');
2764 commitAddPort ($objectInfo['id'], 'console', '1-29', '', ''); // RJ-45 RS-232 console
2765 checkPIC ('1-16');
2766 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2767 break;
ac02ab69
AD
2768 case preg_match ('/^10977\.11825\.11833\.97\.25451\.12800\.100\.4\.4/', $sysObjectID): // Netgear
2769 $sw_version = preg_replace('/^.* V([^ ]+).*$/', '\\1', $sysDescr);
2770 updateStickerForCell ($objectInfo, 5, $sw_version);
2771
49055269
AD
2772 // one AC port, no console
2773 checkPIC ('1-16');
2774 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2775 break;
2776 case preg_match ('/^171\.10\.76\.10/', $sysObjectID): // D-Link DGS-1210-24
ac02ab69
AD
2777 // one AC port, no console
2778 checkPIC ('1-16');
2779 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
2780 break;
2ea5fd28
DO
2781 case preg_match ('/^30065\.1\.3011\./', $sysObjectID): // Arista
2782 detectSoftwareType ($objectInfo, $sysDescr);
2783 checkPIC ('1-29');
2784 commitAddPort ($objectInfo['id'], 'console', '1-29', 'IOIOI', '');
2785 $sw_version = preg_replace ('/^Arista Networks EOS version (.+) running on .*$/', '\\1', $sysDescr);
2786 updateStickerForCell ($objectInfo, 5, $sw_version);
f31831d4
DO
2787 if (strlen ($serialNo = $device->snmpget ('mib-2.47.1.1.1.1.11.1'))) # entPhysicalSerialNumber.1
2788 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($serialNo, strlen ('STRING: '))));
2ea5fd28 2789 break;
a3520e4c
DO
2790 case preg_match ('/^119\.1\.203\.2\.2\./', $sysObjectID): # NEC
2791 checkPIC ('1-681');
2792 commitAddPort ($objectInfo['id'], 'console 0', '1-681', 'console', '');
2793 checkPIC ('1-16');
2794 commitAddPort ($objectInfo['id'], 'PS1', '1-16', '', '');
2795 commitAddPort ($objectInfo['id'], 'PS2', '1-16', '', '');
2796 break;
7d69a266 2797 default: // Nortel...
74aee2dc
DO
2798 break;
2799 }
56a797ef 2800 $ifInfo = array();
92df4b0e 2801 foreach ($device->snmpwalkoid ($ifDescr_tablename) as $oid => $value)
56a797ef 2802 {
92df4b0e 2803 $randomindex = preg_replace ("/^.*${ifDescr_tablename}\.(.+)\$/", '\\1', $oid);
5f2354ce 2804 $value = trim (preg_replace ('/^[^:]+: (.+)$/', '\\1', $value), '"');
92df4b0e 2805 $ifInfo[$randomindex]['ifDescr'] = $value;
56a797ef 2806 }
92df4b0e 2807 foreach ($device->snmpwalkoid ('ifPhysAddress') as $oid => $value)
56a797ef 2808 {
92df4b0e 2809 $randomindex = preg_replace ("/^.*ifPhysAddress\.(.+)\$/", '\\1', $oid);
56a797ef
DO
2810 $value = trim ($value);
2811 // NET-SNMP may return MAC addresses in one of two (?) formats depending on
2812 // DISPLAY-HINT internal database. The best we can do about it is to accept both.
2813 // Bug originally reported by Walery Wysotsky against openSUSE 11.0.
6a845dce 2814 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
2815 {
2816 list ($dummy, $value) = explode (' ', $value);
2817 $addrbytes = explode (':', $value);
2818 foreach ($addrbytes as $bidx => $bytestr)
2819 if (strlen ($bytestr) == 1)
2820 $addrbytes[$bidx] = '0' . $bytestr;
2821 }
6a845dce 2822 elseif (preg_match ('/^hex-string:( [0-9a-f]{2}){6}/i', $value)) // Hex-STRING: xx yy zz xx yy zz
56a797ef 2823 $addrbytes = explode (' ', substr ($value, -17));
6a845dce
DO
2824 elseif (preg_match ('/22[0-9a-f]{12}22$/', bin2hex ($value))) // STRING: "??????"
2825 $addrbytes = array (substr (bin2hex ($value), -14, 12));
56a797ef
DO
2826 else
2827 continue; // martian format
92df4b0e 2828 $ifInfo[$randomindex]['ifPhysAddress'] = implode ('', $addrbytes);
56a797ef
DO
2829 }
2830 // process each interface only once regardless of how many processors we have to run
2831 foreach ($ifInfo as $iface)
2832 foreach ($known_switches[$sysObjectID]['processors'] as $processor_name)
2833 {
56a797ef 2834 $newname = preg_replace ($iftable_processors[$processor_name]['pattern'], $iftable_processors[$processor_name]['replacement'], $iface['ifDescr'], 1, $count);
1f54e1ba
DO
2835 if ($newname === NULL)
2836 {
8ab645cf 2837 showError ('PCRE pattern error, terminating');
1f54e1ba
DO
2838 break 2;
2839 }
56a797ef
DO
2840 if (!$count)
2841 continue; // try next processor on current port
2842 $newlabel = preg_replace ($iftable_processors[$processor_name]['pattern'], $iftable_processors[$processor_name]['label'], $iface['ifDescr'], 1, $count);
bdc91a5c 2843 checkPIC ($iftable_processors[$processor_name]['dict_key']);
73a9a0a0 2844 commitAddPort ($objectInfo['id'], $newname, $iftable_processors[$processor_name]['dict_key'], $newlabel, $iface['ifPhysAddress']);
56a797ef
DO
2845 if (!$iftable_processors[$processor_name]['try_next_proc']) // done with this port
2846 continue 2;
2847 }
8536e20a 2848 // No failure up to this point, thus leave current tab for the "Ports" one.
8ab645cf 2849 return buildRedirectURL (NULL, 'ports');
74aee2dc
DO
2850}
2851
7b2a1a90 2852function doPDUSNMPmining ($objectInfo, $switch)
38e05b77 2853{
29de85b6 2854 global $known_APC_SKUs;
29de85b6
DO
2855 if (FALSE !== ($dict_key = array_search ($switch->getHWModel(), $known_APC_SKUs)))
2856 updateStickerForCell ($objectInfo, 2, $dict_key);
2857 updateStickerForCell ($objectInfo, 1, $switch->getHWSerial());
4848a7e3 2858 updateStickerForCell ($objectInfo, 3, $switch->getName());
29de85b6 2859 updateStickerForCell ($objectInfo, 5, $switch->getFWRev());
bdc91a5c 2860 checkPIC ('1-16');
29de85b6 2861 commitAddPort ($objectInfo['id'], 'input', '1-16', 'input', '');
4848a7e3
DO
2862 $portno = 1;
2863 foreach ($switch->getPorts() as $name => $port)
29de85b6
DO
2864 {
2865 $label = mb_strlen ($port[0]) ? $port[0] : $portno;
bdc91a5c 2866 checkPIC ('1-1322');
29de85b6
DO
2867 commitAddPort ($objectInfo['id'], $portno, '1-1322', $port[0], '');
2868 $portno++;
2869 }
8ab645cf
AA
2870 showSuccess ("Added ${portno} port(s)");
2871 return buildRedirectURL (NULL, 'ports');
38e05b77
DO
2872}
2873
4848a7e3 2874// APC SNMP code by Russ Garrett
38e05b77
DO
2875define('APC_STATUS_ON', 1);
2876define('APC_STATUS_OFF', 2);
2877define('APC_STATUS_REBOOT', 3);
2878
db5d7da5
AD
2879class RTSNMPDevice
2880{
2881 protected $snmp;
2882
2883 function __construct($hostname, $snmpsetup)
2884 {
2885 switch($snmpsetup['version']) {
2886 case 1:
2887 default:
2888 $this->snmp = new RTSNMPv1($hostname, $snmpsetup);
2889 break;
2890 case 2:
2891 $this->snmp = new RTSNMPv2($hostname, $snmpsetup);
2892 break;
2893 case 3:
2894 $this->snmp = new RTSNMPv3($hostname, $snmpsetup);
2895 break;
2896 }
8228bdb4 2897 }
38e05b77 2898
db5d7da5
AD
2899 function getName()
2900 {
2901 return $this->getString('sysName.0');
2902 }
92cfa92a 2903
db5d7da5
AD
2904 function getDescription()
2905 {
2906 return $this->getString('sysDescr.0');
2907 }
92cfa92a 2908
db5d7da5
AD
2909 function snmpget($oid)
2910 {
2911 return $this->snmp->snmpget($oid);
2912 }
92cfa92a 2913
db5d7da5
AD
2914 function snmpwalkoid($oid)
2915 {
2916 return $this->snmp->snmpwalkoid($oid);
2917 }
2918
2919 protected function snmpSet($oid, $type, $value)
2920 {
2921 return $this->snmp->snmpset($oid, $type, $value);
2922 }
2923
2924 protected function getString($oid)
2925 {
2926 return trim(str_replace('STRING: ', '', $this->snmp->snmpget($oid)), '"');
2927 }
8228bdb4
DO
2928}
2929
db5d7da5
AD
2930abstract class RTSNMP
2931{
2932 protected $hostname;
2933 protected $snmpsetup;
2934
2935 function __construct($hostname, $snmpsetup)
2936 {
2937 $this->hostname = $hostname;
2938 $this->snmpsetup = $snmpsetup;
2939 }
92cfa92a 2940
db5d7da5
AD
2941 abstract function snmpget($oid);
2942 abstract function snmpset($oid, $type, $value);
2943 abstract function snmpwalkoid($oid);
8228bdb4
DO
2944}
2945
db5d7da5
AD
2946class RTSNMPv1 extends RTSNMP
2947{
2948 function snmpget($oid)
2949 {
2950 return snmpget($this->hostname, $this->snmpsetup['community'], $oid);
2951 }
2952
2953 function snmpset($oid, $type, $value)
2954 {
2955 return snmpset($this->hostname, $this->snmpsetup['community'], $oid, $type, $value);
2956 }
92cfa92a 2957
db5d7da5
AD
2958 function snmpwalkoid($oid)
2959 {
2960 return snmpwalkoid($this->hostname, $this->snmpsetup['community'], $oid);
2961 }
8228bdb4
DO
2962}
2963
db5d7da5
AD
2964class RTSNMPv2 extends RTSNMP
2965{
2966 function snmpget($oid)
2967 {
2968 return snmp2_get($this->hostname, $this->snmpsetup['community'], $oid);
2969 }
2970
2971 function snmpset($oid, $type, $value)
2972 {
2973 return snmp2_set($this->hostname, $this->snmpsetup['community'], $oid, $type, $value);
2974 }
92cfa92a 2975
db5d7da5
AD
2976 function snmpwalkoid($oid)
2977 {
2978 return snmp2_real_walk($this->hostname, $this->snmpsetup['community'], $oid);
2979 }
047d6ee5
DO
2980}
2981
db5d7da5
AD
2982class RTSNMPv3 extends RTSNMP
2983{
2984 function snmpget($oid)
2985 {
2986 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);
2987 }
2988
2989 function snmpset($oid, $type, $value)
2990 {
2991 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);
2992 }
92cfa92a 2993
db5d7da5
AD
2994 function snmpwalkoid($oid)
2995 {
2996 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);
2997 }
38e05b77
DO
2998}
2999
db5d7da5
AD
3000class APCPowerSwitch extends RTSNMPDevice
3001{
3002 protected $snmpMib = 'SNMPv2-SMI::enterprises.318';
3003
3004 function getPorts()
3005 {
92cfa92a
AD
3006 $data = $this->snmpwalkoid("{$this->snmpMib}.1.1.12.3.3.1.1.2");
3007 $status = $this->snmpwalkoid("{$this->snmpMib}.1.1.12.3.3.1.1.4");
db5d7da5
AD
3008 $out = array();
3009 foreach ($data as $id => $d)
3e847fc8 3010 $out[] = array(trim(str_replace('STRING: ', '', $d), '"'), str_replace('INTEGER: ', '', $status[$id]));
db5d7da5
AD
3011 return $out;
3012 }
92cfa92a 3013
db5d7da5
AD
3014 function getPortStatus($id)
3015 {
3016 return trim($this->snmpget("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id"), 'INTEGER: ');
3017 }
3018
3019 function getPortName($id)
3020 {
3021 return trim(str_replace('STRING: ', '', $this->snmpget("{$this->snmpMib}.1.1.12.3.3.1.1.2.$id")), '"');
3022 }
3023
3024 function setPortName($id, $name)
3025 {
3026 return $this->snmpset("{$this->snmpMib}.1.1.4.5.2.1.3.$id", 's', $name);
3027 }
3028
3029 function portOff($id)
3030 {
3031 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_OFF);
3032 }
3033
3034 function portOn($id)
3035 {
3036 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_ON);
3037 }
3038
3039 function portReboot($id)
3040 {
3041 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_REBOOT);
3042 }
3043
30ad8bc4
DO
3044 // rPDUIdentFirmwareRev.0 == .1.3.6.1.4.1.318.1.1.12.1.3.0 = STRING: "vN.N.N"
3045 function getFWRev()
3046 {
8228bdb4 3047 return preg_replace ('/^STRING: "(.+)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.3.0"));
30ad8bc4 3048 }
db5d7da5 3049
30ad8bc4
DO
3050 // rPDUIdentSerialNumber.0 == .1.3.6.1.4.1.318.1.1.12.1.6.0 = STRING: "XXXXXXXXXXX"
3051 function getHWSerial()
3052 {
8228bdb4 3053 return preg_replace ('/^STRING: "(.+)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.6.0"));
30ad8bc4 3054 }
db5d7da5 3055
30ad8bc4
DO
3056 // rPDUIdentModelNumber.0 == .1.3.6.1.4.1.318.1.1.12.1.5.0 = STRING: "APnnnn"
3057 function getHWModel()
3058 {
8228bdb4 3059 return preg_replace ('/^STRING: "(.*)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.5.0"));
30ad8bc4 3060 }
38e05b77 3061}
367fcba0 3062
2d511052
DO
3063// Take address in the form XX:XX:XX:XX:XX:XX and return the next
3064// address in the same form.
3065function nextMACAddress ($addr)
3066{
cc000fab
DO
3067 if ($addr == '')
3068 return '';
2d511052
DO
3069 $bytes = array();
3070 foreach (explode (':', $addr) as $hex)
3071 $bytes[] = hexdec ($hex);
3072 for ($i = 5; $i >= 0; $i--)
3073 {
3074 $bytes[$i] += 1;
3075 if ($bytes[$i] <= 255) // FF
3076 break; // no roll over
3077 $bytes[$i] = 0;
3078 }
3079 foreach (array_keys ($bytes) as $key)
3080 $bytes[$key] = sprintf ('%02X', $bytes[$key]);
3081 return implode (':', $bytes);
3082}
3083
3084function generatePortsForCatModule ($object_id, $slotno = 1, $mtype = 'X6748', $mac_address = '')
3085{
3086 global $dbxlink;
3087 $mac_address = l2addressFromDatabase (l2addressForDatabase ($mac_address));
3088 switch ($mtype)
3089 {
cc000fab 3090 case 'WS-X6748-GE-TX':
2d511052
DO
3091 $dbxlink->beginTransaction();
3092 for ($i = 1; $i <= 48; $i++)
3093 {
73a9a0a0 3094 commitAddPort ($object_id, "gi${slotno}/${i}", '1-24', "slot ${slotno} port ${i}", $mac_address);
cc000fab 3095 $mac_address = nextMACAddress ($mac_address);
2d511052
DO
3096 }
3097 $dbxlink->commit();
3098 break;
cc000fab
DO
3099 case 'WS-X6708-10GE':
3100 for ($i = 1; $i <= 8; $i++)
3101 {
3102 commitAddPort ($object_id, "te${slotno}/${i}", '6-1080', "slot ${slotno} port ${i}", $mac_address);
3103 $mac_address = nextMACAddress ($mac_address);
3104 }
3105 break;
8fe2d6f0
DO
3106 case 'WS-X6704-10GE':
3107 for ($i = 1; $i <= 4; $i++)
3108 {
3109 commitAddPort ($object_id, "te${slotno}/${i}", '5-1079', "slot ${slotno} port ${i}", $mac_address);
3110 $mac_address = nextMACAddress ($mac_address);
3111 }
3112 break;
cc000fab
DO
3113 case 'VS-S720-10G':
3114 commitAddPort ($object_id, "gi${slotno}/1", '4-1077', "slot ${slotno} port 1", $mac_address);
3115 $mac_address = nextMACAddress ($mac_address);
3116 commitAddPort ($object_id, "gi${slotno}/2", '4-1077', "slot ${slotno} port 2", $mac_address);
3117 $mac_address = nextMACAddress ($mac_address);
3118 commitAddPort ($object_id, "gi${slotno}/3", '1-24', "slot ${slotno} port 3", $mac_address);
3119 $mac_address = nextMACAddress ($mac_address);
3120 commitAddPort ($object_id, "te${slotno}/4", '6-1080', "slot ${slotno} port 4", $mac_address);
3121 $mac_address = nextMACAddress ($mac_address);
3122 commitAddPort ($object_id, "te${slotno}/5", '6-1080', "slot ${slotno} port 5", $mac_address);
3123 break;
3e34adae
DO
3124 case '3750G-24TS':
3125 // MAC address of 1st port is the next one after switch's address
cc000fab 3126 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
3127 for ($i = 1; $i <= 24; $i++)
3128 {
3129 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
cc000fab 3130 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
3131 }
3132 for ($i = 25; $i <= 28; $i++)
3133 {
3134 commitAddPort ($object_id, "gi${slotno}/0/${i}", '4-1077', "unit ${slotno} port ${i}", $mac_address);
abd1e9ac
DO
3135 $mac_address = nextMACAddress ($mac_address);
3136 }
3137 break;
3138 case '3750G-24T':
3139 $mac_address = nextMACAddress ($mac_address);
3140 for ($i = 1; $i <= 24; $i++)
3141 {
3142 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
cc000fab 3143 $mac_address = nextMACAddress ($mac_address);
3e34adae
DO
3144 }
3145 break;
d423bb7d
DO
3146 case '3750G-16TD':
3147 $mac_address = nextMACAddress ($mac_address);
3148 for ($i = 1; $i <= 16; $i++)
3149 {
3150 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
3151 $mac_address = nextMACAddress ($mac_address);
3152 }
3153 commitAddPort ($object_id, "te${slotno}/0/1", '5-1079', "unit ${slotno} port ${i}", $mac_address);
3154 break;
c5553818
DO
3155 case 'LE02G48TA':
3156 for ($i = 0; $i <= 47; $i++)
3157 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "slot ${slotno} port ${i}", $mac_address);
3158 break;
3159 case 'LE02X12SA':
3160 for ($i = 0; $i <= 11; $i++)
3161 commitAddPort ($object_id, "gi${slotno}/0/${i}", '9-1084', "slot ${slotno} port ${i}", $mac_address);
3162 break;
2d511052
DO
3163 }
3164}
3165
1f54e1ba
DO
3166function detectSoftwareType ($objectInfo, $sysDescr)
3167{
3168 global $swtype_pcre;
3169 foreach ($swtype_pcre as $pattern => $dict_key)
3170 if (preg_match ($pattern, $sysDescr))
3171 {
3172 updateStickerForCell ($objectInfo, 4, $dict_key);
3173 return;
3174 }
3175}
2ffd5a2a 3176?>