blob: bd4af6cf685923ff6882ab82ca65e47c5943ec06 [file] [log] [blame]
alshabibfaa1e362015-04-02 15:01:54 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
alshabibfaa1e362015-04-02 15:01:54 -07003 *
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.behaviour;
17
Saurav Das24431192016-03-07 19:13:00 -080018import java.util.List;
19
Daniele Moro06aac702021-07-19 22:39:22 +020020import org.onosproject.core.ApplicationId;
alshabibfaa1e362015-04-02 15:01:54 -070021import org.onosproject.net.DeviceId;
alshabib77b88482015-04-07 15:47:50 -070022import org.onosproject.net.driver.HandlerBehaviour;
alshabibfaa1e362015-04-02 15:01:54 -070023import org.onosproject.net.flowobjective.FilteringObjective;
24import org.onosproject.net.flowobjective.ForwardingObjective;
alshabib77b88482015-04-07 15:47:50 -070025import org.onosproject.net.flowobjective.NextObjective;
alshabibfaa1e362015-04-02 15:01:54 -070026
alshabibfaa1e362015-04-02 15:01:54 -070027/**
28 * Behaviour for handling various pipelines.
29 */
alshabib77b88482015-04-07 15:47:50 -070030public interface Pipeliner extends HandlerBehaviour {
alshabibfaa1e362015-04-02 15:01:54 -070031
32 /**
pier8b3aef42019-03-11 15:14:02 -070033 * Accumulator enabled property. Determines whether the accumulator is enabled.
34 * The accumulator is assumed to be disabled if this property is undefined.
35 *
36 * If enabled, the pipeliner will try to accumulate objectives and create
37 * batches of flow rules when possible.
38 *
39 */
40 String ACCUMULATOR_ENABLED = "accumulatorEnabled";
41
42 /**
Thomas Vachuskaca88bb72015-04-08 19:38:02 -070043 * Initializes the driver with context required for its operation.
alshabibfaa1e362015-04-02 15:01:54 -070044 *
45 * @param deviceId the deviceId
Thomas Vachuskaca88bb72015-04-08 19:38:02 -070046 * @param context processing context
alshabibfaa1e362015-04-02 15:01:54 -070047 */
Thomas Vachuskaca88bb72015-04-08 19:38:02 -070048 void init(DeviceId deviceId, PipelinerContext context);
alshabibfaa1e362015-04-02 15:01:54 -070049
50 /**
51 * Installs the filtering rules onto the device.
52 *
alshabib2a441c62015-04-13 18:39:38 -070053 * @param filterObjective a filtering objective
alshabibfaa1e362015-04-02 15:01:54 -070054 */
alshabib2a441c62015-04-13 18:39:38 -070055 void filter(FilteringObjective filterObjective);
alshabibfaa1e362015-04-02 15:01:54 -070056
57 /**
58 * Installs the forwarding rules onto the device.
59 *
alshabib2a441c62015-04-13 18:39:38 -070060 * @param forwardObjective a forwarding objective
alshabibfaa1e362015-04-02 15:01:54 -070061 */
alshabib2a441c62015-04-13 18:39:38 -070062 void forward(ForwardingObjective forwardObjective);
alshabibfaa1e362015-04-02 15:01:54 -070063
alshabib77b88482015-04-07 15:47:50 -070064 /**
65 * Installs the next hop elements into the device.
66 *
alshabib2a441c62015-04-13 18:39:38 -070067 * @param nextObjective a next objectives
alshabib77b88482015-04-07 15:47:50 -070068 */
alshabib2a441c62015-04-13 18:39:38 -070069 void next(NextObjective nextObjective);
Saurav Das24431192016-03-07 19:13:00 -080070
71 /**
Daniele Moro06aac702021-07-19 22:39:22 +020072 * Purges all objectives for the given application.
73 *
74 * @param appId application identifier
75 */
76 void purgeAll(ApplicationId appId);
77
78 /**
Saurav Das24431192016-03-07 19:13:00 -080079 * Retrieves a mapping of the nextObjective to the groups in the dataplane,
80 * and returns it in a form that can be displayed on the CLI. Typically
81 * group-ids are returned for groups with multiple buckets, where each list element
82 * represents a bucket. For nextObjectives that are converted to flow-actions,
83 * an empty list is returned.
84 *
85 * @param nextGroup representation of the nextObjective. This representation
86 * is stored in the distributed group store
87 * @return a list of preformatted strings representing group information, or
88 * an empty list if no groups were created
89 */
90 List<String> getNextMappings(NextGroup nextGroup);
pier8b3aef42019-03-11 15:14:02 -070091
alshabibfaa1e362015-04-02 15:01:54 -070092}