blob: 5806f10b38ddbd46c35f67b2552e27ff0911b68b [file] [log] [blame]
Carmelo Cascone17fc9e42016-05-31 11:29:21 -07001/*
2 * Copyright 2016-present Open Networking Laboratory
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
17package org.onosproject.bmv2.api.service;
18
19
20import org.onosproject.bmv2.api.context.Bmv2FlowRuleTranslator;
21import org.onosproject.bmv2.api.runtime.Bmv2FlowRuleWrapper;
Carmelo Cascone17fc9e42016-05-31 11:29:21 -070022import org.onosproject.bmv2.api.runtime.Bmv2TableEntryReference;
Carmelo Cascone17fc9e42016-05-31 11:29:21 -070023
24/**
25 * A service for managing BMv2 table entries.
26 */
27public interface Bmv2TableEntryService {
28
29 /**
30 * Returns a flow rule translator.
31 *
32 * @return a flow rule translator
33 */
34 Bmv2FlowRuleTranslator getFlowRuleTranslator();
35
36 /**
Carmelo Cascone17fc9e42016-05-31 11:29:21 -070037 * Binds the given ONOS flow rule with a BMv2 table entry reference.
38 *
39 * @param entryRef a table entry reference
40 * @param rule a BMv2 flow rule wrapper
41 */
42 void bindEntryReference(Bmv2TableEntryReference entryRef, Bmv2FlowRuleWrapper rule);
43
44 /**
45 * Returns the ONOS flow rule associated with the given BMv2 table entry reference, or null if there's no such a
46 * mapping.
47 *
48 * @param entryRef a table entry reference
49 * @return a BMv2 flow rule wrapper
50 */
51 Bmv2FlowRuleWrapper lookupEntryReference(Bmv2TableEntryReference entryRef);
52
53 /**
54 * Removes any flow rule previously bound with a given BMv2 table entry reference.
55 *
56 * @param entryRef a table entry reference
57 */
58 void unbindEntryReference(Bmv2TableEntryReference entryRef);
59}