Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.incubator.net.l2monitoring.cfm; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | |
| 20 | import org.onlab.packet.MacAddress; |
| 21 | import org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException; |
| 22 | import org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementEntry; |
| 23 | import org.onosproject.incubator.net.l2monitoring.soam.loss.LossMeasurementEntry; |
| 24 | |
| 25 | /** |
| 26 | * An extension of the Mep interface to represent the state attributes. |
| 27 | * |
| 28 | */ |
| 29 | public interface MepEntry extends Mep { |
| 30 | /** |
| 31 | * Get the MAC address of the MEP. |
| 32 | * |
| 33 | * @return The MAC address of the MEP |
| 34 | */ |
| 35 | MacAddress macAddress(); |
| 36 | |
| 37 | /** |
| 38 | * Get the state of the MEPs Fault Notification Generator. |
| 39 | * |
| 40 | * @return The state of the MEPs Fault Notification Generator |
| 41 | */ |
| 42 | FngState fngState(); |
| 43 | |
| 44 | /** |
| 45 | * Get the highest-priority defect that has been present since last FNG reset. |
| 46 | * @return The highest-priority defect |
| 47 | */ |
| 48 | FaultDefectType getHighestPriorityDefect(); |
| 49 | |
| 50 | /** |
| 51 | * Get flag indicating that some other MEP in this MEP’s MA is transmitting the RDI bit. |
| 52 | * @return true or false |
| 53 | */ |
| 54 | boolean activeRdiCcmDefect(); |
| 55 | |
| 56 | /** |
| 57 | * Get flag indicating that a Port Status or Interface Status TLV is indicating an error condition. |
| 58 | * @return true or false |
| 59 | */ |
| 60 | boolean activeMacStatusDefect(); |
| 61 | |
| 62 | /** |
| 63 | * Get flag indicating that CCMs are not being received from at least one of the configured remote MEPs. |
| 64 | * @return true or false |
| 65 | */ |
| 66 | boolean activeRemoteCcmDefect(); |
| 67 | |
| 68 | /** |
| 69 | * Get flag indicating that erroneous CCMs are being received from some MEP in this MEP’s MA. |
| 70 | * @return true or false |
| 71 | */ |
| 72 | boolean activeErrorCcmDefect(); |
| 73 | |
| 74 | /** |
| 75 | * Get flag indicating indicating that CCMs are being received from a MEP that could be in some other MA. |
| 76 | * @return true or false |
| 77 | */ |
| 78 | boolean activeXconCcmDefect(); |
| 79 | |
| 80 | /** |
| 81 | * The last-received CCM that triggered a DEF_ERROR_CCM fault. |
| 82 | * |
| 83 | * @return An array of bytes (length 1-1522) containing the CCM |
| 84 | */ |
| 85 | byte[] lastErrorCcm(); |
| 86 | |
| 87 | /** |
| 88 | * The last-received CCM that triggered a DEF_XCON_CCM fault. |
| 89 | * |
| 90 | * @return An array of bytes (length 1-1522) containing the CCM |
| 91 | */ |
| 92 | byte[] lastXconCcm(); |
| 93 | |
| 94 | /** |
| 95 | * Get the total number of out-of-sequence CCMs received. |
| 96 | * @return The total number of out-of-sequence CCMs received |
| 97 | */ |
| 98 | int ccmSequenceErrorCount(); |
| 99 | |
| 100 | /** |
| 101 | * Get the total number of CCMs transmitted. |
| 102 | * @return The total number of CCMs transmitted |
| 103 | */ |
| 104 | int totalCcmsTransmitted(); |
| 105 | |
| 106 | /** |
| 107 | * Get the collection of attributes related to loopback. |
| 108 | * @return An object with loopback attributes |
| 109 | */ |
| 110 | MepLbEntry loopbackAttributes(); |
| 111 | |
| 112 | /** |
| 113 | * Get the collection of attributes related to linktrace. |
| 114 | * @return An object with linktrace attributes |
| 115 | */ |
| 116 | MepLtEntry linktraceAttributes(); |
| 117 | |
| 118 | /** |
| 119 | * Get the list of active Remote MEPs. |
| 120 | * @return A list of remote MEPs including their states |
| 121 | */ |
| 122 | Collection<RemoteMepEntry> activeRemoteMepList(); |
| 123 | |
| 124 | /** |
| 125 | * Get the list of Delay Measurements for this MEP. |
| 126 | * @return A list of the Delay Measurements including their states |
| 127 | */ |
| 128 | Collection<DelayMeasurementEntry> delayMeasurementList(); |
| 129 | |
| 130 | /** |
| 131 | * Get the list of Loss Measurements for this MEP. |
| 132 | * @return A list of the Loss Measurements including their states |
| 133 | */ |
| 134 | Collection<LossMeasurementEntry> lossMeasurementList(); |
| 135 | |
| 136 | /** |
| 137 | * States of Fault Notification Generator. |
| 138 | */ |
| 139 | public enum FngState { |
| 140 | FNG_RESET, |
| 141 | FNG_DEFECT, |
| 142 | FNG_REPORT_DEFECT, |
| 143 | FNG_DEFECT_REPORTED, |
| 144 | FNG_DEFECT_CLEARING |
| 145 | } |
| 146 | |
| 147 | /** |
| 148 | * Builder for {@link org.onosproject.incubator.net.l2monitoring.cfm.MepEntry}. |
| 149 | */ |
| 150 | interface MepEntryBuilder extends MepBuilder { |
| 151 | MepEntryBuilder macAddress(MacAddress macAddress); |
| 152 | |
| 153 | MepEntryBuilder fngState(FngState fngState); |
| 154 | |
| 155 | MepEntryBuilder highestPriorityDefect(FaultDefectType highestPriorityDefect); |
| 156 | |
| 157 | MepEntryBuilder activeRdiCcmDefect(boolean activeRdiCcmDefect); |
| 158 | |
| 159 | MepEntryBuilder activeMacStatusDefect(boolean activeMacStatusDefect); |
| 160 | |
| 161 | MepEntryBuilder activeRemoteCcmDefect(boolean activeRemoteCcmDefect); |
| 162 | |
| 163 | MepEntryBuilder activeErrorCcmDefect(boolean activeErrorCcmDefect); |
| 164 | |
| 165 | MepEntryBuilder activeXconCcmDefect(boolean activeXconCcmDefect); |
| 166 | |
| 167 | MepEntryBuilder lastErrorCcm(byte[] lastErrorCcm); |
| 168 | |
| 169 | MepEntryBuilder lastXconCcm(byte[] lastXconCcm); |
| 170 | |
| 171 | MepEntryBuilder ccmSequenceErrorCount(int ccmSequenceErrorCount); |
| 172 | |
| 173 | MepEntryBuilder totalCcmsTransmitted(int totalCcmsTransmitted); |
| 174 | |
| 175 | MepEntryBuilder loopbackAttributes(MepLbEntry loopbackAttributes); |
| 176 | |
| 177 | MepEntryBuilder linktraceAttributes(MepLtEntry linktraceAttributes); |
| 178 | |
| 179 | MepEntryBuilder addToActiveRemoteMepList(RemoteMepEntry activeRemoteMep); |
| 180 | |
| 181 | MepEntryBuilder addToDelayMeasurementList(DelayMeasurementEntry delayMeasurement); |
| 182 | |
| 183 | MepEntryBuilder addToLossMeasurementList(LossMeasurementEntry lossMeasurement); |
| 184 | |
| 185 | MepEntry buildEntry() throws CfmConfigException; |
| 186 | } |
| 187 | } |