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