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 | /** |
| 214 | * Matches a TCP destination port number. |
| 215 | * |
| 216 | * @param tcpPort a TCP destination port number |
| 217 | * @return a selection builder |
Toshio Koide | 9c44c9a | 2014-10-09 11:44:36 -0700 | [diff] [blame] | 218 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 219 | Builder matchTcpDst(TpPort tcpPort); |
| 220 | |
| 221 | /** |
| 222 | * Matches an UDP source port number. |
| 223 | * |
| 224 | * @param udpPort an UDP source port number |
| 225 | * @return a selection builder |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 226 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 227 | Builder matchUdpSrc(TpPort udpPort); |
| 228 | |
| 229 | /** |
| 230 | * Matches an UDP destination port number. |
| 231 | * |
| 232 | * @param udpPort an UDP destination port number |
| 233 | * @return a selection builder |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 234 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 235 | Builder matchUdpDst(TpPort udpPort); |
| 236 | |
| 237 | /** |
| 238 | * Matches a SCTP source port number. |
| 239 | * |
| 240 | * @param sctpPort a SCTP source port number |
| 241 | * @return a selection builder |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 242 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 243 | Builder matchSctpSrc(TpPort sctpPort); |
| 244 | |
| 245 | /** |
| 246 | * Matches a SCTP destination port number. |
| 247 | * |
| 248 | * @param sctpPort a SCTP destination port number |
| 249 | * @return a selection builder |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 250 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 251 | Builder matchSctpDst(TpPort sctpPort); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 252 | |
| 253 | /** |
| 254 | * Matches an ICMP type. |
| 255 | * |
| 256 | * @param icmpType an ICMP type |
| 257 | * @return a selection builder |
| 258 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 259 | Builder matchIcmpType(byte icmpType); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 260 | |
| 261 | /** |
| 262 | * Matches an ICMP code. |
| 263 | * |
| 264 | * @param icmpCode an ICMP code |
| 265 | * @return a selection builder |
| 266 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 267 | Builder matchIcmpCode(byte icmpCode); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 268 | |
| 269 | /** |
Charles M.C. Chan | 52fae7d | 2015-01-17 00:35:53 +0800 | [diff] [blame] | 270 | * Matches a l3 IPv6 address. |
| 271 | * |
| 272 | * @param ip a l3 IPv6 address |
| 273 | * @return a selection builder |
| 274 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 275 | Builder matchIPv6Src(IpPrefix ip); |
Charles M.C. Chan | 52fae7d | 2015-01-17 00:35:53 +0800 | [diff] [blame] | 276 | |
| 277 | /** |
| 278 | * Matches a l3 IPv6 address. |
| 279 | * |
| 280 | * @param ip a l3 IPv6 address |
| 281 | * @return a selection builder |
| 282 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 283 | Builder matchIPv6Dst(IpPrefix ip); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 284 | |
| 285 | /** |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 286 | * Matches an IPv6 flow label. |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 287 | * |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 288 | * @param flowLabel an IPv6 flow label |
| 289 | * @return a selection builder |
| 290 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 291 | Builder matchIPv6FlowLabel(int flowLabel); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 292 | |
| 293 | /** |
| 294 | * Matches an ICMPv6 type. |
| 295 | * |
| 296 | * @param icmpv6Type an ICMPv6 type |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 297 | * @return a selection builder |
| 298 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 299 | Builder matchIcmpv6Type(byte icmpv6Type); |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 300 | |
| 301 | /** |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 302 | * Matches an ICMPv6 code. |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 303 | * |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 304 | * @param icmpv6Code an ICMPv6 code |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 305 | * @return a selection builder |
| 306 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 307 | Builder matchIcmpv6Code(byte icmpv6Code); |
Kunihiro Ishiguro | 0f9aba8 | 2015-01-15 17:14:17 -0800 | [diff] [blame] | 308 | |
| 309 | /** |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 310 | * Matches an IPv6 Neighbor Discovery target address. |
| 311 | * |
| 312 | * @param targetAddress an IPv6 Neighbor Discovery target address |
| 313 | * @return a selection builder |
| 314 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 315 | Builder matchIPv6NDTargetAddress(Ip6Address targetAddress); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 316 | |
| 317 | /** |
| 318 | * Matches an IPv6 Neighbor Discovery source link-layer address. |
| 319 | * |
| 320 | * @param mac an IPv6 Neighbor Discovery source link-layer address |
| 321 | * @return a selection builder |
| 322 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 323 | Builder matchIPv6NDSourceLinkLayerAddress(MacAddress mac); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 324 | |
| 325 | /** |
| 326 | * Matches an IPv6 Neighbor Discovery target link-layer address. |
| 327 | * |
| 328 | * @param mac an IPv6 Neighbor Discovery target link-layer address |
| 329 | * @return a selection builder |
| 330 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 331 | Builder matchIPv6NDTargetLinkLayerAddress(MacAddress mac); |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 332 | |
| 333 | /** |
| 334 | * Matches on a MPLS label. |
| 335 | * |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 336 | * @param mplsLabel a MPLS label. |
| 337 | * @return a selection builder |
| 338 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 339 | Builder matchMplsLabel(MplsLabel mplsLabel); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 340 | |
Toshio Koide | 9c44c9a | 2014-10-09 11:44:36 -0700 | [diff] [blame] | 341 | /** |
Saurav Das | ffc5bbc | 2015-08-18 23:30:19 -0700 | [diff] [blame] | 342 | * Matches on a MPLS Bottom-of-Stack indicator bit. |
| 343 | * |
| 344 | * @param mplsBos boolean value indicating BOS=1 (true) or BOS=0 (false). |
| 345 | * @return a selection builder |
| 346 | */ |
| 347 | Builder matchMplsBos(boolean mplsBos); |
| 348 | |
| 349 | /** |
Hyunsun Moon | a08c5d0 | 2015-07-14 17:53:00 -0700 | [diff] [blame] | 350 | * Matches a tunnel id. |
| 351 | * |
| 352 | * @param tunnelId a tunnel id |
| 353 | * @return a selection builder |
| 354 | */ |
| 355 | Builder matchTunnelId(long tunnelId); |
| 356 | |
| 357 | /** |
Sho SHIMIZU | 60f1214 | 2015-05-06 14:22:03 -0700 | [diff] [blame] | 358 | * Matches on IPv6 Extension Header pseudo-field flags. |
Pavlin Radoslavov | 5e4f754 | 2015-02-06 18:18:21 -0800 | [diff] [blame] | 359 | * |
Sho SHIMIZU | 60f1214 | 2015-05-06 14:22:03 -0700 | [diff] [blame] | 360 | * @param exthdrFlags the IPv6 Extension Header pseudo-field flags |
Pavlin Radoslavov | 5e4f754 | 2015-02-06 18:18:21 -0800 | [diff] [blame] | 361 | * @return a selection builder |
| 362 | */ |
Sho SHIMIZU | 15c3800 | 2015-04-28 19:00:37 -0700 | [diff] [blame] | 363 | Builder matchIPv6ExthdrFlags(short exthdrFlags); |
Pavlin Radoslavov | 5e4f754 | 2015-02-06 18:18:21 -0800 | [diff] [blame] | 364 | |
| 365 | /** |
BitOhenry | b2f8e81 | 2015-11-17 19:19:53 +0800 | [diff] [blame] | 366 | * Matches a arp IPv4 destination address. |
| 367 | * |
| 368 | * @param addr a arp IPv4 destination address |
| 369 | * @return a selection builder |
| 370 | */ |
| 371 | Builder matchArpTpa(Ip4Address addr); |
| 372 | |
| 373 | /** |
BitOhenry | 08c7294 | 2015-11-18 14:44:29 +0800 | [diff] [blame] | 374 | * Matches a arp IPv4 source address. |
| 375 | * |
| 376 | * @param addr a arp IPv4 source address |
| 377 | * @return a selection builder |
| 378 | */ |
| 379 | Builder matchArpSpa(Ip4Address addr); |
| 380 | |
| 381 | /** |
BitOhenry | 914c7ad | 2015-11-16 14:58:53 +0800 | [diff] [blame] | 382 | * Matches a arp_eth_dst address. |
| 383 | * |
| 384 | * @param addr a arp_eth_dst address |
| 385 | * @return a selection builder |
| 386 | */ |
| 387 | Builder matchArpTha(MacAddress addr); |
| 388 | |
| 389 | /** |
BitOhenry | e330cf0 | 2015-11-17 18:59:33 +0800 | [diff] [blame] | 390 | * Matches a arp_eth_src address. |
| 391 | * |
| 392 | * @param addr a arp_eth_src address |
| 393 | * @return a selection builder |
| 394 | */ |
| 395 | Builder matchArpSha(MacAddress addr); |
| 396 | |
| 397 | /** |
BitOhenry | b40129a | 2015-11-30 12:41:18 +0800 | [diff] [blame] | 398 | * Matches a arp operation type. |
| 399 | * |
| 400 | * @param arpOp a arp operation type |
| 401 | * @return a selection builder |
| 402 | */ |
| 403 | Builder matchArpOp(int arpOp); |
| 404 | |
| 405 | /** |
Jonathan Hart | 26a8d95 | 2015-12-02 15:16:35 -0800 | [diff] [blame] | 406 | * Uses an extension selector. |
| 407 | * |
| 408 | * @param extensionSelector extension selector |
| 409 | * @param deviceId device ID |
| 410 | * @return a selection builder |
| 411 | */ |
| 412 | Builder extension(ExtensionSelector extensionSelector, DeviceId deviceId); |
| 413 | |
| 414 | /** |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 415 | * Builds an immutable traffic selector. |
| 416 | * |
| 417 | * @return traffic selector |
| 418 | */ |
| 419 | TrafficSelector build(); |
| 420 | } |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 421 | } |