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