Jian Li | 38e4d94 | 2018-07-03 22:19:16 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-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.openstackvtap.api; |
| 17 | |
| 18 | import org.onlab.packet.IpPrefix; |
| 19 | import org.onlab.packet.TpPort; |
| 20 | |
| 21 | /** |
| 22 | * A vTAP criterion used for mirroring traffic. |
| 23 | */ |
| 24 | public interface OpenstackVtapCriterion { |
| 25 | |
| 26 | /** |
| 27 | * Returns IP Prefix of Source VM. |
| 28 | * |
| 29 | * @return source IP prefix |
| 30 | */ |
| 31 | IpPrefix srcIpPrefix(); |
| 32 | |
| 33 | /** |
| 34 | * Returns IP Prefix of Destination VM. |
| 35 | * |
| 36 | * @return destination IP prefix |
| 37 | */ |
| 38 | IpPrefix dstIpPrefix(); |
| 39 | |
| 40 | /** |
| 41 | * Returns IP protocol. |
| 42 | * |
| 43 | * @return IP protocol |
| 44 | */ |
| 45 | byte ipProtocol(); |
| 46 | |
| 47 | /** |
| 48 | * Returns source transport port. |
| 49 | * |
| 50 | * @return source transport port number |
| 51 | */ |
| 52 | |
| 53 | TpPort srcTpPort(); |
| 54 | |
| 55 | /** |
| 56 | * Returns destination transport port. |
| 57 | * |
| 58 | * @return destination transport port number |
| 59 | */ |
| 60 | TpPort dstTpPort(); |
| 61 | |
| 62 | /** |
| 63 | * Builder of new openstack vTap criteria. |
| 64 | */ |
| 65 | interface Builder { |
| 66 | |
| 67 | /** |
| 68 | * Builds an immutable openstack vTap criterion instance. |
| 69 | * |
| 70 | * @return openstack vTap criterion |
| 71 | */ |
| 72 | OpenstackVtapCriterion build(); |
| 73 | |
| 74 | /** |
| 75 | * Returns openstack vTap criterion builder with supplied srcIpPrefix. |
| 76 | * |
| 77 | * @param srcIpPrefix Source IP address |
| 78 | * @return openstack vTap criterion builder |
| 79 | */ |
| 80 | Builder srcIpPrefix(IpPrefix srcIpPrefix); |
| 81 | |
| 82 | /** |
| 83 | * Returns openstack vTap criterion builder with supplied srcIpPrefix. |
| 84 | * |
| 85 | * @param dstIpPrefix Destination IP Prefix |
| 86 | * @return openstack vTap criterion builder |
| 87 | */ |
| 88 | Builder dstIpPrefix(IpPrefix dstIpPrefix); |
| 89 | |
| 90 | /** |
| 91 | * Returns openstack vTap criterion builder with supplied ipProtocol. |
| 92 | * |
| 93 | * @param ipProtocol IP protocol number |
| 94 | * @return openstack vTap criterion builder |
| 95 | */ |
| 96 | Builder ipProtocol(byte ipProtocol); |
| 97 | |
| 98 | /** |
| 99 | * Returns openstack vTap criterion builder with supplied srcTpPort. |
| 100 | * |
| 101 | * @param srcTpPort Source transport port number |
| 102 | * @return openstack vTap criterion builder |
| 103 | */ |
| 104 | Builder srcTpPort(TpPort srcTpPort); |
| 105 | |
| 106 | /** |
| 107 | * Returns openstack vTap criterion builder with supplied dstTpPort. |
| 108 | * |
| 109 | * @param dstTpPort Destination transport port number |
| 110 | * @return openstack vTap criterion builder |
| 111 | */ |
| 112 | Builder dstTpPort(TpPort dstTpPort); |
| 113 | } |
| 114 | } |