blob: b3494bd7df4b05a6ea47e51e658dcc648a2e151a [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
alshabibfaa1e362015-04-02 15:01:54 -070020import org.onosproject.net.DeviceId;
alshabib77b88482015-04-07 15:47:50 -070021import org.onosproject.net.driver.HandlerBehaviour;
alshabibfaa1e362015-04-02 15:01:54 -070022import org.onosproject.net.flowobjective.FilteringObjective;
23import org.onosproject.net.flowobjective.ForwardingObjective;
alshabib77b88482015-04-07 15:47:50 -070024import org.onosproject.net.flowobjective.NextObjective;
alshabibfaa1e362015-04-02 15:01:54 -070025
alshabibfaa1e362015-04-02 15:01:54 -070026/**
27 * Behaviour for handling various pipelines.
28 */
alshabib77b88482015-04-07 15:47:50 -070029public interface Pipeliner extends HandlerBehaviour {
alshabibfaa1e362015-04-02 15:01:54 -070030
31 /**
Thomas Vachuskaca88bb72015-04-08 19:38:02 -070032 * Initializes the driver with context required for its operation.
alshabibfaa1e362015-04-02 15:01:54 -070033 *
34 * @param deviceId the deviceId
Thomas Vachuskaca88bb72015-04-08 19:38:02 -070035 * @param context processing context
alshabibfaa1e362015-04-02 15:01:54 -070036 */
Thomas Vachuskaca88bb72015-04-08 19:38:02 -070037 void init(DeviceId deviceId, PipelinerContext context);
alshabibfaa1e362015-04-02 15:01:54 -070038
39 /**
40 * Installs the filtering rules onto the device.
41 *
alshabib2a441c62015-04-13 18:39:38 -070042 * @param filterObjective a filtering objective
alshabibfaa1e362015-04-02 15:01:54 -070043 */
alshabib2a441c62015-04-13 18:39:38 -070044 void filter(FilteringObjective filterObjective);
alshabibfaa1e362015-04-02 15:01:54 -070045
46 /**
47 * Installs the forwarding rules onto the device.
48 *
alshabib2a441c62015-04-13 18:39:38 -070049 * @param forwardObjective a forwarding objective
alshabibfaa1e362015-04-02 15:01:54 -070050 */
alshabib2a441c62015-04-13 18:39:38 -070051 void forward(ForwardingObjective forwardObjective);
alshabibfaa1e362015-04-02 15:01:54 -070052
alshabib77b88482015-04-07 15:47:50 -070053 /**
54 * Installs the next hop elements into the device.
55 *
alshabib2a441c62015-04-13 18:39:38 -070056 * @param nextObjective a next objectives
alshabib77b88482015-04-07 15:47:50 -070057 */
alshabib2a441c62015-04-13 18:39:38 -070058 void next(NextObjective nextObjective);
Saurav Das24431192016-03-07 19:13:00 -080059
60 /**
61 * Retrieves a mapping of the nextObjective to the groups in the dataplane,
62 * and returns it in a form that can be displayed on the CLI. Typically
63 * group-ids are returned for groups with multiple buckets, where each list element
64 * represents a bucket. For nextObjectives that are converted to flow-actions,
65 * an empty list is returned.
66 *
67 * @param nextGroup representation of the nextObjective. This representation
68 * is stored in the distributed group store
69 * @return a list of preformatted strings representing group information, or
70 * an empty list if no groups were created
71 */
72 List<String> getNextMappings(NextGroup nextGroup);
alshabibfaa1e362015-04-02 15:01:54 -070073}