Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2014-present 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 | |
BitOhenry | b2f8e81 | 2015-11-17 19:19:53 +0800 | [diff] [blame] | 18 | import org.onlab.packet.Ip4Address; |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 19 | import org.onlab.packet.Ip6Address; |
| 20 | import org.onlab.packet.IpPrefix; |
| 21 | import org.onlab.packet.MacAddress; |
| 22 | import org.onlab.packet.MplsLabel; |
| 23 | import org.onlab.packet.TpPort; |
| 24 | import org.onlab.packet.VlanId; |
Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [diff] [blame] | 25 | import org.onosproject.net.DeviceId; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 26 | import org.onosproject.net.PortNumber; |
| 27 | import org.onosproject.net.flow.criteria.Criterion; |
Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [diff] [blame] | 28 | import org.onosproject.net.flow.criteria.ExtensionSelector; |
| 29 | |
| 30 | import java.util.Set; |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 31 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 32 | /** |
| 33 | * Abstraction of a slice of network traffic. |
| 34 | */ |
| 35 | public interface TrafficSelector { |
| 36 | |
| 37 | /** |
| 38 | * Returns selection criteria as an ordered list. |
| 39 | * |
| 40 | * @return list of criteria |
| 41 | */ |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 42 | Set<Criterion> criteria(); |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 43 | |
| 44 | /** |
Jonathan Hart | 936c49d | 2014-10-23 16:38:59 -0700 | [diff] [blame] | 45 | * Returns the selection criterion for a particular type, if it exists in |
| 46 | * this traffic selector. |
| 47 | * |
| 48 | * @param type criterion type to look up |
| 49 | * @return the criterion of the specified type if one exists, otherwise null |
| 50 | */ |
| 51 | Criterion getCriterion(Criterion.Type type); |
| 52 | |
| 53 | /** |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 54 | * Builder of traffic selector entities. |
| 55 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 56 | interface Builder { |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * Adds a traffic selection criterion. If a same type criterion has |
| 60 | * already been added, it will be replaced by this one. |
| 61 | * |
| 62 | * @param criterion new criterion |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 63 | * @return self |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 64 | */ |
alshabib | 369d294 | 2014-09-12 17:59:35 -0700 | [diff] [blame] | 65 | Builder add(Criterion criterion); |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 66 | |
| 67 | /** |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 68 | * Matches an inport. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 69 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 70 | * @param port the inport |
| 71 | * @return a selection builder |
| 72 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 73 | Builder matchInPort(PortNumber port); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 74 | |
| 75 | /** |
Pavlin Radoslavov | d0fd841 | 2015-02-04 13:57:00 -0800 | [diff] [blame] | 76 | * Matches a physical inport. |
| 77 | * |
| 78 | * @param port the physical inport |
| 79 | * @return a selection builder |
| 80 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 81 | Builder matchInPhyPort(PortNumber port); |
Pavlin Radoslavov | d0fd841 | 2015-02-04 13:57:00 -0800 | [diff] [blame] | 82 | |
| 83 | /** |
| 84 | * Matches a metadata. |
| 85 | * |
| 86 | * @param metadata the metadata |
| 87 | * @return a selection builder |
| 88 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 89 | Builder matchMetadata(long metadata); |
Pavlin Radoslavov | d0fd841 | 2015-02-04 13:57:00 -0800 | [diff] [blame] | 90 | |
| 91 | /** |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 92 | * Matches a l2 dst address. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 93 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 94 | * @param addr a l2 address |
| 95 | * @return a selection builder |
| 96 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 97 | Builder matchEthDst(MacAddress addr); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 98 | |
| 99 | /** |
Saurav Das | 9d6c86b | 2016-02-19 09:01:07 -0800 | [diff] [blame] | 100 | * Matches a l2 dst address with mask. |
| 101 | * |
| 102 | * @param addr a l2 address |
| 103 | * @param mask a mask for an l2 address |
| 104 | * @return a selection builder |
| 105 | */ |
| 106 | Builder matchEthDstMasked(MacAddress addr, MacAddress mask); |
| 107 | |
| 108 | /** |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 109 | * Matches a l2 src address. |
| 110 | * |
| 111 | * @param addr a l2 address |
| 112 | * @return a selection builder |
| 113 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 114 | Builder matchEthSrc(MacAddress addr); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 115 | |
| 116 | /** |
Saurav Das | 9d6c86b | 2016-02-19 09:01:07 -0800 | [diff] [blame] | 117 | * Matches a l2 src address with mask. |
| 118 | * |
| 119 | * @param addr a l2 address |
| 120 | * @param mask a mask for an l2 address |
| 121 | * @return a selection builder |
| 122 | */ |
| 123 | Builder matchEthSrcMasked(MacAddress addr, MacAddress mask); |
| 124 | |
| 125 | /** |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 126 | * Matches the ethernet type. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 127 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 128 | * @param ethType an ethernet type |
| 129 | * @return a selection builder |
| 130 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 131 | Builder matchEthType(short ethType); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 132 | |
| 133 | /** |
| 134 | * Matches the vlan id. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 135 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 136 | * @param vlanId a vlan id |
| 137 | * @return a selection builder |
| 138 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 139 | Builder matchVlanId(VlanId vlanId); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 140 | |
| 141 | /** |
| 142 | * Matches a vlan priority. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 143 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 144 | * @param vlanPcp a vlan priority |
| 145 | * @return a selection builder |
| 146 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 147 | Builder matchVlanPcp(byte vlanPcp); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 148 | |
| 149 | /** |
alshabib | fa0dc66 | 2016-01-13 11:23:53 -0800 | [diff] [blame] | 150 | * Matches the inner vlan id. |
| 151 | * |
| 152 | * @param vlanId a vlan id |
| 153 | * @return a selection builder |
| 154 | */ |
| 155 | Builder matchInnerVlanId(VlanId vlanId); |
| 156 | |
| 157 | /** |
| 158 | * Matches a vlan priority. |
| 159 | * |
| 160 | * @param vlanPcp a vlan priority |
| 161 | * @return a selection builder |
| 162 | */ |
| 163 | Builder matchInnerVlanPcp(byte vlanPcp); |
| 164 | |
| 165 | /** |
Pavlin Radoslavov | d0fd841 | 2015-02-04 13:57:00 -0800 | [diff] [blame] | 166 | * Matches an IP DSCP (6 bits in ToS field). |
| 167 | * |
| 168 | * @param ipDscp an IP DSCP value |
| 169 | * @return a selection builder |
| 170 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 171 | Builder matchIPDscp(byte ipDscp); |
Pavlin Radoslavov | d0fd841 | 2015-02-04 13:57:00 -0800 | [diff] [blame] | 172 | |
| 173 | /** |
| 174 | * Matches an IP ECN (2 bits in ToS field). |
| 175 | * |
| 176 | * @param ipEcn an IP ECN value |
| 177 | * @return a selection builder |
| 178 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 179 | Builder matchIPEcn(byte ipEcn); |
Pavlin Radoslavov | d0fd841 | 2015-02-04 13:57:00 -0800 | [diff] [blame] | 180 | |
| 181 | /** |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 182 | * Matches the l3 protocol. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 183 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 184 | * @param proto a l3 protocol |
| 185 | * @return a selection builder |
| 186 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 187 | Builder matchIPProtocol(byte proto); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 188 | |
| 189 | /** |
Charles M.C. Chan | 52fae7d | 2015-01-17 00:35:53 +0800 | [diff] [blame] | 190 | * Matches a l3 IPv4 address. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 191 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 192 | * @param ip a l3 address |
| 193 | * @return a selection builder |
| 194 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 195 | Builder matchIPSrc(IpPrefix ip); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 196 | |
| 197 | /** |
Charles M.C. Chan | 52fae7d | 2015-01-17 00:35:53 +0800 | [diff] [blame] | 198 | * Matches a l3 IPv4 address. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 199 | * |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 200 | * @param ip a l3 address |
| 201 | * @return a selection builder |
| 202 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 203 | Builder matchIPDst(IpPrefix ip); |
alshabib | 010c31d | 2014-09-26 10:01:12 -0700 | [diff] [blame] | 204 | |
| 205 | /** |
Toshio Koide | 9c44c9a | 2014-10-09 11:44:36 -0700 | [diff] [blame] | 206 | * Matches a TCP source port number. |
Sho SHIMIZU | bdaea83 | 2014-11-12 11:29:38 -0800 | [diff] [blame] | 207 | * |
Toshio Koide | 9c44c9a | 2014-10-09 11:44:36 -0700 | [diff] [blame] | 208 | * @param tcpPort a TCP source port number |
| 209 | * @return a selection builder |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 210 | */ |
| 211 | Builder matchTcpSrc(TpPort tcpPort); |
| 212 | |
| 213 | /** |
Andreas Gilbert | 75b882f7 | 2017-02-03 09:58:07 +0100 | [diff] [blame] | 214 | * Matches a TCP source port number with mask. |
| 215 | * |
| 216 | * @param tcpPort a TCP source port number |
| 217 | * @param mask a mask for a TCP source port number |
| 218 | * @return a selection builder |
| 219 | */ |
| 220 | Builder matchTcpSrcMasked(TpPort tcpPort, TpPort mask); |
| 221 | |
| 222 | /** |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 223 | * Matches a TCP destination port number. |
| 224 | * |
| 225 | * @param tcpPort a TCP destination port number |
| 226 | * @return a selection builder |
Toshio Koide | 9c44c9a | 2014-10-09 11:44:36 -0700 | [diff] [blame] | 227 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 228 | Builder matchTcpDst(TpPort tcpPort); |
| 229 | |
| 230 | /** |
Andreas Gilbert | 75b882f7 | 2017-02-03 09:58:07 +0100 | [diff] [blame] | 231 | * Matches a TCP destination port number with mask. |
| 232 | * |
| 233 | * @param tcpPort a TCP destination port number |
| 234 | * @param mask a mask for a TCP destination port number |
| 235 | * @return a selection builder |
| 236 | */ |
| 237 | Builder matchTcpDstMasked(TpPort tcpPort, TpPort mask); |
| 238 | |
| 239 | /** |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 240 | * Matches an UDP source port number. |
| 241 | * |
| 242 | * @param udpPort an UDP source port number |
| 243 | * @return a selection builder |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 244 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 245 | Builder matchUdpSrc(TpPort udpPort); |
| 246 | |
| 247 | /** |
Andreas Gilbert | 75b882f7 | 2017-02-03 09:58:07 +0100 | [diff] [blame] | 248 | * Matches a UDP source port number with mask. |
| 249 | * |
| 250 | * @param udpPort a UDP source port number |
| 251 | * @param mask a mask for a UDP source port number |
| 252 | * @return a selection builder |
| 253 | */ |
| 254 | Builder matchUdpSrcMasked(TpPort udpPort, TpPort mask); |
| 255 | |
| 256 | /** |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 257 | * Matches an UDP destination port number. |
| 258 | * |
| 259 | * @param udpPort an UDP destination port number |
| 260 | * @return a selection builder |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 261 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 262 | Builder matchUdpDst(TpPort udpPort); |
| 263 | |
| 264 | /** |
Andreas Gilbert | 75b882f7 | 2017-02-03 09:58:07 +0100 | [diff] [blame] | 265 | * Matches a UDP destination port number with mask. |
| 266 | * |
| 267 | * @param udpPort a UDP destination port number |
| 268 | * @param mask a mask for a UDP destination port number |
| 269 | * @return a selection builder |
| 270 | */ |
| 271 | Builder matchUdpDstMasked(TpPort udpPort, TpPort mask); |
| 272 | |
| 273 | /** |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 274 | * Matches a SCTP source port number. |
| 275 | * |
| 276 | * @param sctpPort a SCTP source port number |
| 277 | * @return a selection builder |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 278 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 279 | Builder matchSctpSrc(TpPort sctpPort); |
| 280 | |
| 281 | /** |
Andreas Gilbert | 75b882f7 | 2017-02-03 09:58:07 +0100 | [diff] [blame] | 282 | * Matches a SCTP source port number with mask. |
| 283 | * |
| 284 | * @param sctpPort a SCTP source port number |
| 285 | * @param mask a mask for a SCTP source port number |
| 286 | * @return a selection builder |
| 287 | */ |
| 288 | Builder matchSctpSrcMasked(TpPort sctpPort, TpPort mask); |
| 289 | |
| 290 | /** |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 291 | * Matches a SCTP destination port number. |
| 292 | * |
| 293 | * @param sctpPort a SCTP destination port number |
| 294 | * @return a selection builder |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 295 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 296 | Builder matchSctpDst(TpPort sctpPort); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 297 | |
| 298 | /** |
Andreas Gilbert | 75b882f7 | 2017-02-03 09:58:07 +0100 | [diff] [blame] | 299 | * Matches a SCTP destination port number with mask. |
| 300 | * |
| 301 | * @param sctpPort a SCTP destination port number |
| 302 | * @param mask a mask for a SCTP destination port number |
| 303 | * @return a selection builder |
| 304 | */ |
| 305 | Builder matchSctpDstMasked(TpPort sctpPort, TpPort mask); |
| 306 | |
| 307 | /** |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 308 | * Matches an ICMP type. |
| 309 | * |
| 310 | * @param icmpType an ICMP type |
| 311 | * @return a selection builder |
| 312 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 313 | Builder matchIcmpType(byte icmpType); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 314 | |
| 315 | /** |
| 316 | * Matches an ICMP code. |
| 317 | * |
| 318 | * @param icmpCode an ICMP code |
| 319 | * @return a selection builder |
| 320 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 321 | Builder matchIcmpCode(byte icmpCode); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 322 | |
| 323 | /** |
Charles M.C. Chan | 52fae7d | 2015-01-17 00:35:53 +0800 | [diff] [blame] | 324 | * Matches a l3 IPv6 address. |
| 325 | * |
| 326 | * @param ip a l3 IPv6 address |
| 327 | * @return a selection builder |
| 328 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 329 | Builder matchIPv6Src(IpPrefix ip); |
Charles M.C. Chan | 52fae7d | 2015-01-17 00:35:53 +0800 | [diff] [blame] | 330 | |
| 331 | /** |
| 332 | * Matches a l3 IPv6 address. |
| 333 | * |
| 334 | * @param ip a l3 IPv6 address |
| 335 | * @return a selection builder |
| 336 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 337 | Builder matchIPv6Dst(IpPrefix ip); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 338 | |
| 339 | /** |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 340 | * Matches an IPv6 flow label. |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 341 | * |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 342 | * @param flowLabel an IPv6 flow label |
| 343 | * @return a selection builder |
| 344 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 345 | Builder matchIPv6FlowLabel(int flowLabel); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 346 | |
| 347 | /** |
| 348 | * Matches an ICMPv6 type. |
| 349 | * |
| 350 | * @param icmpv6Type an ICMPv6 type |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 351 | * @return a selection builder |
| 352 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 353 | Builder matchIcmpv6Type(byte icmpv6Type); |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 354 | |
| 355 | /** |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 356 | * Matches an ICMPv6 code. |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 357 | * |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 358 | * @param icmpv6Code an ICMPv6 code |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 359 | * @return a selection builder |
| 360 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 361 | Builder matchIcmpv6Code(byte icmpv6Code); |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 362 | |
| 363 | /** |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 364 | * Matches an IPv6 Neighbor Discovery target address. |
| 365 | * |
| 366 | * @param targetAddress an IPv6 Neighbor Discovery target address |
| 367 | * @return a selection builder |
| 368 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 369 | Builder matchIPv6NDTargetAddress(Ip6Address targetAddress); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 370 | |
| 371 | /** |
| 372 | * Matches an IPv6 Neighbor Discovery source link-layer address. |
| 373 | * |
| 374 | * @param mac an IPv6 Neighbor Discovery source link-layer address |
| 375 | * @return a selection builder |
| 376 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 377 | Builder matchIPv6NDSourceLinkLayerAddress(MacAddress mac); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 378 | |
| 379 | /** |
| 380 | * Matches an IPv6 Neighbor Discovery target link-layer address. |
| 381 | * |
| 382 | * @param mac an IPv6 Neighbor Discovery target link-layer address |
| 383 | * @return a selection builder |
| 384 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 385 | Builder matchIPv6NDTargetLinkLayerAddress(MacAddress mac); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 386 | |
| 387 | /** |
| 388 | * Matches on a MPLS label. |
| 389 | * |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 390 | * @param mplsLabel a MPLS label. |
| 391 | * @return a selection builder |
| 392 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 393 | Builder matchMplsLabel(MplsLabel mplsLabel); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 394 | |
Toshio Koide | 9c44c9a | 2014-10-09 11:44:36 -0700 | [diff] [blame] | 395 | /** |
Saurav Das | ffc5bbc | 2015-08-18 23:30:19 -0700 | [diff] [blame] | 396 | * Matches on a MPLS Bottom-of-Stack indicator bit. |
| 397 | * |
| 398 | * @param mplsBos boolean value indicating BOS=1 (true) or BOS=0 (false). |
| 399 | * @return a selection builder |
| 400 | */ |
| 401 | Builder matchMplsBos(boolean mplsBos); |
| 402 | |
| 403 | /** |
Hyunsun Moon | a08c5d0 | 2015-07-14 17:53:00 -0700 | [diff] [blame] | 404 | * Matches a tunnel id. |
| 405 | * |
| 406 | * @param tunnelId a tunnel id |
| 407 | * @return a selection builder |
| 408 | */ |
| 409 | Builder matchTunnelId(long tunnelId); |
| 410 | |
| 411 | /** |
Sho SHIMIZU | 60f1214 | 2015-05-06 14:22:03 -0700 | [diff] [blame] | 412 | * Matches on IPv6 Extension Header pseudo-field flags. |
Pavlin Radoslavov | 5e4f754 | 2015-02-06 18:18:21 -0800 | [diff] [blame] | 413 | * |
Sho SHIMIZU | 60f1214 | 2015-05-06 14:22:03 -0700 | [diff] [blame] | 414 | * @param exthdrFlags the IPv6 Extension Header pseudo-field flags |
Pavlin Radoslavov | 5e4f754 | 2015-02-06 18:18:21 -0800 | [diff] [blame] | 415 | * @return a selection builder |
| 416 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 417 | Builder matchIPv6ExthdrFlags(short exthdrFlags); |
Pavlin Radoslavov | 5e4f754 | 2015-02-06 18:18:21 -0800 | [diff] [blame] | 418 | |
| 419 | /** |
BitOhenry | b2f8e81 | 2015-11-17 19:19:53 +0800 | [diff] [blame] | 420 | * Matches a arp IPv4 destination address. |
| 421 | * |
| 422 | * @param addr a arp IPv4 destination address |
| 423 | * @return a selection builder |
| 424 | */ |
| 425 | Builder matchArpTpa(Ip4Address addr); |
| 426 | |
| 427 | /** |
BitOhenry | 08c7294 | 2015-11-18 14:44:29 +0800 | [diff] [blame] | 428 | * Matches a arp IPv4 source address. |
| 429 | * |
| 430 | * @param addr a arp IPv4 source address |
| 431 | * @return a selection builder |
| 432 | */ |
| 433 | Builder matchArpSpa(Ip4Address addr); |
| 434 | |
| 435 | /** |
BitOhenry | 914c7ad | 2015-11-16 14:58:53 +0800 | [diff] [blame] | 436 | * Matches a arp_eth_dst address. |
| 437 | * |
| 438 | * @param addr a arp_eth_dst address |
| 439 | * @return a selection builder |
| 440 | */ |
| 441 | Builder matchArpTha(MacAddress addr); |
| 442 | |
| 443 | /** |
BitOhenry | e330cf0 | 2015-11-17 18:59:33 +0800 | [diff] [blame] | 444 | * Matches a arp_eth_src address. |
| 445 | * |
| 446 | * @param addr a arp_eth_src address |
| 447 | * @return a selection builder |
| 448 | */ |
| 449 | Builder matchArpSha(MacAddress addr); |
| 450 | |
| 451 | /** |
BitOhenry | b40129a | 2015-11-30 12:41:18 +0800 | [diff] [blame] | 452 | * Matches a arp operation type. |
| 453 | * |
| 454 | * @param arpOp a arp operation type |
| 455 | * @return a selection builder |
| 456 | */ |
| 457 | Builder matchArpOp(int arpOp); |
| 458 | |
| 459 | /** |
Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [diff] [blame] | 460 | * Uses an extension selector. |
| 461 | * |
| 462 | * @param extensionSelector extension selector |
| 463 | * @param deviceId device ID |
| 464 | * @return a selection builder |
| 465 | */ |
| 466 | Builder extension(ExtensionSelector extensionSelector, DeviceId deviceId); |
| 467 | |
| 468 | /** |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 469 | * Builds an immutable traffic selector. |
| 470 | * |
| 471 | * @return traffic selector |
| 472 | */ |
| 473 | TrafficSelector build(); |
| 474 | } |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 475 | } |