blob: 5709e4e5fe78c61fee0e2347f4e4bf5eac5a10ac [file] [log] [blame]
Carmelo Cascone1022a4e2017-05-25 00:16:18 -04001/*
2 * Copyright 2017-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.net.pi.model;
18
19import com.google.common.annotations.Beta;
20
21import java.util.Collection;
Carmelo Cascone00a59962017-06-16 17:51:49 +090022import java.util.Optional;
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040023
24/**
25 * Model of a match+action table in a protocol-independent pipeline.
26 */
27@Beta
28public interface PiTableModel {
29
30 /**
31 * Returns the name of this table.
32 *
33 * @return a string value
34 */
35 String name();
36
37 /**
38 * Returns the maximum number of entries supported by this table.
39 *
40 * @return an integer value
41 */
42 int maxSize();
43
44 /**
45 * Returns true if this table has counters, false otherwise.
46 *
47 * @return a boolean value
48 */
49 boolean hasCounters();
50
51 /**
52 * Returns true if this table supports aging, false otherwise.
53 *
54 * @return a boolean value
55 */
56 boolean supportsAging();
57
58 /**
59 * Returns the collection of match fields supported by this table.
60 *
61 * @return a collection of match field models
62 */
63 Collection<PiTableMatchFieldModel> matchFields();
64
65 /**
66 * Returns the actions supported by this table.
67 *
68 * @return a collection of action models
69 */
70 Collection<PiActionModel> actions();
Carmelo Cascone00a59962017-06-16 17:51:49 +090071
72 /**
73 * Returns the action model associated with the given name, if present.
74 * If not present, it means that this table does not support such an action.
75 *
76 * @param name string value
77 * @return optional action model
78 */
79 Optional<PiActionModel> action(String name);
80
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040081}