blob: 015f3c328427ade16f3d3a5bfe43727652a9af60 [file] [log] [blame]
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -08003 *
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.net.group;
17
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080018import org.onosproject.core.GroupId;
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080019import org.onosproject.net.PortNumber;
20import org.onosproject.net.flow.TrafficTreatment;
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080021
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080022/**
23 * Group Bucket definition. A default group Bucket is collection of
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080024 * Instructions that can be performed on a traffic flow. A failover
25 * group bucket is associated with a specific port or group that
26 * controls its liveness. A select group bucket contains optional
27 * weight field to define the weights among the buckets in the group.
28 */
29public interface GroupBucket {
30 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080031 * Returns group type of the bucket.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080032 *
33 * @return GroupType group type
34 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070035 GroupDescription.Type type();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080036
37 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080038 * Returns list of Traffic instructions that are part of the bucket.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080039 *
40 * @return TrafficTreatment traffic instruction list
41 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070042 TrafficTreatment treatment();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080043
44 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080045 * Returns weight of select group bucket.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080046 *
47 * @return short weight associated with a bucket
48 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070049 short weight();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080050
51 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080052 * Returns port number used for liveness detection for a
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080053 * failover bucket.
54 *
55 * @return PortNumber port number used for liveness detection
56 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070057 PortNumber watchPort();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080058
59 /**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080060 * Returns group identifier used for liveness detection for a
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080061 * failover bucket.
62 *
63 * @return GroupId group identifier to be used for liveness detection
64 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070065 GroupId watchGroup();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080066
Srikanth Vavilapalli10e75cd2015-04-13 16:21:24 -070067 /**
68 * Returns the number of packets processed by this group bucket.
69 *
70 * @return number of packets
71 */
72 long packets();
73
74 /**
75 * Returns the number of bytes processed by this group bucket.
76 *
77 * @return number of bytes
78 */
79 long bytes();
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080080}