blob: 502d69214259fa26ad8c6a35e4ff1232ff1f6298 [file] [log] [blame]
Jian Li0a5d4d22018-06-08 14:06:56 +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.MacAddress;
20import org.onlab.packet.VlanId;
21import org.onosproject.net.DeviceId;
22import org.onosproject.net.PortNumber;
23
24/**
25 * Flow info interface.
26 */
27public interface FlowInfo {
28
29 /**
30 * Obtains flow type.
31 *
32 * @return flow type
33 */
34 byte flowType();
35
36 /**
37 * Obtains device identifier.
38 *
39 * @return device identifier
40 */
41 DeviceId deviceId();
42
43 /**
44 * Obtains input interface identifier.
45 *
46 * @return input interface identifier
47 */
48 int inputInterfaceId();
49
50 /**
51 * Obtains output interface identifier.
52 *
53 * @return output interface identifier
54 */
55 int outputInterfaceId();
56
57 /**
58 * Obtains VLAN identifier.
59 *
60 * @return VLAN identifier
61 */
62 VlanId vlanId();
63
64 /**
65 * Obtains VxLAN identifier.
66 *
67 * @return VxLAN identifier
68 */
69 short vxlanId();
70
71 /**
72 * Obtains source IP address.
73 *
74 * @return source IP address
75 */
76 IpPrefix srcIp();
77
78 /**
79 * Obtains destination IP address.
80 *
81 * @return destination IP address
82 */
83 IpPrefix dstIp();
84
85 /**
86 * Obtains source port.
87 *
88 * @return source port
89 */
90 PortNumber srcPort();
91
92 /**
93 * Obtains destination port.
94 *
95 * @return destination port
96 */
97 PortNumber dstPort();
98
99 /**
100 * Obtains protocol type.
101 *
102 * @return protocol type
103 */
104 byte protocol();
105
106 /**
107 * Obtains source MAC address.
108 *
109 * @return source MAC address
110 */
111 MacAddress srcMac();
112
113 /**
114 * Obtains destination MAC address.
115 *
116 * @return destination MAC address
117 */
118 MacAddress dstMac();
119
120 /**
121 * Obtains flow level stats information.
122 *
123 * @return flow level stats information
124 */
125 StatsInfo statsInfo();
126
127 interface Builder {
128
129 /**
130 * Sets flow type.
131 *
132 * @param flowType flow type
133 * @return builder instance
134 */
135 Builder withFlowType(byte flowType);
136
137 /**
138 * Sets device identifier.
139 *
140 * @param deviceId device identifier
141 * @return builder instance
142 */
143 Builder withDeviceId(DeviceId deviceId);
144
145 /**
146 * Sets input interface identifier.
147 *
148 * @param inputInterfaceId input interface identifier
149 * @return builder instance
150 */
151 Builder withInputInterfaceId(int inputInterfaceId);
152
153 /**
154 * Sets output interface identifier.
155 *
156 * @param outputInterfaceId output interface identifier
157 * @return builder instance
158 */
159 Builder withOutputInterfaceId(int outputInterfaceId);
160
161 /**
162 * Sets VLAN identifier.
163 *
164 * @param vlanId VLAN identifier
165 * @return builder instance
166 */
167 Builder withVlanId(VlanId vlanId);
168
169 /**
170 * Sets VxLAN identifier.
171 *
172 * @param vxlanId VxLAN identifier
173 * @return builder instance
174 */
175 Builder withVxlanId(short vxlanId);
176
177 /**
178 * Sets source IP address.
179 *
180 * @param srcIp source IP address
181 * @return builder instance
182 */
183 Builder withSrcIp(IpPrefix srcIp);
184
185 /**
186 * Sets destination IP address.
187 *
188 * @param dstIp destination IP address
189 * @return builder instance
190 */
191 Builder withDstIp(IpPrefix dstIp);
192
193 /**
194 * Sets source port number.
195 *
196 * @param srcPort source port number
197 * @return builder instance
198 */
199 Builder withSrcPort(PortNumber srcPort);
200
201 /**
202 * Sets destination port number.
203 *
204 * @param dstPort destination port number
205 * @return builder instance
206 */
207 Builder withDstPort(PortNumber dstPort);
208
209 /**
210 * Sets protocol type.
211 *
212 * @param protocol protocol type
213 * @return builder instance
214 */
215 Builder withProtocol(byte protocol);
216
217 /**
218 * Sets source MAC address.
219 *
220 * @param srcMac source MAC address
221 * @return builder instance
222 */
223 Builder withSrcMac(MacAddress srcMac);
224
225 /**
226 * Sets destination MAC address.
227 *
228 * @param dstMac destination MAC address
229 * @return builder instance
230 */
231 Builder withDstMac(MacAddress dstMac);
232
233 /**
234 * Sets flow level stats info.
235 *
236 * @param statsInfo flow level stats info
237 * @return builder instance
238 */
239 Builder withStatsInfo(StatsInfo statsInfo);
240
241 /**
242 * Creates a FlowInfo instance.
243 *
244 * @return FlowInfo instance
245 */
246 FlowInfo build();
247 }
248}