CyberHasH | 39b808b | 2019-10-11 05:59:12 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019-present Open Networking Foundation |
| 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 | |
| 17 | package org.onosproject.drivers.p4runtime; |
| 18 | |
| 19 | /** |
| 20 | * Driver properties for P4Runtime. |
| 21 | */ |
| 22 | public final class P4RuntimeDriverProperties { |
| 23 | |
| 24 | // hide default constructor |
| 25 | private P4RuntimeDriverProperties() { |
| 26 | } |
| 27 | |
| 28 | // When updating an existing rule, if true, we issue a DELETE operation |
| 29 | // before inserting the new one, otherwise we issue a MODIFY operation. This |
| 30 | // is useful fore devices that do not support MODIFY operations for table |
| 31 | // entries. |
| 32 | public static final String DELETE_BEFORE_UPDATE = "tableDeleteBeforeUpdate"; |
| 33 | public static final boolean DEFAULT_DELETE_BEFORE_UPDATE = false; |
| 34 | |
| 35 | // If true, we avoid querying the device and return what's already known by |
| 36 | // the ONOS store. |
| 37 | public static final String READ_FROM_MIRROR = "tableReadFromMirror"; |
| 38 | public static final boolean DEFAULT_READ_FROM_MIRROR = false; |
| 39 | |
| 40 | // If true, we read counters when reading table entries (if table has |
| 41 | // counters). Otherwise, we don't. |
| 42 | public static final String SUPPORT_TABLE_COUNTERS = "supportTableCounters"; |
| 43 | public static final boolean DEFAULT_SUPPORT_TABLE_COUNTERS = true; |
| 44 | |
| 45 | // If true, assumes that the device returns table entry message populated |
| 46 | // with direct counter values. If false, we issue a second P4Runtime request |
| 47 | // to read the direct counter values. |
| 48 | public static final String READ_COUNTERS_WITH_TABLE_ENTRIES = "tableReadCountersWithTableEntries"; |
| 49 | public static final boolean DEFAULT_READ_COUNTERS_WITH_TABLE_ENTRIES = true; |
| 50 | |
| 51 | // True if target supports reading and writing table entries. |
| 52 | public static final String SUPPORT_DEFAULT_TABLE_ENTRY = "supportDefaultTableEntry"; |
| 53 | public static final boolean DEFAULT_SUPPORT_DEFAULT_TABLE_ENTRY = true; |
| 54 | } |