1 /* packet-slowprotocols.c
2 * Routines for EtherType (0x8809) Slow Protocols disassembly.
6 * Copyright 2002 Steve Housley <steve_housley@3com.com>
7 * Copyright 2005 Dominique Bastien <dbastien@accedian.com>
8 * Copyright 2009 Artem Tamazov <artem.tamazov@telllabs.com>
9 * Copyright 2010 Roberto Morro <roberto.morro[AT]tilab.com>
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 #include <epan/packet.h>
37 #include <epan/etypes.h>
38 #include <epan/llcsaps.h>
39 #include <epan/ppptypes.h>
40 #include <epan/addr_resolv.h>
41 #include <epan/expert.h>
43 /* General declarations */
45 #define SLOW_PROTO_SUBTYPE 0
47 #define LACP_SUBTYPE 0x1
48 #define MARKER_SUBTYPE 0x2
49 #define OAM_SUBTYPE 0x3
50 #define OSSP_SUBTYPE 0xa /* IEEE 802.3 Annex 57A*/
53 /* Offsets of fields within a LACPDU */
55 #define LACPDU_VERSION_NUMBER 1
57 #define LACPDU_ACTOR_TYPE 2
58 #define LACPDU_ACTOR_INFO_LEN 3
59 #define LACPDU_ACTOR_SYS_PRIORITY 4
60 #define LACPDU_ACTOR_SYSTEM 6
61 #define LACPDU_ACTOR_KEY 12
62 #define LACPDU_ACTOR_PORT_PRIORITY 14
63 #define LACPDU_ACTOR_PORT 16
64 #define LACPDU_ACTOR_STATE 18
65 #define LACPDU_ACTOR_RESERVED 19
67 #define LACPDU_PARTNER_TYPE 22
68 #define LACPDU_PARTNER_INFO_LEN 23
69 #define LACPDU_PARTNER_SYS_PRIORITY 24
70 #define LACPDU_PARTNER_SYSTEM 26
71 #define LACPDU_PARTNER_KEY 32
72 #define LACPDU_PARTNER_PORT_PRIORITY 34
73 #define LACPDU_PARTNER_PORT 36
74 #define LACPDU_PARTNER_STATE 38
75 #define LACPDU_PARTNER_RESERVED 39
77 #define LACPDU_COLL_TYPE 42
78 #define LACPDU_COLL_INFO_LEN 43
79 #define LACPDU_COLL_MAX_DELAY 44
80 #define LACPDU_COLL_RESERVED 46
82 #define LACPDU_TERM_TYPE 58
83 #define LACPDU_TERM_LEN 59
84 #define LACPDU_TERM_RESERVED 60
86 /* Actor and Partner Flag bits */
87 #define LACPDU_FLAGS_ACTIVITY 0x01
88 #define LACPDU_FLAGS_TIMEOUT 0x02
89 #define LACPDU_FLAGS_AGGREGATION 0x04
90 #define LACPDU_FLAGS_SYNC 0x08
91 #define LACPDU_FLAGS_COLLECTING 0x10
92 #define LACPDU_FLAGS_DISTRIB 0x20
93 #define LACPDU_FLAGS_DEFAULTED 0x40
94 #define LACPDU_FLAGS_EXPIRED 0x80
97 /* MARKER TLVs subtype */
98 #define MARKERPDU_END_MARKER 0x0
99 #define MARKERPDU_MARKER_INFO 0x1
100 #define MARKERPDU_MARKER_RESPONSE 0x2
103 /* Offsets of fields within a OAMPDU */
104 #define OAMPDU_FLAGS 1
105 #define OAMPDU_CODE 3
107 #define OAMPDU_HEADER_SIZE 4
109 /* OAMPDU Flag bits */
110 #define OAMPDU_FLAGS_LINK_FAULT 0x01
111 #define OAMPDU_FLAGS_DYING_GASP 0x02
112 #define OAMPDU_FLAGS_CRITICAL_EVENT 0x04
113 #define OAMPDU_FLAGS_LOCAL_EVAL 0x08
114 #define OAMPDU_FLAGS_LOCAL_STABLE 0x10
115 #define OAMPDU_FLAGS_REMOTE_EVAL 0x20
116 #define OAMPDU_FLAGS_REMOTE_STABLE 0x40
119 #define OAMPDU_INFORMATION 0x0
120 #define OAMPDU_EVENT_NOTIFICATION 0x1
121 #define OAMPDU_VAR_REQUEST 0x2
122 #define OAMPDU_VAR_RESPONSE 0x3
123 #define OAMPDU_LOOPBACK_CTRL 0x4
124 #define OAMPDU_VENDOR_SPECIFIC 0xFE
126 /* Information Type */
127 #define OAMPDU_INFO_TYPE_ENDMARKER 0x0
128 #define OAMPDU_INFO_TYPE_LOCAL 0x1
129 #define OAMPDU_INFO_TYPE_REMOTE 0x2
130 #define OAMPDU_INFO_TYPE_ORG 0xFE
132 /* Size of fields within a OAMPDU Information */
133 #define OAMPDU_INFO_TYPE_SZ 1
134 #define OAMPDU_INFO_LENGTH_SZ 1
135 #define OAMPDU_INFO_VERSION_SZ 1
136 #define OAMPDU_INFO_REVISION_SZ 2
137 #define OAMPDU_INFO_STATE_SZ 1
138 #define OAMPDU_INFO_OAM_CONFIG_SZ 1
139 #define OAMPDU_INFO_OAMPDU_CONFIG_SZ 2
140 #define OAMPDU_INFO_OUI_SZ 3
141 #define OAMPDU_INFO_VENDOR_SPECIFIC_SZ 4
143 /* OAM configuration bits */
145 #define OAMPDU_INFO_CONFIG_MODE 0x01
146 #define OAMPDU_INFO_CONFIG_UNI 0x02
147 #define OAMPDU_INFO_CONFIG_LPBK 0x04
148 #define OAMPDU_INFO_CONFIG_EVENT 0x08
149 #define OAMPDU_INFO_CONFIG_VAR 0x10
152 #define OAMPDU_EVENT_TYPE_END 0x0
153 #define OAMPDU_EVENT_TYPE_ESPE 0x1
154 #define OAMPDU_EVENT_TYPE_EFE 0x2
155 #define OAMPDU_EVENT_TYPE_EFPE 0x3
156 #define OAMPDU_EVENT_TYPE_EFSSE 0x4
157 #define OAMPDU_EVENT_TYPE_OSE 0xFE
159 /* Size of fields within a OAMPDU Event notification */
160 #define OAMPDU_EVENT_SEQUENCE_SZ 2
161 #define OAMPDU_EVENT_TYPE_SZ 1
162 #define OAMPDU_EVENT_LENGTH_SZ 1
163 #define OAMPDU_EVENT_TIMESTAMP_SZ 2
165 /* Size of fields within a OAMPDU ESPE: Errored Symbol Period Event TLV */
166 #define OAMPDU_ESPE_WINDOW_SZ 8
167 #define OAMPDU_ESPE_THRESHOLD_SZ 8
168 #define OAMPDU_ESPE_ERRORS_SZ 8
169 #define OAMPDU_ESPE_ERR_TOTAL_SZ 8
170 #define OAMPDU_ESPE_TOTAL_SZ 4
172 /* Size of fields within a OAMPDU EFE: Errored Frame Event TLV */
173 #define OAMPDU_EFE_WINDOW_SZ 2
174 #define OAMPDU_EFE_THRESHOLD_SZ 4
175 #define OAMPDU_EFE_ERRORS_SZ 4
176 #define OAMPDU_EFE_ERR_TOTAL_SZ 8
177 #define OAMPDU_EFE_TOTAL_SZ 4
179 /* Size of fields within a OAMPDU EFPE: Errored Frame Period Event TLV */
180 #define OAMPDU_EFPE_WINDOW_SZ 4
181 #define OAMPDU_EFPE_THRESHOLD_SZ 4
182 #define OAMPDU_EFPE_ERRORS_SZ 4
183 #define OAMPDU_EFPE_ERR_TOTAL_SZ 8
184 #define OAMPDU_EFPE_TOTAL_SZ 4
186 /* Size of fields within a OAMPDU EFSSE: Errored Frame Seconds Summary Event TLV */
187 #define OAMPDU_EFSSE_WINDOW_SZ 2
188 #define OAMPDU_EFSSE_THRESHOLD_SZ 2
189 #define OAMPDU_EFSSE_ERRORS_SZ 2
190 #define OAMPDU_EFSSE_ERR_TOTAL_SZ 4
191 #define OAMPDU_EFSSE_TOTAL_SZ 4
193 /* Variable Branch Type */
194 #define OAMPDU_VARS_OBJECT 0x3
195 #define OAMPDU_VARS_PACKAGE 0x4
196 #define OAMPDU_VARS_BINDING 0x6
197 #define OAMPDU_VARS_ATTRIBUTE 0x7
199 /* OAMPDU Loopback Control bits */
200 #define OAMPDU_LPBK_ENABLE 0x01
201 #define OAMPDU_LPBK_DISABLE 0x02
204 static const value_string subtype_vals[] = {
205 { LACP_SUBTYPE, "LACP" },
206 { MARKER_SUBTYPE, "Marker Protocol" },
207 { OAM_SUBTYPE, "OAM" },
208 { OSSP_SUBTYPE, "Organization Specific Slow Protocol" },
212 static const value_string marker_vals[] = {
213 { 1, "Marker Information" },
214 { 2, "Marker Response Information" },
218 /* see IEEE802.3, table 57-4 */
219 static const value_string code_vals[] = {
220 { 0, "Information" },
221 { 1, "Event Notification" },
222 { 2, "Variable Request" },
223 { 3, "Variable Response" },
224 { 4, "Loopback Control"},
225 { 0xFE, "Organization Specific" },
229 /* see IEEE802.3, table 57-6 */
230 static const value_string info_type_vals[] = {
231 { 0, "End of TLV marker" },
232 { 1, "Local Information TLV" },
233 { 2, "Remote Information TLV" },
234 { 0xFE, "Organization Specific Information TLV" },
238 /* see IEEE802.3, table 57-12 */
239 static const value_string event_type_vals[] = {
240 { 0, "End of TLV marker" },
241 { 1, "Errored Symbol Period Event" },
242 { 2, "Errored Frame Event" },
243 { 3, "Errored Frame Period Event" },
244 { 4, "Errored Frame Seconds Summary Event" },
245 { 0xFE, "Organization Specific Event TLV" },
251 * In the OAM protocol the {iso(1) member-body(2) us(840) ieee802dot3(10006)
252 * csmacdmgt(30)} prefix for the objects is pre-define. Only the
253 * managedObjectClass(3) is put in the branch and the leaf is one of the
256 static const value_string object_vals[] = {
257 { 1, "macObjectClass" },
258 { 2, "phyObjectClass"},
259 { 3, "repeaterObjectClass"},
260 { 4, "groupObjectClass"},
261 { 5, "repeaterPortObjectClass"},
262 { 6, "mauObjectClass"},
263 { 7, "autoNegObjectClass"},
264 { 8, "macControlObjectClass"},
265 { 9, "macControlFunctionObjectClass"},
266 { 10, "oAggregator"},
267 { 11, "oAggregationPort"},
268 { 12, "oAggPortStats"},
269 { 13, "oAggPortDebugInformation" },
270 { 15, "pseObjectClass"},
271 { 17, "midSpanObjectClass"},
272 { 18, "midSpanGroupObjectClass"},
273 { 19, "ompObjectClass"},
274 { 20, "oamObjectClass" },
275 { 21, "mpcpObjectClass" },
276 { 24, "pafObjectClass" },
277 { 25, "pmeObjectClass"},
282 * In the OAM protocol the {iso(1) member-body(2) us(840) ieee802dot3(10006)
283 * csmacdmgt(30)} prefix for the objects is pre-define. Only the
284 * package(4) is put in the branch and the leaf is one of the
287 static const value_string package_vals[] = {
288 { 1, "macMandatoryPkg" },
289 { 2, "macRecommendedPkg" },
290 { 3, "macOptionalPkg" },
291 { 4, "macarrayPkg" },
292 { 5, "macExcessiveDeferralPkg" },
293 { 6, "phyRecommendedPkg" },
294 { 7, "phyMultiplePhyPkg" },
295 { 8, "phy100MbpsMonitor" },
296 { 9, "repeaterPerfMonitorPkg"},
297 { 10, "portPerfMonitorPkg"},
298 { 11, "portAddrTrackPkg"},
299 { 12, "port100MbpsMonitor"},
300 { 13, "mauControlPkg"},
301 { 14, "mediaLossTrackingPkg"},
302 { 15, "broadbandMAUPkg"},
303 { 16, "mau100MbpsMonitor"},
304 { 17, "macControlRecommendedPkg" },
306 { 19, "pAggregatorMandatory"},
307 { 20, "pAggregatorRecommended"},
308 { 21, "pAggregatorOptional"},
309 { 22, "pAggregationPortMandatory"},
310 { 23, "pAggPortStats"},
311 { 24, "pAggPortDebugInformation"},
313 { 27, "pseRecommendedPkg"},
318 { 38, "pafAggregation"},
323 * In the OAM protocol the {iso(1) member-body(2) us(840) ieee802dot3(10006)
324 * csmacdmgt(30)} prefix for the objects is pre-define. Only the
325 * nameBinding(6) is put in the branch and the leaf is one of the
328 static const value_string binding_vals[] = {
329 { 26, "repeaterPortName"},
334 * In the OAM protocol the {iso(1) member-body(2) us(840) ieee802dot3(10006)
335 * csmacdmgt(30)} prefix for the objects is pre-define. Only the
336 * attribute(7) is put in the branch and the leaf is one of the
339 static const value_string attribute_vals[] = {
341 { 2, "aFramesTransmittedOK" },
342 { 3, "aSingleCollisionFrames" },
343 { 4, "aMultipleCollisionFrames" },
344 { 5, "aFramesReceivedOK" },
345 { 6, "aFrameCheckSequenceErrors" },
346 { 7, "aAlignmentErrors" },
347 { 8, "aOctetsTransmittedOK" },
348 { 9, "aFramesWithDeferredXmissions" },
349 { 10, "aLateCollisions" },
350 { 11, "aFramesAbortedDueToXSColls" },
351 { 12, "aFramesLostDueToIntMACXmitError" },
352 { 13, "aCarrierSenseErrors" },
353 { 14, "aOctetsReceivedOK" },
354 { 15, "aFramesLostDueToIntMACRcvError" },
355 { 16, "aPromiscuousStatus" },
356 { 17, "aReadMulticastAddressList" },
357 { 18, "aMulticastFramesXmittedOK" },
358 { 19, "aBroadcastFramesXmittedOK" },
359 { 20, "aFramesWithExcessiveDeferral" },
360 { 21, "aMulticastFramesReceivedOK" },
361 { 22, "aBroadcastFramesReceivedOK" },
362 { 23, "aInRangeLengthErrors" },
363 { 24, "aOutOfRangeLengthField" },
364 { 25, "aFrameTooLongErrors" },
365 { 26, "aMACEnableStatus" },
366 { 27, "aTransmitEnableStatus" },
367 { 28, "aMulticastReceiveStatus" },
368 { 29, "aReadWriteMACAddress" },
369 { 30, "aCollisionFrames" },
372 { 33, "aPHYTypeList" },
373 { 34, "aSQETestErrors" },
374 { 35, "aSymbolErrorDuringCarrier" },
375 { 36, "aMIIDetect" },
376 { 37, "aPHYAdminState" },
377 { 38, "aRepeaterID" },
378 { 39, "aRepeaterType" },
379 { 40, "aRepeaterGroupCapacity" },
381 { 42, "aRepeaterHealthState" },
382 { 43, "aRepeaterHealthText" },
383 { 44, "aRepeaterHealthData" },
384 { 44, "aTransmitCollisions" },
386 { 47, "aGroupPortCapacity" },
389 { 50, "aPortAdminState" },
390 { 51, "aAutoPartitionState" },
391 { 52, "aReadableFrames" },
392 { 53, "aReadableOctets" },
393 { 54, "aFrameCheckSequenceErrors" },
394 { 55, "aAlignmentErrors" },
395 { 56, "aFramesTooLong" },
396 { 57, "aShortEvents" },
398 { 59, "aCollisions" },
399 { 60, "aLateEvents" },
400 { 61, "aVeryLongEvents" },
401 { 62, "aDataRateMismatches" },
402 { 63, "aAutoPartitions" },
404 { 65, "aSymbolErrorDuringPacket" },
405 { 66, "aLastSourceAddress" },
406 { 67, "aSourceAddressChanges" },
409 { 70, "aMAUTypeList" },
410 { 71, "aMediaAvailable" },
411 { 72, "aLoseMediaCounter" },
413 { 74, "aMAUAdminState" },
414 { 75, "aBbMAUXmitRcvSplitType" },
415 { 76, "aBroadbandFrequencies" },
416 { 77, "aFalseCarriers" },
417 { 78, "aAutoNegID" },
418 { 79, "aAutoNegAdminState" },
419 { 80, "aAutoNegRemoteSignaling" },
420 { 81, "aAutoNegAutoConfig" },
421 { 82, "aAutoNegLocalTechnologyAbility" },
422 { 83, "aAutoNegAdvertisedTechnologyAbility" },
423 { 84, "aAutoNegReceivedTechnologyAbility" },
424 { 85, "aAutoNegLocalSelectorAbility" },
425 { 86, "aAutoNegAdvertisedSelectorAbility" },
426 { 87, "aAutoNegReceivedSelectorAbility" },
428 { 89, "aMACCapabilities" },
429 { 90, "aDuplexStatus" },
430 { 91, "aIdleErrorCount"},
431 { 92, "aMACControlID" },
432 { 93, "aMACControlFunctionsSupported" },
433 { 94, "aMACControlFramesTransmitted" },
434 { 95, "aMACControlFramesReceived" },
435 { 96, "aUnsupportedOpcodesReceived" },
436 { 97, "aPAUSELinkDelayAllowance" },
437 { 98, "aPAUSEMACCtrlFramesTransmitted" },
438 { 99, "aPAUSEMACCtrlFramesReceived" },
441 { 102, "aAggDescription" },
443 { 104, "aAggActorSystemID" },
444 { 105, "aAggActorSystemPriority" },
445 { 106, "aAggAggregateOrIndividual" },
446 { 107, "aAggActorAdminKey" },
447 { 108, "aAggActorOperKey" },
448 { 109, "aAggMACAddress" },
449 { 110, "aAggPartnerSystemID" },
450 { 111, "aAggPartnerSystemPriority" },
451 { 112, "aAggPartnerOperKey" },
452 { 113, "aAggAdminState" },
453 { 114, "aAggOperState" },
454 { 115, "aAggTimeOfLastOperChange" },
455 { 116, "aAggDataRate" },
456 { 117, "aAggOctetsTxOK" },
457 { 118, "aAggOctetsRxOK" },
458 { 119, "aAggFramesTxOK" },
459 { 120, "aAggFramesRxOK" },
460 { 121, "aAggMulticastFramesTxOK" },
461 { 122, "aAggMulticastFramesRxOK" },
462 { 123, "aAggBroadcastFramesTxOK" },
463 { 124, "aAggBroadcastFramesRxOK" },
464 { 125, "aAggFramesDiscardedOnTx" },
465 { 126, "aAggFramesDiscardedOnRx" },
466 { 127, "aAggFramesWithTxErrors" },
467 { 128, "aAggFramesWithRxErrors" },
468 { 129, "aAggUnknownProtocolFrames" },
469 { 130, "aAggLinkUpDownNotificationEnable" },
470 { 131, "aAggPortList" },
471 { 132, "aAggCollectorMaxDelay" },
472 { 133, "aAggPortID" },
473 { 134, "aAggPortActorSystemPriority" },
474 { 135, "aAggPortActorSystemID" },
475 { 136, "aAggPortActorAdminKey" },
476 { 137, "aAggPortActorOperKey" },
477 { 138, "aAggPortPartnerAdminSystemPriority" },
478 { 139, "aAggPortPartnerOperSystemPriority" },
479 { 140, "aAggPortPartnerAdminSystemID" },
480 { 141, "aAggPortPartnerOperSystemID" },
481 { 142, "aAggPortPartnerAdminKey" },
482 { 143, "aAggPortPartnerOperKey" },
483 { 144, "aAggPortSelectedAggID" },
484 { 145, "aAggPortAttachedAggID" },
485 { 146, "aAggPortActorPort" },
486 { 147, "aAggPortActorPortPriority" },
487 { 148, "aAggPortPartnerAdminPort" },
488 { 149, "aAggPortPartnerOperPort" },
489 { 150, "aAggPortPartnerAdminPortPriority" },
490 { 151, "aAggPortPartnerOperPortPriority" },
491 { 152, "aAggPortActorAdminState" },
492 { 153, "aAggPortActorOperState" },
493 { 154, "aAggPortPartnerAdminState" },
494 { 155, "aAggPortPartnerOperState" },
495 { 156, "aAggPortAggregateOrIndividual" },
496 { 157, "aAggPortStatsID" },
497 { 158, "aAggPortStatsLACPDUsRx" },
498 { 159, "aAggPortStatsMarkerPDUsRx" },
499 { 160, "aAggPortStatsMarkerResponsePDUsRx" },
500 { 161, "aAggPortStatsUnknownRx" },
501 { 162, "aAggPortStatsIllegalRx" },
502 { 163, "aAggPortStatsLACPDUsTx" },
503 { 164, "aAggPortStatsMarkerPDUsTx" },
504 { 165, "aAggPortStatsMarkerResponsePDUsTx" },
505 { 166, "aAggPortDebugInformationID" },
506 { 167, "aAggPortDebugRxState" },
507 { 168, "aAggPortDebugLastRxTime" },
508 { 169, "aAggPortDebugMuxState" },
509 { 170, "aAggPortDebugMuxReason" },
510 { 171, "aAggPortDebugActorChurnState" },
511 { 172, "aAggPortDebugPartnerChurnState" },
512 { 173, "aAggPortDebugActorChurnCount" },
513 { 174, "aAggPortDebugPartnerChurnCount" },
514 { 175, "aAggPortDebugActorSyncTransitionCount" },
515 { 176, "aAggPortDebugPartnerSyncTransitionCount" },
516 { 177, "aAggPortDebugActorChangeCount" },
517 { 178, "aAggPortDebugPartnerChangeCount" },
521 { 237, "aOAMAdminState" },
523 { 239, "aOAMRemoteMACAddress" },
524 { 240, "aOAMRemoteConfiguration" },
525 { 241, "aOAMRemotePDUConfiguration" },
526 { 242, "aOAMLocalFlagsField" },
527 { 243, "aOAMRemoteFlagsField" },
528 { 244, "aOAMRemoteRevision" },
529 { 245, "aOAMRemoteState" },
530 { 246, "aOAMRemoteVendorOUI" },
531 { 247, "aOAMRemoteVendorSpecificInfo" },
533 { 250, "aOAMUnsupportedCodesRx" },
534 { 251, "aOAMInformationTx" },
535 { 252, "aOAMInformationRx" },
537 { 254, "aOAMUniqueEventNotificationRx" },
538 { 255, "aOAMDuplicateEventNotificationRx" },
539 { 256, "aOAMLoopbackControlTx" },
540 { 257, "aOAMLoopbackControlRx" },
541 { 258, "aOAMVariableRequestTx" },
542 { 259, "aOAMVariableRequestRx" },
543 { 260, "aOAMVariableResponseTx" },
544 { 261, "aOAMVariableResponseRx" },
545 { 262, "aOAMOrganizationSpecificTx" },
546 { 263, "aOAMOrganizationSpecificRx" },
547 { 264, "aOAMLocalErrSymPeriodConfig" },
548 { 265, "aOAMLocalErrSymPeriodEvent" },
549 { 266, "aOAMLocalErrFrameConfig" },
550 { 267, "aOAMLocalErrFrameEvent" },
551 { 268, "aOAMLocalErrFramePeriodConfig" },
552 { 269, "aOAMLocalErrFramePeriodEvent" },
553 { 270, "aOAMLocalErrFrameSecsSummaryConfig" },
554 { 271, "aOAMLocalErrFrameSecsSummaryEvent" },
555 { 272, "aOAMRemoteErrSymPeriodEvent" },
556 { 273, "aOAMRemoteErrFrameEvent" },
557 { 274, "aOAMRemoteErrFramePeriodEvent" },
558 { 275, "aOAMRemoteErrFrameSecsSummaryEvent" },
559 { 276, "aFramesLostDueToOAMError" },
561 { 333, "aOAMDiscoveryState"},
562 { 334, "aOAMLocalConfiguration"},
563 { 335, "aOAMLocalPDUConfiguration"},
564 { 336, "aOAMLocalRevision"},
565 { 337, "aOAMLocalState"},
566 { 338, "aOAMUnsupportedCodesTx" },
567 { 339, "aOAMUniqueEventNotificationTx" },
568 { 340, "aOAMDuplicateEventNotificationTx" },
572 static value_string_ext attribute_vals_ext = VALUE_STRING_EXT_INIT(attribute_vals);
575 * In the OAM protocol the {iso(1) member-body(2) us(840) ieee802dot3(10006)
576 * csmacdmgt(30)} prefix for the objects is pre-define. Only the
577 * package(4) is put in the branch and the leaf is one of the
580 static const value_string indication_vals[] = {
581 { 0x01, "Variable Container(s) exceeded OAMPDU data field" },
583 { 0x20, "Attribute->Unable to return due to an undetermined error" },
584 { 0x21, "Attribute->Unable to return because it is not supported" },
585 { 0x22, "Attribute->May have been corrupted due to reset" },
586 { 0x23, "Attribute->Unable to return due to a hardware failure" },
587 { 0x24, "Attribute->Experience an overflow error" },
589 { 0x40, "Object->End of object indication" },
590 { 0x41, "Object->Unable to return due to an undetermined error" },
591 { 0x42, "Object->Unable to return because it is not supported" },
592 { 0x43, "Object->May have been corrupted due to reset" },
593 { 0x44, "Object->Unable to return due to a hardware failure" },
595 { 0x60, "Package->End of package indication" },
596 { 0x61, "Package->Unable to return due to an undetermined error" },
597 { 0x62, "Package->Unable to return because it is not supported" },
598 { 0x63, "Package->May have been corrupted due to reset" },
599 { 0x64, "Package->Unable to return due to a hardware failure" },
603 static const value_string status_vals[] _U_ = {
604 { 0x00, "Unsatisfied, can't complete" },
605 { 0x01, "Discovery in process" },
606 { 0x02, "Satisfied, Discovery complete" },
607 { 0x10, "Satisfied, Discovery complete" },
608 { 0x20, "Discovery in process" },
609 { 0x40, "Satisfied, Discovery complete" },
610 { 0x50, "BUG Satisfied, Discovery complete" },
611 { 0x80, "Discovery in process" },
616 static const value_string branch_vals[] = {
619 { 6, "nameBinding" },
624 static const value_string parser_vals[] = {
625 { 0, "Forward non-OAMPDUs to higher sublayer" },
626 { 1, "Loopback non-OAMPDUs to the lower sublayer" },
627 { 2, "Discarding non-OAMPDUs" },
632 static const true_false_string mux = {
633 "Discard non-OAMPDUs",
634 "Forward non-OAMPDUs to lower sublayer"
637 static const true_false_string oam_mode = {
638 "DTE configured in Active mode",
639 "DTE configured in Passive mode"
642 static const true_false_string oam_uni = {
643 "DTE is capable of sending OAMPDUs when rcv path is down",
644 "DTE is not capable of sending OAMPDUs when rcv path is down"
647 static const true_false_string oam_lpbk = {
648 "DTE is capable of OAM remote loopback mode",
649 "DTE is not capable of OAM remote loopback mode"
652 static const true_false_string oam_event = {
653 "DTE supports interpreting Link Events",
654 "DTE does not support interpreting Link Events"
657 static const true_false_string oam_var = {
658 "DTE supports sending Variable Response",
659 "DTE does not support sending Variable Response"
665 #define ITU_OUI_0 0x00
666 #define ITU_OUI_1 0x19
667 #define ITU_OUI_2 0xa7
669 #define ESMC_ITU_SUBTYPE 0x0001
670 #define ESMC_VERSION_1 0x01
671 #define ESMC_QL_TLV_TYPE 0x01
672 #define ESMC_QL_TLV_LENGTH 0x04
673 #define ESMC_TIMESTAMP_TLV_TYPE 0x02
674 #define ESMC_TIMESTAMP_TLV_LENGTH 0x08
676 static const value_string esmc_event_flag_vals[] = {
677 { 0, "Information ESMC PDU" },
678 { 1, "Time-critical Event ESMC PDU" },
682 static const value_string esmc_tlv_type_vals[] = {
683 { 1, "Quality Level" },
688 static const value_string esmc_timestamp_valid_flag_vals[] = {
689 { 0, "Not set. Do not use Timestamp value even if Timestamp TLV present" },
690 { 1, "Set. Timestamp TLV Present" },
694 /* G.781 5.5.1.1 Option I SDH (same in G.707) */
695 static const value_string esmc_quality_level_opt_1_vals[] = {
696 { 2, "QL-PRC, Primary reference clock (G.811)" },
697 { 4, "QL-SSU-A, Type I or V SSU clock (G.812), 'transit node clock'" },
698 { 8, "QL-SSU-B, Type VI SSU clock (G.812), 'local node clock'" },
699 { 11, "QL-SEC, SEC clock (G.813, Option I) or QL-EEC1 (G.8262)" },
700 { 15, "QL-DNU, 'Do Not Use'" },
704 static const value_string esmc_quality_level_opt_1_vals_short[] = {
713 #if 0 /*not used yet*/
714 /* G.781 5.5.1.2 Option II SDH synchronization networking */
715 static const value_string esmc_quality_level_opt_2_vals[] = {
716 { 0, "QL-STU, unknown - signal does not carry the QL message of the source" },
717 { 1, "QL-PRS, PRS clock (G.811) / ST1, Stratum 1 Traceable" },
718 { 4, "QL-TNC, Transit Node Clock (G.812, Type V)" },
719 { 7, "QL-ST2, Stratum 2 clock (G.812, Type II)" },
720 { 10, "QL-ST3, Stratum 3 clock (G.812, Type IV) or QL-EEC2 (G.8262)" },
721 { 12, "QL-SMC, SONET self timed clock (G.813, Option II) / SMC 20 ppm Clock Traceable" },
722 { 13, "QL-ST3E, Stratum 3E clock (G.812, Type III)" },
723 { 14, "QL-PROV, provisionable by the network operator / Reserved for Network Synchronization" },
724 { 15, "QL-DUS, shall not be used for synchronization" },
728 static const value_string esmc_quality_level_opt_2_short[] = {
742 static const value_string esmc_quality_level_invalid_vals[] = {
762 /* Initialise the protocol and registered fields */
763 static int proto_slow = -1;
765 static int hf_slow_subtype = -1;
767 static int hf_lacpdu_version_number = -1;
768 static int hf_lacpdu_actor_type = -1;
769 static int hf_lacpdu_actor_info_len = -1;
770 static int hf_lacpdu_actor_sys_priority = -1;
771 static int hf_lacpdu_actor_sys = -1;
772 static int hf_lacpdu_actor_key = -1;
773 static int hf_lacpdu_actor_port_priority = -1;
774 static int hf_lacpdu_actor_port = -1;
775 static int hf_lacpdu_actor_state = -1;
776 static int hf_lacpdu_flags_a_activity = -1;
777 static int hf_lacpdu_flags_a_timeout = -1;
778 static int hf_lacpdu_flags_a_aggregation = -1;
779 static int hf_lacpdu_flags_a_sync = -1;
780 static int hf_lacpdu_flags_a_collecting = -1;
781 static int hf_lacpdu_flags_a_distrib = -1;
782 static int hf_lacpdu_flags_a_defaulted = -1;
783 static int hf_lacpdu_flags_a_expired = -1;
784 static int hf_lacpdu_actor_reserved = -1;
786 static int hf_lacpdu_partner_type = -1;
787 static int hf_lacpdu_partner_info_len = -1;
788 static int hf_lacpdu_partner_sys_priority = -1;
789 static int hf_lacpdu_partner_sys = -1;
790 static int hf_lacpdu_partner_key = -1;
791 static int hf_lacpdu_partner_port_priority = -1;
792 static int hf_lacpdu_partner_port = -1;
793 static int hf_lacpdu_partner_state = -1;
794 static int hf_lacpdu_flags_p_activity = -1;
795 static int hf_lacpdu_flags_p_timeout = -1;
796 static int hf_lacpdu_flags_p_aggregation = -1;
797 static int hf_lacpdu_flags_p_sync = -1;
798 static int hf_lacpdu_flags_p_collecting = -1;
799 static int hf_lacpdu_flags_p_distrib = -1;
800 static int hf_lacpdu_flags_p_defaulted = -1;
801 static int hf_lacpdu_flags_p_expired = -1;
802 static int hf_lacpdu_partner_reserved = -1;
804 static int hf_lacpdu_coll_type = -1;
805 static int hf_lacpdu_coll_info_len = -1;
806 static int hf_lacpdu_coll_max_delay = -1;
807 static int hf_lacpdu_coll_reserved = -1;
809 static int hf_lacpdu_term_type = -1;
810 static int hf_lacpdu_term_len = -1;
811 static int hf_lacpdu_term_reserved = -1;
814 static int hf_ossp_oui = -1;
815 static int hf_itu_subtype = -1;
816 static int hf_esmc_version = -1;
817 static int hf_esmc_event_flag = -1;
818 static int hf_esmc_timestamp_valid_flag = -1;
819 static int hf_esmc_reserved_32 = -1;
820 static int hf_esmc_tlv = -1;
821 static int hf_esmc_tlv_type = -1;
822 static int hf_esmc_tlv_length = -1;
823 static int hf_esmc_tlv_ql_unused = -1;
824 static int hf_esmc_tlv_ts_reserved = -1;
825 static int hf_esmc_quality_level_opt_1 = -1;
826 #if 0 /*not used yet*/
827 static int hf_esmc_quality_level_opt_2 = -1;
829 static int hf_esmc_quality_level_invalid = -1;
830 static int hf_esmc_timestamp = -1;
831 static int hf_esmc_padding = -1;
834 * The Timestamp TLV and Timestamp Valid Flag fields
835 * are proposed in WD56 document for G.8264.
836 * WD56 is not accepted at this moment (June 2009).
838 * The following variable controls dissection of Timestamp fields.
839 * Implementation is not fully complete yet -- in this version
840 * Timestamp dissection is always enabled.
842 * I expect that when WD56 proposal for G.8264 will be accepted,
843 * ESMC Version would be used to control Timestamp dissection.
844 * In this case this variable will be eliminated (replaced).
846 * Until that, a preference which controls Timestamp
847 * dissection may be added, if such need arise.
848 * At the moment this is not practical as nobody needs this.
850 static gboolean pref_decode_esmc_timestamp = TRUE;
853 static int hf_marker_version_number = -1;
854 static int hf_marker_tlv_type = -1;
855 static int hf_marker_tlv_length = -1;
856 static int hf_marker_req_port = -1;
857 static int hf_marker_req_system = -1;
858 static int hf_marker_req_trans_id = -1;
861 static int hf_oampdu_flags = -1;
862 static int hf_oampdu_flags_link_fault = -1;
863 static int hf_oampdu_flags_dying_gasp = -1;
864 static int hf_oampdu_flags_critical_event = -1;
865 static int hf_oampdu_flags_local_evaluating = -1;
866 static int hf_oampdu_flags_local_stable = -1;
867 static int hf_oampdu_flags_remote_evaluating = -1;
868 static int hf_oampdu_flags_remote_stable = -1;
869 static int hf_oampdu_code = -1;
871 static int hf_oampdu_info_type = -1;
872 static int hf_oampdu_info_len = -1;
873 static int hf_oampdu_info_version = -1;
874 static int hf_oampdu_info_revision = -1;
875 static int hf_oampdu_info_state = -1;
876 static int hf_oampdu_info_oamConfig = -1;
877 static int hf_oampdu_info_oampduConfig = -1;
878 static int hf_oampdu_info_oui = -1;
879 static int hf_oampdu_info_vendor = -1;
881 static int hf_oampdu_info_state_parser = -1;
882 static int hf_oampdu_info_state_mux = -1;
884 static int hf_oampdu_info_oamConfig_mode = -1;
885 static int hf_oampdu_info_oamConfig_uni = -1;
886 static int hf_oampdu_info_oamConfig_lpbk = -1;
887 static int hf_oampdu_info_oamConfig_event = -1;
888 static int hf_oampdu_info_oamConfig_var = -1;
890 static int hf_oampdu_event_type = -1;
891 static int hf_oampdu_event_sequence = -1;
892 static int hf_oampdu_event_length = -1;
893 static int hf_oampdu_event_timeStamp = -1;
895 static int hf_oampdu_event_espeWindow = -1;
896 static int hf_oampdu_event_espeThreshold = -1;
897 static int hf_oampdu_event_espeErrors = -1;
898 static int hf_oampdu_event_espeTotalErrors = -1;
899 static int hf_oampdu_event_espeTotalEvents = -1;
901 static int hf_oampdu_event_efeWindow = -1;
902 static int hf_oampdu_event_efeThreshold = -1;
903 static int hf_oampdu_event_efeErrors = -1;
904 static int hf_oampdu_event_efeTotalErrors = -1;
905 static int hf_oampdu_event_efeTotalEvents = -1;
907 static int hf_oampdu_event_efpeWindow = -1;
908 static int hf_oampdu_event_efpeThreshold = -1;
909 static int hf_oampdu_event_efpeErrors = -1;
910 static int hf_oampdu_event_efpeTotalErrors = -1;
911 static int hf_oampdu_event_efpeTotalEvents = -1;
913 static int hf_oampdu_event_efsseWindow = -1;
914 static int hf_oampdu_event_efsseThreshold = -1;
915 static int hf_oampdu_event_efsseErrors = -1;
916 static int hf_oampdu_event_efsseTotalErrors = -1;
917 static int hf_oampdu_event_efsseTotalEvents = -1;
919 static int hf_oampdu_variable_branch = -1;
920 static int hf_oampdu_variable_object = -1;
921 static int hf_oampdu_variable_package = -1;
922 static int hf_oampdu_variable_binding = -1;
923 static int hf_oampdu_variable_attribute = -1;
924 static int hf_oampdu_variable_width = -1;
925 static int hf_oampdu_variable_indication = -1;
926 static int hf_oampdu_variable_value = -1;
928 static int hf_oampdu_lpbk = -1;
929 static int hf_oampdu_lpbk_enable = -1;
930 static int hf_oampdu_lpbk_disable = -1;
933 /* Initialise the subtree pointers */
935 static gint ett_pdu = -1;
937 static gint ett_lacpdu = -1;
938 static gint ett_lacpdu_a_flags = -1;
939 static gint ett_lacpdu_p_flags = -1;
941 static gint ett_marker = -1;
942 static gint ett_esmc = -1;
944 static gint ett_oampdu = -1;
945 static gint ett_oampdu_flags = -1;
947 static gint ett_oampdu_local_info = -1;
948 static gint ett_oampdu_local_info_state = -1;
949 static gint ett_oampdu_local_info_config = -1;
950 static gint ett_oampdu_remote_info = -1;
951 static gint ett_oampdu_remote_info_state = -1;
952 static gint ett_oampdu_remote_info_config = -1;
953 static gint ett_oampdu_org_info = -1;
955 static gint ett_oampdu_event_espe = -1;
956 static gint ett_oampdu_event_efe = -1;
957 static gint ett_oampdu_event_efpe = -1;
958 static gint ett_oampdu_event_efsse = -1;
959 static gint ett_oampdu_event_ose = -1;
961 static gint ett_oampdu_lpbk_ctrl = -1;
963 static gint ett_ossppdu = -1;
964 static gint ett_itu_ossp = -1;
966 static const char initial_sep[] = " (";
967 static const char cont_sep[] = ", ";
969 static dissector_handle_t dh_data;
971 #define APPEND_BOOLEAN_FLAG(flag, item, string) \
974 proto_item_append_text(item, string, sep); \
979 #define APPEND_OUI_NAME(item, string, tvb, offset) \
981 string = tvb_get_manuf_name(tvb, offset); \
982 proto_item_append_text(item, " ("); \
983 proto_item_append_text(item, "%s", string); \
984 proto_item_append_text(item, ")"); \
988 dissect_lacp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
991 dissect_marker_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
994 dissect_ossp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
997 dissect_oampdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1000 dissect_oampdu_information(tvbuff_t *tvb, proto_tree *tree);
1003 dissect_oampdu_event_notification(tvbuff_t *tvb, proto_tree *tree);
1006 dissect_oampdu_variable_request(tvbuff_t *tvb, proto_tree *tree);
1009 dissect_oampdu_variable_response(tvbuff_t *tvb, proto_tree *tree);
1012 dissect_oampdu_loopback_control(tvbuff_t *tvb, proto_tree *tree);
1015 dissect_oampdu_vendor_specific(tvbuff_t *tvb, proto_tree *tree);
1018 dissect_esmc_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *treex);
1021 dissect_itu_ossp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
1024 * Name: dissect_slow_protocols
1027 * This function is used to dissect the slow protocols define in IEEE802.3
1028 * CSMA/CD. The current slow protocols subtype are define in ANNEX 43B of
1029 * the 802.3 document. In case of an unsupported slow protocols, we only
1030 * fill the protocol and info columns.
1033 * tvb: buffer associate with the rcv packet (see tvbuff.h).
1034 * pinfo: structure associate with the rcv packet (see packet_info.h).
1035 * tree: the protocol tree associate with the rcv packet (see proto.h).
1041 * Dominique Bastien (dbastien@accedian.com)
1042 * + add support for OAM slow protocol (defined in clause 57).
1043 * + add support for Marker slow protocol (defined in clause 43).
1044 * Artem Tamazov (artem.tamazov@telllabs.com)
1045 * + add support for ESMC (Ethernet Synchronization Messaging Channel),
1046 * G.8264/Y.1364 clause 11).
1049 dissect_slow_protocols(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1052 proto_tree *pdu_tree;
1053 proto_item *pdu_item;
1055 subtype = tvb_get_guint8(tvb, 0);
1060 dissect_lacp_pdu(tvb, pinfo, tree);
1062 case MARKER_SUBTYPE:
1063 dissect_marker_pdu(tvb, pinfo, tree);
1066 dissect_oampdu(tvb, pinfo, tree);
1069 dissect_ossp_pdu(tvb, pinfo, tree);
1073 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Slow Protocols");
1074 col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown Subtype = %u.", subtype);
1078 pdu_item = proto_tree_add_item(tree, proto_slow, tvb,
1080 pdu_tree = proto_item_add_subtree(pdu_item, ett_pdu);
1083 proto_tree_add_item(pdu_tree, hf_slow_subtype, tvb,
1093 * Name: dissect_lacp_pdu
1096 * This function is used to dissect the Link Aggregation Control Protocol
1097 * slow protocols define in IEEE802.3 clause 43.3.
1100 * tvb: buffer associate with the rcv packet (see tvbuff.h).
1101 * pinfo: structure associate with the rcv packet (see packet_info.h).
1102 * tree: the protocol tree associate with the rcv packet (see proto.h).
1104 * Return Values: None
1109 dissect_lacp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1116 proto_tree *lacpdu_tree;
1117 proto_item *lacpdu_item;
1118 proto_tree *actor_flags_tree;
1119 proto_item *actor_flags_item;
1120 proto_tree *partner_flags_tree;
1121 proto_item *partner_flags_item;
1126 col_set_str(pinfo->cinfo, COL_PROTOCOL, "LACP");
1127 col_set_str(pinfo->cinfo, COL_INFO, "Link Aggregation Control Protocol");
1131 /* Add LACP Heading */
1132 lacpdu_item = proto_tree_add_protocol_format(tree, proto_slow, tvb,
1133 0, -1, "Link Aggregation Control Protocol");
1134 lacpdu_tree = proto_item_add_subtree(lacpdu_item, ett_lacpdu);
1137 proto_tree_add_item(lacpdu_tree, hf_slow_subtype, tvb,
1140 /* Version Number */
1141 raw_octet = tvb_get_guint8(tvb, LACPDU_VERSION_NUMBER);
1142 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_version_number, tvb,
1143 LACPDU_VERSION_NUMBER, 1, raw_octet);
1145 col_append_fstr(pinfo->cinfo, COL_INFO, "Version %d. ", raw_octet);
1148 raw_octet = tvb_get_guint8(tvb, LACPDU_ACTOR_TYPE);
1149 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_actor_type, tvb,
1150 LACPDU_ACTOR_TYPE, 1, raw_octet);
1152 /* Actor Info Length */
1153 raw_octet = tvb_get_guint8(tvb, LACPDU_ACTOR_INFO_LEN);
1154 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_actor_info_len, tvb,
1155 LACPDU_ACTOR_INFO_LEN, 1, raw_octet);
1157 /* Actor System Priority */
1159 raw_word = tvb_get_ntohs(tvb, LACPDU_ACTOR_SYS_PRIORITY);
1160 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_actor_sys_priority, tvb,
1161 LACPDU_ACTOR_SYS_PRIORITY, 2, raw_word);
1164 proto_tree_add_item(lacpdu_tree, hf_lacpdu_actor_sys, tvb,
1165 LACPDU_ACTOR_SYSTEM, 6, ENC_NA);
1169 raw_word = tvb_get_ntohs(tvb, LACPDU_ACTOR_KEY);
1170 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_actor_key, tvb,
1171 LACPDU_ACTOR_KEY, 2, raw_word);
1173 /* Actor Port Priority */
1175 raw_word = tvb_get_ntohs(tvb, LACPDU_ACTOR_PORT_PRIORITY);
1176 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_actor_port_priority, tvb,
1177 LACPDU_ACTOR_PORT_PRIORITY, 2, raw_word);
1181 raw_word = tvb_get_ntohs(tvb, LACPDU_ACTOR_PORT);
1182 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_actor_port, tvb,
1183 LACPDU_ACTOR_PORT, 2, raw_word);
1185 col_append_fstr(pinfo->cinfo, COL_INFO, "Actor Port = %d ", raw_word);
1189 flags = tvb_get_guint8(tvb, LACPDU_ACTOR_STATE);
1190 actor_flags_item = proto_tree_add_uint(lacpdu_tree, hf_lacpdu_actor_state, tvb,
1191 LACPDU_ACTOR_STATE, 1, flags);
1192 actor_flags_tree = proto_item_add_subtree(actor_flags_item, ett_lacpdu_a_flags);
1198 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_ACTIVITY, actor_flags_item,
1200 proto_tree_add_boolean(actor_flags_tree, hf_lacpdu_flags_a_activity, tvb,
1201 LACPDU_ACTOR_STATE, 1, flags);
1205 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_TIMEOUT, actor_flags_item,
1207 proto_tree_add_boolean(actor_flags_tree, hf_lacpdu_flags_a_timeout, tvb,
1208 LACPDU_ACTOR_STATE, 1, flags);
1210 /* Aggregation Flag */
1212 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_AGGREGATION, actor_flags_item,
1214 proto_tree_add_boolean(actor_flags_tree, hf_lacpdu_flags_a_aggregation, tvb,
1215 LACPDU_ACTOR_STATE, 1, flags);
1217 /* Synchronization Flag */
1219 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_SYNC, actor_flags_item,
1220 "%sSynchronization");
1221 proto_tree_add_boolean(actor_flags_tree, hf_lacpdu_flags_a_sync, tvb,
1222 LACPDU_ACTOR_STATE, 1, flags);
1224 /* Collecting Flag */
1226 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_COLLECTING, actor_flags_item,
1228 proto_tree_add_boolean(actor_flags_tree, hf_lacpdu_flags_a_collecting, tvb,
1229 LACPDU_ACTOR_STATE, 1, flags);
1232 /* Distributing Flag */
1234 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DISTRIB, actor_flags_item,
1236 proto_tree_add_boolean(actor_flags_tree, hf_lacpdu_flags_a_distrib, tvb,
1237 LACPDU_ACTOR_STATE, 1, flags);
1239 /* Defaulted Flag */
1241 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DEFAULTED, actor_flags_item,
1243 proto_tree_add_boolean(actor_flags_tree, hf_lacpdu_flags_a_defaulted, tvb,
1244 LACPDU_ACTOR_STATE, 1, flags);
1248 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_EXPIRED, actor_flags_item,
1250 proto_tree_add_boolean(actor_flags_tree, hf_lacpdu_flags_a_expired, tvb,
1251 LACPDU_ACTOR_STATE, 1, flags);
1253 if (sep != initial_sep)
1255 /* We put something in; put in the terminating ")" */
1256 proto_item_append_text(actor_flags_item, ")");
1259 /* Actor Reserved */
1261 proto_tree_add_item(lacpdu_tree, hf_lacpdu_actor_reserved, tvb,
1262 LACPDU_ACTOR_RESERVED, 3, ENC_NA);
1266 raw_octet = tvb_get_guint8(tvb, LACPDU_PARTNER_TYPE);
1267 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_partner_type, tvb,
1268 LACPDU_PARTNER_TYPE, 1, raw_octet);
1270 /* Partner Info Length */
1271 raw_octet = tvb_get_guint8(tvb, LACPDU_PARTNER_INFO_LEN);
1272 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_partner_info_len, tvb,
1273 LACPDU_PARTNER_INFO_LEN, 1, raw_octet);
1275 /* Partner System Priority */
1277 raw_word = tvb_get_ntohs(tvb, LACPDU_PARTNER_SYS_PRIORITY);
1278 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_partner_sys_priority, tvb,
1279 LACPDU_PARTNER_SYS_PRIORITY, 2, raw_word);
1281 /* Partner System */
1283 proto_tree_add_item(lacpdu_tree, hf_lacpdu_partner_sys, tvb,
1284 LACPDU_PARTNER_SYSTEM, 6, ENC_NA);
1288 raw_word = tvb_get_ntohs(tvb, LACPDU_PARTNER_KEY);
1289 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_partner_key, tvb,
1290 LACPDU_PARTNER_KEY, 2, raw_word);
1292 /* Partner Port Priority */
1294 raw_word = tvb_get_ntohs(tvb, LACPDU_PARTNER_PORT_PRIORITY);
1295 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_partner_port_priority, tvb,
1296 LACPDU_PARTNER_PORT_PRIORITY, 2, raw_word);
1300 raw_word = tvb_get_ntohs(tvb, LACPDU_PARTNER_PORT);
1301 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_partner_port, tvb,
1302 LACPDU_PARTNER_PORT, 2, raw_word);
1304 col_append_fstr(pinfo->cinfo, COL_INFO, "Partner Port = %d ", raw_word);
1308 flags = tvb_get_guint8(tvb, LACPDU_PARTNER_STATE);
1309 partner_flags_item = proto_tree_add_uint(lacpdu_tree, hf_lacpdu_partner_state, tvb,
1310 LACPDU_PARTNER_STATE, 1, flags);
1311 partner_flags_tree = proto_item_add_subtree(partner_flags_item, ett_lacpdu_p_flags);
1317 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_ACTIVITY, partner_flags_item,
1319 proto_tree_add_boolean(partner_flags_tree, hf_lacpdu_flags_p_activity, tvb,
1320 LACPDU_PARTNER_STATE, 1, flags);
1324 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_TIMEOUT, partner_flags_item,
1326 proto_tree_add_boolean(partner_flags_tree, hf_lacpdu_flags_p_timeout, tvb,
1327 LACPDU_PARTNER_STATE, 1, flags);
1329 /* Aggregation Flag */
1331 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_AGGREGATION, partner_flags_item,
1333 proto_tree_add_boolean(partner_flags_tree, hf_lacpdu_flags_p_aggregation, tvb,
1334 LACPDU_PARTNER_STATE, 1, flags);
1336 /* Synchronization Flag */
1338 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_SYNC, partner_flags_item,
1339 "%sSynchronization");
1340 proto_tree_add_boolean(partner_flags_tree, hf_lacpdu_flags_p_sync, tvb,
1341 LACPDU_PARTNER_STATE, 1, flags);
1343 /* Collecting Flag */
1345 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_COLLECTING, partner_flags_item,
1347 proto_tree_add_boolean(partner_flags_tree, hf_lacpdu_flags_p_collecting, tvb,
1348 LACPDU_PARTNER_STATE, 1, flags);
1351 /* Distributing Flag */
1353 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DISTRIB, partner_flags_item,
1355 proto_tree_add_boolean(partner_flags_tree, hf_lacpdu_flags_p_distrib, tvb,
1356 LACPDU_PARTNER_STATE, 1, flags);
1358 /* Defaulted Flag */
1360 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DEFAULTED, partner_flags_item,
1362 proto_tree_add_boolean(partner_flags_tree, hf_lacpdu_flags_p_defaulted, tvb,
1363 LACPDU_PARTNER_STATE, 1, flags);
1367 APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_EXPIRED, partner_flags_item,
1369 proto_tree_add_boolean(partner_flags_tree, hf_lacpdu_flags_p_expired, tvb,
1370 LACPDU_PARTNER_STATE, 1, flags);
1372 if (sep != initial_sep)
1374 /* We put something in; put in the terminating ")" */
1375 proto_item_append_text(partner_flags_item, ")");
1378 /* Partner Reserved */
1380 proto_tree_add_item(lacpdu_tree, hf_lacpdu_partner_reserved, tvb,
1381 LACPDU_PARTNER_RESERVED, 3, ENC_NA);
1384 /* Collector Type */
1385 raw_octet = tvb_get_guint8(tvb, LACPDU_COLL_TYPE);
1386 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_coll_type, tvb,
1387 LACPDU_COLL_TYPE, 1, raw_octet);
1389 /* Collector Info Length */
1390 raw_octet = tvb_get_guint8(tvb, LACPDU_COLL_INFO_LEN);
1391 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_coll_info_len, tvb,
1392 LACPDU_COLL_INFO_LEN, 1, raw_octet);
1394 /* Collector Max Delay */
1396 raw_word = tvb_get_ntohs(tvb, LACPDU_COLL_MAX_DELAY);
1397 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_coll_max_delay, tvb,
1398 LACPDU_COLL_MAX_DELAY, 2, raw_word);
1400 /* Collector Reserved */
1402 proto_tree_add_item(lacpdu_tree, hf_lacpdu_coll_reserved, tvb,
1403 LACPDU_COLL_RESERVED, 12, ENC_NA);
1405 /* Terminator Type */
1406 raw_octet = tvb_get_guint8(tvb, LACPDU_TERM_TYPE);
1407 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_term_type, tvb,
1408 LACPDU_TERM_TYPE, 1, raw_octet);
1410 /* Terminator Info Length */
1411 raw_octet = tvb_get_guint8(tvb, LACPDU_TERM_LEN);
1412 proto_tree_add_uint(lacpdu_tree, hf_lacpdu_term_len, tvb,
1413 LACPDU_TERM_LEN, 1, raw_octet);
1415 /* Terminator Reserved */
1417 proto_tree_add_item(lacpdu_tree, hf_lacpdu_term_reserved, tvb,
1418 LACPDU_TERM_RESERVED, 50, ENC_NA);
1423 * Name: dissect_marker_pdu
1426 * This function is used to dissect the Link Aggregation Marker Protocol
1427 * slow protocols define in IEEE802.3 clause 43.5 (The PDUs are define
1428 * in section 43.5.3.2). The TLV type are, 0x01 for a marker TLV and 0x02
1429 * for a marker response. A value of 0x00 indicate an end of message.
1432 * tvb: buffer associate with the rcv packet (see tvbuff.h).
1433 * pinfo: structure associate with the rcv packet (see packet_info.h).
1434 * tree: the protocol tree associate with the rcv packet (see proto.h).
1436 * Return Values: None
1439 * Dominique Bastien (dbastien@accedian.com)
1440 * + add support for MARKER and MARKER Response PDUs.
1443 dissect_marker_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1450 proto_tree *marker_tree;
1451 proto_item *marker_item;
1454 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MARKER");
1455 col_set_str(pinfo->cinfo, COL_INFO, "Marker Protocol");
1459 marker_item = proto_tree_add_protocol_format(tree, proto_slow, tvb,
1460 0, -1, "Marker Protocol");
1461 marker_tree = proto_item_add_subtree(marker_item, ett_marker);
1464 proto_tree_add_item(marker_tree, hf_slow_subtype, tvb,
1469 /* Version Number */
1470 raw_octet = tvb_get_guint8(tvb, offset);
1471 proto_tree_add_uint(marker_tree, hf_marker_version_number, tvb,
1472 offset, 1, raw_octet);
1479 raw_octet = tvb_get_guint8(tvb, offset);
1481 if (raw_octet==0) break;
1483 proto_tree_add_uint(marker_tree, hf_marker_tlv_type, tvb,
1484 offset, 1, raw_octet);
1489 raw_octet = tvb_get_guint8(tvb, offset);
1490 proto_tree_add_uint(marker_tree, hf_marker_tlv_length, tvb,
1491 offset, 1, raw_octet);
1494 /* Requester Port */
1495 raw_word = tvb_get_ntohs(tvb, offset);
1496 proto_tree_add_uint(marker_tree, hf_marker_req_port, tvb,
1497 offset, 2, raw_word);
1500 /* Requester System */
1501 proto_tree_add_item(marker_tree, hf_marker_req_system, tvb,
1505 /* Requester Transaction ID */
1506 dword = tvb_get_ntohl(tvb, offset);
1507 proto_tree_add_uint(marker_tree, hf_marker_req_trans_id, tvb,
1518 * Name: dissect_ossp_pdu
1521 * This function is used to dissect the Organization Specific Slow
1522 * Protocol defined in IEEE 802.3 Annex 57B. Currently only the ESMC
1523 * slow protocol as defined in ITU-T G.8264 is implemented
1526 * tvb: buffer associate with the rcv packet (see tvbuff.h).
1527 * pinfo: structure associate with the rcv packet (see packet_info.h).
1528 * tree: the protocol tree associate with the rcv packet (see proto.h).
1530 * Return Values: None
1533 * Roberto Morro (roberto.morro[AT]tilab.com)
1536 dissect_ossp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1540 proto_item *oui_item, *ossp_item;
1541 proto_tree *ossp_tree;
1543 const guint8 itu_oui[] = {ITU_OUI_0, ITU_OUI_1, ITU_OUI_2};
1545 /* OUI of the organization defining the protocol */
1546 str = tvb_get_manuf_name(tvb, offset+1);
1548 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OSSP");
1549 col_add_fstr(pinfo->cinfo, COL_INFO, "OUI: %s", str);
1551 ossp_item = proto_tree_add_protocol_format(tree, proto_slow, tvb, 0, -1,
1552 "Organization Specific Slow Protocol");
1553 ossp_tree = proto_item_add_subtree(ossp_item, ett_ossppdu);
1555 /* Slow Protocol Subtype */
1556 proto_tree_add_item(ossp_tree, hf_slow_subtype, tvb, offset, 1, FALSE);
1559 oui_item = proto_tree_add_item(ossp_tree, hf_ossp_oui,
1560 tvb, offset, OUI_SIZE, ENC_NA);
1561 proto_item_append_text(oui_item, " (%s)", str);
1564 ossp_tvb = tvb_new_subset(tvb, offset, -1, -1);
1565 if (tvb_memeql(tvb, 1, itu_oui, OUI_SIZE) == 0)
1567 dissect_itu_ossp(ossp_tvb, pinfo, ossp_tree);
1569 /* new Organization Specific Slow Protocols go hereafter
1571 * else if (tvb_memeql(tvb, 1, xxx_oui, OUI_SIZE) == 0)
1573 * dissect_xxx_ossp(ossp_tvb, pinfo, ossp_tree);
1575 * else if (tvb_memeql(tvb, 1, yyy_oui, OUI_SIZE) == 0)
1577 * dissect_yyy_ossp(ossp_tvb, pinfo, ossp_tree);
1582 proto_item_append_text(oui_item, " (Unknown OSSP organization)");
1588 * Name: dissect_itu_ossp
1591 * This function is used to dissect the ITU-T OSSP (Organization Specific
1592 * Slow Protocol). Currently only the Ethernet Synchronization
1593 * Messaging Channel (ESMC) slow protocol as defined in ITU-T G.8264
1597 * tvb: buffer associate with the rcv packet (see tvbuff.h).
1598 * pinfo: structure associate with the rcv packet (see packet_info.h).
1599 * tree: the protocol tree associate with the rcv packet (see proto.h).
1600 * subtype: the protocol subtype (according to IEEE802.3 annex 57B)
1602 * Return Values: None
1605 * Roberto Morro (roberto.morro[AT]tilab.com)
1609 dissect_itu_ossp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1612 proto_tree *itu_ossp_tree, *ti;
1614 /* ITU-T OSSP Subtype */
1615 subtype = tvb_get_ntohs(tvb, 0);
1616 ti = proto_tree_add_item(tree, hf_itu_subtype, tvb, 0, 2, FALSE);
1618 itu_ossp_tree = proto_item_add_subtree(ti, ett_itu_ossp);
1622 case ESMC_ITU_SUBTYPE:
1623 dissect_esmc_pdu(tvb, pinfo, itu_ossp_tree);
1626 /* Other ITU-T defined slow protocols go hereafter
1628 * case XXXX_ITU_SUBTYPE:
1629 * dissect_xxxx_pdu(tvb, pinfo, itu_ossp_tree);
1633 proto_item_append_text(itu_ossp_tree, " (Unknown)");
1638 * This function is used to dissect ESMC PDU defined G.8264/Y.1364 clause 11.3.1.1.
1640 * Added: TimeStamp TLV as per WD56 proposal for G.8264,
1641 * "TLVs for ESMC and Querying Capability".
1644 dissect_esmc_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *treex)
1646 gint offset = 2; /*starting from ESMC Version */
1647 gboolean event_flag;
1648 gboolean malformed = FALSE;
1649 gint ql = -1; /*negative means unknown:*/
1650 gboolean timestamp_valid_flag = FALSE; /*set if timestamp valid*/
1651 gint32 timestamp = -1; /*nanoseconds*/
1653 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ESMC");
1655 proto_item_append_text(treex, ": ESMC");
1658 tree_a = proto_item_add_subtree(treex, ett_esmc);
1662 item_b = proto_tree_add_item(tree_a, hf_esmc_version, tvb, offset, 1, FALSE);
1663 if ((tvb_get_guint8(tvb, offset) >> 4) != ESMC_VERSION_1)
1666 expert_add_info_format(pinfo, item_b, PI_MALFORMED, PI_ERROR
1667 ,"Version must be 0x%.1x claim compliance with Version 1 of this protocol"
1670 /*stay at the same octet in tvb*/
1673 event_flag = ((tvb_get_guint8(tvb, offset) & 0x08) != 0);
1674 proto_tree_add_item(tree_a, hf_esmc_event_flag, tvb, offset, 1, FALSE);
1675 /*stay at the same octet in tvb*/
1677 if (pref_decode_esmc_timestamp)
1678 { /* timestamp valid flag */
1679 timestamp_valid_flag = ((tvb_get_guint8(tvb, offset) & 0x04) != 0);
1680 proto_tree_add_item(tree_a, hf_esmc_timestamp_valid_flag, tvb, offset, 1, FALSE);
1681 /*stay at the same octet in tvb*/
1683 { /* reserved bits */
1686 reserved = tvb_get_ntohl(tvb, offset)
1687 & (pref_decode_esmc_timestamp ? 0x3ffffff : 0x7ffffff);
1688 item_b = proto_tree_add_uint_format_value(tree_a, hf_esmc_reserved_32, tvb, offset, 4
1689 , reserved, "0x%.7x", reserved);
1690 if (reserved != 0x0)
1693 expert_add_info_format(pinfo, item_b, PI_MALFORMED, PI_WARN
1694 ,"Reserved bits must be set to all zero on transmitter");
1698 proto_item_append_text(treex, ", Event:%s", event_flag ?
1699 "Time-critical" : "Information");
1702 * Quality Level TLV is mandatory at fixed location.
1707 item_b = proto_tree_add_item(tree_a, hf_esmc_tlv, tvb, offset, 4, ENC_NA);
1710 tree_b = proto_item_add_subtree(item_b, ett_esmc);
1717 type = tvb_get_guint8(tvb, offset);
1718 item_c = proto_tree_add_item(tree_b, hf_esmc_tlv_type, tvb, offset, 1, FALSE);
1719 if (type != ESMC_QL_TLV_TYPE)
1722 expert_add_info_format(pinfo, item_c, PI_MALFORMED, PI_ERROR
1723 ,"TLV Type must be == 0x%.2x (QL) because QL TLV must be first in the ESMC PDU"
1725 expert_add_info_format(pinfo, item_c, PI_UNDECODED, PI_NOTE
1726 ,"Let's decode as if this is QL TLV");
1731 length = tvb_get_ntohs(tvb, offset);
1732 item_c = proto_tree_add_item(tree_b, hf_esmc_tlv_length, tvb, offset, 2, FALSE);
1733 if (length != ESMC_QL_TLV_LENGTH)
1736 expert_add_info_format(pinfo, item_c, PI_MALFORMED, PI_ERROR
1737 ,"QL TLV Length must be == 0x%.4x", ESMC_QL_TLV_LENGTH);
1738 expert_add_info_format(pinfo, item_c, PI_UNDECODED, PI_NOTE
1739 ,"Let's decode this TLV as if Length has valid value");
1744 unused = tvb_get_guint8(tvb, offset); /*as temp var*/
1747 item_c = proto_tree_add_item(tree_b, hf_esmc_tlv_ql_unused, tvb, offset, 1, FALSE);
1751 expert_add_info_format(pinfo, item_c, PI_MALFORMED, PI_WARN
1752 ,"Unused bits of TLV must be all zeroes");
1754 if (NULL != match_strval(ql, esmc_quality_level_opt_1_vals))
1756 proto_tree_add_item(tree_b, hf_esmc_quality_level_opt_1, tvb, offset, 1, FALSE);
1760 item_c = proto_tree_add_item(tree_b, hf_esmc_quality_level_invalid, tvb, offset, 1, FALSE);
1761 expert_add_info_format(pinfo, item_c, PI_UNDECODED, PI_WARN
1762 ,"Invalid SSM message, unknown QL code");
1767 proto_item_append_text(item_b, ", %s"
1768 , val_to_str(ql, esmc_quality_level_opt_1_vals_short, "QL-INV%d"));
1770 proto_item_append_text(treex, ", %s"
1771 , val_to_str(ql, esmc_quality_level_opt_1_vals_short, "QL-INV%d"));
1773 if (pref_decode_esmc_timestamp)
1776 * Timestamp TLV is optional at fixed location.
1777 * Decode it if Timestamp Valid flag is set,
1778 * or if type of next TLV is 0x02.
1781 type = tvb_get_guint8(tvb, offset);
1783 if (timestamp_valid_flag || type == ESMC_TIMESTAMP_TLV_TYPE)
1786 item_b = proto_tree_add_item(tree_a, hf_esmc_tlv, tvb, offset, 8, ENC_NA);
1789 tree_b = proto_item_add_subtree(item_b, ett_esmc);
1796 item_c = proto_tree_add_item(tree_b, hf_esmc_tlv_type, tvb, offset, 1, FALSE);
1797 if (type != ESMC_TIMESTAMP_TLV_TYPE)
1800 expert_add_info_format(pinfo, item_c, PI_MALFORMED, PI_ERROR
1801 ,"TLV Type must be == 0x%.2x (Timestamp) because Timestamp Valid Flag is set"
1802 ,ESMC_TIMESTAMP_TLV_TYPE);
1803 expert_add_info_format(pinfo, item_c, PI_UNDECODED, PI_NOTE
1804 ,"Let's decode as if this is Timestamp TLV");
1809 length = tvb_get_ntohs(tvb, offset);
1810 item_c = proto_tree_add_item(tree_b, hf_esmc_tlv_length, tvb, offset, 2, FALSE);
1811 if (length != ESMC_TIMESTAMP_TLV_LENGTH)
1814 expert_add_info_format(pinfo, item_c, PI_MALFORMED, PI_ERROR
1815 ,"Timestamp TLV Length must be == 0x%.4x"
1816 ,ESMC_TIMESTAMP_TLV_LENGTH);
1817 expert_add_info_format(pinfo, item_c, PI_UNDECODED, PI_NOTE
1818 ,"Let's decode this TLV as if Length has valid value");
1823 timestamp = (gint32)tvb_get_ntohl(tvb, offset);
1824 item_c = proto_tree_add_item(tree_b, hf_esmc_timestamp, tvb, offset, 4, FALSE);
1825 if (!timestamp_valid_flag) proto_item_append_text(item_c, " [invalid]");
1829 reserved = tvb_get_guint8(tvb, offset);
1830 item_c = proto_tree_add_item(tree_b, hf_esmc_tlv_ts_reserved, tvb, offset, 1, FALSE);
1831 if (reserved != 0x0)
1833 expert_add_info_format(pinfo, item_c, PI_UNDECODED, PI_WARN
1834 ,"Reserved bits must be set to all zero");
1839 proto_item_append_text(item_b, ", Timestamp: %d ns", timestamp);
1840 if (!timestamp_valid_flag) proto_item_append_text(item_b, " [invalid]");
1843 if (timestamp_valid_flag)
1845 proto_item_append_text(treex, ", Timestamp:%d", timestamp);
1851 padding_size = tvb_length_remaining(tvb, offset);
1852 if (0 != padding_size)
1855 tree_a = proto_item_add_subtree(treex, ett_esmc);
1859 tvb_next = tvb_new_subset(tvb, offset, padding_size, -1);
1860 item_b = proto_tree_add_item(tree_a, hf_esmc_padding, tvb_next, 0, -1, ENC_NA);
1861 proto_item_append_text(item_b, ", %d %s%s", padding_size
1862 , "octet", plurality(padding_size,"","s"));
1865 tree_b = proto_item_add_subtree(item_b, ett_esmc);
1866 call_dissector(dh_data, tvb_next, pinfo, tree_b);
1872 col_clear(pinfo->cinfo, COL_INFO);
1873 /* append summary info */
1874 col_append_fstr(pinfo->cinfo, COL_INFO, "Event:%s", event_flag ?
1875 "Time-critical" : "Information");
1878 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s"
1879 , val_to_str(ql, esmc_quality_level_opt_1_vals_short, "QL-INVALID-%d"));
1881 if (timestamp_valid_flag)
1883 col_append_fstr(pinfo->cinfo, COL_INFO, ", TS:%d", timestamp);
1887 col_append_str(pinfo->cinfo, COL_INFO, ", Malformed PDU");
1892 * Name: dissect_oampdu
1895 * This function is used to dissect the Operation, Administration, and
1896 * Maintenance slow protocol define in IEEE802.3 clause 57 (The OAMPDUs
1897 * common part is define in section 57.4).
1899 * Only the 6 folowing code are currently define in the 2004 version of this
1901 * OAMPDU_INFORMATION: 0x0
1902 * OAMPDU_EVENT_NOTIFICATION: 0x1
1903 * OAMPDU_VAR_REQUEST: 0x2
1904 * OAMPDU_VAR_RESPONSE: 0x3
1905 * OAMPDU_LOOPBACK_CTRL: 0x4
1906 * OAMPDU_VENDOR_SPECIFIC: 0xFE
1909 * tvb: buffer associate with the rcv packet (see tvbuff.h).
1910 * pinfo: structure associate with the rcv packet (see packet_info.h).
1911 * tree: the protocol tree associate with the rcv packet (see proto.h).
1913 * Return Values: None
1916 * Dominique Bastien (dbastien@accedian.com)
1917 * + add support for 802.3ah-2004.
1920 dissect_oampdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1923 guint16 flags,state;
1926 proto_tree *oampdu_tree;
1927 proto_item *oampdu_item;
1928 proto_tree *flags_tree;
1929 proto_item *flags_item;
1931 const char *sep = initial_sep;
1933 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OAM");
1935 oampdu_code = tvb_get_guint8(tvb, OAMPDU_CODE);
1937 switch (oampdu_code)
1939 case OAMPDU_INFORMATION:
1940 col_set_str(pinfo->cinfo, COL_INFO, "OAMPDU: Information");
1942 case OAMPDU_EVENT_NOTIFICATION:
1943 col_set_str(pinfo->cinfo, COL_INFO, "OAMPDU: Event Notification");
1945 case OAMPDU_VAR_REQUEST:
1946 col_set_str(pinfo->cinfo, COL_INFO, "OAMPDU: Variable Request");
1948 case OAMPDU_VAR_RESPONSE:
1949 col_set_str(pinfo->cinfo, COL_INFO, "OAMPDU: Variable Response");
1951 case OAMPDU_LOOPBACK_CTRL:
1952 col_set_str(pinfo->cinfo, COL_INFO, "OAMPDU: Loopback Control");
1954 case OAMPDU_VENDOR_SPECIFIC:
1955 col_set_str(pinfo->cinfo, COL_INFO, "OAMPDU: Organization Specific");
1958 col_set_str(pinfo->cinfo, COL_INFO, "OAMPDU reserved");
1965 /* Add OAM Heading */
1966 oampdu_item = proto_tree_add_protocol_format(tree, proto_slow, tvb,
1967 0, -1, "OAM Protocol");
1968 oampdu_tree = proto_item_add_subtree(oampdu_item, ett_oampdu);
1971 proto_tree_add_item(oampdu_tree, hf_slow_subtype, tvb,
1975 flags = tvb_get_ntohs(tvb, OAMPDU_FLAGS);
1976 flags_item = proto_tree_add_uint(oampdu_tree, hf_oampdu_flags, tvb,
1977 OAMPDU_FLAGS, 2, flags);
1978 flags_tree = proto_item_add_subtree(flags_item, ett_oampdu_flags);
1981 * In this section we add keywords for the bit set on the Flags's line.
1982 * We also add all the bit inside the subtree.
1984 APPEND_BOOLEAN_FLAG(flags & OAMPDU_FLAGS_LINK_FAULT, flags_item,
1986 proto_tree_add_boolean(flags_tree, hf_oampdu_flags_link_fault,
1987 tvb, OAMPDU_FLAGS, 1, flags);
1989 APPEND_BOOLEAN_FLAG(flags & OAMPDU_FLAGS_DYING_GASP, flags_item,
1991 proto_tree_add_boolean(flags_tree, hf_oampdu_flags_dying_gasp,
1992 tvb, OAMPDU_FLAGS, 1, flags);
1994 APPEND_BOOLEAN_FLAG(flags & OAMPDU_FLAGS_CRITICAL_EVENT, flags_item,
1996 proto_tree_add_boolean(flags_tree, hf_oampdu_flags_critical_event,
1997 tvb, OAMPDU_FLAGS, 1, flags);
1999 proto_tree_add_boolean(flags_tree, hf_oampdu_flags_local_evaluating,
2000 tvb, OAMPDU_FLAGS, 1, flags);
2002 proto_tree_add_boolean(flags_tree, hf_oampdu_flags_local_stable,
2003 tvb, OAMPDU_FLAGS, 1, flags);
2005 proto_tree_add_boolean(flags_tree, hf_oampdu_flags_remote_evaluating,
2006 tvb, OAMPDU_FLAGS, 1, flags);
2008 proto_tree_add_boolean(flags_tree, hf_oampdu_flags_remote_stable,
2009 tvb, OAMPDU_FLAGS, 1, flags);
2011 if (sep != cont_sep)
2012 proto_item_append_text(flags_item, " (");
2014 proto_item_append_text(flags_item, ", ");
2020 proto_item_append_text(flags_item, "local: ");
2021 state = (flags&(OAMPDU_FLAGS_LOCAL_EVAL|OAMPDU_FLAGS_LOCAL_STABLE));
2026 proto_item_append_text(flags_item, "remote: ");
2027 state = (flags&(OAMPDU_FLAGS_REMOTE_EVAL|OAMPDU_FLAGS_REMOTE_STABLE));
2034 proto_item_append_text(flags_item, "Unsatisfied");
2037 proto_item_append_text(flags_item, "Discovery in process");
2040 proto_item_append_text(flags_item, "Discovery complete");
2043 proto_item_append_text(flags_item, "Reserved");
2048 proto_item_append_text(flags_item, ", ");
2052 proto_item_append_text(flags_item, ")");
2055 oampdu_code = tvb_get_guint8(tvb, OAMPDU_CODE);
2056 proto_tree_add_uint(oampdu_tree, hf_oampdu_code, tvb,
2057 OAMPDU_CODE, 1, oampdu_code);
2059 switch (oampdu_code)
2061 case OAMPDU_INFORMATION:
2062 dissect_oampdu_information(tvb, oampdu_tree);
2064 case OAMPDU_EVENT_NOTIFICATION:
2065 dissect_oampdu_event_notification(tvb, oampdu_tree);
2067 case OAMPDU_VAR_REQUEST:
2068 dissect_oampdu_variable_request(tvb, oampdu_tree);
2070 case OAMPDU_VAR_RESPONSE:
2071 dissect_oampdu_variable_response(tvb, oampdu_tree);
2073 case OAMPDU_LOOPBACK_CTRL:
2074 dissect_oampdu_loopback_control(tvb, oampdu_tree);
2076 case OAMPDU_VENDOR_SPECIFIC:
2077 dissect_oampdu_vendor_specific(tvb, oampdu_tree);
2085 * Name: dissect_oampdu_information
2088 * This function is used to dissect the Information TLVs define in IEEE802.3
2093 * tvb: buffer associate with the rcv packet (see tvbuff.h).
2094 * tree: the protocol tree associate with the oampdu (see proto.h).
2096 * Return Values: None
2099 * Dominique Bastien (dbastien@accedian.com)
2100 * + add support for 802.3ah-2004.
2103 dissect_oampdu_information(tvbuff_t *tvb, proto_tree *tree)
2113 proto_tree *info_tree;
2114 proto_item *info_item;
2115 proto_tree *state_tree;
2116 proto_item *state_item;
2117 proto_tree *cfg_tree;
2118 proto_item *cfg_item;
2119 proto_item *oui_item;
2123 offset = OAMPDU_HEADER_SIZE;
2127 bytes = tvb_length_remaining(tvb, offset);
2128 if (bytes < 1) break;
2130 info_type = tvb_get_guint8(tvb, offset);
2132 if (info_type == OAMPDU_INFO_TYPE_ENDMARKER) break;
2134 info_item = proto_tree_add_uint(tree, hf_oampdu_info_type, tvb,
2135 offset, 1, info_type);
2139 case OAMPDU_INFO_TYPE_LOCAL:
2140 info_tree = proto_item_add_subtree(info_item, ett_oampdu_local_info);
2142 case OAMPDU_INFO_TYPE_REMOTE:
2143 info_tree = proto_item_add_subtree(info_item, ett_oampdu_remote_info);
2145 case OAMPDU_INFO_TYPE_ORG:
2146 info_tree = proto_item_add_subtree(info_item, ett_oampdu_org_info);
2153 offset += OAMPDU_INFO_TYPE_SZ;
2155 if ((info_type==OAMPDU_INFO_TYPE_LOCAL)||(info_type==OAMPDU_INFO_TYPE_REMOTE))
2157 raw_octet = tvb_get_guint8(tvb, offset);
2158 proto_tree_add_uint(info_tree, hf_oampdu_info_len,
2159 tvb, offset, 1, raw_octet);
2161 offset += OAMPDU_INFO_LENGTH_SZ;
2163 raw_octet = tvb_get_guint8(tvb, offset);
2164 proto_tree_add_uint(info_tree, hf_oampdu_info_version,
2165 tvb, offset, 1, raw_octet);
2167 offset += OAMPDU_INFO_VERSION_SZ;
2169 raw_word = tvb_get_ntohs(tvb, offset);
2170 proto_tree_add_uint(info_tree, hf_oampdu_info_revision,
2171 tvb, offset, 2, raw_word);
2173 offset += OAMPDU_INFO_REVISION_SZ;
2175 /* Build OAM State field field */
2176 raw_octet = tvb_get_guint8(tvb, offset);
2177 state_item = proto_tree_add_uint(info_tree, hf_oampdu_info_state,
2178 tvb, offset, 1, raw_octet);
2180 if (raw_octet == OAMPDU_INFO_TYPE_LOCAL)
2181 state_tree = proto_item_add_subtree(state_item, ett_oampdu_local_info_state);
2183 state_tree = proto_item_add_subtree(state_item, ett_oampdu_remote_info_state);
2185 proto_tree_add_uint(state_tree, hf_oampdu_info_state_parser,
2186 tvb, offset, 1, raw_octet);
2188 proto_tree_add_boolean(state_tree, hf_oampdu_info_state_mux,
2189 tvb, offset, 1, raw_octet);
2191 offset += OAMPDU_INFO_STATE_SZ;
2193 /* Build OAM configuration field */
2194 raw_octet = tvb_get_guint8(tvb, offset);
2195 cfg_item = proto_tree_add_uint(info_tree, hf_oampdu_info_oamConfig,
2196 tvb, offset, 1, raw_octet);
2198 if (raw_octet == OAMPDU_INFO_TYPE_LOCAL)
2199 cfg_tree = proto_item_add_subtree(cfg_item, ett_oampdu_local_info_config);
2201 cfg_tree = proto_item_add_subtree(cfg_item, ett_oampdu_remote_info_config);
2203 proto_tree_add_boolean(cfg_tree, hf_oampdu_info_oamConfig_mode,
2204 tvb, offset, 1, raw_octet);
2206 proto_tree_add_boolean(cfg_tree, hf_oampdu_info_oamConfig_uni,
2207 tvb, offset, 1, raw_octet);
2209 proto_tree_add_boolean(cfg_tree, hf_oampdu_info_oamConfig_lpbk,
2210 tvb, offset, 1, raw_octet);
2212 proto_tree_add_boolean(cfg_tree, hf_oampdu_info_oamConfig_event,
2213 tvb, offset, 1, raw_octet);
2215 proto_tree_add_boolean(cfg_tree, hf_oampdu_info_oamConfig_var,
2216 tvb, offset, 1, raw_octet);
2218 offset += OAMPDU_INFO_OAM_CONFIG_SZ;
2220 raw_word = tvb_get_ntohs(tvb, offset);
2221 item = proto_tree_add_uint(info_tree, hf_oampdu_info_oampduConfig,
2222 tvb, offset, 2, raw_word);
2224 proto_item_append_text(item, " (bytes)");
2226 offset += OAMPDU_INFO_OAMPDU_CONFIG_SZ;
2228 oui_item = proto_tree_add_item(info_tree, hf_oampdu_info_oui,
2229 tvb, offset, 3, ENC_NA);
2231 APPEND_OUI_NAME(oui_item, ptr, tvb, offset);
2233 offset += OAMPDU_INFO_OUI_SZ;
2235 proto_tree_add_item(info_tree, hf_oampdu_info_vendor,
2236 tvb, offset, 4, ENC_NA);
2238 offset += OAMPDU_INFO_VENDOR_SPECIFIC_SZ;
2240 else if (info_type == OAMPDU_INFO_TYPE_ORG)
2242 /* see IEEE802.3, section 57.5.2.3 for more details */
2243 raw_octet = tvb_get_guint8(tvb, offset);
2244 proto_tree_add_uint(info_tree, hf_oampdu_info_len,
2245 tvb, offset, 1, raw_octet);
2247 offset += OAMPDU_INFO_LENGTH_SZ;
2249 oui_item = proto_tree_add_item(info_tree, hf_oampdu_info_oui,
2250 tvb, offset, 3, ENC_NA);
2252 APPEND_OUI_NAME(oui_item, ptr, tvb, offset);
2254 offset += OAMPDU_INFO_OUI_SZ;
2256 proto_tree_add_item(info_tree, hf_oampdu_info_vendor,
2257 tvb, offset, raw_octet-5, ENC_NA);
2259 offset += raw_octet-2;
2262 else if (info_type==OAMPDU_INFO_TYPE_ENDMARKER)
2264 /* A TLV of zero indicate an End of TLV marker */
2269 /* If it's a unknown type jump over */
2270 raw_octet = tvb_get_guint8(tvb, offset);
2271 offset += raw_octet;
2277 * Name: dissect_oampdu_event_notification
2280 * This function is used to dissect the Event Notification TLVs define in
2281 * IEEE802.3 section 57.5.3).
2285 * tvb: buffer associate with the rcv packet (see tvbuff.h).
2286 * tree: the protocol tree associate with the oampdu (see proto.h).
2288 * Return Values: None
2291 * Dominique Bastien (dbastien@accedian.com)
2292 * + add support for 802.3ah-2004.
2295 dissect_oampdu_event_notification(tvbuff_t *tvb, proto_tree *tree)
2306 proto_tree *event_tree;
2307 proto_item *event_item;
2309 offset = OAMPDU_HEADER_SIZE;
2311 /* Display the sequence number before displaying the TLVs */
2312 raw_word = tvb_get_ntohs(tvb, offset);
2313 proto_tree_add_uint(tree, hf_oampdu_event_sequence,
2314 tvb, offset, 2, raw_word);
2316 offset += OAMPDU_EVENT_SEQUENCE_SZ;
2320 bytes = tvb_length_remaining(tvb, offset);
2321 if (bytes < 1) break;
2323 event_type = tvb_get_guint8(tvb, offset);
2325 if (event_type == 0) break;
2327 event_item = proto_tree_add_uint(tree, hf_oampdu_event_type,
2328 tvb, offset, 1, event_type);
2330 offset += OAMPDU_EVENT_TYPE_SZ;
2334 case OAMPDU_EVENT_TYPE_END:
2336 case OAMPDU_EVENT_TYPE_ESPE:
2338 event_tree = proto_item_add_subtree(event_item,
2339 ett_oampdu_event_espe);
2341 raw_octet = tvb_get_guint8(tvb, offset);
2342 proto_tree_add_uint(event_tree, hf_oampdu_event_length,
2343 tvb, offset, 1, raw_octet);
2345 offset += OAMPDU_EVENT_LENGTH_SZ;
2347 raw_word = tvb_get_ntohs(tvb, offset);
2348 proto_tree_add_uint(event_tree, hf_oampdu_event_timeStamp,
2349 tvb, offset, 2, raw_word);
2351 offset += OAMPDU_EVENT_TIMESTAMP_SZ;
2353 big = tvb_get_ntoh64(tvb, offset);
2354 proto_tree_add_uint64(event_tree, hf_oampdu_event_espeWindow,
2355 tvb, offset, 8, big);
2357 offset += OAMPDU_ESPE_WINDOW_SZ;
2359 big = tvb_get_ntoh64(tvb, offset);
2360 proto_tree_add_uint64(event_tree, hf_oampdu_event_espeThreshold,
2361 tvb, offset, 8, big);
2363 offset += OAMPDU_ESPE_THRESHOLD_SZ;
2365 big = tvb_get_ntoh64(tvb, offset);
2366 proto_tree_add_uint64(event_tree, hf_oampdu_event_espeErrors,
2367 tvb, offset, 8, big);
2369 offset += OAMPDU_ESPE_ERRORS_SZ;
2371 big = tvb_get_ntoh64(tvb, offset);
2372 proto_tree_add_uint64(event_tree, hf_oampdu_event_espeTotalErrors,
2373 tvb, offset, 8, big);
2375 offset += OAMPDU_ESPE_ERR_TOTAL_SZ;
2377 dword = tvb_get_ntohl(tvb, offset);
2378 proto_tree_add_uint(event_tree, hf_oampdu_event_espeTotalEvents,
2379 tvb, offset, 4, dword);
2381 offset += OAMPDU_ESPE_TOTAL_SZ;
2384 case OAMPDU_EVENT_TYPE_EFE:
2386 event_tree = proto_item_add_subtree(event_item,
2387 ett_oampdu_event_efe);
2389 raw_octet = tvb_get_guint8(tvb, offset);
2390 proto_tree_add_uint(event_tree, hf_oampdu_event_length,
2391 tvb, offset, 1, raw_octet);
2393 offset += OAMPDU_EVENT_LENGTH_SZ;
2395 raw_word = tvb_get_ntohs(tvb, offset);
2396 proto_tree_add_uint(event_tree, hf_oampdu_event_timeStamp,
2397 tvb, offset, 2, raw_word);
2399 offset += OAMPDU_EVENT_TIMESTAMP_SZ;
2401 raw_word = tvb_get_ntohs(tvb, offset);
2402 proto_tree_add_uint(event_tree, hf_oampdu_event_efeWindow,
2403 tvb, offset, 2, raw_word);
2405 offset += OAMPDU_EFE_WINDOW_SZ;
2407 dword = tvb_get_ntohl(tvb, offset);
2408 proto_tree_add_uint(event_tree, hf_oampdu_event_efeThreshold,
2409 tvb, offset, 4, dword);
2411 offset += OAMPDU_EFE_THRESHOLD_SZ;
2413 dword = tvb_get_ntohl(tvb, offset);
2414 proto_tree_add_uint(event_tree, hf_oampdu_event_efeErrors,
2415 tvb, offset, 4, dword);
2417 offset += OAMPDU_EFE_ERRORS_SZ;
2419 big = tvb_get_ntoh64(tvb, offset);
2420 proto_tree_add_uint64(event_tree, hf_oampdu_event_efeTotalErrors,
2421 tvb, offset, 8, big);
2423 offset += OAMPDU_EFE_ERR_TOTAL_SZ;
2425 dword = tvb_get_ntohl(tvb, offset);
2426 proto_tree_add_uint(event_tree, hf_oampdu_event_efeTotalEvents,
2427 tvb, offset, 4, dword);
2429 offset += OAMPDU_EFE_TOTAL_SZ;
2433 case OAMPDU_EVENT_TYPE_EFPE:
2435 event_tree = proto_item_add_subtree(event_item,
2436 ett_oampdu_event_efpe);
2438 raw_octet = tvb_get_guint8(tvb, offset);
2439 proto_tree_add_uint(event_tree, hf_oampdu_event_length,
2440 tvb, offset, 1, raw_octet);
2442 offset += OAMPDU_EVENT_LENGTH_SZ;
2444 raw_word = tvb_get_ntohs(tvb, offset);
2445 proto_tree_add_uint(event_tree, hf_oampdu_event_timeStamp,
2446 tvb, offset, 2, raw_word);
2448 offset += OAMPDU_EVENT_TIMESTAMP_SZ;
2450 raw_word = tvb_get_ntohl(tvb, offset);
2451 proto_tree_add_uint(event_tree, hf_oampdu_event_efpeWindow,
2452 tvb, offset, 4, raw_word);
2454 offset += OAMPDU_EFPE_WINDOW_SZ;
2456 dword = tvb_get_ntohl(tvb, offset);
2457 proto_tree_add_uint(event_tree, hf_oampdu_event_efpeThreshold,
2458 tvb, offset, 4, dword);
2460 offset += OAMPDU_EFPE_THRESHOLD_SZ;
2462 dword = tvb_get_ntohl(tvb, offset);
2463 proto_tree_add_uint(event_tree, hf_oampdu_event_efpeErrors,
2464 tvb, offset, 4, dword);
2466 offset += OAMPDU_EFPE_ERRORS_SZ;
2468 big = tvb_get_ntoh64(tvb, offset);
2469 proto_tree_add_uint64(event_tree, hf_oampdu_event_efpeTotalErrors,
2470 tvb, offset, 8, big);
2472 offset += OAMPDU_EFPE_ERR_TOTAL_SZ;
2474 dword = tvb_get_ntohl(tvb, offset);
2475 proto_tree_add_uint(event_tree, hf_oampdu_event_efpeTotalEvents,
2476 tvb, offset, 4, dword);
2478 offset += OAMPDU_EFPE_TOTAL_SZ;
2482 case OAMPDU_EVENT_TYPE_EFSSE:
2484 event_tree = proto_item_add_subtree(event_item,
2485 ett_oampdu_event_efsse);
2487 raw_octet = tvb_get_guint8(tvb, offset);
2488 proto_tree_add_uint(event_tree, hf_oampdu_event_length,
2489 tvb, offset, 1, raw_octet);
2491 offset += OAMPDU_EVENT_LENGTH_SZ;
2493 raw_word = tvb_get_ntohs(tvb, offset);
2494 proto_tree_add_uint(event_tree, hf_oampdu_event_timeStamp,
2495 tvb, offset, 2, raw_word);
2497 offset += OAMPDU_EVENT_TIMESTAMP_SZ;
2499 raw_word = tvb_get_ntohs(tvb, offset);
2500 proto_tree_add_uint(event_tree, hf_oampdu_event_efsseWindow,
2501 tvb, offset, 2, raw_word);
2503 offset += OAMPDU_EFSSE_WINDOW_SZ;
2505 dword = tvb_get_ntohs(tvb, offset);
2506 proto_tree_add_uint(event_tree, hf_oampdu_event_efsseThreshold,
2507 tvb, offset, 2, dword);
2509 offset += OAMPDU_EFSSE_THRESHOLD_SZ;
2511 dword = tvb_get_ntohs(tvb, offset);
2512 proto_tree_add_uint(event_tree, hf_oampdu_event_efsseErrors,
2513 tvb, offset, 2, dword);
2515 offset += OAMPDU_EFSSE_ERRORS_SZ;
2517 dword = tvb_get_ntohl(tvb, offset);
2518 proto_tree_add_uint(event_tree, hf_oampdu_event_efsseTotalErrors,
2519 tvb, offset, 4, dword);
2521 offset += OAMPDU_EFSSE_ERR_TOTAL_SZ;
2523 dword = tvb_get_ntohl(tvb, offset);
2524 proto_tree_add_uint(event_tree, hf_oampdu_event_efsseTotalEvents,
2525 tvb, offset, 4, dword);
2527 offset += OAMPDU_EFSSE_TOTAL_SZ;
2531 case OAMPDU_EVENT_TYPE_OSE:
2533 event_tree = proto_item_add_subtree(event_item,
2534 ett_oampdu_event_ose);
2536 raw_octet = tvb_get_guint8(tvb, offset);
2537 proto_tree_add_uint(event_tree, hf_oampdu_event_length,
2538 tvb, offset, 1, raw_octet);
2540 offset += OAMPDU_EVENT_LENGTH_SZ;
2542 offset += (raw_word-2);
2552 * Name: dissect_oampdu_variable_request
2555 * This function is used to dissect the Variable Request TLVs define in
2556 * IEEE802.3 section 57.6).
2560 * tvb: buffer associate with the rcv packet (see tvbuff.h).
2561 * tree: the protocol tree associate with the oampdu (see proto.h).
2563 * Return Values: None
2566 * Dominique Bastien (dbastien@accedian.com)
2567 * + add support for 802.3ah-2004.
2570 dissect_oampdu_variable_request(tvbuff_t *tvb, proto_tree *tree)
2577 offset = OAMPDU_HEADER_SIZE;
2581 raw_octet = tvb_get_guint8(tvb, offset);
2583 if (raw_octet == 0) break;
2585 proto_tree_add_uint(tree, hf_oampdu_variable_branch,
2586 tvb,offset, 1, raw_octet);
2592 case OAMPDU_VARS_OBJECT:
2594 raw_word = tvb_get_ntohs(tvb, offset);
2595 proto_tree_add_uint(tree, hf_oampdu_variable_object,
2596 tvb, offset, 2, raw_word);
2599 case OAMPDU_VARS_PACKAGE:
2601 raw_word = tvb_get_ntohs(tvb, offset);
2602 proto_tree_add_uint(tree, hf_oampdu_variable_package,
2603 tvb, offset, 2, raw_word);
2606 case OAMPDU_VARS_BINDING:
2608 raw_word = tvb_get_ntohs(tvb, offset);
2609 proto_tree_add_uint(tree, hf_oampdu_variable_binding,
2610 tvb, offset, 2, raw_word);
2613 case OAMPDU_VARS_ATTRIBUTE:
2615 raw_word = tvb_get_ntohs(tvb, offset);
2616 proto_tree_add_uint(tree, hf_oampdu_variable_attribute,
2617 tvb, offset, 2, raw_word);
2629 * Name: dissect_oampdu_variable_response
2632 * This function is used to dissect the Variable Response TLVs define in
2633 * IEEE802.3 section 57.6).
2637 * tvb: buffer associate with the rcv packet (see tvbuff.h).
2638 * tree: the protocol tree associate with the oampdu (see proto.h).
2640 * Return Values: None
2643 * Dominique Bastien (dbastien@accedian.com)
2644 * + add support for 802.3ah-2004.
2647 dissect_oampdu_variable_response(tvbuff_t *tvb, proto_tree *tree)
2654 offset = OAMPDU_HEADER_SIZE;
2658 raw_octet = tvb_get_guint8(tvb, offset);
2660 if (raw_octet == 0) break;
2662 proto_tree_add_uint(tree, hf_oampdu_variable_branch,
2663 tvb,offset, 1, raw_octet);
2669 case OAMPDU_VARS_OBJECT:
2671 raw_word = tvb_get_ntohs(tvb, offset);
2672 proto_tree_add_uint(tree, hf_oampdu_variable_object,
2673 tvb, offset, 2, raw_word);
2676 case OAMPDU_VARS_PACKAGE:
2678 raw_word = tvb_get_ntohs(tvb, offset);
2679 proto_tree_add_uint(tree, hf_oampdu_variable_package,
2680 tvb, offset, 2, raw_word);
2683 case OAMPDU_VARS_BINDING:
2685 raw_word = tvb_get_ntohs(tvb, offset);
2686 proto_tree_add_uint(tree, hf_oampdu_variable_binding,
2687 tvb, offset, 2, raw_word);
2690 case OAMPDU_VARS_ATTRIBUTE:
2692 raw_word = tvb_get_ntohs(tvb, offset);
2693 proto_tree_add_uint(tree, hf_oampdu_variable_attribute,
2694 tvb, offset, 2, raw_word);
2703 raw_octet = tvb_get_guint8(tvb, offset);
2705 if (raw_octet >= 0x80)
2707 /* Variable Indication */
2708 proto_tree_add_uint(tree, hf_oampdu_variable_indication,
2709 tvb,offset, 1, (raw_octet&0x7F));
2715 /* Special case for 128 bytes container */
2716 if (raw_octet == 0) raw_octet = 128;
2718 proto_tree_add_uint(tree, hf_oampdu_variable_width,
2719 tvb,offset, 1, raw_octet);
2723 proto_tree_add_item(tree, hf_oampdu_variable_value,
2724 tvb, offset, raw_octet, ENC_NA);
2732 * Name: dissect_oampdu_loopback_control
2735 * This function is used to dissect the Variable Request TLVs define in
2736 * IEEE802.3 section 57.6).
2740 * tvb: buffer associate with the rcv packet (see tvbuff.h).
2741 * tree: the protocol tree associate with the oampdu (see proto.h).
2743 * Return Values: None
2746 * Dominique Bastien (dbastien@accedian.com)
2747 * + add support for 802.3ah-2004.
2750 dissect_oampdu_loopback_control(tvbuff_t *tvb, proto_tree *tree)
2756 proto_tree *ctrl_tree;
2757 proto_item *ctrl_item;
2761 offset = OAMPDU_HEADER_SIZE;
2763 bytes = tvb_length_remaining(tvb, offset);
2767 ctrl = tvb_get_guint8(tvb, offset);
2769 ctrl_item = proto_tree_add_uint(tree, hf_oampdu_lpbk,
2770 tvb, offset, 1, ctrl);
2772 ctrl_tree = proto_item_add_subtree(ctrl_item, ett_oampdu_lpbk_ctrl);
2776 APPEND_BOOLEAN_FLAG(ctrl & OAMPDU_LPBK_ENABLE, ctrl_item,
2777 "%sEnable Remote Loopack");
2778 proto_tree_add_boolean(ctrl_tree, hf_oampdu_lpbk_enable,
2779 tvb, offset, 1, ctrl);
2781 APPEND_BOOLEAN_FLAG(ctrl & OAMPDU_LPBK_DISABLE, ctrl_item,
2782 "%sDisable Remote Loopback");
2783 proto_tree_add_boolean(ctrl_tree, hf_oampdu_lpbk_disable,
2784 tvb, offset, 1, ctrl);
2786 if (sep != initial_sep)
2787 proto_item_append_text(ctrl_item, ")");
2792 * Name: dissect_oampdu_vendor_specific
2795 * This function is used to dissect the Vendor Specific TLV define in
2796 * IEEE802.3 section 57.4.3.6).
2800 * tvb: buffer associate with the rcv packet (see tvbuff.h).
2801 * tree: the protocol tree associate with the oampdu (see proto.h).
2803 * Return Values: None
2806 * Dominique Bastien (dbastien@accedian.com)
2807 * + add support for 802.3ah-2004.
2810 dissect_oampdu_vendor_specific(tvbuff_t *tvb, proto_tree *tree)
2817 proto_item *oui_item;
2820 offset = OAMPDU_HEADER_SIZE;
2822 bytes = tvb_length_remaining(tvb, offset);
2826 oui_item = proto_tree_add_item(tree, hf_oampdu_info_oui,
2827 tvb, offset, 3, ENC_NA);
2829 APPEND_OUI_NAME(oui_item, ptr, tvb, offset);
2834 /* Register the protocol with Wireshark */
2836 proto_register_slow_protocols(void)
2838 /* Setup list of header fields */
2840 static hf_register_info hf[] = {
2843 * Generic slow protocol portion
2846 { "Slow Protocols subtype", "slow.subtype",
2847 FT_UINT8, BASE_HEX, VALS(subtype_vals), 0x0,
2848 "Identifies the LACP version", HFILL }},
2853 { &hf_lacpdu_version_number,
2854 { "LACP Version Number", "slow.lacp.version",
2855 FT_UINT8, BASE_HEX, NULL, 0x0,
2856 "Identifies the LACP version", HFILL }},
2858 { &hf_lacpdu_actor_type,
2859 { "Actor Information", "slow.lacp.actorInfo",
2860 FT_UINT8, BASE_HEX, NULL, 0x0,
2861 "TLV type = Actor", HFILL }},
2863 { &hf_lacpdu_actor_info_len,
2864 { "Actor Information Length", "slow.lacp.actorInfoLen",
2865 FT_UINT8, BASE_HEX, NULL, 0x0,
2866 "The length of the Actor TLV", HFILL }},
2868 { &hf_lacpdu_actor_sys_priority,
2869 { "Actor System Priority", "slow.lacp.actorSysPriority",
2870 FT_UINT16, BASE_DEC, NULL, 0x0,
2871 "The priority assigned to this System by management or admin", HFILL }},
2873 { &hf_lacpdu_actor_sys,
2874 { "Actor System", "slow.lacp.actorSystem",
2875 FT_ETHER, BASE_NONE, NULL, 0x0,
2876 "The Actor's System ID encoded as a MAC address", HFILL }},
2878 { &hf_lacpdu_actor_key,
2879 { "Actor Key", "slow.lacp.actorKey",
2880 FT_UINT16, BASE_DEC, NULL, 0x0,
2881 "The operational Key value assigned to the port by the Actor", HFILL }},
2883 { &hf_lacpdu_actor_port_priority,
2884 { "Actor Port Priority", "slow.lacp.actorPortPriority",
2885 FT_UINT16, BASE_DEC, NULL, 0x0,
2886 "The priority assigned to the port by the Actor (via Management or Admin)", HFILL }},
2888 { &hf_lacpdu_actor_port,
2889 { "Actor Port", "slow.lacp.actorPort",
2890 FT_UINT16, BASE_DEC, NULL, 0x0,
2891 "The port number assigned to the port by the Actor (via Management or Admin)", HFILL }},
2893 { &hf_lacpdu_actor_state,
2894 { "Actor State", "slow.lacp.actorState",
2895 FT_UINT8, BASE_HEX, NULL, 0x0,
2896 "The Actor's state variables for the port, encoded as bits within a single octet", HFILL }},
2898 { &hf_lacpdu_flags_a_activity,
2899 { "LACP Activity", "slow.lacp.actorState.activity",
2900 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_ACTIVITY,
2901 "Activity control value for this link. Active = 1, Passive = 0", HFILL }},
2903 { &hf_lacpdu_flags_a_timeout,
2904 { "LACP Timeout", "slow.lacp.actorState.timeout",
2905 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_TIMEOUT,
2906 "Timeout control value for this link. Short Timeout = 1, Long Timeout = 0", HFILL }},
2908 { &hf_lacpdu_flags_a_aggregation,
2909 { "Aggregation", "slow.lacp.actorState.aggregation",
2910 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_AGGREGATION,
2911 "Aggregatable = 1, Individual = 0", HFILL }},
2913 { &hf_lacpdu_flags_a_sync,
2914 { "Synchronization", "slow.lacp.actorState.synchronization",
2915 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_SYNC,
2916 "In Sync = 1, Out of Sync = 0", HFILL }},
2918 { &hf_lacpdu_flags_a_collecting,
2919 { "Collecting", "slow.lacp.actorState.collecting",
2920 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_COLLECTING,
2921 "Collection of incoming frames is: Enabled = 1, Disabled = 0", HFILL }},
2923 { &hf_lacpdu_flags_a_distrib,
2924 { "Distributing", "slow.lacp.actorState.distributing",
2925 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_DISTRIB,
2926 "Distribution of outgoing frames is: Enabled = 1, Disabled = 0", HFILL }},
2928 { &hf_lacpdu_flags_a_defaulted,
2929 { "Defaulted", "slow.lacp.actorState.defaulted",
2930 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_DEFAULTED,
2931 "1 = Actor Rx machine is using DEFAULT Partner info, 0 = using info in Rx'd LACPDU", HFILL }},
2933 { &hf_lacpdu_flags_a_expired,
2934 { "Expired", "slow.lacp.actorState.expired",
2935 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_EXPIRED,
2936 "1 = Actor Rx machine is EXPIRED, 0 = is NOT EXPIRED", HFILL }},
2938 { &hf_lacpdu_actor_reserved,
2939 { "Reserved", "slow.lacp.reserved",
2940 FT_BYTES, BASE_NONE, NULL, 0x0,
2943 { &hf_lacpdu_partner_type,
2944 { "Partner Information", "slow.lacp.partnerInfo",
2945 FT_UINT8, BASE_HEX, NULL, 0x0,
2946 "TLV type = Partner", HFILL }},
2948 { &hf_lacpdu_partner_info_len,
2949 { "Partner Information Length", "slow.lacp.partnerInfoLen",
2950 FT_UINT8, BASE_HEX, NULL, 0x0,
2951 "The length of the Partner TLV", HFILL }},
2953 { &hf_lacpdu_partner_sys_priority,
2954 { "Partner System Priority", "slow.lacp.partnerSysPriority",
2955 FT_UINT16, BASE_DEC, NULL, 0x0,
2956 "The priority assigned to the Partner System by management or admin", HFILL }},
2958 { &hf_lacpdu_partner_sys,
2959 { "Partner System", "slow.lacp.partnerSystem",
2960 FT_ETHER, BASE_NONE, NULL, 0x0,
2961 "The Partner's System ID encoded as a MAC address", HFILL }},
2963 { &hf_lacpdu_partner_key,
2964 { "Partner Key", "slow.lacp.partnerKey",
2965 FT_UINT16, BASE_DEC, NULL, 0x0,
2966 "The operational Key value assigned to the port associated with this link by the Partner", HFILL }},
2968 { &hf_lacpdu_partner_port_priority,
2969 { "Partner Port Priority", "slow.lacp.partnerPortPriority",
2970 FT_UINT16, BASE_DEC, NULL, 0x0,
2971 "The priority assigned to the port by the Partner (via Management or Admin)", HFILL }},
2973 { &hf_lacpdu_partner_port,
2974 { "Partner Port", "slow.lacp.partnerPort",
2975 FT_UINT16, BASE_DEC, NULL, 0x0,
2976 "The port number associated with this link assigned to the port by the Partner (via Management or Admin)", HFILL }},
2978 { &hf_lacpdu_partner_state,
2979 { "Partner State", "slow.lacp.partnerState",
2980 FT_UINT8, BASE_HEX, NULL, 0x0,
2981 "The Partner's state variables for the port, encoded as bits within a single octet", HFILL }},
2983 { &hf_lacpdu_flags_p_activity,
2984 { "LACP Activity", "slow.lacp.partnerState.activity",
2985 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_ACTIVITY,
2986 "Activity control value for this link. Active = 1, Passive = 0", HFILL }},
2988 { &hf_lacpdu_flags_p_timeout,
2989 { "LACP Timeout", "slow.lacp.partnerState.timeout",
2990 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_TIMEOUT,
2991 "Timeout control value for this link. Short Timeout = 1, Long Timeout = 0", HFILL }},
2993 { &hf_lacpdu_flags_p_aggregation,
2994 { "Aggregation", "slow.lacp.partnerState.aggregation",
2995 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_AGGREGATION,
2996 "Aggregatable = 1, Individual = 0", HFILL }},
2998 { &hf_lacpdu_flags_p_sync,
2999 { "Synchronization", "slow.lacp.partnerState.synchronization",
3000 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_SYNC,
3001 "In Sync = 1, Out of Sync = 0", HFILL }},
3003 { &hf_lacpdu_flags_p_collecting,
3004 { "Collecting", "slow.lacp.partnerState.collecting",
3005 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_COLLECTING,
3006 "Collection of incoming frames is: Enabled = 1, Disabled = 0", HFILL }},
3008 { &hf_lacpdu_flags_p_distrib,
3009 { "Distributing", "slow.lacp.partnerState.distributing",
3010 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_DISTRIB,
3011 "Distribution of outgoing frames is: Enabled = 1, Disabled = 0", HFILL }},
3013 { &hf_lacpdu_flags_p_defaulted,
3014 { "Defaulted", "slow.lacp.partnerState.defaulted",
3015 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_DEFAULTED,
3016 "1 = Actor Rx machine is using DEFAULT Partner info, 0 = using info in Rx'd LACPDU", HFILL }},
3018 { &hf_lacpdu_flags_p_expired,
3019 { "Expired", "slow.lacp.partnerState.expired",
3020 FT_BOOLEAN, 8, TFS(&tfs_yes_no), LACPDU_FLAGS_EXPIRED,
3021 "1 = Actor Rx machine is EXPIRED, 0 = is NOT EXPIRED", HFILL }},
3023 { &hf_lacpdu_partner_reserved,
3024 { "Reserved", "slow.lacp.reserved",
3025 FT_BYTES, BASE_NONE, NULL, 0x0,
3028 { &hf_lacpdu_coll_type,
3029 { "Collector Information", "slow.lacp.collectorInfo",
3030 FT_UINT8, BASE_HEX, NULL, 0x0,
3031 "TLV type = Collector", HFILL }},
3033 { &hf_lacpdu_coll_info_len,
3034 { "Collector Information Length", "slow.lacp.collectorInfoLen",
3035 FT_UINT8, BASE_HEX, NULL, 0x0,
3036 "The length of the Collector TLV", HFILL }},
3038 { &hf_lacpdu_coll_max_delay,
3039 { "Collector Max Delay", "slow.lacp.collectorMaxDelay",
3040 FT_UINT16, BASE_DEC, NULL, 0x0,
3041 "The max delay of the station tx'ing the LACPDU (in tens of usecs)", HFILL }},
3043 { &hf_lacpdu_coll_reserved,
3044 { "Reserved", "slow.lacp.coll_reserved",
3045 FT_BYTES, BASE_NONE, NULL, 0x0,
3048 { &hf_lacpdu_term_type,
3049 { "Terminator Information", "slow.lacp.termInfo",
3050 FT_UINT8, BASE_HEX, NULL, 0x0,
3051 "TLV type = Terminator", HFILL }},
3053 { &hf_lacpdu_term_len,
3054 { "Terminator Length", "slow.lacp.termLen",
3055 FT_UINT8, BASE_HEX, NULL, 0x0,
3056 "The length of the Terminator TLV", HFILL }},
3058 { &hf_lacpdu_term_reserved,
3059 { "Reserved", "slow.lacp.term_reserved",
3060 FT_BYTES, BASE_NONE, NULL, 0x0,
3068 { &hf_marker_version_number,
3069 { "Version Number", "slow.marker.version",
3070 FT_UINT8, BASE_HEX, NULL, 0x0,
3071 "Identifies the Marker version", HFILL }},
3073 { &hf_marker_tlv_type,
3074 { "TLV Type", "slow.marker.tlvType",
3075 FT_UINT8, BASE_HEX, VALS(marker_vals), 0x0,
3076 "Marker TLV type", HFILL }},
3078 { &hf_marker_tlv_length,
3079 { "TLV Length", "slow.marker.tlvLen",
3080 FT_UINT8, BASE_HEX, NULL, 0x0,
3081 "The length of the Actor TLV", HFILL }},
3083 { &hf_marker_req_port,
3084 { "Requester Port", "slow.marker.requesterPort",
3085 FT_UINT16, BASE_DEC, NULL, 0x0,
3086 "The Requester Port", HFILL }},
3088 { &hf_marker_req_system,
3089 { "Requester System", "slow.marker.requesterSystem",
3090 FT_ETHER, BASE_NONE, NULL, 0x0,
3091 "The Requester System ID encoded as a MAC address", HFILL }},
3093 { &hf_marker_req_trans_id,
3094 { "Requester Transaction ID", "slow.marker.requesterTransId",
3095 FT_UINT32, BASE_DEC, NULL, 0x0,
3096 "The Requester Transaction ID", HFILL }},
3103 { "OUI", "slow.ossp.oui",
3104 FT_BYTES, BASE_NONE, NULL, 0,
3105 "IEEE assigned Organizationally Unique Identifier", HFILL }},
3108 { "ITU-T OSSP Subtype", "slow.ossp.itu.subtype",
3109 FT_UINT16, BASE_HEX, NULL, 0,
3110 "Subtype assigned by the ITU-T", HFILL }},
3113 { "Version", "slow.esmc.version",
3114 FT_UINT8, BASE_HEX, NULL, 0xf0,
3115 "This field indicates the version of ITU-T SG15 Q13 OSSP frame format", HFILL }},
3117 { &hf_esmc_event_flag,
3118 { "Event Flag", "slow.esmc.event_flag",
3119 FT_UINT8, BASE_HEX, VALS(esmc_event_flag_vals), 0x08,
3120 "This bit distinguishes the critical, time sensitive behaviour of the"
3121 " ESMC Event PDU from the ESMC Information PDU", HFILL }},
3123 { &hf_esmc_timestamp_valid_flag,
3124 { "Timestamp Valid Flag", "slow.esmc.timestamp_valid_flag",
3125 FT_UINT8, BASE_HEX, VALS(esmc_timestamp_valid_flag_vals), 0x04,
3126 "Indicates validity (i.e. presence) of the Timestamp TLV", HFILL }},
3128 { &hf_esmc_reserved_32,
3129 { "Reserved", "slow.esmc.reserved",
3130 FT_UINT32, BASE_HEX, NULL, 0,
3131 "Reserved. Set to all zero at the transmitter and ignored by the receiver", HFILL }},
3134 { "ESMC TLV", "slow.esmc.tlv",
3135 FT_NONE, BASE_NONE, NULL, 0,
3138 { &hf_esmc_tlv_type,
3139 { "TLV Type", "slow.esmc.tlv_type",
3140 FT_UINT8, BASE_HEX, VALS(esmc_tlv_type_vals), 0,
3143 { &hf_esmc_tlv_length,
3144 { "TLV Length", "slow.esmc.tlv_length",
3145 FT_UINT16, BASE_HEX, NULL, 0,
3148 { &hf_esmc_tlv_ql_unused,
3149 { "Unused", "slow.esmc.tlv_ql_unused",
3150 FT_UINT8, BASE_HEX, NULL, 0xf0,
3151 "This field is not used in QL TLV", HFILL }},
3153 { &hf_esmc_quality_level_opt_1,
3154 { "SSM Code", "slow.esmc.ql",
3155 FT_UINT8, BASE_HEX, VALS(esmc_quality_level_opt_1_vals), 0x0f,
3156 "Quality Level information", HFILL }},
3158 #if 0 /*not used yet*/
3159 { &hf_esmc_quality_level_opt_2,
3160 { "SSM Code", "slow.esmc.ql",
3161 FT_UINT8, BASE_HEX, VALS(esmc_quality_level_opt_2_vals), 0x0f,
3162 "Quality Level information", HFILL }},
3165 { &hf_esmc_quality_level_invalid,
3166 { "SSM Code", "slow.esmc.ql",
3167 FT_UINT8, BASE_HEX, VALS(esmc_quality_level_invalid_vals), 0x0f,
3168 "Quality Level information", HFILL }},
3170 { &hf_esmc_timestamp,
3171 { "Timestamp (ns)", "slow.esmc.timestamp",
3172 FT_INT32, BASE_DEC, NULL, 0,
3173 "Timestamp according to the \"whole nanoseconds\" part of the IEEE 1588 originTimestamp", HFILL }},
3175 { &hf_esmc_tlv_ts_reserved,
3176 { "Reserved", "slow.esmc.tlv_ts_reserved",
3177 FT_UINT8, BASE_HEX, NULL, 0,
3178 "Reserved. Set to all zero at the transmitter and ignored by the receiver", HFILL }},
3181 { "Padding", "slow.esmc.padding",
3182 FT_BYTES, BASE_NONE, NULL, 0x0,
3183 "This field contains necessary padding to achieve the minimum frame size of 64 bytes at least", HFILL }},
3189 { "Flags", "slow.oam.flags",
3190 FT_UINT16, BASE_HEX, NULL, 0x0,
3191 "The Flags Field", HFILL }},
3193 { &hf_oampdu_flags_link_fault,
3194 { "Link Fault", "slow.oam.flags.linkFault",
3195 FT_BOOLEAN, 8, TFS(&tfs_true_false), OAMPDU_FLAGS_LINK_FAULT,
3196 "The PHY detected a fault in the receive direction. True = 1, False = 0", HFILL }},
3198 { &hf_oampdu_flags_dying_gasp,
3199 { "Dying Gasp", "slow.oam.flags.dyingGasp",
3200 FT_BOOLEAN, 8, TFS(&tfs_true_false), OAMPDU_FLAGS_DYING_GASP,
3201 "An unrecoverable local failure occured. True = 1, False = 0", HFILL }},
3203 { &hf_oampdu_flags_critical_event,
3204 { "Critical Event", "slow.oam.flags.criticalEvent",
3205 FT_BOOLEAN, 8, TFS(&tfs_true_false), OAMPDU_FLAGS_CRITICAL_EVENT,
3206 "A critical event has occurred. True = 1, False = 0", HFILL }},
3208 { &hf_oampdu_flags_local_evaluating,
3209 { "Local Evaluating", "slow.oam.flags.localEvaluating",
3210 FT_BOOLEAN, 8, TFS(&tfs_true_false), OAMPDU_FLAGS_LOCAL_EVAL,
3211 "Local DTE Discovery process in progress. True = 1, False = 0", HFILL }},
3213 { &hf_oampdu_flags_local_stable,
3214 { "Local Stable", "slow.oam.flags.localStable",
3215 FT_BOOLEAN, 8, TFS(&tfs_true_false), OAMPDU_FLAGS_LOCAL_STABLE,
3216 "Local DTE is Stable. True = 1, False = 0", HFILL }},
3218 { &hf_oampdu_flags_remote_evaluating,
3219 { "Remote Evaluating", "slow.oam.flags.remoteEvaluating",
3220 FT_BOOLEAN, 8, TFS(&tfs_true_false), OAMPDU_FLAGS_REMOTE_EVAL,
3221 "Remote DTE Discovery process in progress. True = 1, False = 0", HFILL }},
3223 { &hf_oampdu_flags_remote_stable,
3224 { "Remote Stable", "slow.oam.flags.remoteStable",
3225 FT_BOOLEAN, 8, TFS(&tfs_true_false), OAMPDU_FLAGS_REMOTE_STABLE,
3226 "Remote DTE is Stable. True = 1, False = 0", HFILL }},
3229 { "OAMPDU code", "slow.oam.code",
3230 FT_UINT8, BASE_HEX, VALS(code_vals), 0x0,
3231 "Identifies the TLVs code", HFILL }},
3233 { &hf_oampdu_info_type,
3234 { "Type", "slow.oam.info.type",
3235 FT_UINT8, BASE_HEX, VALS(info_type_vals), 0x0,
3236 "Identifies the TLV type", HFILL }},
3238 { &hf_oampdu_info_len,
3239 { "TLV Length", "slow.oam.info.length",
3240 FT_UINT8, BASE_DEC, NULL, 0x0,
3241 "Identifies the TLVs type", HFILL }},
3243 { &hf_oampdu_info_version,
3244 { "TLV Version", "slow.oam.info.version",
3245 FT_UINT8, BASE_HEX, NULL, 0x0,
3246 "Identifies the TLVs version", HFILL }},
3248 { &hf_oampdu_info_revision,
3249 { "TLV Revision", "slow.oam.info.revision",
3250 FT_UINT16, BASE_DEC, NULL, 0x0,
3251 "Identifies the TLVs revision", HFILL }},
3253 { &hf_oampdu_info_state,
3254 { "OAM DTE States", "slow.oam.info.state",
3255 FT_UINT8, BASE_HEX, NULL, 0x0,
3256 "OAM DTE State of the Mux and the Parser", HFILL }},
3258 { &hf_oampdu_info_state_parser,
3259 { "Parser Action", "slow.oam.info.state.parser",
3260 FT_UINT8, BASE_HEX, VALS(parser_vals), 0x03,
3263 { &hf_oampdu_info_state_mux,
3264 { "Muxiplexer Action", "slow.oam.info.state.muxiplexer",
3265 FT_BOOLEAN, 8, TFS(&mux), 0x04,
3268 { &hf_oampdu_info_oamConfig,
3269 { "OAM Configuration", "slow.oam.info.oamConfig",
3270 FT_UINT8, BASE_HEX, NULL, 0x0,
3273 { &hf_oampdu_info_oamConfig_mode,
3274 { "OAM Mode", "slow.oam.info.oamConfig.mode",
3275 FT_BOOLEAN, 8, TFS(&oam_mode), OAMPDU_INFO_CONFIG_MODE,
3278 { &hf_oampdu_info_oamConfig_uni,
3279 { "Unidirectional support", "slow.oam.flags.dyingGasp",
3280 FT_BOOLEAN, 8, TFS(&oam_uni), OAMPDU_INFO_CONFIG_UNI,
3283 { &hf_oampdu_info_oamConfig_lpbk,
3284 { "Loopback support", "slow.oam.flags.criticalEvent",
3285 FT_BOOLEAN, 8, TFS(&oam_lpbk), OAMPDU_INFO_CONFIG_LPBK,
3288 { &hf_oampdu_info_oamConfig_event,
3289 { "Link Events support", "slow.oam.flags.localEvaluating",
3290 FT_BOOLEAN, 8, TFS(&oam_event), OAMPDU_INFO_CONFIG_EVENT,
3293 { &hf_oampdu_info_oamConfig_var,
3294 { "Variable Retrieval", "slow.oam.flags.localStable",
3295 FT_BOOLEAN, 8, TFS(&oam_var), OAMPDU_INFO_CONFIG_VAR,
3296 "Variable Retrieval support", HFILL }},
3298 { &hf_oampdu_info_oampduConfig,
3299 { "Max OAMPDU Size", "slow.oam.info.oampduConfig",
3300 FT_UINT16, BASE_DEC, NULL, 0x0,
3301 "OAMPDU Configuration", HFILL }},
3303 { &hf_oampdu_info_oui,
3304 { "Organizationally Unique Identifier", "slow.oam.info.oui",
3305 FT_BYTES, BASE_NONE, NULL, 0x0,
3308 { &hf_oampdu_info_vendor,
3309 { "Vendor Specific Information", "slow.oam.info.vendor",
3310 FT_BYTES, BASE_NONE, NULL, 0x0,
3314 * Event notification definitions
3316 { &hf_oampdu_event_sequence,
3317 { "Sequence Number", "slow.oam.event.sequence",
3318 FT_UINT16, BASE_DEC, NULL, 0x0,
3319 "Identifies the Event Notification TLVs", HFILL }},
3321 { &hf_oampdu_event_type,
3322 { "Event Type", "slow.oam.event.type",
3323 FT_UINT8, BASE_HEX, VALS(event_type_vals), 0x0,
3324 "Identifies the TLV type", HFILL }},
3326 { &hf_oampdu_event_length,
3327 { "Event Length", "slow.oam.event.length",
3328 FT_UINT8, BASE_HEX, NULL, 0x0,
3329 "This field indicates the length in octets of the TLV-tuple", HFILL }},
3331 { &hf_oampdu_event_timeStamp,
3332 { "Event Timestamp (100ms)", "slow.oam.event.timestamp",
3333 FT_UINT16, BASE_DEC, NULL, 0x0,
3334 "Event Time Stamp in term of 100 ms intervals", HFILL }},
3336 /* Errored Symbol Period Event TLV */
3337 { &hf_oampdu_event_espeWindow,
3338 { "Errored Symbol Window", "slow.oam.event.espeWindow",
3339 FT_UINT64, BASE_DEC, NULL, 0x0,
3340 "Number of symbols in the period", HFILL }},
3342 { &hf_oampdu_event_espeThreshold,
3343 { "Errored Symbol Threshold", "slow.oam.event.espeThreshold",
3344 FT_UINT64, BASE_DEC, NULL, 0x0,
3345 "Number of symbols required to generate the Event", HFILL }},
3347 { &hf_oampdu_event_espeErrors,
3348 { "Errored Symbols", "slow.oam.event.espeErrors",
3349 FT_UINT64, BASE_DEC, NULL, 0x0,
3350 "Number of symbols in error", HFILL }},
3352 { &hf_oampdu_event_espeTotalErrors,
3353 { "Error Running Total", "slow.oam.event.espeTotalErrors",
3354 FT_UINT64, BASE_DEC, NULL, 0x0,
3355 "Number of symbols in error since reset of the sublayer", HFILL }},
3357 { &hf_oampdu_event_espeTotalEvents,
3358 { "Event Running Total", "slow.oam.event.espeTotalEvents",
3359 FT_UINT32, BASE_DEC, NULL, 0x0,
3360 "Total Event generated since reset of the sublayer", HFILL }},
3362 /* Errored Frame Event TLV */
3363 { &hf_oampdu_event_efeWindow,
3364 { "Errored Frame Window", "slow.oam.event.efeWindow",
3365 FT_UINT16, BASE_DEC, NULL, 0x0,
3366 "Number of symbols in the period", HFILL }},
3368 { &hf_oampdu_event_efeThreshold,
3369 { "Errored Frame Threshold", "slow.oam.event.efeThreshold",
3370 FT_UINT32, BASE_DEC, NULL, 0x0,
3371 "Number of frames required to generate the Event", HFILL }},
3373 { &hf_oampdu_event_efeErrors,
3374 { "Errored Frames", "slow.oam.event.efeErrors",
3375 FT_UINT32, BASE_DEC, NULL, 0x0,
3376 "Number of symbols in error", HFILL }},
3378 { &hf_oampdu_event_efeTotalErrors,
3379 { "Error Running Total", "slow.oam.event.efeTotalErrors",
3380 FT_UINT64, BASE_DEC, NULL, 0x0,
3381 "Number of frames in error since reset of the sublayer", HFILL }},
3383 { &hf_oampdu_event_efeTotalEvents,
3384 { "Event Running Total", "slow.oam.event.efeTotalEvents",
3385 FT_UINT32, BASE_DEC, NULL, 0x0,
3386 "Total Event generated since reset of the sublayer", HFILL }},
3388 /* Errored Frame Period Event TLV */
3389 { &hf_oampdu_event_efpeWindow,
3390 { "Errored Frame Window", "slow.oam.event.efpeWindow",
3391 FT_UINT32, BASE_DEC, NULL, 0x0,
3392 "Number of frame in error during the period", HFILL }},
3394 { &hf_oampdu_event_efpeThreshold,
3395 { "Errored Frame Threshold", "slow.oam.event.efpeThreshold",
3396 FT_UINT32, BASE_DEC, NULL, 0x0,
3397 "Number of frames required to generate the Event", HFILL }},
3399 { &hf_oampdu_event_efpeErrors,
3400 { "Errored Frames", "slow.oam.event.efeErrors",
3401 FT_UINT32, BASE_DEC, NULL, 0x0,
3402 "Number of symbols in error", HFILL }},
3404 { &hf_oampdu_event_efpeTotalErrors,
3405 { "Error Running Total", "slow.oam.event.efpeTotalErrors",
3406 FT_UINT64, BASE_DEC, NULL, 0x0,
3407 "Number of frames in error since reset of the sublayer", HFILL }},
3409 { &hf_oampdu_event_efpeTotalEvents,
3410 { "Event Running Total", "slow.oam.event.efpeTotalEvents",
3411 FT_UINT32, BASE_DEC, NULL, 0x0,
3412 "Total Event generated since reset of the sublayer", HFILL }},
3414 /* Errored Frame Second Summary Event TLV */
3415 { &hf_oampdu_event_efsseWindow,
3416 { "Errored Frame Window", "slow.oam.event.efsseWindow",
3417 FT_UINT16, BASE_DEC, NULL, 0x0,
3418 "Number of frame in error during the period", HFILL }},
3420 { &hf_oampdu_event_efsseThreshold,
3421 { "Errored Frame Threshold", "slow.oam.event.efsseThreshold",
3422 FT_UINT16, BASE_DEC, NULL, 0x0,
3423 "Number of frames required to generate the Event", HFILL }},
3425 { &hf_oampdu_event_efsseErrors,
3426 { "Errored Frames", "slow.oam.event.efeErrors",
3427 FT_UINT16, BASE_DEC, NULL, 0x0,
3428 "Number of symbols in error", HFILL }},
3430 { &hf_oampdu_event_efsseTotalErrors,
3431 { "Error Running Total", "slow.oam.event.efsseTotalErrors",
3432 FT_UINT32, BASE_DEC, NULL, 0x0,
3433 "Number of frames in error since reset of the sublayer", HFILL }},
3435 { &hf_oampdu_event_efsseTotalEvents,
3436 { "Event Running Total", "slow.oam.event.efsseTotalEvents",
3437 FT_UINT32, BASE_DEC, NULL, 0x0,
3438 "Total Event generated since reset of the sublayer", HFILL }},
3440 /* Variable request and response definitions*/
3441 { &hf_oampdu_variable_branch,
3442 { "Branch", "slow.oam.variable.branch",
3443 FT_UINT8, BASE_HEX, VALS(branch_vals), 0x0,
3444 "Variable Branch, derived from the CMIP protocol in Annex 30A", HFILL }},
3446 { &hf_oampdu_variable_object,
3447 { "Leaf", "slow.oam.variable.object",
3448 FT_UINT16, BASE_HEX, VALS(object_vals), 0x0,
3449 "Object, derived from the CMIP protocol in Annex 30A", HFILL }},
3451 { &hf_oampdu_variable_package,
3452 { "Leaf", "slow.oam.variable.package",
3453 FT_UINT16, BASE_HEX, VALS(package_vals), 0x0,
3454 "Package, derived from the CMIP protocol in Annex 30A", HFILL }},
3456 { &hf_oampdu_variable_binding,
3457 { "Leaf", "slow.oam.variable.binding",
3458 FT_UINT16, BASE_HEX, VALS(binding_vals), 0x0,
3459 "Binding, derived from the CMIP protocol in Annex 30A", HFILL }},
3461 { &hf_oampdu_variable_attribute,
3462 { "Leaf", "slow.oam.variable.attribute",
3463 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &attribute_vals_ext, 0x0,
3464 "Attribute, derived from the CMIP protocol in Annex 30A", HFILL }},
3466 { &hf_oampdu_variable_width,
3467 { "Variable Width", "slow.oam.variable.width",
3468 FT_UINT8, BASE_DEC, NULL, 0x0,
3471 { &hf_oampdu_variable_indication,
3472 { "Variable indication", "slow.oam.variable.indication",
3473 FT_UINT8, BASE_HEX, VALS(indication_vals), 0x0,
3476 { &hf_oampdu_variable_value,
3477 { "Variable Value", "slow.oam.variable.value",
3478 FT_BYTES, BASE_NONE, NULL, 0x0,
3481 /* Loopback Control definitions*/
3483 { "Commands", "slow.oam.lpbk.commands",
3484 FT_UINT8, BASE_HEX, NULL, 0x0,
3485 "The List of Loopback Commands", HFILL }},
3487 { &hf_oampdu_lpbk_enable,
3488 { "Enable Remote Loopback", "slow.oam.lpbk.commands.enable",
3489 FT_BOOLEAN, 8, NULL, OAMPDU_LPBK_ENABLE,
3490 "Enable Remote Loopback Command", HFILL }},
3492 { &hf_oampdu_lpbk_disable,
3493 { "Disable Remote Loopback", "slow.oam.lpbk.commands.disable",
3494 FT_BOOLEAN, 8, NULL, OAMPDU_LPBK_DISABLE,
3495 "Disable Remote Loopback Command", HFILL }}
3498 /* Setup protocol subtree array */
3500 static gint *ett[] = {
3503 &ett_lacpdu_a_flags,
3504 &ett_lacpdu_p_flags,
3509 &ett_oampdu_local_info,
3510 &ett_oampdu_local_info_state,
3511 &ett_oampdu_local_info_config,
3512 &ett_oampdu_remote_info,
3513 &ett_oampdu_remote_info_state,
3514 &ett_oampdu_remote_info_config,
3515 &ett_oampdu_org_info,
3516 &ett_oampdu_event_espe,
3517 &ett_oampdu_event_efe,
3518 &ett_oampdu_event_efpe,
3519 &ett_oampdu_event_efsse,
3520 &ett_oampdu_event_ose,
3521 &ett_oampdu_lpbk_ctrl,
3527 /* Register the protocol name and description */
3529 proto_slow = proto_register_protocol("Slow Protocols", "802.3 Slow protocols", "slow");
3531 /* Required function calls to register the header fields and subtrees used */
3533 proto_register_field_array(proto_slow, hf, array_length(hf));
3534 proto_register_subtree_array(ett, array_length(ett));
3539 proto_reg_handoff_slow_protocols(void)
3541 dissector_handle_t slow_protocols_handle;
3543 slow_protocols_handle = create_dissector_handle(dissect_slow_protocols, proto_slow);
3544 dissector_add_uint("ethertype", ETHERTYPE_SLOW_PROTOCOLS, slow_protocols_handle);
3545 dh_data = find_dissector("data");