Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [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 | |
| 17 | package org.onosproject.p4runtime.api; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
Yi Tseng | 2a340f7 | 2018-11-02 16:52:47 -0700 | [diff] [blame] | 20 | import org.onosproject.grpc.api.GrpcClient; |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 21 | import org.onosproject.net.pi.model.PiActionProfileId; |
Carmelo Cascone | 81929aa | 2018-04-07 01:38:55 -0700 | [diff] [blame] | 22 | import org.onosproject.net.pi.model.PiCounterId; |
| 23 | import org.onosproject.net.pi.model.PiMeterId; |
| 24 | import org.onosproject.net.pi.model.PiPipeconf; |
| 25 | import org.onosproject.net.pi.model.PiTableId; |
| 26 | import org.onosproject.net.pi.runtime.PiActionGroup; |
Yi Tseng | 8d35513 | 2018-04-13 01:40:48 +0800 | [diff] [blame] | 27 | import org.onosproject.net.pi.runtime.PiActionGroupMember; |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 28 | import org.onosproject.net.pi.runtime.PiActionGroupMemberId; |
steven30801 | 7632e15 | 2018-10-20 00:51:08 +0800 | [diff] [blame] | 29 | import org.onosproject.net.pi.runtime.PiCounterCell; |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 30 | import org.onosproject.net.pi.runtime.PiCounterCellId; |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 31 | import org.onosproject.net.pi.runtime.PiMeterCellConfig; |
| 32 | import org.onosproject.net.pi.runtime.PiMeterCellId; |
Carmelo Cascone | 5813681 | 2018-07-19 03:40:16 +0200 | [diff] [blame] | 33 | import org.onosproject.net.pi.runtime.PiMulticastGroupEntry; |
Andrea Campanella | 432f718 | 2017-07-14 18:43:27 +0200 | [diff] [blame] | 34 | import org.onosproject.net.pi.runtime.PiPacketOperation; |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 35 | import org.onosproject.net.pi.runtime.PiTableEntry; |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 36 | |
Carmelo Cascone | d61fdb3 | 2017-10-30 10:09:57 -0700 | [diff] [blame] | 37 | import java.nio.ByteBuffer; |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 38 | import java.util.List; |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 39 | import java.util.Set; |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 40 | import java.util.concurrent.CompletableFuture; |
| 41 | |
| 42 | /** |
| 43 | * Client to control a P4Runtime device. |
| 44 | */ |
| 45 | @Beta |
Yi Tseng | 2a340f7 | 2018-11-02 16:52:47 -0700 | [diff] [blame] | 46 | public interface P4RuntimeClient extends GrpcClient { |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * Type of write operation. |
| 50 | */ |
| 51 | enum WriteOperationType { |
| 52 | UNSPECIFIED, |
| 53 | INSERT, |
Carmelo Cascone | 8d99b17 | 2017-07-18 17:26:31 -0400 | [diff] [blame] | 54 | MODIFY, |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 55 | DELETE |
| 56 | } |
| 57 | |
| 58 | /** |
Carmelo Cascone | 9e4972c | 2018-08-30 00:29:16 -0700 | [diff] [blame] | 59 | * Starts the Stream RPC with the device. |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 60 | * |
| 61 | * @return completable future containing true if the operation was |
| 62 | * successful, false otherwise. |
| 63 | */ |
Carmelo Cascone | 9e4972c | 2018-08-30 00:29:16 -0700 | [diff] [blame] | 64 | CompletableFuture<Boolean> startStreamChannel(); |
| 65 | |
| 66 | /** |
| 67 | * Returns true if the stream RPC is active, false otherwise. |
| 68 | * |
| 69 | * @return boolean |
| 70 | */ |
| 71 | boolean isStreamChannelOpen(); |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 72 | |
| 73 | /** |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 74 | * Sends a master arbitration update to the device with a new election ID |
| 75 | * that is guaranteed to be the highest value between all clients. |
| 76 | * |
| 77 | * @return completable future containing true if the operation was |
| 78 | * successful; false otherwise |
| 79 | */ |
| 80 | CompletableFuture<Boolean> becomeMaster(); |
| 81 | |
| 82 | /** |
Carmelo Cascone | 9e4972c | 2018-08-30 00:29:16 -0700 | [diff] [blame] | 83 | * Returns true if this client is master for the device, false otherwise. |
| 84 | * |
| 85 | * @return boolean |
| 86 | */ |
| 87 | boolean isMaster(); |
| 88 | |
| 89 | /** |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 90 | * Sets the device pipeline according to the given pipeconf, and for the |
| 91 | * given byte buffer representing the target-specific data to be used in the |
| 92 | * P4Runtime's SetPipelineConfig message. This method should be called |
Carmelo Cascone | d61fdb3 | 2017-10-30 10:09:57 -0700 | [diff] [blame] | 93 | * before any other method of this client. |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 94 | * |
Carmelo Cascone | d61fdb3 | 2017-10-30 10:09:57 -0700 | [diff] [blame] | 95 | * @param pipeconf pipeconf |
| 96 | * @param deviceData target-specific data |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 97 | * @return a completable future of a boolean, true if the operations was |
| 98 | * successful, false otherwise. |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 99 | */ |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 100 | CompletableFuture<Boolean> setPipelineConfig( |
| 101 | PiPipeconf pipeconf, ByteBuffer deviceData); |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 102 | |
| 103 | /** |
Carmelo Cascone | 9e4972c | 2018-08-30 00:29:16 -0700 | [diff] [blame] | 104 | * Returns true if the device has the given pipeconf set, false otherwise. |
| 105 | * Equality is based on the P4Info extension of the pipeconf as well as the |
| 106 | * given device data byte buffer. |
| 107 | * <p> |
| 108 | * This method is expected to return {@code true} if invoked after calling |
| 109 | * {@link #setPipelineConfig(PiPipeconf, ByteBuffer)} with the same |
| 110 | * parameters. |
| 111 | * |
| 112 | * @param pipeconf pipeconf |
| 113 | * @param deviceData target-specific data |
| 114 | * @return boolean |
| 115 | */ |
| 116 | boolean isPipelineConfigSet(PiPipeconf pipeconf, ByteBuffer deviceData); |
| 117 | |
| 118 | /** |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 119 | * Performs the given write operation for the given table entries and |
| 120 | * pipeconf. |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 121 | * |
Carmelo Cascone | 8d99b17 | 2017-07-18 17:26:31 -0400 | [diff] [blame] | 122 | * @param entries table entries |
| 123 | * @param opType operation type |
| 124 | * @param pipeconf pipeconf currently deployed on the device |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 125 | * @return true if the operation was successful, false otherwise. |
| 126 | */ |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 127 | CompletableFuture<Boolean> writeTableEntries( |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 128 | List<PiTableEntry> entries, WriteOperationType opType, |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 129 | PiPipeconf pipeconf); |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 130 | |
| 131 | /** |
Carmelo Cascone | 50d195f | 2018-09-11 13:26:38 -0700 | [diff] [blame] | 132 | * Dumps all entries currently installed in the given tables, for the given |
| 133 | * pipeconf. If defaultEntries is set to true only the default action |
| 134 | * entries will be returned, otherwise non-default entries will be |
| 135 | * considered. |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 136 | * |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 137 | * @param tableIds table identifiers |
| 138 | * @param defaultEntries true to read default entries, false for |
| 139 | * non-default |
| 140 | * @param pipeconf pipeconf currently deployed on the device |
| 141 | * @return completable future of a list of table entries |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 142 | */ |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 143 | CompletableFuture<List<PiTableEntry>> dumpTables( |
Carmelo Cascone | 50d195f | 2018-09-11 13:26:38 -0700 | [diff] [blame] | 144 | Set<PiTableId> tableIds, boolean defaultEntries, PiPipeconf pipeconf); |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 145 | |
| 146 | /** |
| 147 | * Dumps entries from all tables, for the given pipeconf. |
| 148 | * |
| 149 | * @param pipeconf pipeconf currently deployed on the device |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 150 | * @return completable future of a list of table entries |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 151 | */ |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 152 | CompletableFuture<List<PiTableEntry>> dumpAllTables(PiPipeconf pipeconf); |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 153 | |
| 154 | /** |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 155 | * Executes a packet-out operation for the given pipeconf. |
Andrea Campanella | 432f718 | 2017-07-14 18:43:27 +0200 | [diff] [blame] | 156 | * |
| 157 | * @param packet packet-out operation to be performed by the device |
| 158 | * @param pipeconf pipeconf currently deployed on the device |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 159 | * @return a completable future of a boolean, true if the operations was |
| 160 | * successful, false otherwise. |
Andrea Campanella | 432f718 | 2017-07-14 18:43:27 +0200 | [diff] [blame] | 161 | */ |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 162 | CompletableFuture<Boolean> packetOut( |
| 163 | PiPacketOperation packet, PiPipeconf pipeconf); |
Andrea Campanella | 432f718 | 2017-07-14 18:43:27 +0200 | [diff] [blame] | 164 | |
Andrea Campanella | 432f718 | 2017-07-14 18:43:27 +0200 | [diff] [blame] | 165 | /** |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 166 | * Returns the value of all counter cells for the given set of counter |
| 167 | * identifiers and pipeconf. |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 168 | * |
| 169 | * @param counterIds counter identifiers |
| 170 | * @param pipeconf pipeconf |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 171 | * @return list of counter data |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 172 | */ |
steven30801 | 7632e15 | 2018-10-20 00:51:08 +0800 | [diff] [blame] | 173 | CompletableFuture<List<PiCounterCell>> readAllCounterCells( |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 174 | Set<PiCounterId> counterIds, PiPipeconf pipeconf); |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 175 | |
| 176 | /** |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 177 | * Returns a list of counter data corresponding to the given set of counter |
| 178 | * cell identifiers, for the given pipeconf. |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 179 | * |
Carmelo Cascone | d61fdb3 | 2017-10-30 10:09:57 -0700 | [diff] [blame] | 180 | * @param cellIds set of counter cell identifiers |
| 181 | * @param pipeconf pipeconf |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 182 | * @return list of counter data |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 183 | */ |
steven30801 | 7632e15 | 2018-10-20 00:51:08 +0800 | [diff] [blame] | 184 | CompletableFuture<List<PiCounterCell>> readCounterCells( |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 185 | Set<PiCounterCellId> cellIds, PiPipeconf pipeconf); |
Carmelo Cascone | b045ddc | 2017-09-01 01:26:35 +0200 | [diff] [blame] | 186 | |
| 187 | /** |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 188 | * Performs the given write operation for the given action group members and |
| 189 | * pipeconf. |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 190 | * |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 191 | * @param members action group members |
| 192 | * @param opType write operation type |
| 193 | * @param pipeconf the pipeconf currently deployed on the device |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 194 | * @return true if the operation was successful, false otherwise |
| 195 | */ |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 196 | CompletableFuture<Boolean> writeActionGroupMembers( |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 197 | List<PiActionGroupMember> members, |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 198 | WriteOperationType opType, PiPipeconf pipeconf); |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 199 | |
| 200 | /** |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 201 | * Performs the given write operation for the given action group and |
| 202 | * pipeconf. |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 203 | * |
Carmelo Cascone | d61fdb3 | 2017-10-30 10:09:57 -0700 | [diff] [blame] | 204 | * @param group the action group |
| 205 | * @param opType write operation type |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 206 | * @param pipeconf the pipeconf currently deployed on the device |
ghj0504520 | ed7340c | 2018-10-26 13:06:35 -0700 | [diff] [blame] | 207 | * @param maxMemberSize the maximum number of members that can be added to the group. |
| 208 | * This is meaningful only if it's an INSERT operation, otherwise |
| 209 | * its value should be 0 |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 210 | * @return true if the operation was successful, false otherwise |
| 211 | */ |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 212 | CompletableFuture<Boolean> writeActionGroup( |
ghj0504520 | ed7340c | 2018-10-26 13:06:35 -0700 | [diff] [blame] | 213 | PiActionGroup group, WriteOperationType opType, PiPipeconf pipeconf, int maxMemberSize); |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 214 | |
| 215 | /** |
| 216 | * Dumps all groups currently installed for the given action profile. |
| 217 | * |
| 218 | * @param actionProfileId the action profile id |
Carmelo Cascone | d61fdb3 | 2017-10-30 10:09:57 -0700 | [diff] [blame] | 219 | * @param pipeconf the pipeconf currently deployed on the device |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 220 | * @return completable future of a list of groups |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 221 | */ |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 222 | CompletableFuture<List<PiActionGroup>> dumpGroups( |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 223 | PiActionProfileId actionProfileId, PiPipeconf pipeconf); |
Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 224 | |
| 225 | /** |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 226 | * Dumps all action profile member IDs for a given action profile. |
| 227 | * |
| 228 | * @param actionProfileId action profile ID |
| 229 | * @param pipeconf pipeconf |
| 230 | * @return future of list of action profile member ID |
| 231 | */ |
| 232 | CompletableFuture<List<PiActionGroupMemberId>> dumpActionProfileMemberIds( |
| 233 | PiActionProfileId actionProfileId, PiPipeconf pipeconf); |
| 234 | |
| 235 | /** |
| 236 | * Removes the given members from the given action profile. Returns the list |
| 237 | * of successfully removed members. |
| 238 | * |
| 239 | * @param actionProfileId action profile ID |
| 240 | * @param memberIds member IDs |
| 241 | * @param pipeconf pipeconf |
| 242 | * @return list of member IDs that were successfully removed from the device |
| 243 | */ |
| 244 | CompletableFuture<List<PiActionGroupMemberId>> removeActionProfileMembers( |
| 245 | PiActionProfileId actionProfileId, |
| 246 | List<PiActionGroupMemberId> memberIds, |
| 247 | PiPipeconf pipeconf); |
| 248 | |
| 249 | /** |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 250 | * Returns the configuration of all meter cells for the given set of meter |
| 251 | * identifiers and pipeconf. |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 252 | * |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 253 | * @param meterIds meter identifiers |
| 254 | * @param pipeconf pipeconf |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 255 | * @return list of meter configurations |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 256 | */ |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 257 | CompletableFuture<List<PiMeterCellConfig>> readAllMeterCells( |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 258 | Set<PiMeterId> meterIds, PiPipeconf pipeconf); |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 259 | |
| 260 | /** |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 261 | * Returns a list of meter configurations corresponding to the given set of |
| 262 | * meter cell identifiers, for the given pipeconf. |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 263 | * |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 264 | * @param cellIds set of meter cell identifiers |
| 265 | * @param pipeconf pipeconf |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 266 | * @return list of meter configrations |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 267 | */ |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 268 | CompletableFuture<List<PiMeterCellConfig>> readMeterCells( |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 269 | Set<PiMeterCellId> cellIds, PiPipeconf pipeconf); |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 270 | |
| 271 | /** |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 272 | * Performs a write operation for the given meter configurations and |
| 273 | * pipeconf. |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 274 | * |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 275 | * @param cellConfigs meter cell configurations |
| 276 | * @param pipeconf pipeconf currently deployed on the device |
Frank Wang | d7e3b4b | 2017-09-24 13:37:54 +0900 | [diff] [blame] | 277 | * @return true if the operation was successful, false otherwise. |
| 278 | */ |
Carmelo Cascone | e5b2872 | 2018-06-22 17:28:28 +0200 | [diff] [blame] | 279 | CompletableFuture<Boolean> writeMeterCells( |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 280 | List<PiMeterCellConfig> cellConfigs, PiPipeconf pipeconf); |
Carmelo Cascone | 5813681 | 2018-07-19 03:40:16 +0200 | [diff] [blame] | 281 | |
| 282 | /** |
| 283 | * Performs the given write operation for the given PI multicast groups |
| 284 | * entries. |
| 285 | * |
| 286 | * @param entries multicast group entries |
| 287 | * @param opType write operation type |
| 288 | * @return true if the operation was successful, false otherwise |
| 289 | */ |
| 290 | CompletableFuture<Boolean> writePreMulticastGroupEntries( |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 291 | List<PiMulticastGroupEntry> entries, |
Carmelo Cascone | 5813681 | 2018-07-19 03:40:16 +0200 | [diff] [blame] | 292 | WriteOperationType opType); |
| 293 | |
| 294 | /** |
| 295 | * Returns all multicast groups on device. |
| 296 | * |
| 297 | * @return multicast groups |
| 298 | */ |
Carmelo Cascone | e44592f | 2018-09-12 02:24:47 -0700 | [diff] [blame] | 299 | CompletableFuture<List<PiMulticastGroupEntry>> readAllMulticastGroupEntries(); |
Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 300 | } |