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