Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame^] | 1 | // Copyright 2012 Google, Inc. All rights reserved. |
| 2 | // |
| 3 | // Use of this source code is governed by a BSD-style license |
| 4 | // that can be found in the LICENSE file in the root of the source |
| 5 | // tree. |
| 6 | |
| 7 | // Enum types courtesy of... |
| 8 | // http://anonsvn.wireshark.org/wireshark/trunk/epan/dissectors/packet-ndp.c |
| 9 | |
| 10 | package layers |
| 11 | |
| 12 | import ( |
| 13 | "fmt" |
| 14 | "github.com/google/gopacket" |
| 15 | "net" |
| 16 | ) |
| 17 | |
| 18 | type NDPChassisType uint8 |
| 19 | |
| 20 | // Nortel Chassis Types |
| 21 | const ( |
| 22 | NDPChassisother NDPChassisType = 1 |
| 23 | NDPChassis3000 NDPChassisType = 2 |
| 24 | NDPChassis3030 NDPChassisType = 3 |
| 25 | NDPChassis2310 NDPChassisType = 4 |
| 26 | NDPChassis2810 NDPChassisType = 5 |
| 27 | NDPChassis2912 NDPChassisType = 6 |
| 28 | NDPChassis2914 NDPChassisType = 7 |
| 29 | NDPChassis271x NDPChassisType = 8 |
| 30 | NDPChassis2813 NDPChassisType = 9 |
| 31 | NDPChassis2814 NDPChassisType = 10 |
| 32 | NDPChassis2915 NDPChassisType = 11 |
| 33 | NDPChassis5000 NDPChassisType = 12 |
| 34 | NDPChassis2813SA NDPChassisType = 13 |
| 35 | NDPChassis2814SA NDPChassisType = 14 |
| 36 | NDPChassis810M NDPChassisType = 15 |
| 37 | NDPChassisEthercell NDPChassisType = 16 |
| 38 | NDPChassis5005 NDPChassisType = 17 |
| 39 | NDPChassisAlcatelEWC NDPChassisType = 18 |
| 40 | NDPChassis2715SA NDPChassisType = 20 |
| 41 | NDPChassis2486 NDPChassisType = 21 |
| 42 | NDPChassis28000series NDPChassisType = 22 |
| 43 | NDPChassis23000series NDPChassisType = 23 |
| 44 | NDPChassis5DN00xseries NDPChassisType = 24 |
| 45 | NDPChassisBayStackEthernet NDPChassisType = 25 |
| 46 | NDPChassis23100series NDPChassisType = 26 |
| 47 | NDPChassis100BaseTHub NDPChassisType = 27 |
| 48 | NDPChassis3000FastEthernet NDPChassisType = 28 |
| 49 | NDPChassisOrionSwitch NDPChassisType = 29 |
| 50 | NDPChassisDDS NDPChassisType = 31 |
| 51 | NDPChassisCentillion6slot NDPChassisType = 32 |
| 52 | NDPChassisCentillion12slot NDPChassisType = 33 |
| 53 | NDPChassisCentillion1slot NDPChassisType = 34 |
| 54 | NDPChassisBayStack301 NDPChassisType = 35 |
| 55 | NDPChassisBayStackTokenRingHub NDPChassisType = 36 |
| 56 | NDPChassisFVCMultimediaSwitch NDPChassisType = 37 |
| 57 | NDPChassisSwitchNode NDPChassisType = 38 |
| 58 | NDPChassisBayStack302Switch NDPChassisType = 39 |
| 59 | NDPChassisBayStack350Switch NDPChassisType = 40 |
| 60 | NDPChassisBayStack150EthernetHub NDPChassisType = 41 |
| 61 | NDPChassisCentillion50NSwitch NDPChassisType = 42 |
| 62 | NDPChassisCentillion50TSwitch NDPChassisType = 43 |
| 63 | NDPChassisBayStack303304Switches NDPChassisType = 44 |
| 64 | NDPChassisBayStack200EthernetHub NDPChassisType = 45 |
| 65 | NDPChassisBayStack25010100EthernetHub NDPChassisType = 46 |
| 66 | NDPChassisBayStack450101001000Switches NDPChassisType = 48 |
| 67 | NDPChassisBayStack41010100Switches NDPChassisType = 49 |
| 68 | NDPChassisPassport1200L3Switch NDPChassisType = 50 |
| 69 | NDPChassisPassport1250L3Switch NDPChassisType = 51 |
| 70 | NDPChassisPassport1100L3Switch NDPChassisType = 52 |
| 71 | NDPChassisPassport1150L3Switch NDPChassisType = 53 |
| 72 | NDPChassisPassport1050L3Switch NDPChassisType = 54 |
| 73 | NDPChassisPassport1051L3Switch NDPChassisType = 55 |
| 74 | NDPChassisPassport8610L3Switch NDPChassisType = 56 |
| 75 | NDPChassisPassport8606L3Switch NDPChassisType = 57 |
| 76 | NDPChassisPassport8010 NDPChassisType = 58 |
| 77 | NDPChassisPassport8006 NDPChassisType = 59 |
| 78 | NDPChassisBayStack670wirelessaccesspoint NDPChassisType = 60 |
| 79 | NDPChassisPassport740 NDPChassisType = 61 |
| 80 | NDPChassisPassport750 NDPChassisType = 62 |
| 81 | NDPChassisPassport790 NDPChassisType = 63 |
| 82 | NDPChassisBusinessPolicySwitch200010100Switches NDPChassisType = 64 |
| 83 | NDPChassisPassport8110L2Switch NDPChassisType = 65 |
| 84 | NDPChassisPassport8106L2Switch NDPChassisType = 66 |
| 85 | NDPChassisBayStack3580GigSwitch NDPChassisType = 67 |
| 86 | NDPChassisBayStack10PowerSupplyUnit NDPChassisType = 68 |
| 87 | NDPChassisBayStack42010100Switch NDPChassisType = 69 |
| 88 | NDPChassisOPTeraMetro1200EthernetServiceModule NDPChassisType = 70 |
| 89 | NDPChassisOPTera8010co NDPChassisType = 71 |
| 90 | NDPChassisOPTera8610coL3Switch NDPChassisType = 72 |
| 91 | NDPChassisOPTera8110coL2Switch NDPChassisType = 73 |
| 92 | NDPChassisOPTera8003 NDPChassisType = 74 |
| 93 | NDPChassisOPTera8603L3Switch NDPChassisType = 75 |
| 94 | NDPChassisOPTera8103L2Switch NDPChassisType = 76 |
| 95 | NDPChassisBayStack380101001000Switch NDPChassisType = 77 |
| 96 | NDPChassisEthernetSwitch47048T NDPChassisType = 78 |
| 97 | NDPChassisOPTeraMetro1450EthernetServiceModule NDPChassisType = 79 |
| 98 | NDPChassisOPTeraMetro1400EthernetServiceModule NDPChassisType = 80 |
| 99 | NDPChassisAlteonSwitchFamily NDPChassisType = 81 |
| 100 | NDPChassisEthernetSwitch46024TPWR NDPChassisType = 82 |
| 101 | NDPChassisOPTeraMetro8010OPML2Switch NDPChassisType = 83 |
| 102 | NDPChassisOPTeraMetro8010coOPML2Switch NDPChassisType = 84 |
| 103 | NDPChassisOPTeraMetro8006OPML2Switch NDPChassisType = 85 |
| 104 | NDPChassisOPTeraMetro8003OPML2Switch NDPChassisType = 86 |
| 105 | NDPChassisAlteon180e NDPChassisType = 87 |
| 106 | NDPChassisAlteonAD3 NDPChassisType = 88 |
| 107 | NDPChassisAlteon184 NDPChassisType = 89 |
| 108 | NDPChassisAlteonAD4 NDPChassisType = 90 |
| 109 | NDPChassisPassport1424L3Switch NDPChassisType = 91 |
| 110 | NDPChassisPassport1648L3Switch NDPChassisType = 92 |
| 111 | NDPChassisPassport1612L3Switch NDPChassisType = 93 |
| 112 | NDPChassisPassport1624L3Switch NDPChassisType = 94 |
| 113 | NDPChassisBayStack38024FFiber1000Switch NDPChassisType = 95 |
| 114 | NDPChassisEthernetRoutingSwitch551024T NDPChassisType = 96 |
| 115 | NDPChassisEthernetRoutingSwitch551048T NDPChassisType = 97 |
| 116 | NDPChassisEthernetSwitch47024T NDPChassisType = 98 |
| 117 | NDPChassisNortelNetworksWirelessLANAccessPoint2220 NDPChassisType = 99 |
| 118 | NDPChassisPassportRBS2402L3Switch NDPChassisType = 100 |
| 119 | NDPChassisAlteonApplicationSwitch2424 NDPChassisType = 101 |
| 120 | NDPChassisAlteonApplicationSwitch2224 NDPChassisType = 102 |
| 121 | NDPChassisAlteonApplicationSwitch2208 NDPChassisType = 103 |
| 122 | NDPChassisAlteonApplicationSwitch2216 NDPChassisType = 104 |
| 123 | NDPChassisAlteonApplicationSwitch3408 NDPChassisType = 105 |
| 124 | NDPChassisAlteonApplicationSwitch3416 NDPChassisType = 106 |
| 125 | NDPChassisNortelNetworksWirelessLANSecuritySwitch2250 NDPChassisType = 107 |
| 126 | NDPChassisEthernetSwitch42548T NDPChassisType = 108 |
| 127 | NDPChassisEthernetSwitch42524T NDPChassisType = 109 |
| 128 | NDPChassisNortelNetworksWirelessLANAccessPoint2221 NDPChassisType = 110 |
| 129 | NDPChassisNortelMetroEthernetServiceUnit24TSPFswitch NDPChassisType = 111 |
| 130 | NDPChassisNortelMetroEthernetServiceUnit24TLXDCswitch NDPChassisType = 112 |
| 131 | NDPChassisPassport830010slotchassis NDPChassisType = 113 |
| 132 | NDPChassisPassport83006slotchassis NDPChassisType = 114 |
| 133 | NDPChassisEthernetRoutingSwitch552024TPWR NDPChassisType = 115 |
| 134 | NDPChassisEthernetRoutingSwitch552048TPWR NDPChassisType = 116 |
| 135 | NDPChassisNortelNetworksVPNGateway3050 NDPChassisType = 117 |
| 136 | NDPChassisAlteonSSL31010100 NDPChassisType = 118 |
| 137 | NDPChassisAlteonSSL31010100Fiber NDPChassisType = 119 |
| 138 | NDPChassisAlteonSSL31010100FIPS NDPChassisType = 120 |
| 139 | NDPChassisAlteonSSL410101001000 NDPChassisType = 121 |
| 140 | NDPChassisAlteonSSL410101001000Fiber NDPChassisType = 122 |
| 141 | NDPChassisAlteonApplicationSwitch2424SSL NDPChassisType = 123 |
| 142 | NDPChassisEthernetSwitch32524T NDPChassisType = 124 |
| 143 | NDPChassisEthernetSwitch32524G NDPChassisType = 125 |
| 144 | NDPChassisNortelNetworksWirelessLANAccessPoint2225 NDPChassisType = 126 |
| 145 | NDPChassisNortelNetworksWirelessLANSecuritySwitch2270 NDPChassisType = 127 |
| 146 | NDPChassis24portEthernetSwitch47024TPWR NDPChassisType = 128 |
| 147 | NDPChassis48portEthernetSwitch47048TPWR NDPChassisType = 129 |
| 148 | NDPChassisEthernetRoutingSwitch553024TFD NDPChassisType = 130 |
| 149 | NDPChassisEthernetSwitch351024T NDPChassisType = 131 |
| 150 | NDPChassisNortelMetroEthernetServiceUnit12GACL3Switch NDPChassisType = 132 |
| 151 | NDPChassisNortelMetroEthernetServiceUnit12GDCL3Switch NDPChassisType = 133 |
| 152 | NDPChassisNortelSecureAccessSwitch NDPChassisType = 134 |
| 153 | NDPChassisNortelNetworksVPNGateway3070 NDPChassisType = 135 |
| 154 | NDPChassisOPTeraMetro3500 NDPChassisType = 136 |
| 155 | NDPChassisSMBBES101024T NDPChassisType = 137 |
| 156 | NDPChassisSMBBES101048T NDPChassisType = 138 |
| 157 | NDPChassisSMBBES102024TPWR NDPChassisType = 139 |
| 158 | NDPChassisSMBBES102048TPWR NDPChassisType = 140 |
| 159 | NDPChassisSMBBES201024T NDPChassisType = 141 |
| 160 | NDPChassisSMBBES201048T NDPChassisType = 142 |
| 161 | NDPChassisSMBBES202024TPWR NDPChassisType = 143 |
| 162 | NDPChassisSMBBES202048TPWR NDPChassisType = 144 |
| 163 | NDPChassisSMBBES11024T NDPChassisType = 145 |
| 164 | NDPChassisSMBBES11048T NDPChassisType = 146 |
| 165 | NDPChassisSMBBES12024TPWR NDPChassisType = 147 |
| 166 | NDPChassisSMBBES12048TPWR NDPChassisType = 148 |
| 167 | NDPChassisSMBBES21024T NDPChassisType = 149 |
| 168 | NDPChassisSMBBES21048T NDPChassisType = 150 |
| 169 | NDPChassisSMBBES22024TPWR NDPChassisType = 151 |
| 170 | NDPChassisSMBBES22048TPWR NDPChassisType = 152 |
| 171 | NDPChassisOME6500 NDPChassisType = 153 |
| 172 | NDPChassisEthernetRoutingSwitch4548GT NDPChassisType = 154 |
| 173 | NDPChassisEthernetRoutingSwitch4548GTPWR NDPChassisType = 155 |
| 174 | NDPChassisEthernetRoutingSwitch4550T NDPChassisType = 156 |
| 175 | NDPChassisEthernetRoutingSwitch4550TPWR NDPChassisType = 157 |
| 176 | NDPChassisEthernetRoutingSwitch4526FX NDPChassisType = 158 |
| 177 | NDPChassisEthernetRoutingSwitch250026T NDPChassisType = 159 |
| 178 | NDPChassisEthernetRoutingSwitch250026TPWR NDPChassisType = 160 |
| 179 | NDPChassisEthernetRoutingSwitch250050T NDPChassisType = 161 |
| 180 | NDPChassisEthernetRoutingSwitch250050TPWR NDPChassisType = 162 |
| 181 | ) |
| 182 | |
| 183 | type NDPBackplaneType uint8 |
| 184 | |
| 185 | // Nortel Backplane Types |
| 186 | const ( |
| 187 | NDPBackplaneOther NDPBackplaneType = 1 |
| 188 | NDPBackplaneEthernet NDPBackplaneType = 2 |
| 189 | NDPBackplaneEthernetTokenring NDPBackplaneType = 3 |
| 190 | NDPBackplaneEthernetFDDI NDPBackplaneType = 4 |
| 191 | NDPBackplaneEthernetTokenringFDDI NDPBackplaneType = 5 |
| 192 | NDPBackplaneEthernetTokenringRedundantPower NDPBackplaneType = 6 |
| 193 | NDPBackplaneEthernetTokenringFDDIRedundantPower NDPBackplaneType = 7 |
| 194 | NDPBackplaneTokenRing NDPBackplaneType = 8 |
| 195 | NDPBackplaneEthernetTokenringFastEthernet NDPBackplaneType = 9 |
| 196 | NDPBackplaneEthernetFastEthernet NDPBackplaneType = 10 |
| 197 | NDPBackplaneEthernetTokenringFastEthernetRedundantPower NDPBackplaneType = 11 |
| 198 | NDPBackplaneEthernetFastEthernetGigabitEthernet NDPBackplaneType = 12 |
| 199 | ) |
| 200 | |
| 201 | type NDPState uint8 |
| 202 | |
| 203 | // Device State |
| 204 | const ( |
| 205 | NDPStateTopology NDPState = 1 |
| 206 | NDPStateHeartbeat NDPState = 2 |
| 207 | NDPStateNew NDPState = 3 |
| 208 | ) |
| 209 | |
| 210 | // NortelDiscovery is a packet layer containing the Nortel Discovery Protocol. |
| 211 | type NortelDiscovery struct { |
| 212 | BaseLayer |
| 213 | IPAddress net.IP |
| 214 | SegmentID []byte |
| 215 | Chassis NDPChassisType |
| 216 | Backplane NDPBackplaneType |
| 217 | State NDPState |
| 218 | NumLinks uint8 |
| 219 | } |
| 220 | |
| 221 | // LayerType returns gopacket.LayerTypeNortelDiscovery. |
| 222 | func (c *NortelDiscovery) LayerType() gopacket.LayerType { |
| 223 | return LayerTypeNortelDiscovery |
| 224 | } |
| 225 | |
| 226 | func decodeNortelDiscovery(data []byte, p gopacket.PacketBuilder) error { |
| 227 | c := &NortelDiscovery{} |
| 228 | if len(data) < 11 { |
| 229 | return fmt.Errorf("Invalid NortelDiscovery packet length %d", len(data)) |
| 230 | } |
| 231 | c.IPAddress = data[0:4] |
| 232 | c.SegmentID = data[4:7] |
| 233 | c.Chassis = NDPChassisType(data[7]) |
| 234 | c.Backplane = NDPBackplaneType(data[8]) |
| 235 | c.State = NDPState(data[9]) |
| 236 | c.NumLinks = uint8(data[10]) |
| 237 | p.AddLayer(c) |
| 238 | return nil |
| 239 | } |
| 240 | |
| 241 | func (t NDPChassisType) String() (s string) { |
| 242 | switch t { |
| 243 | case NDPChassisother: |
| 244 | s = "other" |
| 245 | case NDPChassis3000: |
| 246 | s = "3000" |
| 247 | case NDPChassis3030: |
| 248 | s = "3030" |
| 249 | case NDPChassis2310: |
| 250 | s = "2310" |
| 251 | case NDPChassis2810: |
| 252 | s = "2810" |
| 253 | case NDPChassis2912: |
| 254 | s = "2912" |
| 255 | case NDPChassis2914: |
| 256 | s = "2914" |
| 257 | case NDPChassis271x: |
| 258 | s = "271x" |
| 259 | case NDPChassis2813: |
| 260 | s = "2813" |
| 261 | case NDPChassis2814: |
| 262 | s = "2814" |
| 263 | case NDPChassis2915: |
| 264 | s = "2915" |
| 265 | case NDPChassis5000: |
| 266 | s = "5000" |
| 267 | case NDPChassis2813SA: |
| 268 | s = "2813SA" |
| 269 | case NDPChassis2814SA: |
| 270 | s = "2814SA" |
| 271 | case NDPChassis810M: |
| 272 | s = "810M" |
| 273 | case NDPChassisEthercell: |
| 274 | s = "Ethercell" |
| 275 | case NDPChassis5005: |
| 276 | s = "5005" |
| 277 | case NDPChassisAlcatelEWC: |
| 278 | s = "Alcatel Ethernet workgroup conc." |
| 279 | case NDPChassis2715SA: |
| 280 | s = "2715SA" |
| 281 | case NDPChassis2486: |
| 282 | s = "2486" |
| 283 | case NDPChassis28000series: |
| 284 | s = "28000 series" |
| 285 | case NDPChassis23000series: |
| 286 | s = "23000 series" |
| 287 | case NDPChassis5DN00xseries: |
| 288 | s = "5DN00x series" |
| 289 | case NDPChassisBayStackEthernet: |
| 290 | s = "BayStack Ethernet" |
| 291 | case NDPChassis23100series: |
| 292 | s = "23100 series" |
| 293 | case NDPChassis100BaseTHub: |
| 294 | s = "100Base-T Hub" |
| 295 | case NDPChassis3000FastEthernet: |
| 296 | s = "3000 Fast Ethernet" |
| 297 | case NDPChassisOrionSwitch: |
| 298 | s = "Orion switch" |
| 299 | case NDPChassisDDS: |
| 300 | s = "DDS" |
| 301 | case NDPChassisCentillion6slot: |
| 302 | s = "Centillion (6 slot)" |
| 303 | case NDPChassisCentillion12slot: |
| 304 | s = "Centillion (12 slot)" |
| 305 | case NDPChassisCentillion1slot: |
| 306 | s = "Centillion (1 slot)" |
| 307 | case NDPChassisBayStack301: |
| 308 | s = "BayStack 301" |
| 309 | case NDPChassisBayStackTokenRingHub: |
| 310 | s = "BayStack TokenRing Hub" |
| 311 | case NDPChassisFVCMultimediaSwitch: |
| 312 | s = "FVC Multimedia Switch" |
| 313 | case NDPChassisSwitchNode: |
| 314 | s = "Switch Node" |
| 315 | case NDPChassisBayStack302Switch: |
| 316 | s = "BayStack 302 Switch" |
| 317 | case NDPChassisBayStack350Switch: |
| 318 | s = "BayStack 350 Switch" |
| 319 | case NDPChassisBayStack150EthernetHub: |
| 320 | s = "BayStack 150 Ethernet Hub" |
| 321 | case NDPChassisCentillion50NSwitch: |
| 322 | s = "Centillion 50N switch" |
| 323 | case NDPChassisCentillion50TSwitch: |
| 324 | s = "Centillion 50T switch" |
| 325 | case NDPChassisBayStack303304Switches: |
| 326 | s = "BayStack 303 and 304 Switches" |
| 327 | case NDPChassisBayStack200EthernetHub: |
| 328 | s = "BayStack 200 Ethernet Hub" |
| 329 | case NDPChassisBayStack25010100EthernetHub: |
| 330 | s = "BayStack 250 10/100 Ethernet Hub" |
| 331 | case NDPChassisBayStack450101001000Switches: |
| 332 | s = "BayStack 450 10/100/1000 Switches" |
| 333 | case NDPChassisBayStack41010100Switches: |
| 334 | s = "BayStack 410 10/100 Switches" |
| 335 | case NDPChassisPassport1200L3Switch: |
| 336 | s = "Passport 1200 L3 Switch" |
| 337 | case NDPChassisPassport1250L3Switch: |
| 338 | s = "Passport 1250 L3 Switch" |
| 339 | case NDPChassisPassport1100L3Switch: |
| 340 | s = "Passport 1100 L3 Switch" |
| 341 | case NDPChassisPassport1150L3Switch: |
| 342 | s = "Passport 1150 L3 Switch" |
| 343 | case NDPChassisPassport1050L3Switch: |
| 344 | s = "Passport 1050 L3 Switch" |
| 345 | case NDPChassisPassport1051L3Switch: |
| 346 | s = "Passport 1051 L3 Switch" |
| 347 | case NDPChassisPassport8610L3Switch: |
| 348 | s = "Passport 8610 L3 Switch" |
| 349 | case NDPChassisPassport8606L3Switch: |
| 350 | s = "Passport 8606 L3 Switch" |
| 351 | case NDPChassisPassport8010: |
| 352 | s = "Passport 8010" |
| 353 | case NDPChassisPassport8006: |
| 354 | s = "Passport 8006" |
| 355 | case NDPChassisBayStack670wirelessaccesspoint: |
| 356 | s = "BayStack 670 wireless access point" |
| 357 | case NDPChassisPassport740: |
| 358 | s = "Passport 740" |
| 359 | case NDPChassisPassport750: |
| 360 | s = "Passport 750" |
| 361 | case NDPChassisPassport790: |
| 362 | s = "Passport 790" |
| 363 | case NDPChassisBusinessPolicySwitch200010100Switches: |
| 364 | s = "Business Policy Switch 2000 10/100 Switches" |
| 365 | case NDPChassisPassport8110L2Switch: |
| 366 | s = "Passport 8110 L2 Switch" |
| 367 | case NDPChassisPassport8106L2Switch: |
| 368 | s = "Passport 8106 L2 Switch" |
| 369 | case NDPChassisBayStack3580GigSwitch: |
| 370 | s = "BayStack 3580 Gig Switch" |
| 371 | case NDPChassisBayStack10PowerSupplyUnit: |
| 372 | s = "BayStack 10 Power Supply Unit" |
| 373 | case NDPChassisBayStack42010100Switch: |
| 374 | s = "BayStack 420 10/100 Switch" |
| 375 | case NDPChassisOPTeraMetro1200EthernetServiceModule: |
| 376 | s = "OPTera Metro 1200 Ethernet Service Module" |
| 377 | case NDPChassisOPTera8010co: |
| 378 | s = "OPTera 8010co" |
| 379 | case NDPChassisOPTera8610coL3Switch: |
| 380 | s = "OPTera 8610co L3 switch" |
| 381 | case NDPChassisOPTera8110coL2Switch: |
| 382 | s = "OPTera 8110co L2 switch" |
| 383 | case NDPChassisOPTera8003: |
| 384 | s = "OPTera 8003" |
| 385 | case NDPChassisOPTera8603L3Switch: |
| 386 | s = "OPTera 8603 L3 switch" |
| 387 | case NDPChassisOPTera8103L2Switch: |
| 388 | s = "OPTera 8103 L2 switch" |
| 389 | case NDPChassisBayStack380101001000Switch: |
| 390 | s = "BayStack 380 10/100/1000 Switch" |
| 391 | case NDPChassisEthernetSwitch47048T: |
| 392 | s = "Ethernet Switch 470-48T" |
| 393 | case NDPChassisOPTeraMetro1450EthernetServiceModule: |
| 394 | s = "OPTera Metro 1450 Ethernet Service Module" |
| 395 | case NDPChassisOPTeraMetro1400EthernetServiceModule: |
| 396 | s = "OPTera Metro 1400 Ethernet Service Module" |
| 397 | case NDPChassisAlteonSwitchFamily: |
| 398 | s = "Alteon Switch Family" |
| 399 | case NDPChassisEthernetSwitch46024TPWR: |
| 400 | s = "Ethernet Switch 460-24T-PWR" |
| 401 | case NDPChassisOPTeraMetro8010OPML2Switch: |
| 402 | s = "OPTera Metro 8010 OPM L2 Switch" |
| 403 | case NDPChassisOPTeraMetro8010coOPML2Switch: |
| 404 | s = "OPTera Metro 8010co OPM L2 Switch" |
| 405 | case NDPChassisOPTeraMetro8006OPML2Switch: |
| 406 | s = "OPTera Metro 8006 OPM L2 Switch" |
| 407 | case NDPChassisOPTeraMetro8003OPML2Switch: |
| 408 | s = "OPTera Metro 8003 OPM L2 Switch" |
| 409 | case NDPChassisAlteon180e: |
| 410 | s = "Alteon 180e" |
| 411 | case NDPChassisAlteonAD3: |
| 412 | s = "Alteon AD3" |
| 413 | case NDPChassisAlteon184: |
| 414 | s = "Alteon 184" |
| 415 | case NDPChassisAlteonAD4: |
| 416 | s = "Alteon AD4" |
| 417 | case NDPChassisPassport1424L3Switch: |
| 418 | s = "Passport 1424 L3 switch" |
| 419 | case NDPChassisPassport1648L3Switch: |
| 420 | s = "Passport 1648 L3 switch" |
| 421 | case NDPChassisPassport1612L3Switch: |
| 422 | s = "Passport 1612 L3 switch" |
| 423 | case NDPChassisPassport1624L3Switch: |
| 424 | s = "Passport 1624 L3 switch" |
| 425 | case NDPChassisBayStack38024FFiber1000Switch: |
| 426 | s = "BayStack 380-24F Fiber 1000 Switch" |
| 427 | case NDPChassisEthernetRoutingSwitch551024T: |
| 428 | s = "Ethernet Routing Switch 5510-24T" |
| 429 | case NDPChassisEthernetRoutingSwitch551048T: |
| 430 | s = "Ethernet Routing Switch 5510-48T" |
| 431 | case NDPChassisEthernetSwitch47024T: |
| 432 | s = "Ethernet Switch 470-24T" |
| 433 | case NDPChassisNortelNetworksWirelessLANAccessPoint2220: |
| 434 | s = "Nortel Networks Wireless LAN Access Point 2220" |
| 435 | case NDPChassisPassportRBS2402L3Switch: |
| 436 | s = "Passport RBS 2402 L3 switch" |
| 437 | case NDPChassisAlteonApplicationSwitch2424: |
| 438 | s = "Alteon Application Switch 2424" |
| 439 | case NDPChassisAlteonApplicationSwitch2224: |
| 440 | s = "Alteon Application Switch 2224" |
| 441 | case NDPChassisAlteonApplicationSwitch2208: |
| 442 | s = "Alteon Application Switch 2208" |
| 443 | case NDPChassisAlteonApplicationSwitch2216: |
| 444 | s = "Alteon Application Switch 2216" |
| 445 | case NDPChassisAlteonApplicationSwitch3408: |
| 446 | s = "Alteon Application Switch 3408" |
| 447 | case NDPChassisAlteonApplicationSwitch3416: |
| 448 | s = "Alteon Application Switch 3416" |
| 449 | case NDPChassisNortelNetworksWirelessLANSecuritySwitch2250: |
| 450 | s = "Nortel Networks Wireless LAN SecuritySwitch 2250" |
| 451 | case NDPChassisEthernetSwitch42548T: |
| 452 | s = "Ethernet Switch 425-48T" |
| 453 | case NDPChassisEthernetSwitch42524T: |
| 454 | s = "Ethernet Switch 425-24T" |
| 455 | case NDPChassisNortelNetworksWirelessLANAccessPoint2221: |
| 456 | s = "Nortel Networks Wireless LAN Access Point 2221" |
| 457 | case NDPChassisNortelMetroEthernetServiceUnit24TSPFswitch: |
| 458 | s = "Nortel Metro Ethernet Service Unit 24-T SPF switch" |
| 459 | case NDPChassisNortelMetroEthernetServiceUnit24TLXDCswitch: |
| 460 | s = " Nortel Metro Ethernet Service Unit 24-T LX DC switch" |
| 461 | case NDPChassisPassport830010slotchassis: |
| 462 | s = "Passport 8300 10-slot chassis" |
| 463 | case NDPChassisPassport83006slotchassis: |
| 464 | s = "Passport 8300 6-slot chassis" |
| 465 | case NDPChassisEthernetRoutingSwitch552024TPWR: |
| 466 | s = "Ethernet Routing Switch 5520-24T-PWR" |
| 467 | case NDPChassisEthernetRoutingSwitch552048TPWR: |
| 468 | s = "Ethernet Routing Switch 5520-48T-PWR" |
| 469 | case NDPChassisNortelNetworksVPNGateway3050: |
| 470 | s = "Nortel Networks VPN Gateway 3050" |
| 471 | case NDPChassisAlteonSSL31010100: |
| 472 | s = "Alteon SSL 310 10/100" |
| 473 | case NDPChassisAlteonSSL31010100Fiber: |
| 474 | s = "Alteon SSL 310 10/100 Fiber" |
| 475 | case NDPChassisAlteonSSL31010100FIPS: |
| 476 | s = "Alteon SSL 310 10/100 FIPS" |
| 477 | case NDPChassisAlteonSSL410101001000: |
| 478 | s = "Alteon SSL 410 10/100/1000" |
| 479 | case NDPChassisAlteonSSL410101001000Fiber: |
| 480 | s = "Alteon SSL 410 10/100/1000 Fiber" |
| 481 | case NDPChassisAlteonApplicationSwitch2424SSL: |
| 482 | s = "Alteon Application Switch 2424-SSL" |
| 483 | case NDPChassisEthernetSwitch32524T: |
| 484 | s = "Ethernet Switch 325-24T" |
| 485 | case NDPChassisEthernetSwitch32524G: |
| 486 | s = "Ethernet Switch 325-24G" |
| 487 | case NDPChassisNortelNetworksWirelessLANAccessPoint2225: |
| 488 | s = "Nortel Networks Wireless LAN Access Point 2225" |
| 489 | case NDPChassisNortelNetworksWirelessLANSecuritySwitch2270: |
| 490 | s = "Nortel Networks Wireless LAN SecuritySwitch 2270" |
| 491 | case NDPChassis24portEthernetSwitch47024TPWR: |
| 492 | s = "24-port Ethernet Switch 470-24T-PWR" |
| 493 | case NDPChassis48portEthernetSwitch47048TPWR: |
| 494 | s = "48-port Ethernet Switch 470-48T-PWR" |
| 495 | case NDPChassisEthernetRoutingSwitch553024TFD: |
| 496 | s = "Ethernet Routing Switch 5530-24TFD" |
| 497 | case NDPChassisEthernetSwitch351024T: |
| 498 | s = "Ethernet Switch 3510-24T" |
| 499 | case NDPChassisNortelMetroEthernetServiceUnit12GACL3Switch: |
| 500 | s = "Nortel Metro Ethernet Service Unit 12G AC L3 switch" |
| 501 | case NDPChassisNortelMetroEthernetServiceUnit12GDCL3Switch: |
| 502 | s = "Nortel Metro Ethernet Service Unit 12G DC L3 switch" |
| 503 | case NDPChassisNortelSecureAccessSwitch: |
| 504 | s = "Nortel Secure Access Switch" |
| 505 | case NDPChassisNortelNetworksVPNGateway3070: |
| 506 | s = "Nortel Networks VPN Gateway 3070" |
| 507 | case NDPChassisOPTeraMetro3500: |
| 508 | s = "OPTera Metro 3500" |
| 509 | case NDPChassisSMBBES101024T: |
| 510 | s = "SMB BES 1010 24T" |
| 511 | case NDPChassisSMBBES101048T: |
| 512 | s = "SMB BES 1010 48T" |
| 513 | case NDPChassisSMBBES102024TPWR: |
| 514 | s = "SMB BES 1020 24T PWR" |
| 515 | case NDPChassisSMBBES102048TPWR: |
| 516 | s = "SMB BES 1020 48T PWR" |
| 517 | case NDPChassisSMBBES201024T: |
| 518 | s = "SMB BES 2010 24T" |
| 519 | case NDPChassisSMBBES201048T: |
| 520 | s = "SMB BES 2010 48T" |
| 521 | case NDPChassisSMBBES202024TPWR: |
| 522 | s = "SMB BES 2020 24T PWR" |
| 523 | case NDPChassisSMBBES202048TPWR: |
| 524 | s = "SMB BES 2020 48T PWR" |
| 525 | case NDPChassisSMBBES11024T: |
| 526 | s = "SMB BES 110 24T" |
| 527 | case NDPChassisSMBBES11048T: |
| 528 | s = "SMB BES 110 48T" |
| 529 | case NDPChassisSMBBES12024TPWR: |
| 530 | s = "SMB BES 120 24T PWR" |
| 531 | case NDPChassisSMBBES12048TPWR: |
| 532 | s = "SMB BES 120 48T PWR" |
| 533 | case NDPChassisSMBBES21024T: |
| 534 | s = "SMB BES 210 24T" |
| 535 | case NDPChassisSMBBES21048T: |
| 536 | s = "SMB BES 210 48T" |
| 537 | case NDPChassisSMBBES22024TPWR: |
| 538 | s = "SMB BES 220 24T PWR" |
| 539 | case NDPChassisSMBBES22048TPWR: |
| 540 | s = "SMB BES 220 48T PWR" |
| 541 | case NDPChassisOME6500: |
| 542 | s = "OME 6500" |
| 543 | case NDPChassisEthernetRoutingSwitch4548GT: |
| 544 | s = "Ethernet Routing Switch 4548GT" |
| 545 | case NDPChassisEthernetRoutingSwitch4548GTPWR: |
| 546 | s = "Ethernet Routing Switch 4548GT-PWR" |
| 547 | case NDPChassisEthernetRoutingSwitch4550T: |
| 548 | s = "Ethernet Routing Switch 4550T" |
| 549 | case NDPChassisEthernetRoutingSwitch4550TPWR: |
| 550 | s = "Ethernet Routing Switch 4550T-PWR" |
| 551 | case NDPChassisEthernetRoutingSwitch4526FX: |
| 552 | s = "Ethernet Routing Switch 4526FX" |
| 553 | case NDPChassisEthernetRoutingSwitch250026T: |
| 554 | s = "Ethernet Routing Switch 2500-26T" |
| 555 | case NDPChassisEthernetRoutingSwitch250026TPWR: |
| 556 | s = "Ethernet Routing Switch 2500-26T-PWR" |
| 557 | case NDPChassisEthernetRoutingSwitch250050T: |
| 558 | s = "Ethernet Routing Switch 2500-50T" |
| 559 | case NDPChassisEthernetRoutingSwitch250050TPWR: |
| 560 | s = "Ethernet Routing Switch 2500-50T-PWR" |
| 561 | default: |
| 562 | s = "Unknown" |
| 563 | } |
| 564 | return |
| 565 | } |
| 566 | |
| 567 | func (t NDPBackplaneType) String() (s string) { |
| 568 | switch t { |
| 569 | case NDPBackplaneOther: |
| 570 | s = "Other" |
| 571 | case NDPBackplaneEthernet: |
| 572 | s = "Ethernet" |
| 573 | case NDPBackplaneEthernetTokenring: |
| 574 | s = "Ethernet and Tokenring" |
| 575 | case NDPBackplaneEthernetFDDI: |
| 576 | s = "Ethernet and FDDI" |
| 577 | case NDPBackplaneEthernetTokenringFDDI: |
| 578 | s = "Ethernet, Tokenring and FDDI" |
| 579 | case NDPBackplaneEthernetTokenringRedundantPower: |
| 580 | s = "Ethernet and Tokenring with redundant power" |
| 581 | case NDPBackplaneEthernetTokenringFDDIRedundantPower: |
| 582 | s = "Ethernet, Tokenring, FDDI with redundant power" |
| 583 | case NDPBackplaneTokenRing: |
| 584 | s = "Token Ring" |
| 585 | case NDPBackplaneEthernetTokenringFastEthernet: |
| 586 | s = "Ethernet, Tokenring and Fast Ethernet" |
| 587 | case NDPBackplaneEthernetFastEthernet: |
| 588 | s = "Ethernet and Fast Ethernet" |
| 589 | case NDPBackplaneEthernetTokenringFastEthernetRedundantPower: |
| 590 | s = "Ethernet, Tokenring, Fast Ethernet with redundant power" |
| 591 | case NDPBackplaneEthernetFastEthernetGigabitEthernet: |
| 592 | s = "Ethernet, Fast Ethernet and Gigabit Ethernet" |
| 593 | default: |
| 594 | s = "Unknown" |
| 595 | } |
| 596 | return |
| 597 | } |
| 598 | |
| 599 | func (t NDPState) String() (s string) { |
| 600 | switch t { |
| 601 | case NDPStateTopology: |
| 602 | s = "Topology Change" |
| 603 | case NDPStateHeartbeat: |
| 604 | s = "Heartbeat" |
| 605 | case NDPStateNew: |
| 606 | s = "New" |
| 607 | default: |
| 608 | s = "Unknown" |
| 609 | } |
| 610 | return |
| 611 | } |