blob: f7a9bcce13a444b94560a5b96a0426903e49fb4b [file] [log] [blame]
Bharat saraswal531fcf52015-10-26 12:34:51 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Bharat saraswal531fcf52015-10-26 12:34:51 +05303 *
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.vtnrsc;
17
18import org.onlab.packet.IpPrefix;
19
20/**
21 * Abstraction of an entity which provides flow classifier for service function chain.
22 * FlowClassifier classify the traffic based on the criteria defined in the request.
23 * The classification can be based on port range or source and destination IP address or
24 * other flow classifier elements.
25 */
26public interface FlowClassifier {
27
28 /**
29 * Returns flow classifier ID.
30 *
31 * @return flow classifier id
32 */
33 FlowClassifierId flowClassifierId();
34
35 /**
36 * Returns Tenant ID.
37 *
38 * @return tenant Id
39 */
40 TenantId tenantId();
41
42 /**
43 * Returns flow classifier name.
44 *
45 * @return flow classifier name
46 */
47 String name();
48
49 /**
50 * Returns flow classifier description.
51 *
52 * @return flow classifier description
53 */
54 String description();
55
56 /**
57 * Returns EtherType.
58 *
59 * @return EtherType
60 */
61 String etherType();
62
63 /**
64 * Returns IP Protocol.
65 *
66 * @return IP protocol
67 */
68 String protocol();
69
70 /**
Phaneendra Manda299877f2016-04-13 23:28:03 +053071 * Returns priority.
72 *
73 * @return priority
74 */
75 int priority();
76
77 /**
Bharat saraswal531fcf52015-10-26 12:34:51 +053078 * Returns minimum source port range.
79 *
80 * @return minimum source port range
81 */
82 int minSrcPortRange();
83
84 /**
85 * Returns maximum source port range.
86 *
87 * @return maximum source port range
88 */
89 int maxSrcPortRange();
90
91 /**
92 * Returns minimum destination port range.
93 *
94 * @return minimum destination port range
95 */
96 int minDstPortRange();
97
98 /**
99 * Returns maximum destination port range.
100 *
101 * @return maximum destination port range.
102 */
103 int maxDstPortRange();
104
105 /**
106 * Returns Source IP prefix.
107 *
108 * @return Source IP prefix
109 */
110 IpPrefix srcIpPrefix();
111
112 /**
113 * Returns Destination IP prefix.
114 *
115 * @return Destination IP prefix
116 */
117 IpPrefix dstIpPrefix();
118
119 /**
120 * Returns Source virtual port.
121 *
122 * @return Source virtual port
123 */
124 VirtualPortId srcPort();
125
126 /**
127 * Returns Destination virtual port.
128 *
129 * @return Destination virtual port
130 */
131 VirtualPortId dstPort();
132
133 /**
134 * Returns whether this Flow classifier is an exact match to the
135 * Flow classifier given in the argument.
136 *
137 * @param flowClassifier other flowClassifier to match against
138 * @return true if the flowClassifiers are an exact match, otherwise false
139 */
140 boolean exactMatch(FlowClassifier flowClassifier);
141
142 /**
143 * Builder for flow Classifier.
144 */
145 interface Builder {
146
147 /**
148 * Returns Flow Classifier.
149 *
150 * @return flow classifier.
151 */
152 FlowClassifier build();
153
154 /**
155 * Sets Flow Classifier ID.
156 *
157 * @param flowClassifierId flow classifier id.
158 * @return Builder object by setting flow classifier Id.
159 */
160 Builder setFlowClassifierId(FlowClassifierId flowClassifierId);
161
162 /**
163 * Sets Tenant ID.
164 *
165 * @param tenantId tenant id.
166 * @return Builder object by setting Tenant ID.
167 */
168 Builder setTenantId(TenantId tenantId);
169
170 /**
171 * Sets Flow classifier name.
172 *
173 * @param name flow classifier name
174 * @return builder object by setting flow classifier name
175 */
176 Builder setName(String name);
177
178 /**
179 * Sets flow classifier description.
180 *
181 * @param description flow classifier description
182 * @return flow classifier description
183 */
184 Builder setDescription(String description);
185
186 /**
187 * Sets EtherType.
188 *
189 * @param etherType EtherType
190 * @return EtherType
191 */
192 Builder setEtherType(String etherType);
193
194 /**
195 * Sets IP protocol.
196 *
197 * @param protocol IP protocol
198 * @return builder object by setting IP protocol
199 */
200 Builder setProtocol(String protocol);
201
202 /**
Phaneendra Manda299877f2016-04-13 23:28:03 +0530203 * Sets priority.
204 *
205 * @param priority priority
206 * @return builder object by setting priority
207 */
208 Builder setPriority(int priority);
209
210 /**
Bharat saraswal531fcf52015-10-26 12:34:51 +0530211 * Set minimum source port range.
212 *
213 * @param minRange minimum source port range
214 * @return builder object by setting minimum source port range
215 */
216 Builder setMinSrcPortRange(int minRange);
217
218 /**
219 * Sets maximum source port range.
220 *
221 * @param maxRange maximum source port range
222 * @return builder object by setting maximum source port range
223 */
224 Builder setMaxSrcPortRange(int maxRange);
225
226 /**
227 * Sets minimum destination port range.
228 *
229 * @param minRange minimum destination port range
230 * @return builder object by setting minimum destination port range
231 */
232 Builder setMinDstPortRange(int minRange);
233
234 /**
235 * Sets maximum destination port range.
236 *
237 * @param maxRange maximum destination port range.
238 * @return builder object by setting maximum destination port range.
239 */
240 Builder setMaxDstPortRange(int maxRange);
241
242 /**
243 * Sets Source IP prefix.
244 *
245 * @param srcIpPrefix Source IP prefix
246 * @return builder object by setting Source IP prefix
247 */
248 Builder setSrcIpPrefix(IpPrefix srcIpPrefix);
249
250 /**
251 * Sets Destination IP prefix.
252 *
253 * @param dstIpPrefix Destination IP prefix
254 * @return builder object by setting Destination IP prefix
255 */
256 Builder setDstIpPrefix(IpPrefix dstIpPrefix);
257
258 /**
259 * Sets Source virtual port.
260 *
261 * @param srcPort Source virtual port
262 * @return builder object by setting Source virtual port
263 */
264 Builder setSrcPort(VirtualPortId srcPort);
265
266 /**
267 * Sets Destination virtual port.
268 *
269 * @param dstPort Destination virtual port
270 * @return builder object by setting Destination virtual port
271 */
272 Builder setDstPort(VirtualPortId dstPort);
273 }
274}