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 org.onlab.packet.MacAddress; |
| 19 | import org.onosproject.incubator.net.l2monitoring.cfm.Mep.Priority; |
| 20 | import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId; |
| 21 | |
| 22 | /** |
| 23 | * Grouping of parameters used to create a loopback test on a MEP. |
| 24 | */ |
| 25 | public interface MepLbCreate { |
| 26 | /** |
| 27 | * The remote Mep will be identified by either a MacAddress or a MEPId. |
| 28 | * @return The MAC address of the remoteMep |
| 29 | */ |
| 30 | MacAddress remoteMepAddress(); |
| 31 | |
| 32 | /** |
| 33 | * The remote Mep will be identified by either a MacAddress or a MEPId. |
| 34 | * @return The id of the remoteMep |
| 35 | */ |
| 36 | MepId remoteMepId(); |
| 37 | |
| 38 | /** |
| 39 | * The number of LBM transmissions in a session. |
| 40 | * [802.1q] 12.14.7.3.2:c, [MEF30] R39 |
| 41 | * @return The number of messages to send |
| 42 | */ |
| 43 | Integer numberMessages(); |
| 44 | |
| 45 | /** |
| 46 | * An arbitrary amount of data to be included in a Data TLV. |
| 47 | * [802.1q] 12.14.7.3.d, IEEE8021-CFM-MIB.dot1agCfmMepTransmitLbmDataTlv |
| 48 | * @return The data that will be sent encoded as hexadecimal (lower case, colon separated bytes) |
| 49 | */ |
| 50 | String dataTlvHex(); |
| 51 | |
| 52 | /** |
| 53 | * The priority parameter to be used in the transmitted LBMs. |
| 54 | * [802.1q] 12.14.7.3.2:e |
| 55 | * @return The priority to be used |
| 56 | */ |
| 57 | Priority vlanPriority(); |
| 58 | |
| 59 | /** |
| 60 | * The drop eligible parameter to be used in the transmitted LBMs. |
| 61 | * @return True or False |
| 62 | */ |
| 63 | Boolean vlanDropEligible(); |
| 64 | |
| 65 | /** |
| 66 | * Builder for {@link org.onosproject.incubator.net.l2monitoring.cfm.MepLbCreate}. |
| 67 | */ |
| 68 | interface MepLbCreateBuilder { |
| 69 | MepLbCreateBuilder numberMessages(int numberMessages); |
| 70 | |
| 71 | /** |
| 72 | * Define the dataTlv straight from a byte array. |
| 73 | * @param dataTlv String of hex pairs separated by : e.g. AA:BB:CC |
| 74 | * @return The builder |
| 75 | */ |
| 76 | MepLbCreateBuilder dataTlv(byte[] dataTlv); |
| 77 | |
| 78 | /** |
| 79 | * Define the dataTlv byte array from a Hex string. |
| 80 | * @param dataTlv String of hex pairs separated by : e.g. AA:BB:CC |
| 81 | * @return The builder |
| 82 | */ |
| 83 | MepLbCreateBuilder dataTlvHex(String dataTlv); |
| 84 | |
| 85 | /** |
| 86 | * Define the dataTlv byte array from a Base64 string. |
| 87 | * @param dataTlv A string in base64 encoding |
| 88 | * @return The builder |
| 89 | */ |
| 90 | MepLbCreateBuilder dataTlvB64(String dataTlv); |
| 91 | |
| 92 | MepLbCreateBuilder vlanPriority(Priority vlanPriority); |
| 93 | |
| 94 | MepLbCreateBuilder vlanDropEligible(boolean vlanDropEligible); |
| 95 | |
| 96 | MepLbCreate build(); |
| 97 | } |
| 98 | } |