Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 | ||||
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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. | ||||
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.flow; |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 17 | |
alshabib | 7b808c5 | 2015-06-26 14:22:24 -0700 | [diff] [blame] | 18 | import org.onlab.packet.EthType; |
Pavlin Radoslavov | 855ea2d | 2014-10-30 15:32:39 -0700 | [diff] [blame] | 19 | import org.onlab.packet.IpAddress; |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 20 | import org.onlab.packet.MacAddress; |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 21 | import org.onlab.packet.MplsLabel; |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 22 | import org.onlab.packet.VlanId; |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 23 | import org.onosproject.core.GroupId; |
24 | import org.onosproject.net.PortNumber; | ||||
25 | import org.onosproject.net.flow.instructions.Instruction; | ||||
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 26 | import org.onosproject.net.flow.instructions.Instructions; |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 27 | |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 28 | import java.util.List; |
29 | |||||
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 30 | /** |
31 | * Abstraction of network traffic treatment. | ||||
32 | */ | ||||
33 | public interface TrafficTreatment { | ||||
34 | |||||
35 | /** | ||||
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 36 | * Returns the list of treatment instructions that will be applied |
37 | * further down the pipeline. | ||||
38 | * @return list of treatment instructions | ||||
39 | */ | ||||
40 | List<Instruction> deferred(); | ||||
41 | |||||
42 | /** | ||||
43 | * Returns the list of treatment instructions that will be applied | ||||
44 | * immediately. | ||||
45 | * @return list of treatment instructions | ||||
46 | */ | ||||
47 | List<Instruction> immediate(); | ||||
48 | |||||
49 | /** | ||||
Jonathan Hart | 8ef6d3b | 2015-03-08 21:21:27 -0700 | [diff] [blame] | 50 | * Returns the list of all instructions in the treatment, both immediate and |
51 | * deferred. | ||||
52 | * | ||||
53 | * @return list of treatment instructions | ||||
54 | */ | ||||
55 | List<Instruction> allInstructions(); | ||||
56 | |||||
57 | /** | ||||
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 58 | * Returns the next table in the pipeline. |
59 | * @return a table transition; may be null. | ||||
60 | */ | ||||
61 | Instructions.TableTypeTransition tableTransition(); | ||||
62 | |||||
63 | /** | ||||
64 | * Whether the deferred treatment instructions will be cleared | ||||
65 | * by the device. | ||||
66 | * @return a boolean | ||||
67 | */ | ||||
Jonathan Hart | 4a0ba56 | 2015-03-23 17:23:33 -0700 | [diff] [blame] | 68 | boolean clearedDeferred(); |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 69 | |
70 | /** | ||||
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 71 | * Returns the metadata instruction if there is one. |
72 | * | ||||
73 | * @return a metadata instruction that may be null | ||||
74 | */ | ||||
75 | Instructions.MetadataInstruction writeMetadata(); | ||||
76 | |||||
77 | /** | ||||
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 78 | * Builder of traffic treatment entities. |
79 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 80 | interface Builder { |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 81 | |
82 | /** | ||||
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 83 | * Adds an instruction to the builder. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 84 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 85 | * @param instruction an instruction |
86 | * @return a treatment builder | ||||
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 87 | */ |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 88 | Builder add(Instruction instruction); |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 89 | |
90 | /** | ||||
Thomas Vachuska | f4df005 | 2015-01-06 12:30:11 -0800 | [diff] [blame] | 91 | * Adds a drop instruction. |
92 | * | ||||
93 | * @return a treatment builder | ||||
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 94 | */ |
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 95 | Builder drop(); |
Thomas Vachuska | f4df005 | 2015-01-06 12:30:11 -0800 | [diff] [blame] | 96 | |
97 | /** | ||||
98 | * Adds a punt-to-controller instruction. | ||||
99 | * | ||||
100 | * @return a treatment builder | ||||
101 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 102 | Builder punt(); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 103 | |
104 | /** | ||||
105 | * Set the output port. | ||||
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 106 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 107 | * @param number the out port |
108 | * @return a treatment builder | ||||
109 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 110 | Builder setOutput(PortNumber number); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 111 | |
112 | /** | ||||
113 | * Sets the src l2 address. | ||||
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 114 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 115 | * @param addr a macaddress |
116 | * @return a treatment builder | ||||
117 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 118 | Builder setEthSrc(MacAddress addr); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 119 | |
120 | /** | ||||
121 | * Sets the dst l2 address. | ||||
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 122 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 123 | * @param addr a macaddress |
124 | * @return a treatment builder | ||||
125 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 126 | Builder setEthDst(MacAddress addr); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 127 | |
128 | /** | ||||
129 | * Sets the vlan id. | ||||
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 130 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 131 | * @param id a vlanid |
132 | * @return a treatment builder | ||||
133 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 134 | Builder setVlanId(VlanId id); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 135 | |
136 | /** | ||||
137 | * Sets the vlan priority. | ||||
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 138 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 139 | * @param pcp a vlan priority |
140 | * @return a treatment builder | ||||
141 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 142 | Builder setVlanPcp(Byte pcp); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 143 | |
144 | /** | ||||
145 | * Sets the src l3 address. | ||||
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 146 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 147 | * @param addr an ip |
148 | * @return a treatment builder | ||||
149 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 150 | Builder setIpSrc(IpAddress addr); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 151 | |
152 | /** | ||||
153 | * Sets the dst l3 address. | ||||
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 154 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 155 | * @param addr an ip |
156 | * @return a treatment builder | ||||
157 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 158 | Builder setIpDst(IpAddress addr); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 159 | |
160 | /** | ||||
Pavlin Radoslavov | febe82c | 2015-02-11 19:08:15 -0800 | [diff] [blame] | 161 | * Decrement the TTL in IP header by one. |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 162 | * |
163 | * @return a treatment builder | ||||
164 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 165 | Builder decNwTtl(); |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 166 | |
167 | /** | ||||
168 | * Copy the TTL to outer protocol layer. | ||||
169 | * | ||||
170 | * @return a treatment builder | ||||
171 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 172 | Builder copyTtlOut(); |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 173 | |
174 | /** | ||||
175 | * Copy the TTL to inner protocol layer. | ||||
176 | * | ||||
177 | * @return a treatment builder | ||||
178 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 179 | Builder copyTtlIn(); |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 180 | |
181 | /** | ||||
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 182 | * Push MPLS ether type. |
Thomas Vachuska | f4df005 | 2015-01-06 12:30:11 -0800 | [diff] [blame] | 183 | * |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 184 | * @return a treatment builder. |
185 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 186 | Builder pushMpls(); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 187 | |
188 | /** | ||||
189 | * Pops MPLS ether type. | ||||
Thomas Vachuska | f4df005 | 2015-01-06 12:30:11 -0800 | [diff] [blame] | 190 | * |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 191 | * @return a treatment builder. |
192 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 193 | Builder popMpls(); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 194 | |
195 | /** | ||||
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 196 | * Pops MPLS ether type and set the new ethertype. |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 197 | * |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 198 | * @param etherType an ether type |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 199 | * @return a treatment builder. |
Sho SHIMIZU | 9a2b081 | 2015-06-30 10:02:22 -0700 | [diff] [blame] | 200 | * @deprecated in Drake Release |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 201 | */ |
alshabib | 7b808c5 | 2015-06-26 14:22:24 -0700 | [diff] [blame] | 202 | @Deprecated |
alshabib | 0ad4398 | 2015-05-07 13:43:13 -0700 | [diff] [blame] | 203 | Builder popMpls(int etherType); |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 204 | |
205 | /** | ||||
alshabib | 7b808c5 | 2015-06-26 14:22:24 -0700 | [diff] [blame] | 206 | * Pops MPLS ether type and set the new ethertype. |
207 | * | ||||
208 | * @param etherType an ether type | ||||
209 | * @return a treatment builder. | ||||
210 | */ | ||||
211 | Builder popMpls(EthType etherType); | ||||
212 | |||||
213 | /** | ||||
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 214 | * Sets the mpls label. |
Thomas Vachuska | f4df005 | 2015-01-06 12:30:11 -0800 | [diff] [blame] | 215 | * |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 216 | * @param mplsLabel MPLS label. |
217 | * @return a treatment builder. | ||||
218 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 219 | Builder setMpls(MplsLabel mplsLabel); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 220 | |
221 | /** | ||||
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 222 | * Decrement MPLS TTL. |
223 | * | ||||
224 | * @return a treatment builder | ||||
225 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 226 | Builder decMplsTtl(); |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 227 | |
228 | /** | ||||
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 229 | * Sets the optical channel ID or lambda. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 230 | * |
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 231 | * @param lambda optical channel ID |
232 | * @return a treatment builder | ||||
Sho SHIMIZU | 9553bb8 | 2015-06-30 16:02:45 -0700 | [diff] [blame^] | 233 | * @deprecated in Drake Release |
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 234 | */ |
Sho SHIMIZU | 9553bb8 | 2015-06-30 16:02:45 -0700 | [diff] [blame^] | 235 | @Deprecated |
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 236 | Builder setLambda(short lambda); |
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 237 | |
238 | /** | ||||
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 239 | * Sets the group ID. |
240 | * | ||||
241 | * @param groupId group ID | ||||
242 | * @return a treatment builder | ||||
243 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 244 | Builder group(GroupId groupId); |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 245 | |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 246 | |
247 | /** | ||||
248 | * Sets the next table type to transition to. | ||||
249 | * | ||||
250 | * @param type the table type | ||||
251 | * @return a treatement builder | ||||
Sho SHIMIZU | 9a2b081 | 2015-06-30 10:02:22 -0700 | [diff] [blame] | 252 | * @deprecated in Cardinal Release |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 253 | */ |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 254 | @Deprecated |
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 255 | Builder transition(FlowRule.Type type); |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 256 | |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 257 | /** |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 258 | * Sets the next table id to transition to. |
259 | * | ||||
260 | * @param tableId the table table | ||||
261 | * @return a treatement builder | ||||
262 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 263 | Builder transition(Integer tableId); |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 264 | |
265 | |||||
266 | /** | ||||
Saurav Das | fbe25c5 | 2015-03-04 11:12:00 -0800 | [diff] [blame] | 267 | * Pops outermost VLAN tag. |
268 | * | ||||
269 | * @return a treatment builder. | ||||
270 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 271 | Builder popVlan(); |
Saurav Das | fbe25c5 | 2015-03-04 11:12:00 -0800 | [diff] [blame] | 272 | |
273 | /** | ||||
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 274 | * Pushes a new VLAN tag. |
275 | * | ||||
276 | * @return a treatment builder. | ||||
277 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 278 | Builder pushVlan(); |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 279 | |
280 | /** | ||||
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 281 | * Any instructions preceded by this method call will be deferred. |
282 | * @return a treatment builder | ||||
283 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 284 | Builder deferred(); |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 285 | |
286 | /** | ||||
287 | * Any instructions preceded by this method call will be immediate. | ||||
288 | * @return a treatment builder | ||||
289 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 290 | Builder immediate(); |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 291 | |
292 | |||||
293 | /** | ||||
294 | * Instructs the device to clear the deferred instructions set. | ||||
295 | * @return a treatment builder | ||||
296 | */ | ||||
Sho SHIMIZU | 79906e4 | 2015-05-04 18:27:31 -0700 | [diff] [blame] | 297 | Builder wipeDeferred(); |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 298 | |
299 | /** | ||||
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 300 | * Writes metadata to associate with a packet. |
301 | * <pre> | ||||
302 | * {@code | ||||
303 | * new_metadata = (old_metadata & ̃mask) | (value & mask) | ||||
304 | * } | ||||
305 | * </pre> | ||||
306 | * | ||||
307 | * @param value the metadata to write | ||||
308 | * @param mask the masked bits for the value | ||||
309 | * @return a treatment builder | ||||
310 | */ | ||||
311 | Builder writeMetadata(long value, long mask); | ||||
312 | |||||
313 | /** | ||||
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 314 | * Builds an immutable traffic treatment descriptor. |
Brian O'Connor | 6b52813 | 2015-03-10 16:39:52 -0700 | [diff] [blame] | 315 | * <p> |
316 | * If the treatment is empty when build() is called, it will add a default | ||||
317 | * drop rule automatically. For a treatment that is actually empty, use | ||||
318 | * {@link org.onosproject.net.flow.DefaultTrafficTreatment#emptyTreatment}. | ||||
319 | * </p> | ||||
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 320 | * |
321 | * @return traffic treatment | ||||
322 | */ | ||||
323 | TrafficTreatment build(); | ||||
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 324 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 325 | } |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 326 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 327 | } |