r4897 Fix #500 in trunk
[racktables] / wwwroot / inc / snmp.php
1 <?php
2
3 global $iftable_processors;
4 $iftable_processors = array();
5
6 $iftable_processors['catalyst-chassis-mgmt'] = array
7 (
8 'pattern' => '@^FastEthernet([[:digit:]])$@',
9 'replacement' => 'fa\\1',
10 'dict_key' => '1-19',
11 'label' => 'mgmt',
12 'try_next_proc' => FALSE,
13 );
14
15 $iftable_processors['catalyst-chassis-25-to-26-1000SFP'] = array
16 (
17 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(25|26)$@',
18 'replacement' => 'gi\\1\\2',
19 'dict_key' => '4-1077',
20 'label' => '\\2X',
21 'try_next_proc' => FALSE,
22 );
23
24 $iftable_processors['catalyst-chassis-any-100TX'] = array
25 (
26 'pattern' => '@^FastEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
27 'replacement' => 'fa\\1\\2',
28 'dict_key' => 19,
29 'label' => '\\2X',
30 'try_next_proc' => FALSE,
31 );
32
33 $iftable_processors['catalyst-chassis-25-to-26-100FX/MT-RJ'] = array
34 (
35 'pattern' => '@^FastEthernet([[:digit:]]+/)?(25|26)$@',
36 'replacement' => 'fa\\1\\2',
37 'dict_key' => 1195,
38 'label' => '\\2',
39 'try_next_proc' => FALSE,
40 );
41
42 $iftable_processors['catalyst-chassis-any-1000T'] = array
43 (
44 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
45 'replacement' => 'gi\\1\\2',
46 'dict_key' => 24,
47 'label' => '\\2X',
48 'try_next_proc' => FALSE,
49 );
50
51 $iftable_processors['catalyst-chassis-uplinks-1000T'] = array
52 (
53 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
54 'replacement' => 'gi\\1\\2',
55 'dict_key' => 24,
56 'label' => '\\2',
57 'try_next_proc' => FALSE,
58 );
59
60 $iftable_processors['catalyst-chassis-uplinks-1000SX'] = array
61 (
62 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
63 'replacement' => 'gi\\1\\2',
64 'dict_key' => '1-1202', // Gig-SX hardwired
65 'label' => '\\2',
66 'try_next_proc' => FALSE,
67 );
68
69 $iftable_processors['catalyst-chassis-any-1000SFP'] = array
70 (
71 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
72 'replacement' => 'gi\\1\\2',
73 'dict_key' => '4-1077',
74 'label' => '\\2',
75 'try_next_proc' => FALSE,
76 );
77
78 $iftable_processors['catalyst-chassis-any-1000GBIC'] = array
79 (
80 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
81 'replacement' => 'gi\\1\\2',
82 'dict_key' => '3-1078',
83 'label' => '\\2',
84 'try_next_proc' => FALSE,
85 );
86
87 $iftable_processors['catalyst-chassis-1-to-2-combo-1000SFP'] = array
88 (
89 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2)$@',
90 'replacement' => 'gi\\1\\2',
91 'dict_key' => '4-1077',
92 'label' => '\\2',
93 'try_next_proc' => TRUE,
94 );
95
96 $iftable_processors['catalyst-chassis-1-to-2-1000SFP'] = array
97 (
98 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2)$@',
99 'replacement' => 'gi\\1\\2',
100 'dict_key' => '4-1077',
101 'label' => '\\2',
102 'try_next_proc' => FALSE,
103 );
104
105 $iftable_processors['catalyst-chassis-8-combo-1000SFP'] = array
106 (
107 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(8)$@',
108 'replacement' => 'gi\\1\\2',
109 'dict_key' => '4-1077',
110 'label' => '\\2',
111 'try_next_proc' => TRUE,
112 );
113
114 $iftable_processors['catalyst-chassis-21-to-24-combo-1000SFP'] = array
115 (
116 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(21|22|23|24)$@',
117 'replacement' => 'gi\\1\\2',
118 'dict_key' => '4-1077',
119 'label' => '\\2',
120 'try_next_proc' => TRUE,
121 );
122
123 $iftable_processors['catalyst-chassis-45-to-48-combo-1000SFP'] = array
124 (
125 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(45|46|47|48)$@',
126 'replacement' => 'gi\\1\\2',
127 'dict_key' => '4-1077',
128 'label' => '\\2',
129 'try_next_proc' => TRUE,
130 );
131
132 $iftable_processors['catalyst-chassis-uplinks-10000X2'] = array
133 (
134 'pattern' => '@^TenGigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
135 'replacement' => 'te\\1\\2',
136 'dict_key' => '6-1080',
137 'label' => '\\2',
138 'try_next_proc' => FALSE,
139 );
140
141 $iftable_processors['catalyst-chassis-uplinks-10000SFP+'] = array
142 (
143 'pattern' => '@^TenGigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
144 'replacement' => 'te\\1\\2',
145 'dict_key' => '9-1084',
146 'label' => '\\2',
147 'try_next_proc' => FALSE,
148 );
149
150 $iftable_processors['catalyst-chassis-25-to-28-1000SFP'] = array
151 (
152 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(25|26|27|28)$@',
153 'replacement' => 'gi\\1\\2',
154 'dict_key' => '4-1077',
155 'label' => '\\2',
156 'try_next_proc' => FALSE,
157 );
158
159 $iftable_processors['catalyst-chassis-49-to-52-1000SFP'] = array
160 (
161 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(49|50|51|52)$@',
162 'replacement' => 'gi\\1\\2',
163 'dict_key' => '4-1077',
164 'label' => '\\2',
165 'try_next_proc' => FALSE,
166 );
167
168 $iftable_processors['catalyst-blade-13-to-16-1000SFP'] = array
169 (
170 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(13|14|15|16)$@',
171 'replacement' => 'gi\\1\\2',
172 'dict_key' => '4-1077',
173 'label' => '\\2',
174 'try_next_proc' => FALSE,
175 );
176
177 $iftable_processors['catalyst-blade-21-to-24-1000SFP'] = array
178 (
179 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(21|22|23|24)$@',
180 'replacement' => 'gi\\1\\2',
181 'dict_key' => '4-1077',
182 'label' => '\\2',
183 'try_next_proc' => FALSE,
184 );
185
186 $iftable_processors['catalyst-blade-11-to-12-1000T'] = array
187 (
188 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
189 'replacement' => 'gi\\1\\2',
190 'dict_key' => '1-24',
191 'label' => '\\2',
192 'try_next_proc' => FALSE,
193 );
194
195 $iftable_processors['catalyst-blade-17-to-20-1000T'] = array
196 (
197 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(17|18|19|20)$@',
198 'replacement' => 'gi\\1\\2',
199 'dict_key' => '1-24',
200 'label' => '\\2',
201 'try_next_proc' => FALSE,
202 );
203
204 $iftable_processors['catalyst-blade-any-bp/1000T'] = array
205 (
206 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?([[:digit:]]+)$@',
207 'replacement' => 'gi\\1\\2',
208 'dict_key' => '1-1087',
209 'label' => '',
210 'try_next_proc' => FALSE,
211 );
212
213 $iftable_processors['catalyst-11-to-12-1000T'] = array
214 (
215 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
216 'replacement' => 'gi\\1\\2',
217 'dict_key' => '1-24',
218 'label' => '\\2',
219 'try_next_proc' => FALSE,
220 );
221
222 $iftable_processors['catalyst-1-to-10-1000T'] = array
223 (
224 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(1|2|3|4|5|6|7|8|9|10)$@',
225 'replacement' => 'gi\\1\\2',
226 'dict_key' => '1-24',
227 'label' => '\\2',
228 'try_next_proc' => FALSE,
229 );
230
231 $iftable_processors['catalyst-11-to-12-GBIC'] = array
232 (
233 'pattern' => '@^GigabitEthernet([[:digit:]]+/)?(11|12)$@',
234 'replacement' => 'gi\\1\\2',
235 'dict_key' => '3-1078',
236 'label' => '\\2',
237 'try_next_proc' => FALSE,
238 );
239
240 $iftable_processors['catalyst-stack-any-1000T'] = array
241 (
242 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(\d+)$@',
243 'replacement' => 'gi\\1/\\2/\\3',
244 'dict_key' => '1-24',
245 'label' => 'unit \\1 port \\3',
246 'try_next_proc' => FALSE,
247 );
248
249 $iftable_processors['catalyst-stack-25-to-28-SFP'] = array
250 (
251 'pattern' => '@^GigabitEthernet(\d+)/(\d+)/(25|26|27|28)$@',
252 'replacement' => 'gi\\1/\\2/\\3',
253 'dict_key' => '4-1077',
254 'label' => 'unit \\1 port \\3',
255 'try_next_proc' => FALSE,
256 );
257
258 $iftable_processors['nexus-any-10000SFP+'] = array
259 (
260 'pattern' => '@^Ethernet([[:digit:]]/[[:digit:]]+)$@',
261 'replacement' => 'e\\1',
262 'dict_key' => '9-1084',
263 'label' => '\\1',
264 'try_next_proc' => FALSE,
265 );
266
267 $iftable_processors['ftos-any-1000T'] = array
268 (
269 'pattern' => '@^GigabitEthernet 0/(\d+)$@',
270 'replacement' => 'gi0/\\1',
271 'dict_key' => '1-24',
272 'label' => '\\1',
273 'try_next_proc' => FALSE,
274 );
275
276 $iftable_processors['ftos-44-to-47-1000SFP'] = array
277 (
278 'pattern' => '@^GigabitEthernet 0/(44|45|46|47)$@',
279 'replacement' => 'gi0/\\1',
280 'dict_key' => '4-1077',
281 'label' => '\\1',
282 'try_next_proc' => FALSE,
283 );
284
285 $iftable_processors['ftos-any-10000SFP+'] = array
286 (
287 'pattern' => '@^TenGigabitEthernet 0/(\d+)$@',
288 'replacement' => 'te0/\\1',
289 'dict_key' => '9-1084',
290 'label' => '\\1',
291 'try_next_proc' => FALSE,
292 );
293
294 $iftable_processors['ftos-any-QSFP+'] = array
295 (
296 'pattern' => '@^fortyGigE 0/(\d+)$@',
297 'replacement' => 'fo0/\\1',
298 'dict_key' => '10-1588',
299 'label' => '\\1',
300 'try_next_proc' => FALSE,
301 );
302
303 $iftable_processors['ftos-mgmt'] = array
304 (
305 'pattern' => '@^ManagementEthernet 0/0$@',
306 'replacement' => 'ma0/0',
307 'dict_key' => '1-19',
308 'label' => 'ethernet',
309 'try_next_proc' => FALSE,
310 );
311
312 $iftable_processors['nexus-mgmt'] = array
313 (
314 'pattern' => '@^(mgmt[[:digit:]]+)$@',
315 'replacement' => '\\1',
316 'dict_key' => '1-24',
317 'label' => '\\1',
318 'try_next_proc' => FALSE,
319 );
320
321 $iftable_processors['procurve-chassis-100TX'] = array
322 (
323 'pattern' => '@^([[:digit:]]+)$@',
324 'replacement' => '\\1',
325 'dict_key' => 19,
326 'label' => '\\1',
327 'try_next_proc' => FALSE,
328 );
329
330 $iftable_processors['procurve-chassis-1000T'] = array
331 (
332 'pattern' => '@^([[:digit:]]+)$@',
333 'replacement' => '\\1',
334 'dict_key' => 24,
335 'label' => '\\1',
336 'try_next_proc' => FALSE,
337 );
338
339 $iftable_processors['procurve-45-to-48-combo-1000SFP'] = array
340 (
341 'pattern' => '@^(45|46|47|48)$@',
342 'replacement' => '\\1',
343 'dict_key' => '4-1077',
344 'label' => '\\1',
345 'try_next_proc' => TRUE,
346 );
347
348 $iftable_processors['procurve-21-to-24-combo-1000SFP'] = array
349 (
350 'pattern' => '@^(21|22|23|24)$@',
351 'replacement' => '\\1',
352 'dict_key' => '4-1077',
353 'label' => '\\1',
354 'try_next_proc' => TRUE,
355 );
356
357 $iftable_processors['procurve-23-to-24-combo-1000SFP'] = array
358 (
359 'pattern' => '@^(23|24)$@',
360 'replacement' => '\\1',
361 'dict_key' => '4-1077',
362 'label' => '\\1',
363 'try_next_proc' => TRUE,
364 );
365
366 $iftable_processors['procurve-modular-100TX'] = array
367 (
368 'pattern' => '@^([A-Z][[:digit:]]+)$@',
369 'replacement' => '\\1',
370 'dict_key' => 19,
371 'label' => '\\1',
372 'try_next_proc' => FALSE,
373 );
374
375 $iftable_processors['procurve-25-to-26-1000T'] = array
376 (
377 'pattern' => '@^(25|26)$@',
378 'replacement' => '\\1',
379 'dict_key' => 24,
380 'label' => '\\1',
381 'try_next_proc' => FALSE,
382 );
383
384 $iftable_processors['procurve-49-to-50-1000T'] = array
385 (
386 'pattern' => '@^(49|50)$@',
387 'replacement' => '\\1',
388 'dict_key' => 24,
389 'label' => '\\1',
390 'try_next_proc' => FALSE,
391 );
392
393 $iftable_processors['procurve-51-to-52-1000SFP'] = array
394 (
395 'pattern' => '@^(51|52)$@',
396 'replacement' => '\\1',
397 'dict_key' => '4-1077',
398 'label' => '\\1',
399 'try_next_proc' => FALSE,
400 );
401
402 $iftable_processors['gbe2csfp-1-to-16'] = array
403 (
404 'pattern' => '@^Downlink(\d+)$@',
405 'replacement' => '\\0',
406 'dict_key' => '1-1603',
407 'label' => '\\1',
408 'try_next_proc' => FALSE,
409 );
410
411 $iftable_processors['gbe2csfp-17'] = array
412 (
413 'pattern' => '@^Xconnect1$@',
414 'replacement' => '\\0',
415 'dict_key' => '1-1603',
416 'label' => '17',
417 'try_next_proc' => FALSE,
418 );
419
420 $iftable_processors['gbe2csfp-18'] = array
421 (
422 'pattern' => '@^Xconnect2$@',
423 'replacement' => '\\0',
424 'dict_key' => '1-1603',
425 'label' => '18',
426 'try_next_proc' => FALSE,
427 );
428
429 $iftable_processors['gbe2csfp-19'] = array
430 (
431 'pattern' => '@^Mgmt$@',
432 'replacement' => '\\0',
433 'dict_key' => '1-1604',
434 'label' => '19',
435 'try_next_proc' => FALSE,
436 );
437
438 $iftable_processors['gbe2csfp-20'] = array
439 (
440 'pattern' => '@^Uplink1$@',
441 'replacement' => '\\0',
442 'dict_key' => '1-24',
443 'label' => '20',
444 'try_next_proc' => FALSE,
445 );
446
447 $iftable_processors['gbe2csfp-21sfp'] = array
448 (
449 'pattern' => '@^Uplink2$@',
450 'replacement' => '\\0',
451 'dict_key' => '4-1077',
452 'label' => '21',
453 'try_next_proc' => TRUE,
454 );
455
456 $iftable_processors['gbe2csfp-21'] = array
457 (
458 'pattern' => '@^Uplink2$@',
459 'replacement' => '\\0',
460 'dict_key' => '1-24',
461 'label' => '21',
462 'try_next_proc' => FALSE,
463 );
464
465 $iftable_processors['gbe2csfp-22sfp'] = array
466 (
467 'pattern' => '@^Uplink3$@',
468 'replacement' => '\\0',
469 'dict_key' => '4-1077',
470 'label' => '22',
471 'try_next_proc' => TRUE,
472 );
473
474 $iftable_processors['gbe2csfp-22'] = array
475 (
476 'pattern' => '@^Uplink3$@',
477 'replacement' => '\\0',
478 'dict_key' => '1-24',
479 'label' => '22',
480 'try_next_proc' => FALSE,
481 );
482
483 $iftable_processors['gbe2csfp-23sfp'] = array
484 (
485 'pattern' => '@^Uplink4$@',
486 'replacement' => '\\0',
487 'dict_key' => '4-1077',
488 'label' => '23',
489 'try_next_proc' => TRUE,
490 );
491
492 $iftable_processors['gbe2csfp-23'] = array
493 (
494 'pattern' => '@^Uplink4$@',
495 'replacement' => '\\0',
496 'dict_key' => '1-24',
497 'label' => '23',
498 'try_next_proc' => FALSE,
499 );
500
501 $iftable_processors['gbe2csfp-24sfp'] = array
502 (
503 'pattern' => '@^Uplink5$@',
504 'replacement' => '\\0',
505 'dict_key' => '4-1077',
506 'label' => '24',
507 'try_next_proc' => TRUE,
508 );
509
510 $iftable_processors['gbe2csfp-24'] = array
511 (
512 'pattern' => '@^Uplink5$@',
513 'replacement' => '\\0',
514 'dict_key' => '1-24',
515 'label' => '24',
516 'try_next_proc' => FALSE,
517 );
518
519 $iftable_processors['netgear-chassis-any-1000T'] = array
520 (
521 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) Gigabit - Level$@',
522 'replacement' => '\\1/\\2/\\3',
523 'dict_key' => 24,
524 'label' => '\\3',
525 'try_next_proc' => FALSE,
526 );
527
528 $iftable_processors['netgear-chassis-21-to-24-1000Tcombo'] = array
529 (
530 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (21|22|23|24) Gigabit - Level$@',
531 'replacement' => '\\1/\\2/\\3',
532 'dict_key' => 24,
533 'label' => '\\3T',
534 'try_next_proc' => FALSE,
535 );
536
537 $iftable_processors['netgear-chassis-21-to-24-1000SFP'] = array
538 (
539 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (21|22|23|24) Gigabit - Level$@',
540 'replacement' => '\\1/\\2/\\3',
541 'dict_key' => '4-1077',
542 'label' => '\\3F',
543 'try_next_proc' => TRUE,
544 );
545
546 $iftable_processors['netgear-chassis-any-1000SFPcombo'] = array
547 (
548 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) Gigabit - Level$@',
549 'replacement' => '\\1/\\2/\\3',
550 'dict_key' => '4-1077',
551 'label' => '\\3F',
552 'try_next_proc' => TRUE,
553 );
554
555 $iftable_processors['netgear-chassis-any-100TX'] = array
556 (
557 'pattern' => '@^Unit: (\d+) Slot: (\d+) Port: (\d+) 10/100 Copper - Level$@',
558 'replacement' => '\\1/\\2/\\3',
559 'dict_key' => 19,
560 'label' => '\\3',
561 'try_next_proc' => FALSE,
562 );
563
564 $iftable_processors['nortel-any-1000T'] = array
565 (
566 'pattern' => '@^Ethernet Port on unit 1, port ([[:digit:]]+)$@',
567 'replacement' => '\\1',
568 'dict_key' => 24,
569 'label' => '\\1',
570 'try_next_proc' => FALSE,
571 );
572
573 $iftable_processors['smc-combo-45-to-48'] = array
574 (
575 'pattern' => '@^Ethernet Port on unit 1, port (45|46|47|48)$@',
576 'replacement' => '\\1',
577 'dict_key' => '4-1077',
578 'label' => '\\1',
579 'try_next_proc' => TRUE,
580 );
581
582 $iftable_processors['smc2-combo-21-to-24'] = array
583 (
584 'pattern' => '@^Port #(21|22|23|24)$@',
585 'replacement' => '\\1',
586 'dict_key' => '4-1077',
587 'label' => '\\1',
588 'try_next_proc' => TRUE,
589 );
590
591 $iftable_processors['smc2-combo-23-to-24'] = array
592 (
593 'pattern' => '@^Port #(23|24)$@',
594 'replacement' => '\\1',
595 'dict_key' => '4-1077',
596 'label' => '\\1',
597 'try_next_proc' => TRUE,
598 );
599
600 $iftable_processors['smc2-combo-25-to-28'] = array
601 (
602 'pattern' => '@^Port #(25|26|27|28)$@',
603 'replacement' => '\\1',
604 'dict_key' => '4-1077',
605 'label' => '\\1',
606 'try_next_proc' => TRUE,
607 );
608
609 $iftable_processors['smc2-1000T-25-to-28'] = array
610 (
611 'pattern' => '@^Port #(25|26|27|28)$@',
612 'replacement' => '\\1',
613 'dict_key' => '1-24',
614 'label' => '\\1',
615 'try_next_proc' => FALSE,
616 );
617
618 $iftable_processors['smc2-any-1000T'] = array
619 (
620 'pattern' => '@^Port #(\d+)$@',
621 'replacement' => '\\1',
622 'dict_key' => '1-24',
623 'label' => '\\1',
624 'try_next_proc' => FALSE,
625 );
626
627 $iftable_processors['smc2-any-100TX'] = array
628 (
629 'pattern' => '@^Port #(\d+)$@',
630 'replacement' => '\\1',
631 'dict_key' => '1-19',
632 'label' => '\\1',
633 'try_next_proc' => FALSE,
634 );
635
636 $iftable_processors['juniper-DPCE-R-4XGE-XFP'] = array
637 (
638 'pattern' => '@^xe-([[:digit:]]+)/([[:digit:]]+/[[:digit:]]+)$@',
639 'replacement' => '\\0',
640 'dict_key' => '8-1082', // XFP/empty
641 'label' => 'slot \\1 port \\2',
642 'try_next_proc' => FALSE,
643 );
644
645 $iftable_processors['juniper-ex-pic0-1000T'] = array
646 (
647 'pattern' => '@^ge-([[:digit:]]+)/0/([[:digit:]]+)$@',
648 'replacement' => '\\0',
649 'dict_key' => '1-24',
650 'label' => 'unit \\1 port \\2',
651 'try_next_proc' => FALSE,
652 );
653
654 $iftable_processors['juniper-ex-mgmt'] = array
655 (
656 'pattern' => '/^me0$/',
657 'replacement' => 'me0',
658 'dict_key' => '1-24',
659 'label' => 'MGMT',
660 'try_next_proc' => FALSE,
661 );
662
663 $iftable_processors['quidway-21-to-24-comboT'] = array
664 (
665 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)(21|22|23|24)$@',
666 'replacement' => 'gi\\1\\2',
667 'dict_key' => '1-24',
668 'label' => '\\2',
669 'try_next_proc' => TRUE,
670 );
671
672 $iftable_processors['quidway-21-to-24-comboSFP'] = array
673 (
674 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)(21|22|23|24)$@',
675 'replacement' => 'gi\\1\\2',
676 'dict_key' => '4-1077',
677 'label' => '\\2',
678 'try_next_proc' => TRUE,
679 );
680
681 $iftable_processors['quidway-slot1-SFP'] = array
682 (
683 'pattern' => '@^GigabitEthernet0/1/([[:digit:]]+)$@',
684 'replacement' => 'gi0/1/\\1',
685 'dict_key' => '4-1077',
686 'label' => 'SFP\\1',
687 'try_next_proc' => FALSE,
688 );
689
690 $iftable_processors['quidway-any-1000SFP'] = array
691 (
692 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
693 'replacement' => 'gi\\1\\2',
694 'dict_key' => '4-1077', // empty SFP-1000
695 'label' => '\\2',
696 'try_next_proc' => FALSE,
697 );
698
699 $iftable_processors['quidway-any-1000T'] = array
700 (
701 'pattern' => '@^GigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
702 'replacement' => 'gi\\1\\2',
703 'dict_key' => '1-24',
704 'label' => '\\2',
705 'try_next_proc' => FALSE,
706 );
707
708 $iftable_processors['quidway-XFP'] = array
709 (
710 'pattern' => '@^XGigabitEthernet([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
711 'replacement' => 'xg\\1\\2',
712 'dict_key' => '8-1082',
713 'label' => '\\2',
714 'try_next_proc' => FALSE,
715 );
716
717 $iftable_processors['quidway-mgmt'] = array
718 (
719 'pattern' => '@^MEth([[:digit:]]+/[[:digit:]]+/)([[:digit:]]+)$@',
720 'replacement' => 'me\\1\\2',
721 'dict_key' => '1-19',
722 'label' => 'eth',
723 'try_next_proc' => FALSE,
724 );
725
726 $iftable_processors['fgs-1-to-4-comboSFP'] = array
727 (
728 # only 4 first copper ports of 1st unit of a stack
729 'pattern' => '@^GigabitEthernet1/1/(1|2|3|4)$@',
730 'replacement' => 'e1/1/\\1',
731 'dict_key' => '4-1077',
732 'label' => '\\1F',
733 'try_next_proc' => TRUE,
734 );
735
736 $iftable_processors['fgs-any-1000T'] = array
737 (
738 'pattern' => '@^GigabitEthernet(0|1)/1/([[:digit:]]+)$@',
739 'replacement' => 'e\\1/1/\\2',
740 'dict_key' => '1-24',
741 'label' => '\\2',
742 'try_next_proc' => FALSE,
743 );
744
745 $iftable_processors['fls624-combo'] = array
746 (
747 'pattern' => '@^GigabitEthernet0/1/(21|22|23|24)$@',
748 'replacement' => 'e0/1/\\1',
749 'dict_key' => '4-1077',
750 'label' => '\\1',
751 'try_next_proc' => TRUE,
752 );
753
754 $iftable_processors['fls648-combo'] = array
755 (
756 'pattern' => '@^GigabitEthernet0/1/(45|46|47|48)$@',
757 'replacement' => 'e0/1/\\1',
758 'dict_key' => '4-1077',
759 'label' => '\\1',
760 'try_next_proc' => TRUE,
761 );
762
763 # These can be CX4, but that is not handled here.
764 $iftable_processors['fls-uplinks'] = array
765 (
766 'pattern' => '@^10GigabitEthernet0/([234])/1$@',
767 'replacement' => 'e0/\\1/1',
768 'dict_key' => '8-1082',
769 'label' => 'Slot \\1',
770 'try_next_proc' => FALSE,
771 );
772
773 $iftable_processors['fgs-uplinks'] = array
774 (
775 'pattern' => '@^10GigabitEthernet1/2/([[:digit:]]+)$@',
776 'replacement' => 'e1/2/\\1',
777 'dict_key' => '8-1082', // default is XFP, but may be overridden to CX4
778 'label' => 'Slot2 \\1',
779 'try_next_proc' => FALSE,
780 );
781
782 $iftable_processors['fcx-uplinks'] = array
783 (
784 'pattern' => '@^10GigabitEthernet1/2/([[:digit:]]+)$@',
785 'replacement' => 'e1/2/\\1',
786 'dict_key' => '9-1084',
787 'label' => 'X\\1',
788 'try_next_proc' => FALSE,
789 );
790
791 $iftable_processors['fcx-management'] = array
792 (
793 'pattern' => '@^Management$@',
794 'replacement' => 'management1',
795 'dict_key' => '1-24',
796 'label' => 'Management',
797 'try_next_proc' => FALSE,
798 );
799
800 $iftable_processors['summit-25-to-26-XFP-uplinks'] = array
801 (
802 'pattern' => '@^.+ Port (25|26)$@',
803 'replacement' => '\\1',
804 'dict_key' => '8-1082',
805 'label' => '\\1',
806 'try_next_proc' => FALSE,
807 );
808
809 $iftable_processors['summit-27-to-30-XFP-uplinks'] = array
810 (
811 'pattern' => '@^.+ Port (27|28|29|30)$@',
812 'replacement' => '\\1',
813 'dict_key' => '8-1082',
814 'label' => '\\1',
815 'try_next_proc' => FALSE,
816 );
817
818 $iftable_processors['summit-21-to-24-comboSFP'] = array
819 (
820 'pattern' => '@^.+ Port (21|22|23|24)$@',
821 'replacement' => '\\1',
822 'dict_key' => '4-1077',
823 'label' => '\\1',
824 'try_next_proc' => TRUE,
825 );
826
827 $iftable_processors['summit-13-to-24-comboT'] = array
828 (
829 'pattern' => '@^.+ Port (1[3456789]|2[01234])$@',
830 'replacement' => '\\1',
831 'dict_key' => '1-24',
832 'label' => '\\1',
833 'try_next_proc' => TRUE,
834 );
835
836 $iftable_processors['summit-any-1000T'] = array
837 (
838 'pattern' => '@^.+ Port ([[:digit:]]+)$@',
839 'replacement' => '\\1',
840 'dict_key' => '1-24',
841 'label' => '\\1',
842 'try_next_proc' => FALSE,
843 );
844
845 $iftable_processors['summit-any-SFP'] = array
846 (
847 'pattern' => '@^.+ Port ([[:digit:]]+)$@',
848 'replacement' => '\\1',
849 'dict_key' => '4-1077',
850 'label' => '\\1',
851 'try_next_proc' => FALSE,
852 );
853
854 $iftable_processors['summit-management'] = array
855 (
856 'pattern' => '@^Management Port$@',
857 'replacement' => 'mgmt',
858 'dict_key' => '1-19',
859 'label' => 'management',
860 'try_next_proc' => FALSE,
861 );
862
863 $iftable_processors['C3KX-NM-10000'] = array
864 (
865 'pattern' => '@^TenGigabitEthernet1/(\d+)$@',
866 'replacement' => 'te1/\\1',
867 'dict_key' => '9-1084',
868 'label' => 'NM TE\\1',
869 'try_next_proc' => FALSE,
870 );
871
872 $iftable_processors['C3KX-NM-1000'] = array
873 (
874 'pattern' => '@^GigabitEthernet1/(\d+)$@',
875 'replacement' => 'gi1/\\1',
876 'dict_key' => '4-1077',
877 'label' => 'NM G\\1',
878 'try_next_proc' => FALSE,
879 );
880
881 $iftable_processors['fortinet-chassis-any-1000T'] = array
882 (
883 'pattern' => '@^port([[:digit:]]+)$@',
884 'replacement' => '\\1',
885 'dict_key' => 24,
886 'label' => '\\1',
887 'try_next_proc' => FALSE,
888 );
889
890 global $known_switches;
891 $known_switches = array // key is system OID w/o "enterprises" prefix
892 (
893 '9.1.217' => array
894 (
895 'dict_key' => 124,
896 'text' => 'WS-C2924-XL: 24 RJ-45/10-100TX',
897 'processors' => array ('catalyst-chassis-any-100TX'),
898 ),
899 '9.1.246' => array
900 (
901 'dict_key' => 391,
902 'text' => 'WS-C3508G-XL: 8 GBIC/1000',
903 'processors' => array ('catalyst-chassis-any-1000GBIC'),
904 ),
905 '9.1.248' => array
906 (
907 'dict_key' => 393,
908 'text' => 'WS-C3524-XL: 24 RJ-45/10-100TX + 2 GBIC/1000',
909 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
910 ),
911 '9.1.278' => array
912 (
913 'dict_key' => 395,
914 'text' => 'WS-C3548-XL: 48 RJ-45/10-100TX + 2 GBIC/1000',
915 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
916 ),
917 '9.1.324' => array
918 (
919 'dict_key' => 380,
920 'text' => 'WS-C2950-24: 24 RJ-45/10-100TX',
921 'processors' => array ('catalyst-chassis-any-100TX'),
922 ),
923 '9.1.325' => array
924 (
925 'dict_key' => 382,
926 'text' => 'WS-C2950C-24: 24 RJ-45/10-100TX + 2 MT-RJ/100FX fiber',
927 'processors' => array ('catalyst-chassis-25-to-26-100FX/MT-RJ', 'catalyst-chassis-any-100TX'),
928 ),
929 '9.1.359' => array
930 (
931 'dict_key' => 386,
932 'text' => 'WS-C2950T-24: 24 RJ-45/10-100TX + 2 1000T uplinks',
933 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
934 ),
935 '9.1.559' => array
936 (
937 'dict_key' => 387,
938 'text' => 'WS-C2950T-48: 48 RJ-45/10-100TX + 2 1000T uplinks',
939 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
940 ),
941 '9.1.695' => array
942 (
943 'dict_key' => 1590,
944 'text' => 'WS-C2960-48TC-L: 48 RJ-45/10-100TX + 2 combo-gig',
945 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
946 ),
947 '9.1.930' => array
948 (
949 'dict_key' => 1607,
950 'text' => 'WS-C3560E-12D-S: 12 X2/10000 w/TwinGig + OOBM',
951 'processors' => array
952 (
953 'catalyst-chassis-any-1000SFP',
954 'catalyst-chassis-uplinks-10000X2',
955 'catalyst-chassis-mgmt',
956 ),
957 ),
958 '9.1.793' => array
959 (
960 'dict_key' => 1575,
961 'text' => 'WS-C3560E-24TD: 24 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig + OOBM',
962 'processors' => array
963 (
964 'catalyst-chassis-25-to-28-1000SFP', // TwinGig
965 'catalyst-chassis-any-1000T',
966 'catalyst-chassis-uplinks-10000X2',
967 'catalyst-chassis-mgmt',
968 ),
969 ),
970 '9.1.794' => array
971 (
972 'dict_key' => 1574,
973 'text' => 'WS-C3560E-48TD: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig + OOBM',
974 'processors' => array
975 (
976 'catalyst-chassis-49-to-52-1000SFP', // TwinGig
977 'catalyst-chassis-any-1000T',
978 'catalyst-chassis-uplinks-10000X2',
979 'catalyst-chassis-mgmt',
980 ),
981 ),
982 '9.1.1257' => array
983 (
984 'dict_key' => 167,
985 'text' => 'WS-C2960G-24TS-S: 24 RJ-45/10-100-1000T(X)',
986 'processors' => array ('catalyst-chassis-25-to-26-1000SFP', 'catalyst-chassis-mgmt', 'catalyst-chassis-any-1000T'),
987 ),
988 '9.1.799' => array
989 (
990 'dict_key' => 168,
991 'text' => 'WS-C2960G-8TC-L: 7 RJ-45/10-100-1000T(X) + 1 combo-gig',
992 'processors' => array ('catalyst-chassis-8-combo-1000SFP', 'catalyst-chassis-any-1000T'),
993 ),
994 '9.1.696' => array
995 (
996 'dict_key' => 167,
997 'text' => 'WS-C2960G-24TC-L: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
998 'processors' => array ('catalyst-chassis-21-to-24-combo-1000SFP', 'catalyst-chassis-any-1000T'),
999 ),
1000 '9.1.697' => array
1001 (
1002 'dict_key' => 166,
1003 'text' => 'WS-C2960G-48TC-L: 44 RJ-45/10-100-1000T(X) + 4 combo-gig',
1004 'processors' => array ('catalyst-chassis-45-to-48-combo-1000SFP', 'catalyst-chassis-any-1000T'),
1005 ),
1006 '9.1.928' => array
1007 (
1008 'dict_key' => 163,
1009 'text' => 'WS-C2960-24TC-S: 24 RJ-45/10-100TX + 2 combo-gig',
1010 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-100TX'),
1011 ),
1012 '9.1.716' => array
1013 (
1014 'dict_key' => 164,
1015 'text' => 'WS-C2960-24TT-L: 24 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1016 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
1017 ),
1018 '9.1.717' => array
1019 (
1020 'dict_key' => 1572,
1021 'text' => 'WS-C2960-48TT-L: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1022 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
1023 ),
1024 '9.1.950' => array
1025 (
1026 'dict_key' => 1347,
1027 'text' => 'WS-C2960-24PC: 44 RJ-45/10-100TX + 2 combo-gig',
1028 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1029 ),
1030 '9.1.927' => array
1031 (
1032 'dict_key' => 140,
1033 'text' => 'WS-C2960-48TC-S: 48 RJ-45/10-100TX + 2 combo-gig',
1034 'processors' => array ('catalyst-chassis-1-to-2-combo-1000SFP', 'catalyst-chassis-any-1000T', 'catalyst-chassis-any-100TX'),
1035 ),
1036 '9.1.1005' => array
1037 (
1038 'dict_key' => 1573,
1039 'text' => 'WS-C2960-48TT-S: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1040 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000T'),
1041 ),
1042 '9.1.527' => array
1043 (
1044 'dict_key' => 210,
1045 'text' => 'WS-C2970G-24T: 24 RJ-45/10-100-1000T(X)',
1046 'processors' => array ('catalyst-chassis-any-1000T'),
1047 ),
1048 '9.1.561' => array
1049 (
1050 'dict_key' => 115,
1051 'text' => 'WS-C2970G-24TS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
1052 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
1053 ),
1054 '9.1.633' => array
1055 (
1056 'dict_key' => 169,
1057 'text' => 'WS-C3560-24TS: 24 RJ-45/10-100TX + 2 SFP/1000',
1058 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
1059 ),
1060 '9.1.634' => array
1061 (
1062 'dict_key' => 170,
1063 'text' => 'WS-C3560-48TS: 48 RJ-45/10-100TX + 4 SFP/1000',
1064 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
1065 ),
1066 '9.1.563' => array
1067 (
1068 'dict_key' => 171,
1069 'text' => 'WS-C3560-24PS: 24 RJ-45/10-100TX + 2 SFP/1000',
1070 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
1071 ),
1072 '9.1.564' => array
1073 (
1074 'dict_key' => 172,
1075 'text' => 'WS-C3560-48PS: 48 RJ-45/10-100TX + 4 SFP/1000',
1076 'processors' => array ('catalyst-chassis-any-1000SFP', 'catalyst-chassis-any-100TX'),
1077 ),
1078 '9.1.614' => array
1079 (
1080 'dict_key' => 175,
1081 'text' => 'WS-C3560G-24PS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
1082 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
1083 ),
1084 '9.1.615' => array
1085 (
1086 'dict_key' => 173,
1087 'text' => 'WS-C3560G-24TS: 24 RJ-45/10-100-1000T(X) + 4 SFP/1000',
1088 'processors' => array ('catalyst-chassis-25-to-28-1000SFP', 'catalyst-chassis-any-1000T'),
1089 ),
1090 '9.1.616' => array
1091 (
1092 'dict_key' => 176,
1093 'text' => 'WS-C3560G-48PS: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000',
1094 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-any-1000T'),
1095 ),
1096 '9.1.617' => array
1097 (
1098 'dict_key' => 174,
1099 'text' => 'WS-C3560G-48TS: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000',
1100 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-any-1000T'),
1101 ),
1102 '9.1.626' => array
1103 (
1104 'dict_key' => 147,
1105 'text' => 'WS-C4948: 48 RJ-45/10-100-1000T(X) + 4 SFP/1000 + 1 RJ-45/100TX (OOB mgmt)',
1106 'processors' => array ('catalyst-chassis-49-to-52-1000SFP', 'catalyst-chassis-uplinks-1000T', 'catalyst-chassis-mgmt'),
1107 ),
1108 '9.1.659' => array
1109 (
1110 'dict_key' => 377,
1111 'text' => 'WS-C4948-10GE: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 + 1 RJ-45/100TX (OOB mgmt)',
1112 'processors' => array ('catalyst-chassis-uplinks-10000X2', 'catalyst-chassis-uplinks-1000T', 'catalyst-chassis-mgmt'),
1113 ),
1114 '9.1.428' => array
1115 (
1116 'dict_key' => 389,
1117 'text' => 'WS-C2950G-24: 24 RJ-45/10-100TX + 2 GBIC/1000',
1118 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1119 ),
1120 '9.1.429' => array
1121 (
1122 'dict_key' => 390,
1123 'text' => 'WS-C2950G-48: 48 RJ-45/10-100TX + 2 GBIC/1000',
1124 'processors' => array ('catalyst-chassis-any-1000GBIC', 'catalyst-chassis-any-100TX'),
1125 ),
1126 '9.1.559' => array
1127 (
1128 'dict_key' => 387,
1129 'text' => 'WS-C2950T-48: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1130 'processors' => array ('catalyst-chassis-uplinks-1000T', 'catalyst-chassis-any-100TX'),
1131 ),
1132 '9.1.560' => array
1133 (
1134 'dict_key' => 384,
1135 'text' => 'WS-C2950SX-48: 48 RJ-45/10-100TX + 2 1000Base-SX',
1136 'processors' => array ('catalyst-chassis-uplinks-1000SX', 'catalyst-chassis-any-100TX'),
1137 ),
1138 '9.1.749' => array
1139 (
1140 'dict_key' => 989,
1141 'text' => 'WS-CBS3030-DEL: 10 internal/10-100-1000T(X) + 2 RJ-45/10-100-1000T(X) + 4 SFP/1000',
1142 'processors' => array ('catalyst-blade-11-to-12-1000T', 'catalyst-blade-13-to-16-1000SFP', 'catalyst-blade-any-bp/1000T'),
1143 ),
1144 '9.1.920' => array
1145 (
1146 'dict_key' => 795,
1147 'text' => 'WS-CBS3032-DEL: 16 internal/10-100-1000T(X) + 4 RJ-45/10-100-1000T(X) + 4 SFP/1000',
1148 'processors' => array ('catalyst-blade-17-to-20-1000T', 'catalyst-blade-21-to-24-1000SFP', 'catalyst-blade-any-bp/1000T'),
1149 ),
1150 '9.1.367' => array
1151 (
1152 'dict_key' => 404,
1153 'text' => 'WS-C3550-48: 48 RJ-45/10-100TX + 2 GBIC/1000',
1154 'processors' => array ('catalyst-chassis-any-100TX', 'catalyst-chassis-any-1000GBIC'),
1155 ),
1156 '9.1.368' => array
1157 (
1158 'dict_key' => 398,
1159 'text' => 'WS-C3550-12T: 10 RJ-45/10-100-1000T(X) + 2 GBIC/1000',
1160 'processors' => array ('catalyst-1-to-10-1000T', 'catalyst-11-to-12-GBIC'),
1161 ),
1162 '9.1.431' => array
1163 (
1164 'dict_key' => 399,
1165 'text' => 'WS-C3550-12G: 10 GBIC/1000 + 2 RJ-45/10-100-1000T(X)',
1166 'processors' => array ('catalyst-11-to-12-1000T', 'catalyst-chassis-any-1000GBIC'),
1167 ),
1168 '9.1.282' => array
1169 (
1170 'dict_key' => 154,
1171 'text' => 'WS-C6506: modular device (INCOMPLETE!)',
1172 'processors' => array ('catalyst-chassis-any-1000T'),
1173 ),
1174 '9.1.1104' => array
1175 (
1176 'dict_key' => 1348,
1177 'text' => 'WS-C2350-48TD: 48 RJ-45/10-100-1000T(X) + 2 X2/10000 w/TwinGig option',
1178 'processors' => array
1179 (
1180 'catalyst-chassis-49-to-52-1000SFP', // TwinGig actually
1181 'catalyst-chassis-any-1000T',
1182 'catalyst-chassis-uplinks-10000X2',
1183 'catalyst-chassis-mgmt',
1184 ),
1185 ),
1186 '9.1.1016' => array
1187 (
1188 'dict_key' => 1370,
1189 'text' => 'WS-C2960-48PST-L: 48 RJ-45/10-100TX PoE + 2 SFP/1000 + 2 RJ-45/10-100-1000T(X)',
1190 'processors' => array
1191 (
1192 'catalyst-chassis-any-100TX',
1193 'catalyst-chassis-1-to-2-1000SFP',
1194 'catalyst-chassis-uplinks-1000T',
1195 ),
1196 ),
1197 '9.1.1208' => array
1198 (
1199 'dict_key' => 1394,
1200 'text' => 'WS-C2960S-24PS-L: 24 RJ-45/10-100-1000T(X) PoE+ + 4 SFP/1000',
1201 'processors' => array
1202 (
1203 'catalyst-chassis-mgmt',
1204 'catalyst-stack-25-to-28-SFP',
1205 'catalyst-stack-any-1000T',
1206 ),
1207 ),
1208 '9.1.1227' => array
1209 (
1210 'dict_key' => 1577,
1211 'text' => 'WS-C3560X-48T: 48 RJ-45/10-100-1000T(X) + network module + OOBM',
1212 'processors' => array
1213 (
1214 'C3KX-NM-10000',
1215 'C3KX-NM-1000',
1216 'catalyst-chassis-any-1000T',
1217 'catalyst-chassis-mgmt',
1218 ),
1219 ),
1220 '9.1.1292' => array
1221 (
1222 'dict_key' => 1606,
1223 'text' => 'WS-C2360-48TD: 48 RJ-45 GigE + 4 SFP+/10000',
1224 'processors' => array ('catalyst-chassis-any-1000T', 'catalyst-chassis-mgmt', 'catalyst-chassis-uplinks-10000SFP+'),
1225 ),
1226 '9.12.3.1.3.719' => array
1227 (
1228 'dict_key' => 960,
1229 'text' => 'N5K-C5020: 40 SFP+/10000',
1230 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1231 ),
1232 '9.12.3.1.3.798' => array
1233 (
1234 'dict_key' => 959,
1235 'text' => 'N5K-C5010: 20 SFP+/10000',
1236 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1237 ),
1238 '9.12.3.1.3.1008' => array
1239 (
1240 'dict_key' => 1412,
1241 'text' => 'N5K-C5548P: 32 SFP+/10000',
1242 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1243 ),
1244 '9.12.3.1.3.1084' => array
1245 (
1246 'dict_key' => 1412,
1247 'text' => 'N5K-C5548P: 32 SFP+/10000',
1248 'processors' => array ('nexus-any-10000SFP+', 'nexus-mgmt'),
1249 ),
1250 '11.2.3.7.11.19' => array
1251 (
1252 'dict_key' => 859,
1253 'text' => 'J4813A: 24 RJ-45/10-100TX + 2 modules of varying type',
1254 'processors' => array ('procurve-chassis-100TX'),
1255 ),
1256 '11.2.3.7.11.32' => array
1257 (
1258 'dict_key' => 871,
1259 'text' => 'J4904A: 48 RJ-45/10-100-1000T(X)',
1260 'processors' => array ('procurve-chassis-1000T'),
1261 ),
1262 '11.2.3.7.11.36' => array
1263 (
1264 'dict_key' => 865,
1265 'text' => 'J8164A: 24 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1266 'processors' => array ('procurve-25-to-26-1000T', 'procurve-chassis-100TX'),
1267 ),
1268 '11.2.3.7.11.35' => array
1269 (
1270 'dict_key' => 867,
1271 'text' => 'J8165A: 48 RJ-45/10-100TX + 2 RJ-45/10-100-1000T(X)',
1272 'processors' => array ('procurve-49-to-50-1000T', 'procurve-chassis-100TX'),
1273 ),
1274 '11.2.3.7.11.9' => array
1275 (
1276 'dict_key' => 1086,
1277 'text' => 'J4121A: modular system',
1278 'processors' => array ('procurve-modular-100TX'),
1279 ),
1280 '11.2.3.7.11.63' => array
1281 (
1282 'dict_key' => 868,
1283 'text' => 'J9021A: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1284 'processors' => array ('procurve-21-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1285 ),
1286 '11.2.3.7.11.65' => array
1287 (
1288 'dict_key' => 850,
1289 'text' => 'J9028A: 22 RJ-45/10-100-1000T(X) + 2 combo-gig',
1290 'processors' => array ('smc2-combo-23-to-24', 'smc2-any-1000T'),
1291 ),
1292 '11.2.3.7.11.86' => array
1293 (
1294 'dict_key' => 1571,
1295 'text' => 'J9145A: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1296 'processors' => array ('procurve-21-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1297 ),
1298 '11.2.3.7.11.87' => array
1299 (
1300 'dict_key' => 1349,
1301 'text' => 'J9147A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1302 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1303 ),
1304 '11.2.3.7.11.85' => array
1305 (
1306 'dict_key' => 1600,
1307 'text' => 'J9148A: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + varying uplinks',
1308 'processors' => array ('procurve-45-to-48-combo-1000SFP', 'procurve-chassis-1000T'),
1309 ),
1310 '11.2.3.7.11.88' => array
1311 (
1312 'dict_key' => 1349,
1313 'text' => 'J9279A: 22 RJ-45/10-100-1000T(X) + 2 combo-gig + varying uplinks',
1314 'processors' => array ('procurve-23-to-24-combo-1000SFP', 'procurve-chassis-1000T'),
1315 ),
1316 '11.2.3.7.11.79' => array
1317 (
1318 'dict_key' => 863,
1319 'text' => 'J9089A: 48 RJ-45/10-100TX PoE + 2 1000T + 2 SFP-1000',
1320 'processors' => array ('procurve-49-to-50-1000T', 'procurve-51-to-52-1000SFP', 'procurve-chassis-100TX'),
1321 ),
1322 '11.2.3.7.11.33.4.1.1' => array
1323 (
1324 'dict_key' => 1605,
1325 'text' => 'HP GbE2c w/SFP',
1326 'processors' => array
1327 (
1328 'gbe2csfp-1-to-16',
1329 'gbe2csfp-17',
1330 'gbe2csfp-18',
1331 'gbe2csfp-19',
1332 'gbe2csfp-20',
1333 'gbe2csfp-21sfp',
1334 'gbe2csfp-22sfp',
1335 'gbe2csfp-23sfp',
1336 'gbe2csfp-24sfp',
1337 'gbe2csfp-21',
1338 'gbe2csfp-22',
1339 'gbe2csfp-23',
1340 'gbe2csfp-24',
1341 ),
1342 ),
1343 '4526.100.1.1' => array
1344 (
1345 'dict_key' => 587,
1346 'text' => 'FSM7328S: 24 RJ-45/10-100TX + 4 combo-gig',
1347 'processors' => array ('netgear-chassis-any-100TX', 'netgear-chassis-any-1000SFPcombo', 'netgear-chassis-any-1000T'),
1348 ),
1349 '4526.100.2.2' => array
1350 (
1351 'dict_key' => 562,
1352 'text' => 'GSM7224: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1353 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1354 ),
1355 '4526.100.2.3' => array
1356 (
1357 'dict_key' => 559,
1358 'text' => 'GSM7212: 12 combo-gig',
1359 'processors' => array ('netgear-chassis-any-1000SFPcombo', 'netgear-chassis-any-1000T'),
1360 ),
1361 '4526.100.11.1' => array
1362 (
1363 'dict_key' => 557,
1364 'text' => 'GSM7224R: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1365 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1366 ),
1367 '4526.100.11.5' => array
1368 (
1369 'dict_key' => 1602,
1370 'text' => 'GSM7224v2: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1371 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1372 ),
1373 '4526.100.1.13' => array
1374 (
1375 'dict_key' => 1601,
1376 'text' => 'GSM7328Sv2: 20 RJ-45/10-100-1000T(X) + 4 combo-gig',
1377 'processors' => array ('netgear-chassis-21-to-24-1000SFP', 'netgear-chassis-21-to-24-1000Tcombo', 'netgear-chassis-any-1000T'),
1378 ),
1379 '45.3.68.5' => array
1380 (
1381 'dict_key' => 1085,
1382 'text' => 'BES50GE-12T PWR: 12 RJ-45/10-100-1000T(X)',
1383 'processors' => array ('nortel-any-1000T'),
1384 ),
1385 '2636.1.1.1.2.29' => array
1386 (
1387 'dict_key' => 925,
1388 'text' => 'MX240 modular router',
1389 'processors' => array ('juniper-DPCE-R-4XGE-XFP'),
1390 ),
1391 // Juniper Networks assigns single SNMP OID per series:
1392 // EX2200 2636.1.1.1.1.43
1393 // EX3200 2636.1.1.1.2.30
1394 // EX4200 2636.1.1.1.2.31
1395 // EX4500 2636.1.1.1.1.44
1396 // There is a special workaround in code below to derive specific
1397 // product number from sysDescr string.
1398 '2636.1.1.1.2.31' => array
1399 (
1400 'dict_key' => 905,
1401 'text' => 'Juniper EX4200 series',
1402 'processors' => array ('juniper-ex-pic0-1000T', 'juniper-ex-mgmt'),
1403 ),
1404 '2011.2.23.96' => array
1405 (
1406 'dict_key' => 1321,
1407 'text' => 'S5328C-EI-24S: 20 SFP-1000 + 4 combo-gig + 2 XFP slots',
1408 'processors' => array ('quidway-21-to-24-comboT', 'quidway-any-1000SFP', 'quidway-XFP', 'quidway-mgmt'),
1409 ),
1410 '2011.2.23.103' => array
1411 (
1412 'dict_key' => 1341,
1413 'text' => 'S5352C-SI: 48 RJ-45/10-100-1000T(X) + optional 2xXFP/4xSFP slots',
1414 'processors' => array ('quidway-slot1-SFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1415 ),
1416 '2011.2.23.97' => array
1417 (
1418 'dict_key' => 1337,
1419 'text' => 'S5352C-EI: 48 RJ-45/10-100-1000T(X) + optional 2xXFP/4xSFP slots',
1420 'processors' => array ('quidway-slot1-SFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1421 ),
1422 '2011.2.23.95' => array
1423 (
1424 'dict_key' => 1335,
1425 'text' => 'S5328C-EI: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 XFP slots',
1426 'processors' => array ('quidway-21-to-24-comboSFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1427 ),
1428 '2011.2.23.102' => array
1429 (
1430 'dict_key' => 1339,
1431 'text' => 'S5328C-SI: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 XFP slots',
1432 'processors' => array ('quidway-21-to-24-comboSFP', 'quidway-any-1000T', 'quidway-XFP', 'quidway-mgmt'),
1433 ),
1434 '1991.1.3.45.2.1.1.1' => array
1435 (
1436 'dict_key' => 127,
1437 'text' => 'FGS648P: 48 RJ-45/10-100-1000T(X) + 4 combo-gig + uplink slot',
1438 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T', 'fgs-uplinks'),
1439 ),
1440 '1991.1.3.45.2.2.1.1' => array
1441 (
1442 'dict_key' => 131,
1443 'text' => 'FGS648P-POE: 48 RJ-45/10-100-1000T(X) + 4 combo-gig + uplink slot',
1444 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T', 'fgs-uplinks'),
1445 ),
1446 '1991.1.3.54.2.4.1.1' => array
1447 (
1448 'dict_key' => 1362,
1449 'text' => 'FCX 648: 48 RJ-45/10-100-1000T(X) + uplink slot with 4 SFP+',
1450 'processors' => array ('fgs-any-1000T', 'fcx-uplinks', 'fcx-management'),
1451 ),
1452 '1991.1.3.46.1.1.1.1' => array
1453 (
1454 'dict_key' => 413,
1455 'text' => 'FLS 624: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + 3 optional 10G modules',
1456 'processors' => array ('fls624-combo', 'fgs-any-1000T', 'fls-uplinks'),
1457 ),
1458 '1991.1.3.46.2.1.1.1' => array
1459 (
1460 'dict_key' => 414,
1461 'text' => 'FLS 648: 44 RJ-45/10-100-1000T(X) + 4 combo-gig + 2 optional 10G modules',
1462 'processors' => array ('fls648-combo', 'fgs-any-1000T', 'fls-uplinks'),
1463 ),
1464 '1991.1.3.52.2.2.1.1' => array
1465 (
1466 'dict_key' => 1032,
1467 'text' => 'FWS648G: 4 combo-gig + 44 RJ-45/10-100-1000T(X)',
1468 'processors' => array ('fgs-1-to-4-comboSFP', 'fgs-any-1000T'),
1469 ),
1470 '1916.2.71' => array
1471 (
1472 'dict_key' => 694,
1473 'text' => 'X450a-24t: 20 RJ-45/10-100-1000T(X) + 4 combo-gig + XFP uplinks slot',
1474 'processors' => array ('summit-25-to-26-XFP-uplinks', 'summit-21-to-24-comboSFP', 'summit-any-1000T', 'summit-management'),
1475 ),
1476 '1916.2.139' => array
1477 (
1478 'dict_key' => 1353,
1479 'text' => 'X480-24x: 12 SFP-1000 + 12 combo-gig + 2 XFP + VIM slot',
1480 'processors' => array
1481 (
1482 'summit-27-to-30-XFP-uplinks',
1483 'summit-25-to-26-XFP-uplinks',
1484 'summit-13-to-24-comboT',
1485 'summit-any-SFP',
1486 'summit-management'
1487 ),
1488 ),
1489 '202.20.68' => array
1490 (
1491 'dict_key' => 1374,
1492 'text' => 'SMC8150L2: 46 RJ-45/10-100-1000T(X) + 4 combo ports',
1493 'processors' => array ('smc-combo-45-to-48', 'nortel-any-1000T'),
1494 ),
1495 '6027.1.3.12' => array
1496 (
1497 'dict_key' => 1471,
1498 'text' => 'Force10 S60: 44 RJ-45/10-100-1000T(X) + 4 SFP-1000 ports + 0/2/4 SFP+ ports',
1499 'processors' => array ('ftos-44-to-47-1000SFP', 'ftos-any-1000T', 'ftos-any-10000SFP+', 'ftos-mgmt'),
1500 ),
1501 '6027.1.3.13' => array
1502 (
1503 'dict_key' => 1470,
1504 'text' => 'Force10 S55: 44 RJ-45/10-100-1000T(X) + 4 SFP-1000 ports + 0/2/4 SFP+ ports',
1505 'processors' => array ('ftos-44-to-47-1000SFP', 'ftos-any-1000T', 'ftos-any-10000SFP+', 'ftos-mgmt'),
1506 ),
1507 '6027.1.3.14' => array
1508 (
1509 'dict_key' => 1472,
1510 'text' => 'Force10 S4810: 48 SFP+-1000/10000 + 4 QSFP-40000 ports',
1511 'processors' => array ('ftos-any-10000SFP+', 'ftos-any-QSFP+', 'ftos-mgmt'),
1512 ),
1513 '202.20.59' => array
1514 (
1515 'dict_key' => 1371,
1516 'text' => 'SMC8124L2: 20 RJ-45/10-100-1000T(X) + 4 combo ports',
1517 'processors' => array ('smc2-combo-21-to-24', 'smc2-any-1000T'),
1518 ),
1519 '202.20.66' => array
1520 (
1521 'dict_key' => 1567,
1522 'text' => 'SMC6128L2: 24 RJ-45/10-100TX + 4 combo-gig ports',
1523 'processors' => array ('smc2-combo-25-to-28', 'smc2-1000T-25-to-28', 'smc2-any-100TX'),
1524 ),
1525 '12356.101.1.3002'=> array
1526 (
1527 'dict_key' => 1609,
1528 'text' => 'FG310B: 10 RJ-45/10-1000T',
1529 'processors' => array('fortinet-chassis-any-1000T'),
1530 ),
1531 );
1532
1533 global $swtype_pcre;
1534 $swtype_pcre = array
1535 (
1536 '/Huawei Versatile Routing Platform Software.+VRP.+Software, Version 5.30 /s' => 1360,
1537 '/Huawei Versatile Routing Platform Software.+VRP.+Software, Version 5.50 /s' => 1361,
1538 '/Huawei Versatile Routing Platform Software.+VRP.+Software,\s*Version 5.70 /is' => 1369,
1539 // FIXME: get sysDescr for IronWare 5 and add a pattern
1540 '/^Brocade Communications Systems.+, IronWare Version 07\./' => 1364,
1541 '/^Juniper Networks,.+JUNOS 9\./' => 1366,
1542 '/^Juniper Networks,.+JUNOS 10\./' => 1367,
1543 );
1544
1545 function updateStickerForCell ($cell, $attr_id, $new_value)
1546 {
1547 if
1548 (
1549 isset ($cell['attrs'][$attr_id])
1550 and !strlen ($cell['attrs'][$attr_id]['value'])
1551 and strlen ($new_value)
1552 )
1553 commitUpdateAttrValue ($cell['id'], $attr_id, $new_value);
1554 }
1555
1556 // Accept "X-Y" on input and make sure, that PortInterfaceCompat contains
1557 // a record with IIF id = X and OIF id = Y.
1558 function checkPIC ($port_type_id)
1559 {
1560 // cache PortInterfaceCompat
1561 static $compat_array = NULL;
1562 if (! isset ($compat_array))
1563 {
1564 $compat_array = array();
1565 foreach (getPortInterfaceCompat() as $record)
1566 {
1567 $key = $record['iif_id'] . '-' . $record['oif_id'];
1568 $compat_array[$key] = 1;
1569 }
1570 }
1571
1572 if (preg_match ('/^(\d+-)?(\d+)$/', $port_type_id, $m))
1573 {
1574 $iif_id = $m[1];
1575 $oif_id = $m[2];
1576 if (empty ($iif_id[1]))
1577 {
1578 $iif_id = 1;
1579 $port_type_id = $iif_id . '-' . $port_type_id;
1580 }
1581 if (! array_key_exists ($port_type_id, $compat_array))
1582 {
1583 commitSupplementPIC ($iif_id, $oif_id);
1584 $compat_array[$port_type_id] = 1;
1585 }
1586 }
1587 }
1588
1589 $msgcode['doSNMPmining']['ERR1'] = 161;
1590 $msgcode['doSNMPmining']['ERR2'] = 162;
1591 function doSNMPmining ($object_id, $snmpsetup)
1592 {
1593 $objectInfo = spotEntity ('object', $object_id);
1594 $objectInfo['attrs'] = getAttrValues ($object_id);
1595 $endpoints = findAllEndpoints ($object_id, $objectInfo['name']);
1596 if (count ($endpoints) == 0)
1597 return showFuncMessage (__FUNCTION__, 'ERR1'); // endpoint not found
1598 if (count ($endpoints) > 1)
1599 return showFuncMessage (__FUNCTION__, 'ERR2'); // can't pick an address
1600
1601 switch ($objectInfo['objtype_id'])
1602 {
1603 case 7:
1604 case 8:
1605 $device = new RTSNMPDevice ($endpoints[0], $snmpsetup);
1606 return doSwitchSNMPmining ($objectInfo, $device);
1607 case 2:
1608 $device = new APCPowerSwitch ($endpoints[0], $snmpsetup);
1609 return doPDUSNMPmining ($objectInfo, $device);
1610 }
1611 }
1612
1613 $msgcode['doSwitchSNMPmining']['ERR3'] = 188;
1614 $msgcode['doSwitchSNMPmining']['ERR4'] = 189;
1615 function doSwitchSNMPmining ($objectInfo, $device)
1616 {
1617 global $known_switches, $iftable_processors;
1618
1619 if (FALSE === ($sysObjectID = $device->snmpget ('sysObjectID.0')))
1620 return showFuncMessage (__FUNCTION__, 'ERR3'); // // fatal SNMP failure
1621 $sysObjectID = preg_replace ('/^.*(enterprises\.)([\.[:digit:]]+)$/', '\\2', $sysObjectID);
1622 $sysName = substr ($device->snmpget ('sysName.0'), strlen ('STRING: '));
1623 $sysDescr = substr ($device->snmpget ('sysDescr.0'), strlen ('STRING: '));
1624 $sysDescr = str_replace (array ("\n", "\r"), " ", $sysDescr); // Make it one line
1625 if (!isset ($known_switches[$sysObjectID]))
1626 return showFuncMessage (__FUNCTION__, 'ERR4', array ($sysObjectID)); // unknown OID
1627 showSuccess ($known_switches[$sysObjectID]['text']);
1628 foreach (array_keys ($known_switches[$sysObjectID]['processors']) as $pkey)
1629 if (!array_key_exists ($known_switches[$sysObjectID]['processors'][$pkey], $iftable_processors))
1630 {
1631 showWarning ('processor "' . $known_switches[$sysObjectID]['processors'][$pkey] . '" not found');
1632 unset ($known_switches[$sysObjectID]['processors'][$pkey]);
1633 }
1634 updateStickerForCell ($objectInfo, 2, $known_switches[$sysObjectID]['dict_key']);
1635 updateStickerForCell ($objectInfo, 3, $sysName);
1636 switch (1)
1637 {
1638 case preg_match ('/^9\.1\./', $sysObjectID): // Catalyst
1639 $exact_release = preg_replace ('/^.*, Version ([^ ]+), .*$/', '\\1', $sysDescr);
1640 $major_line = preg_replace ('/^([[:digit:]]+\.[[:digit:]]+)[^[:digit:]].*/', '\\1', $exact_release);
1641 $ios_codes = array
1642 (
1643 '12.0' => 244,
1644 '12.1' => 251,
1645 '12.2' => 252,
1646 );
1647 updateStickerForCell ($objectInfo, 5, $exact_release);
1648 if (array_key_exists ($major_line, $ios_codes))
1649 updateStickerForCell ($objectInfo, 4, $ios_codes[$major_line]);
1650 $sysChassi = $device->snmpget ('1.3.6.1.4.1.9.3.6.3.0');
1651 if ($sysChassi !== FALSE or $sysChassi !== NULL)
1652 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
1653 checkPIC ('1-29');
1654 commitAddPort ($objectInfo['id'], 'con0', '1-29', 'console', ''); // RJ-45 RS-232 console
1655 // blade devices are powered through internal circuitry of chassis
1656 if ($sysObjectID != '9.1.749' and $sysObjectID != '9.1.920')
1657 {
1658 checkPIC ('1-16'); // AC input
1659 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
1660 }
1661 break;
1662 case preg_match ('/^9\.12\.3\.1\.3\./', $sysObjectID): // Nexus
1663 $exact_release = preg_replace ('/^.*, Version ([^ ]+), .*$/', '\\1', $sysDescr);
1664 $major_line = preg_replace ('/^([[:digit:]]+\.[[:digit:]]+)[^[:digit:]].*/', '\\1', $exact_release);
1665 $nxos_codes = array
1666 (
1667 '4.0' => 963,
1668 '4.1' => 964,
1669 );
1670 if (array_key_exists ($major_line, $nxos_codes))
1671 updateStickerForCell ($objectInfo, 4, $nxos_codes[$major_line]);
1672 updateStickerForCell ($objectInfo, 5, $exact_release);
1673 $sysChassi = $device->snmpget ('1.3.6.1.2.1.47.1.1.1.1.11.149');
1674 if ($sysChassi !== FALSE or $sysChassi !== NULL)
1675 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
1676 checkPIC ('1-29');
1677 commitAddPort ($objectInfo['id'], 'con0', '1-29', 'console', ''); // RJ-45 RS-232 console
1678 checkPIC ('1-16'); // AC input
1679 commitAddPort ($objectInfo['id'], 'AC-in-1', '1-16', 'AC1', '');
1680 commitAddPort ($objectInfo['id'], 'AC-in-2', '1-16', 'AC2', '');
1681 break;
1682 case preg_match ('/^11\.2\.3\.7\.11\.(\d+)$/', $sysObjectID, $matches): // ProCurve
1683 $console_per_product = array
1684 (
1685 79 => '1-29', # RJ-45 RS-232
1686 86 => '1-29',
1687 87 => '1-29',
1688 63 => '1-29',
1689 19 => '1-681', # DB-9 RS-232
1690 );
1691 if (array_key_exists ($matches[1], $console_per_product))
1692 {
1693 checkPIC ($console_per_product[$matches[1]]);
1694 commitAddPort ($objectInfo['id'], '', $console_per_product[$matches[1]], 'Console', '');
1695 }
1696 $exact_release = preg_replace ('/^.* revision ([^ ]+), .*$/', '\\1', $sysDescr);
1697 updateStickerForCell ($objectInfo, 5, $exact_release);
1698 break;
1699 case preg_match ('/^4526\.100\./', $sysObjectID): // NETGEAR
1700 checkPIC ('1-681');
1701 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
1702 break;
1703 case preg_match ('/^2011\.2\.23\./', $sysObjectID): // Huawei
1704 detectSoftwareType ($objectInfo, $sysDescr);
1705 checkPIC ('1-681');
1706 commitAddPort ($objectInfo['id'], 'con0', '1-681', 'console', ''); // DB-9 RS-232 console
1707 break;
1708 case '2636.1.1.1.2.31' == $sysObjectID: // Juniper EX4200
1709 detectSoftwareType ($objectInfo, $sysDescr);
1710 checkPIC ('1-29');
1711 commitAddPort ($objectInfo['id'], 'con', '1-29', 'CON', ''); // RJ-45 RS-232 console
1712 // EX4200-24T is already in DB
1713 if (preg_match ('/^Juniper Networks, Inc. ex4200-48t internet router/', $sysDescr))
1714 updateStickerForCell ($objectInfo, 2, 907);
1715 break;
1716 case preg_match ('/^2636\.1\.1\.1\.2\./', $sysObjectID): // Juniper
1717 detectSoftwareType ($objectInfo, $sysDescr);
1718 checkPIC ('1-681');
1719 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
1720 break;
1721 case preg_match ('/^1991\.1\.3\.45\./', $sysObjectID): // snFGSFamily
1722 case preg_match ('/^1991\.1\.3\.46\./', $sysObjectID): // snFLSFamily
1723 case preg_match ('/^1991\.1\.3\.54\.2\.4\.1\.1$/', $sysObjectID): // FCX 648
1724 detectSoftwareType ($objectInfo, $sysDescr);
1725 $exact_release = preg_replace ('/^.*, IronWare Version ([^ ]+) .*$/', '\\1', $sysDescr);
1726 updateStickerForCell ($objectInfo, 5, $exact_release);
1727 # FOUNDRY-SN-AGENT-MIB::snChasSerNum.0
1728 $sysChassi = $device->snmpget ('enterprises.1991.1.1.1.1.2.0');
1729 if ($sysChassi !== FALSE or $sysChassi !== NULL)
1730 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($sysChassi, strlen ('STRING: '))));
1731
1732 # Type of uplink module installed.
1733 # table: FOUNDRY-SN-AGENT-MIB::snAgentBrdMainBrdDescription
1734 # Possible part numbers are:
1735 # FGS-1XG1XGC (one fixed CX4 port)
1736 # FGS-2XGC (two fixed CX4 ports)
1737 # FGS-2XG (two XFP slots)
1738 # And for FLS result (which is not handled here) would be:
1739 # 1991.1.1.2.2.1.1.2.1 = STRING: "FLS-24G 24-port Management Module"
1740 # 1991.1.1.2.2.1.1.2.3 = STRING: "FLS-1XG 1-port 10G Module (1-XFP)"
1741 # 1991.1.1.2.2.1.1.2.4 = STRING: "FLS-1XG 1-port 10G Module (1-XFP)"
1742 # (assuming, that the device has 2 XFP modules in slots 3 and 4).
1743
1744 foreach ($device->snmpwalkoid ('enterprises.1991.1.1.2.2.1.1.2') as $module_raw)
1745 if (preg_match ('/^STRING: "(FGS-1XG1XGC|FGS-2XGC) /i', $module_raw))
1746 {
1747 $iftable_processors['fgs-uplinks']['dict_key'] = '1-40'; // CX4
1748 break;
1749 }
1750
1751 # AC inputs
1752 # table: FOUNDRY-SN-AGENT-MIB::snChasPwrSupplyDescription
1753 # "Power supply 1 "
1754 # "Power supply 2 "
1755 foreach ($device->snmpwalkoid ('enterprises.1991.1.1.1.2.1.1.2') as $PSU_raw)
1756 {
1757 $count = 0;
1758 $PSU_cooked = trim (preg_replace ('/^string: "(.+)"$/i', '\\1', $PSU_raw, 1, $count));
1759 if ($count)
1760 {
1761 checkPIC ('1-16');
1762 commitAddPort ($objectInfo['id'], $PSU_cooked, '1-16', '', '');
1763 }
1764 }
1765 # fixed console port
1766 checkPIC ('1-681');
1767 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232 console
1768 break;
1769 case preg_match ('/^1916\.2\./', $sysObjectID): // Extreme Networks Summit
1770 $xos_release = preg_replace ('/^ExtremeXOS version ([[:digit:]]+)\..*$/', '\\1', $sysDescr);
1771 $xos_codes = array
1772 (
1773 '10' => 1350,
1774 '11' => 1351,
1775 '12' => 1352,
1776 );
1777 if (array_key_exists ($xos_release, $xos_codes))
1778 updateStickerForCell ($objectInfo, 4, $xos_codes[$xos_release]);
1779 checkPIC ('1-681');
1780 commitAddPort ($objectInfo['id'], 'console', '1-681', 'console', ''); // DB-9 RS-232
1781 checkPIC ('1-16');
1782 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
1783 break;
1784 case preg_match ('/^6027\.1\./', $sysObjectID): # Force10
1785 commitAddPort ($objectInfo['id'], 'aux0', '1-29', 'RS-232', ''); // RJ-45 RS-232 console
1786 $m = array();
1787 if (preg_match ('/Force10 Application Software Version: ([\d\.]+)/', $sysDescr, $m))
1788 {
1789 updateStickerForCell ($objectInfo, 5, $m[1]);
1790 $ftos_release = preg_replace ('/^([678])\..+$/', '\\1', $m[1]);
1791 $ftos_codes = array
1792 (
1793 '6' => 1592,
1794 '7' => 1593,
1795 '8' => 1594,
1796 );
1797 if (array_key_exists ($ftos_release, $ftos_codes))
1798 updateStickerForCell ($objectInfo, 4, $ftos_codes[$ftos_release]);
1799 }
1800 # F10-S-SERIES-CHASSIS-MIB::chStackUnitSerialNumber.1
1801 $serialNo = $device->snmpget ('enterprises.6027.3.10.1.2.2.1.12.1');
1802 # F10-S-SERIES-CHASSIS-MIB::chSysPowerSupplyType.1.1
1803 if ($device->snmpget ('enterprises.6027.3.10.1.2.3.1.3.1.1') == 'INTEGER: 1')
1804 {
1805 checkPIC ('1-16');
1806 commitAddPort ($objectInfo['id'], 'PSU0', '1-16', 'PSU0', '');
1807 }
1808 # F10-S-SERIES-CHASSIS-MIB::chSysPowerSupplyType.1.2
1809 if ($device->snmpget ('enterprises.6027.3.10.1.2.3.1.3.1.2') == 'INTEGER: 1')
1810 {
1811 checkPIC ('1-16');
1812 commitAddPort ($objectInfo['id'], 'PSU1', '1-16', 'PSU1', '');
1813 }
1814 if (strlen ($serialNo))
1815 updateStickerForCell ($objectInfo, 1, str_replace ('"', '', substr ($serialNo, strlen ('STRING: '))));
1816 break;
1817 case preg_match ('/^202\.20\./', $sysObjectID): // SMC TigerSwitch
1818 checkPIC ('1-681');
1819 commitAddPort ($objectInfo['id'], 'console', '1-681', '', ''); // DB-9 RS-232
1820 checkPIC ('1-16');
1821 commitAddPort ($objectInfo['id'], 'AC-in', '1-16', '', '');
1822 break;
1823 default: // Nortel...
1824 break;
1825 }
1826 $ifInfo = array();
1827 $tablename = 'ifDescr';
1828 foreach ($device->snmpwalkoid ($tablename) as $oid => $value)
1829 {
1830 $randomindex = preg_replace ("/^.*${tablename}\.(.+)\$/", '\\1', $oid);
1831 $value = trim (preg_replace ('/^[^:]+: (.+)$/', '\\1', $value), '"');
1832 $ifInfo[$randomindex][$tablename] = $value;
1833 }
1834 $tablename = 'ifPhysAddress';
1835 foreach ($device->snmpwalkoid ($tablename) as $oid => $value)
1836 {
1837 $randomindex = preg_replace ("/^.*${tablename}\.(.+)\$/", '\\1', $oid);
1838 $value = trim ($value);
1839 // NET-SNMP may return MAC addresses in one of two (?) formats depending on
1840 // DISPLAY-HINT internal database. The best we can do about it is to accept both.
1841 // Bug originally reported by Walery Wysotsky against openSUSE 11.0.
1842 if (preg_match ('/^string: [0-9a-f]{1,2}(:[0-9a-f]{1,2}){5}/i', $value)) // STRING: x:yy:z:xx:y:zz
1843 {
1844 list ($dummy, $value) = explode (' ', $value);
1845 $addrbytes = explode (':', $value);
1846 foreach ($addrbytes as $bidx => $bytestr)
1847 if (strlen ($bytestr) == 1)
1848 $addrbytes[$bidx] = '0' . $bytestr;
1849 }
1850 elseif (preg_match ('/^hex-string:( [0-9a-f]{2}){6}/i', $value)) // Hex-STRING: xx yy zz xx yy zz
1851 $addrbytes = explode (' ', substr ($value, -17));
1852 elseif (preg_match ('/22[0-9a-f]{12}22$/', bin2hex ($value))) // STRING: "??????"
1853 $addrbytes = array (substr (bin2hex ($value), -14, 12));
1854 else
1855 continue; // martian format
1856 $ifInfo[$randomindex][$tablename] = implode ('', $addrbytes);
1857 }
1858 // process each interface only once regardless of how many processors we have to run
1859 foreach ($ifInfo as $iface)
1860 foreach ($known_switches[$sysObjectID]['processors'] as $processor_name)
1861 {
1862 $newname = preg_replace ($iftable_processors[$processor_name]['pattern'], $iftable_processors[$processor_name]['replacement'], $iface['ifDescr'], 1, $count);
1863 if ($newname === NULL)
1864 {
1865 showError ('PCRE pattern error, terminating');
1866 break 2;
1867 }
1868 if (!$count)
1869 continue; // try next processor on current port
1870 $newlabel = preg_replace ($iftable_processors[$processor_name]['pattern'], $iftable_processors[$processor_name]['label'], $iface['ifDescr'], 1, $count);
1871 checkPIC ($iftable_processors[$processor_name]['dict_key']);
1872 commitAddPort ($objectInfo['id'], $newname, $iftable_processors[$processor_name]['dict_key'], $newlabel, $iface['ifPhysAddress']);
1873 if (!$iftable_processors[$processor_name]['try_next_proc']) // done with this port
1874 continue 2;
1875 }
1876 // No failure up to this point, thus leave current tab for the "Ports" one.
1877 return buildRedirectURL (NULL, 'ports');
1878 }
1879
1880 function doPDUSNMPmining ($objectInfo, $switch)
1881 {
1882 global $known_APC_SKUs;
1883 if (FALSE !== ($dict_key = array_search ($switch->getHWModel(), $known_APC_SKUs)))
1884 updateStickerForCell ($objectInfo, 2, $dict_key);
1885 updateStickerForCell ($objectInfo, 1, $switch->getHWSerial());
1886 updateStickerForCell ($objectInfo, 3, $switch->getName());
1887 updateStickerForCell ($objectInfo, 5, $switch->getFWRev());
1888 checkPIC ('1-16');
1889 commitAddPort ($objectInfo['id'], 'input', '1-16', 'input', '');
1890 $portno = 1;
1891 foreach ($switch->getPorts() as $name => $port)
1892 {
1893 $label = mb_strlen ($port[0]) ? $port[0] : $portno;
1894 checkPIC ('1-1322');
1895 commitAddPort ($objectInfo['id'], $portno, '1-1322', $port[0], '');
1896 $portno++;
1897 }
1898 showSuccess ("Added ${portno} port(s)");
1899 return buildRedirectURL (NULL, 'ports');
1900 }
1901
1902 // APC SNMP code by Russ Garrett
1903 define('APC_STATUS_ON', 1);
1904 define('APC_STATUS_OFF', 2);
1905 define('APC_STATUS_REBOOT', 3);
1906
1907 class RTSNMPDevice {
1908 protected $snmp;
1909
1910 function __construct($hostname, $snmpsetup) {
1911 switch($snmpsetup['version']) {
1912 case 1:
1913 default:
1914 $this->snmp = new RTSNMPv1($hostname, $snmpsetup);
1915 break;
1916 case 2:
1917 $this->snmp = new RTSNMPv2($hostname, $snmpsetup);
1918 break;
1919 case 3:
1920 $this->snmp = new RTSNMPv3($hostname, $snmpsetup);
1921 break;
1922 }
1923 }
1924
1925 function getName() {
1926 return $this->getString('sysName.0');
1927 }
1928
1929 function getDescription() {
1930 return $this->getString('sysDescr.0');
1931 }
1932
1933 function snmpget($oid) {
1934 return $this->snmp->snmpget($oid);
1935 }
1936
1937 function snmpwalkoid($oid) {
1938 return $this->snmp->snmpwalkoid($oid);
1939 }
1940
1941 protected function snmpSet($oid, $type, $value) {
1942 return $this->snmp->snmpset($oid, $type, $value);
1943 }
1944
1945 protected function getString($oid) {
1946 return trim(str_replace('STRING: ', '', $this->snmp->snmpget($oid)), '"');
1947 }
1948 }
1949
1950 abstract class RTSNMP {
1951 protected $hostname;
1952 protected $snmpsetup;
1953
1954 function __construct($hostname, $snmpsetup) {
1955 $this->hostname = $hostname;
1956 $this->snmpsetup = $snmpsetup;
1957 }
1958
1959 abstract function snmpget($oid);
1960 abstract function snmpset($oid, $type, $value);
1961 abstract function snmpwalkoid($oid);
1962 }
1963
1964 class RTSNMPv1 extends RTSNMP {
1965 function snmpget($oid) {
1966 return snmpget($this->hostname, $this->snmpsetup['community'], $oid);
1967 }
1968
1969 function snmpset($oid, $type, $value) {
1970 return snmpset($this->hostname, $this->snmpsetup['community'], $oid, $type, $value);
1971 }
1972
1973 function snmpwalkoid($oid) {
1974 return snmpwalkoid($this->hostname, $this->snmpsetup['community'], $oid);
1975 }
1976 }
1977
1978 class RTSNMPv2 extends RTSNMP {
1979 function snmpget($oid) {
1980 return snmp2_get($this->hostname, $this->snmpsetup['community'], $oid);
1981 }
1982
1983 function snmpset($oid, $type, $value) {
1984 return snmp2_set($this->hostname, $this->snmpsetup['community'], $oid, $type, $value);
1985 }
1986
1987 function snmpwalkoid($oid) {
1988 return snmp2_real_walk($this->hostname, $this->snmpsetup['community'], $oid);
1989 }
1990 }
1991
1992 class RTSNMPv3 extends RTSNMP {
1993 function snmpget($oid) {
1994 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);
1995 }
1996
1997 function snmpset($oid, $type, $value) {
1998 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);
1999 }
2000
2001 function snmpwalkoid($oid) {
2002 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);
2003 }
2004 }
2005
2006 class APCPowerSwitch extends RTSNMPDevice {
2007 protected $snmpMib = 'SNMPv2-SMI::enterprises.318';
2008
2009 function getPorts() {
2010 $data = $this->snmpwalk("{$this->snmpMib}.1.1.12.3.3.1.1.2");
2011 $status = $this->snmpwalk("{$this->snmpMib}.1.1.12.3.3.1.1.4");
2012 $out = array();
2013 foreach ($data as $id => $d) {
2014 $out[$id + 1] = array(trim(str_replace('STRING: ', '', $d), '"'), str_replace('INTEGER: ', '', $status[$id]));
2015 }
2016 return $out;
2017 }
2018
2019 function getPortStatus($id) {
2020 return trim($this->snmpget("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id"), 'INTEGER: ');
2021 }
2022
2023 function getPortName($id) {
2024 return trim(str_replace('STRING: ', '', $this->snmpget("{$this->snmpMib}.1.1.12.3.3.1.1.2.$id")), '"');
2025 }
2026
2027 function setPortName($id, $name) {
2028 return $this->snmpset("{$this->snmpMib}.1.1.4.5.2.1.3.$id", 's', $name);
2029 }
2030
2031 function portOff($id) {
2032 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_OFF);
2033 }
2034
2035 function portOn($id) {
2036 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_ON);
2037 }
2038
2039 function portReboot($id) {
2040 return $this->snmpSet("{$this->snmpMib}.1.1.12.3.3.1.1.4.$id", 'i', APC_STATUS_REBOOT);
2041 }
2042 // rPDUIdentFirmwareRev.0 == .1.3.6.1.4.1.318.1.1.12.1.3.0 = STRING: "vN.N.N"
2043 function getFWRev()
2044 {
2045 return preg_replace ('/^STRING: "(.+)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.3.0"));
2046 }
2047 // rPDUIdentSerialNumber.0 == .1.3.6.1.4.1.318.1.1.12.1.6.0 = STRING: "XXXXXXXXXXX"
2048 function getHWSerial()
2049 {
2050 return preg_replace ('/^STRING: "(.+)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.6.0"));
2051 }
2052 // rPDUIdentModelNumber.0 == .1.3.6.1.4.1.318.1.1.12.1.5.0 = STRING: "APnnnn"
2053 function getHWModel()
2054 {
2055 return preg_replace ('/^STRING: "(.*)"$/', '\\1', $this->snmpget ("{$this->snmpMib}.1.1.12.1.5.0"));
2056 }
2057 }
2058
2059 // Take address in the form XX:XX:XX:XX:XX:XX and return the next
2060 // address in the same form.
2061 function nextMACAddress ($addr)
2062 {
2063 if ($addr == '')
2064 return '';
2065 $bytes = array();
2066 foreach (explode (':', $addr) as $hex)
2067 $bytes[] = hexdec ($hex);
2068 for ($i = 5; $i >= 0; $i--)
2069 {
2070 $bytes[$i] += 1;
2071 if ($bytes[$i] <= 255) // FF
2072 break; // no roll over
2073 $bytes[$i] = 0;
2074 }
2075 foreach (array_keys ($bytes) as $key)
2076 $bytes[$key] = sprintf ('%02X', $bytes[$key]);
2077 return implode (':', $bytes);
2078 }
2079
2080 function generatePortsForCatModule ($object_id, $slotno = 1, $mtype = 'X6748', $mac_address = '')
2081 {
2082 global $dbxlink;
2083 $mac_address = l2addressFromDatabase (l2addressForDatabase ($mac_address));
2084 switch ($mtype)
2085 {
2086 case 'WS-X6748-GE-TX':
2087 $dbxlink->beginTransaction();
2088 for ($i = 1; $i <= 48; $i++)
2089 {
2090 commitAddPort ($object_id, "gi${slotno}/${i}", '1-24', "slot ${slotno} port ${i}", $mac_address);
2091 $mac_address = nextMACAddress ($mac_address);
2092 }
2093 $dbxlink->commit();
2094 break;
2095 case 'WS-X6708-10GE':
2096 for ($i = 1; $i <= 8; $i++)
2097 {
2098 commitAddPort ($object_id, "te${slotno}/${i}", '6-1080', "slot ${slotno} port ${i}", $mac_address);
2099 $mac_address = nextMACAddress ($mac_address);
2100 }
2101 break;
2102 case 'WS-X6704-10GE':
2103 for ($i = 1; $i <= 4; $i++)
2104 {
2105 commitAddPort ($object_id, "te${slotno}/${i}", '5-1079', "slot ${slotno} port ${i}", $mac_address);
2106 $mac_address = nextMACAddress ($mac_address);
2107 }
2108 break;
2109 case 'VS-S720-10G':
2110 commitAddPort ($object_id, "gi${slotno}/1", '4-1077', "slot ${slotno} port 1", $mac_address);
2111 $mac_address = nextMACAddress ($mac_address);
2112 commitAddPort ($object_id, "gi${slotno}/2", '4-1077', "slot ${slotno} port 2", $mac_address);
2113 $mac_address = nextMACAddress ($mac_address);
2114 commitAddPort ($object_id, "gi${slotno}/3", '1-24', "slot ${slotno} port 3", $mac_address);
2115 $mac_address = nextMACAddress ($mac_address);
2116 commitAddPort ($object_id, "te${slotno}/4", '6-1080', "slot ${slotno} port 4", $mac_address);
2117 $mac_address = nextMACAddress ($mac_address);
2118 commitAddPort ($object_id, "te${slotno}/5", '6-1080', "slot ${slotno} port 5", $mac_address);
2119 break;
2120 case '3750G-24TS':
2121 // MAC address of 1st port is the next one after switch's address
2122 $mac_address = nextMACAddress ($mac_address);
2123 for ($i = 1; $i <= 24; $i++)
2124 {
2125 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
2126 $mac_address = nextMACAddress ($mac_address);
2127 }
2128 for ($i = 25; $i <= 28; $i++)
2129 {
2130 commitAddPort ($object_id, "gi${slotno}/0/${i}", '4-1077', "unit ${slotno} port ${i}", $mac_address);
2131 $mac_address = nextMACAddress ($mac_address);
2132 }
2133 break;
2134 case '3750G-24T':
2135 $mac_address = nextMACAddress ($mac_address);
2136 for ($i = 1; $i <= 24; $i++)
2137 {
2138 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
2139 $mac_address = nextMACAddress ($mac_address);
2140 }
2141 break;
2142 case '3750G-16TD':
2143 $mac_address = nextMACAddress ($mac_address);
2144 for ($i = 1; $i <= 16; $i++)
2145 {
2146 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "unit ${slotno} port ${i}", $mac_address);
2147 $mac_address = nextMACAddress ($mac_address);
2148 }
2149 commitAddPort ($object_id, "te${slotno}/0/1", '5-1079', "unit ${slotno} port ${i}", $mac_address);
2150 break;
2151 case 'LE02G48TA':
2152 for ($i = 0; $i <= 47; $i++)
2153 commitAddPort ($object_id, "gi${slotno}/0/${i}", '1-24', "slot ${slotno} port ${i}", $mac_address);
2154 break;
2155 case 'LE02X12SA':
2156 for ($i = 0; $i <= 11; $i++)
2157 commitAddPort ($object_id, "gi${slotno}/0/${i}", '9-1084', "slot ${slotno} port ${i}", $mac_address);
2158 break;
2159 }
2160 }
2161
2162 function detectSoftwareType ($objectInfo, $sysDescr)
2163 {
2164 global $swtype_pcre;
2165 foreach ($swtype_pcre as $pattern => $dict_key)
2166 if (preg_match ($pattern, $sysDescr))
2167 {
2168 updateStickerForCell ($objectInfo, 4, $dict_key);
2169 return;
2170 }
2171 }
2172 ?>