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.BitSet; |
| 19 | import java.util.Collection; |
| 20 | |
| 21 | import org.onlab.packet.MacAddress; |
| 22 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId; |
| 23 | |
| 24 | /** |
| 25 | * The LTM entry for a previously transmitted LTM. |
| 26 | * An LTM entry consists of a list of LTR entries, each |
| 27 | * corresponding to a Linktrace Reply (LTR) PDU received in response to that LTM. |
| 28 | * |
| 29 | * See IEEE 802.1Q 12.14.7.5.3 |
| 30 | */ |
| 31 | public interface MepLtTransactionEntry { |
| 32 | /** |
| 33 | * The LTM Transaction Identifier to which the LTR entries will be attached. |
| 34 | * @return The id |
| 35 | */ |
| 36 | int transactionId(); |
| 37 | |
| 38 | /** |
| 39 | * The remote Mep will be identified by either a MacAddress or a MEPId. |
| 40 | * @return The MAC address of the remoteMep |
| 41 | */ |
| 42 | MacAddress macAddress(); |
| 43 | |
| 44 | /** |
| 45 | * The remote Mep will be identified by either a MacAddress or a MEPId. |
| 46 | * @return The id of the remoteMep |
| 47 | */ |
| 48 | MepId mepId(); |
| 49 | |
| 50 | /** |
| 51 | * The Flags field for LTMs transmitted by the MEP. |
| 52 | * [802.1q] 12.14.7.4.2:b |
| 53 | * Bit 0 is use-fdb-only |
| 54 | * @return A bit set of flags |
| 55 | */ |
| 56 | BitSet transmitLtmUseFdbOnly(); |
| 57 | |
| 58 | /** |
| 59 | * An initial value for the LTM TTL field. 64 if not specified. |
| 60 | * [802.1q] 12.14.7.4.2:d |
| 61 | * @return The default number of hops |
| 62 | */ |
| 63 | int defaultTtl(); |
| 64 | |
| 65 | /** |
| 66 | * The list of LTRs associated with a specific Linktrace transaction. |
| 67 | * @return A collection of Replies |
| 68 | */ |
| 69 | Collection<MepLtReply> ltrReplies(); |
| 70 | |
| 71 | /** |
| 72 | * Builder for {@link org.onosproject.incubator.net.l2monitoring.cfm.MepLtTransactionEntry}. |
| 73 | */ |
| 74 | interface MepLtEntryBuilder { |
| 75 | MepLtEntryBuilder macAddress(MacAddress macAddress); |
| 76 | |
| 77 | MepLtEntryBuilder mepId(MepId mepId); |
| 78 | |
| 79 | MepLtEntryBuilder transmitLtmUseFdbOnly(boolean transmitLtmUseFdbOnly); |
| 80 | |
| 81 | MepLtEntryBuilder defaultTtl(int defaultTtl); |
| 82 | |
| 83 | MepLtEntryBuilder addToLtrReplies(MepLtReply ltrReply); |
| 84 | |
| 85 | MepLtEntryBuilder build(); |
| 86 | } |
| 87 | } |