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