blob: 86caca65de2cea69ed54df70804b4a68bd1708c7 [file] [log] [blame]
Boyoung Jeong9e8faec2018-06-17 21:19:23 +09001/*
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 */
16package org.onosproject.openstacktelemetry.api;
17
18import org.onlab.packet.IpPrefix;
19import org.onlab.packet.TpPort;
20
21/**
22 * Flow Rule Interface for Statistics.
23 */
24public 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 Jeong9e8faec2018-06-17 21:19:23 +090039 /**
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 Jeong9e8faec2018-06-17 21:19:23 +090061 /**
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 Jeong9e8faec2018-06-17 21:19:23 +090081 /**
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 Jeong9e8faec2018-06-17 21:19:23 +090089 /**
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 Jeong9e8faec2018-06-17 21:19:23 +090097 /**
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}