alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.net.behaviour; |
| 17 | |
Saurav Das | 2443119 | 2016-03-07 19:13:00 -0800 | [diff] [blame] | 18 | import java.util.List; |
| 19 | |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 20 | import org.onosproject.net.DeviceId; |
alshabib | 77b8848 | 2015-04-07 15:47:50 -0700 | [diff] [blame] | 21 | import org.onosproject.net.driver.HandlerBehaviour; |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 22 | import org.onosproject.net.flowobjective.FilteringObjective; |
| 23 | import org.onosproject.net.flowobjective.ForwardingObjective; |
alshabib | 77b8848 | 2015-04-07 15:47:50 -0700 | [diff] [blame] | 24 | import org.onosproject.net.flowobjective.NextObjective; |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 25 | |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 26 | /** |
| 27 | * Behaviour for handling various pipelines. |
| 28 | */ |
alshabib | 77b8848 | 2015-04-07 15:47:50 -0700 | [diff] [blame] | 29 | public interface Pipeliner extends HandlerBehaviour { |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
pier | 8b3aef4 | 2019-03-11 15:14:02 -0700 | [diff] [blame] | 32 | * Accumulator enabled property. Determines whether the accumulator is enabled. |
| 33 | * The accumulator is assumed to be disabled if this property is undefined. |
| 34 | * |
| 35 | * If enabled, the pipeliner will try to accumulate objectives and create |
| 36 | * batches of flow rules when possible. |
| 37 | * |
| 38 | */ |
| 39 | String ACCUMULATOR_ENABLED = "accumulatorEnabled"; |
| 40 | |
| 41 | /** |
Thomas Vachuska | ca88bb7 | 2015-04-08 19:38:02 -0700 | [diff] [blame] | 42 | * Initializes the driver with context required for its operation. |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 43 | * |
| 44 | * @param deviceId the deviceId |
Thomas Vachuska | ca88bb7 | 2015-04-08 19:38:02 -0700 | [diff] [blame] | 45 | * @param context processing context |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 46 | */ |
Thomas Vachuska | ca88bb7 | 2015-04-08 19:38:02 -0700 | [diff] [blame] | 47 | void init(DeviceId deviceId, PipelinerContext context); |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * Installs the filtering rules onto the device. |
| 51 | * |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 52 | * @param filterObjective a filtering objective |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 53 | */ |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 54 | void filter(FilteringObjective filterObjective); |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 55 | |
| 56 | /** |
| 57 | * Installs the forwarding rules onto the device. |
| 58 | * |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 59 | * @param forwardObjective a forwarding objective |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 60 | */ |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 61 | void forward(ForwardingObjective forwardObjective); |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 62 | |
alshabib | 77b8848 | 2015-04-07 15:47:50 -0700 | [diff] [blame] | 63 | /** |
| 64 | * Installs the next hop elements into the device. |
| 65 | * |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 66 | * @param nextObjective a next objectives |
alshabib | 77b8848 | 2015-04-07 15:47:50 -0700 | [diff] [blame] | 67 | */ |
alshabib | 2a441c6 | 2015-04-13 18:39:38 -0700 | [diff] [blame] | 68 | void next(NextObjective nextObjective); |
Saurav Das | 2443119 | 2016-03-07 19:13:00 -0800 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * Retrieves a mapping of the nextObjective to the groups in the dataplane, |
| 72 | * and returns it in a form that can be displayed on the CLI. Typically |
| 73 | * group-ids are returned for groups with multiple buckets, where each list element |
| 74 | * represents a bucket. For nextObjectives that are converted to flow-actions, |
| 75 | * an empty list is returned. |
| 76 | * |
| 77 | * @param nextGroup representation of the nextObjective. This representation |
| 78 | * is stored in the distributed group store |
| 79 | * @return a list of preformatted strings representing group information, or |
| 80 | * an empty list if no groups were created |
| 81 | */ |
| 82 | List<String> getNextMappings(NextGroup nextGroup); |
pier | 8b3aef4 | 2019-03-11 15:14:02 -0700 | [diff] [blame] | 83 | |
alshabib | faa1e36 | 2015-04-02 15:01:54 -0700 | [diff] [blame] | 84 | } |