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.instructions; |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 17 | |
alshabib | 7b808c5 | 2015-06-26 14:22:24 -0700 | [diff] [blame] | 18 | import org.onlab.packet.EthType; |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 19 | import org.onlab.packet.IpAddress; |
| 20 | import org.onlab.packet.MacAddress; |
| 21 | import org.onlab.packet.MplsLabel; |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 22 | import org.onlab.packet.TpPort; |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 23 | import org.onlab.packet.VlanId; |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 24 | import org.onosproject.core.GroupId; |
Sho SHIMIZU | 2e7ac84 | 2015-05-05 15:45:38 -0700 | [diff] [blame] | 25 | import org.onosproject.net.IndexedLambda; |
| 26 | import org.onosproject.net.Lambda; |
Sho SHIMIZU | e9e1275 | 2015-05-05 14:45:40 -0700 | [diff] [blame] | 27 | import org.onosproject.net.OchSignal; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 28 | import org.onosproject.net.PortNumber; |
| 29 | import org.onosproject.net.flow.instructions.L0ModificationInstruction.L0SubType; |
| 30 | import org.onosproject.net.flow.instructions.L0ModificationInstruction.ModLambdaInstruction; |
Sho SHIMIZU | 2e7ac84 | 2015-05-05 15:45:38 -0700 | [diff] [blame] | 31 | import org.onosproject.net.flow.instructions.L0ModificationInstruction.ModOchSignalInstruction; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 32 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.L3SubType; |
| 33 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPInstruction; |
Pavlin Radoslavov | febe82c | 2015-02-11 19:08:15 -0800 | [diff] [blame] | 34 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction; |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 35 | import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModTtlInstruction; |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 36 | import org.onosproject.net.flow.instructions.L4ModificationInstruction.L4SubType; |
| 37 | import org.onosproject.net.flow.instructions.L4ModificationInstruction.ModTransportPortInstruction; |
alshabib | 10c810b | 2015-08-18 16:59:04 -0700 | [diff] [blame] | 38 | import org.onosproject.net.meter.MeterId; |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 39 | |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 40 | import java.util.Objects; |
| 41 | |
| 42 | import static com.google.common.base.MoreObjects.toStringHelper; |
| 43 | import static com.google.common.base.Preconditions.checkNotNull; |
alshabib | 64231f6 | 2014-09-16 17:58:36 -0700 | [diff] [blame] | 44 | |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 45 | /** |
| 46 | * Factory class for creating various traffic treatment instructions. |
| 47 | */ |
| 48 | public final class Instructions { |
| 49 | |
| 50 | |
| 51 | // Ban construction |
| 52 | private Instructions() {} |
| 53 | |
| 54 | /** |
| 55 | * Creates an output instruction using the specified port number. This can |
| 56 | * include logical ports such as CONTROLLER, FLOOD, etc. |
| 57 | * |
| 58 | * @param number port number |
| 59 | * @return output instruction |
| 60 | */ |
| 61 | public static OutputInstruction createOutput(final PortNumber number) { |
| 62 | checkNotNull(number, "PortNumber cannot be null"); |
| 63 | return new OutputInstruction(number); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Creates a drop instruction. |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 68 | * |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 69 | * @return drop instruction |
| 70 | */ |
| 71 | public static DropInstruction createDrop() { |
| 72 | return new DropInstruction(); |
| 73 | } |
| 74 | |
| 75 | /** |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 76 | * Creates a group instruction. |
| 77 | * |
| 78 | * @param groupId Group Id |
| 79 | * @return group instruction |
| 80 | */ |
| 81 | public static GroupInstruction createGroup(final GroupId groupId) { |
| 82 | checkNotNull(groupId, "GroupId cannot be null"); |
| 83 | return new GroupInstruction(groupId); |
| 84 | } |
| 85 | |
alshabib | 10c810b | 2015-08-18 16:59:04 -0700 | [diff] [blame] | 86 | public static MeterInstruction meterTraffic(final MeterId meterId) { |
| 87 | checkNotNull(meterId, "meter id cannot be null"); |
| 88 | return new MeterInstruction(meterId); |
| 89 | } |
| 90 | |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 91 | /** |
Sho SHIMIZU | e9e1275 | 2015-05-05 14:45:40 -0700 | [diff] [blame] | 92 | * Creates an L0 modification with the specified OCh signal. |
| 93 | * |
| 94 | * @param lambda OCh signal |
| 95 | * @return an L0 modification |
| 96 | */ |
Sho SHIMIZU | 2e7ac84 | 2015-05-05 15:45:38 -0700 | [diff] [blame] | 97 | public static L0ModificationInstruction modL0Lambda(Lambda lambda) { |
Sho SHIMIZU | e9e1275 | 2015-05-05 14:45:40 -0700 | [diff] [blame] | 98 | checkNotNull(lambda, "L0 OCh signal cannot be null"); |
Sho SHIMIZU | 2e7ac84 | 2015-05-05 15:45:38 -0700 | [diff] [blame] | 99 | |
| 100 | if (lambda instanceof IndexedLambda) { |
| 101 | return new ModLambdaInstruction(L0SubType.LAMBDA, (short) ((IndexedLambda) lambda).index()); |
| 102 | } else if (lambda instanceof OchSignal) { |
| 103 | return new ModOchSignalInstruction((OchSignal) lambda); |
| 104 | } else { |
| 105 | throw new UnsupportedOperationException(String.format("Unsupported type: %s", lambda)); |
| 106 | } |
Sho SHIMIZU | e9e1275 | 2015-05-05 14:45:40 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | /** |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 110 | * Creates a l2 src modification. |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 111 | * |
| 112 | * @param addr the mac address to modify to |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 113 | * @return a l2 modification |
| 114 | */ |
Ayaka Koshibe | a9c199f | 2014-09-16 16:21:40 -0700 | [diff] [blame] | 115 | public static L2ModificationInstruction modL2Src(MacAddress addr) { |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 116 | checkNotNull(addr, "Src l2 address cannot be null"); |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 117 | return new L2ModificationInstruction.ModEtherInstruction( |
| 118 | L2ModificationInstruction.L2SubType.ETH_SRC, addr); |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Creates a L2 dst modification. |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 123 | * |
| 124 | * @param addr the mac address to modify to |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 125 | * @return a L2 modification |
| 126 | */ |
Ayaka Koshibe | a9c199f | 2014-09-16 16:21:40 -0700 | [diff] [blame] | 127 | public static L2ModificationInstruction modL2Dst(MacAddress addr) { |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 128 | checkNotNull(addr, "Dst l2 address cannot be null"); |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 129 | return new L2ModificationInstruction.ModEtherInstruction( |
| 130 | L2ModificationInstruction.L2SubType.ETH_DST, addr); |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 134 | * Creates a VLAN ID modification. |
| 135 | * |
| 136 | * @param vlanId the VLAN ID to modify to |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 137 | * @return a L2 modification |
| 138 | */ |
Ayaka Koshibe | a9c199f | 2014-09-16 16:21:40 -0700 | [diff] [blame] | 139 | public static L2ModificationInstruction modVlanId(VlanId vlanId) { |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 140 | checkNotNull(vlanId, "VLAN id cannot be null"); |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 141 | return new L2ModificationInstruction.ModVlanIdInstruction(vlanId); |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 142 | } |
| 143 | |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 144 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 145 | * Creates a VLAN PCP modification. |
| 146 | * |
| 147 | * @param vlanPcp the PCP to modify to |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 148 | * @return a L2 modification |
| 149 | */ |
| 150 | public static L2ModificationInstruction modVlanPcp(Byte vlanPcp) { |
| 151 | checkNotNull(vlanPcp, "VLAN Pcp cannot be null"); |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 152 | return new L2ModificationInstruction.ModVlanPcpInstruction(vlanPcp); |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | /** |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 156 | * Creates a MPLS label modification. |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 157 | * |
| 158 | * @param mplsLabel MPLS label to set |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 159 | * @return a L2 Modification |
| 160 | */ |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 161 | public static L2ModificationInstruction modMplsLabel(MplsLabel mplsLabel) { |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 162 | checkNotNull(mplsLabel, "MPLS label cannot be null"); |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 163 | return new L2ModificationInstruction.ModMplsLabelInstruction(mplsLabel); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 164 | } |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 165 | |
| 166 | /** |
Saurav Das | 73a7dd4 | 2015-08-19 22:20:31 -0700 | [diff] [blame] | 167 | * Creates a MPLS BOS bit modification. |
| 168 | * |
| 169 | * @param mplsBos MPLS BOS bit to set (true) or unset (false) |
| 170 | * @return a L2 Modification |
| 171 | */ |
| 172 | public static L2ModificationInstruction modMplsBos(boolean mplsBos) { |
| 173 | return new L2ModificationInstruction.ModMplsBosInstruction(mplsBos); |
| 174 | } |
| 175 | |
| 176 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 177 | * Creates a MPLS decrement TTL modification. |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 178 | * |
| 179 | * @return a L2 Modification |
| 180 | */ |
| 181 | public static L2ModificationInstruction decMplsTtl() { |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 182 | return new L2ModificationInstruction.ModMplsTtlInstruction(); |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 183 | } |
Pavlin Radoslavov | febe82c | 2015-02-11 19:08:15 -0800 | [diff] [blame] | 184 | |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 185 | /** |
Pavlin Radoslavov | febe82c | 2015-02-11 19:08:15 -0800 | [diff] [blame] | 186 | * Creates a L3 IPv4 src modification. |
| 187 | * |
| 188 | * @param addr the IPv4 address to modify to |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 189 | * @return a L3 modification |
| 190 | */ |
Pavlin Radoslavov | 855ea2d | 2014-10-30 15:32:39 -0700 | [diff] [blame] | 191 | public static L3ModificationInstruction modL3Src(IpAddress addr) { |
Pavlin Radoslavov | febe82c | 2015-02-11 19:08:15 -0800 | [diff] [blame] | 192 | checkNotNull(addr, "Src l3 IPv4 address cannot be null"); |
| 193 | return new ModIPInstruction(L3SubType.IPV4_SRC, addr); |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | /** |
Pavlin Radoslavov | febe82c | 2015-02-11 19:08:15 -0800 | [diff] [blame] | 197 | * Creates a L3 IPv4 dst modification. |
| 198 | * |
| 199 | * @param addr the IPv4 address to modify to |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 200 | * @return a L3 modification |
| 201 | */ |
Pavlin Radoslavov | 855ea2d | 2014-10-30 15:32:39 -0700 | [diff] [blame] | 202 | public static L3ModificationInstruction modL3Dst(IpAddress addr) { |
Pavlin Radoslavov | febe82c | 2015-02-11 19:08:15 -0800 | [diff] [blame] | 203 | checkNotNull(addr, "Dst l3 IPv4 address cannot be null"); |
| 204 | return new ModIPInstruction(L3SubType.IPV4_DST, addr); |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * Creates a L3 IPv6 src modification. |
| 209 | * |
| 210 | * @param addr the IPv6 address to modify to |
| 211 | * @return a L3 modification |
| 212 | */ |
| 213 | public static L3ModificationInstruction modL3IPv6Src(IpAddress addr) { |
| 214 | checkNotNull(addr, "Src l3 IPv6 address cannot be null"); |
| 215 | return new ModIPInstruction(L3SubType.IPV6_SRC, addr); |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Creates a L3 IPv6 dst modification. |
| 220 | * |
| 221 | * @param addr the IPv6 address to modify to |
| 222 | * @return a L3 modification |
| 223 | */ |
| 224 | public static L3ModificationInstruction modL3IPv6Dst(IpAddress addr) { |
| 225 | checkNotNull(addr, "Dst l3 IPv6 address cannot be null"); |
| 226 | return new ModIPInstruction(L3SubType.IPV6_DST, addr); |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Creates a L3 IPv6 Flow Label modification. |
| 231 | * |
| 232 | * @param flowLabel the IPv6 flow label to modify to (20 bits) |
| 233 | * @return a L3 modification |
| 234 | */ |
| 235 | public static L3ModificationInstruction modL3IPv6FlowLabel(int flowLabel) { |
| 236 | return new ModIPv6FlowLabelInstruction(flowLabel); |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 237 | } |
| 238 | |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 239 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 240 | * Creates a L3 decrement TTL modification. |
| 241 | * |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 242 | * @return a L3 modification |
| 243 | */ |
| 244 | public static L3ModificationInstruction decNwTtl() { |
| 245 | return new ModTtlInstruction(L3SubType.DEC_TTL); |
| 246 | } |
| 247 | |
| 248 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 249 | * Creates a L3 copy TTL to outer header modification. |
| 250 | * |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 251 | * @return a L3 modification |
| 252 | */ |
| 253 | public static L3ModificationInstruction copyTtlOut() { |
| 254 | return new ModTtlInstruction(L3SubType.TTL_OUT); |
| 255 | } |
| 256 | |
| 257 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 258 | * Creates a L3 copy TTL to inner header modification. |
| 259 | * |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 260 | * @return a L3 modification |
| 261 | */ |
| 262 | public static L3ModificationInstruction copyTtlIn() { |
| 263 | return new ModTtlInstruction(L3SubType.TTL_IN); |
| 264 | } |
| 265 | |
| 266 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 267 | * Creates a push MPLS header instruction. |
| 268 | * |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 269 | * @return a L2 modification. |
| 270 | */ |
| 271 | public static Instruction pushMpls() { |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 272 | return new L2ModificationInstruction.PushHeaderInstructions( |
| 273 | L2ModificationInstruction.L2SubType.MPLS_PUSH, |
alshabib | 7b808c5 | 2015-06-26 14:22:24 -0700 | [diff] [blame] | 274 | EthType.EtherType.MPLS_UNICAST.ethType()); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 278 | * Creates a pop MPLS header instruction. |
| 279 | * |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 280 | * @return a L2 modification. |
| 281 | */ |
| 282 | public static Instruction popMpls() { |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 283 | return new L2ModificationInstruction.PushHeaderInstructions( |
| 284 | L2ModificationInstruction.L2SubType.MPLS_POP, |
alshabib | 7b808c5 | 2015-06-26 14:22:24 -0700 | [diff] [blame] | 285 | EthType.EtherType.MPLS_UNICAST.ethType()); |
Praseed Balakrishnan | 8c67d17 | 2014-11-10 10:15:41 -0800 | [diff] [blame] | 286 | } |
alshabib | 7410fea | 2014-09-16 13:48:39 -0700 | [diff] [blame] | 287 | |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 288 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 289 | * Creates a pop MPLS header instruction with a particular ethertype. |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 290 | * |
| 291 | * @param etherType Ethernet type to set |
| 292 | * @return a L2 modification. |
alshabib | 7b808c5 | 2015-06-26 14:22:24 -0700 | [diff] [blame] | 293 | */ |
| 294 | public static Instruction popMpls(EthType etherType) { |
| 295 | checkNotNull(etherType, "Ethernet type cannot be null"); |
| 296 | return new L2ModificationInstruction.PushHeaderInstructions( |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 297 | L2ModificationInstruction.L2SubType.MPLS_POP, etherType); |
sangho | 3f97a17d | 2015-01-29 22:56:29 -0800 | [diff] [blame] | 298 | } |
| 299 | |
Saurav Das | fbe25c5 | 2015-03-04 11:12:00 -0800 | [diff] [blame] | 300 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 301 | * Creates a pop VLAN header instruction. |
| 302 | * |
| 303 | * @return a L2 modification |
Saurav Das | fbe25c5 | 2015-03-04 11:12:00 -0800 | [diff] [blame] | 304 | */ |
| 305 | public static Instruction popVlan() { |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 306 | return new L2ModificationInstruction.PopVlanInstruction( |
| 307 | L2ModificationInstruction.L2SubType.VLAN_POP); |
Saurav Das | fbe25c5 | 2015-03-04 11:12:00 -0800 | [diff] [blame] | 308 | } |
| 309 | |
| 310 | /** |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 311 | * Creates a push VLAN header instruction. |
| 312 | * |
| 313 | * @return a L2 modification |
| 314 | */ |
| 315 | public static Instruction pushVlan() { |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 316 | return new L2ModificationInstruction.PushHeaderInstructions( |
alshabib | 7b808c5 | 2015-06-26 14:22:24 -0700 | [diff] [blame] | 317 | L2ModificationInstruction.L2SubType.VLAN_PUSH, |
| 318 | EthType.EtherType.VLAN.ethType()); |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | /** |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 322 | * Sends the packet to the table id. |
Jonathan Hart | 54b406b | 2015-03-06 16:24:14 -0800 | [diff] [blame] | 323 | * |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 324 | * @param tableId flow rule table id |
Thomas Vachuska | 3e2b651 | 2015-03-05 09:25:03 -0800 | [diff] [blame] | 325 | * @return table type transition instruction |
Saurav Das | fbe25c5 | 2015-03-04 11:12:00 -0800 | [diff] [blame] | 326 | */ |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 327 | public static Instruction transition(Integer tableId) { |
| 328 | checkNotNull(tableId, "Table id cannot be null"); |
| 329 | return new TableTypeTransition(tableId); |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 330 | } |
| 331 | |
Yuta HIGUCHI | 6a47964 | 2015-02-08 01:28:50 -0800 | [diff] [blame] | 332 | /** |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 333 | * Writes metadata to associate with a packet. |
| 334 | * |
| 335 | * @param metadata the metadata value to write |
| 336 | * @param metadataMask the bits to mask for the metadata value |
| 337 | * @return metadata instruction |
| 338 | */ |
| 339 | public static Instruction writeMetadata(long metadata, long metadataMask) { |
| 340 | return new MetadataInstruction(metadata, metadataMask); |
| 341 | } |
| 342 | |
| 343 | /** |
Hyunsun Moon | a08c5d0 | 2015-07-14 17:53:00 -0700 | [diff] [blame] | 344 | * Creates a Tunnel ID modification. |
| 345 | * |
| 346 | * @param tunnelId the Tunnel ID to modify to |
| 347 | * @return a L2 modification |
| 348 | */ |
| 349 | public static L2ModificationInstruction modTunnelId(long tunnelId) { |
| 350 | checkNotNull(tunnelId, "Tunnel id cannot be null"); |
| 351 | return new L2ModificationInstruction.ModTunnelIdInstruction(tunnelId); |
| 352 | } |
| 353 | |
| 354 | /** |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 355 | * Creates a TCP src modification. |
| 356 | * |
| 357 | * @param port the TCP port number to modify to |
| 358 | * @return a L4 modification |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 359 | * @deprecated in Drake release |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 360 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 361 | @Deprecated |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 362 | public static L4ModificationInstruction modTcpSrc(short port) { |
| 363 | checkNotNull(port, "Src TCP port cannot be null"); |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 364 | return new ModTransportPortInstruction(L4SubType.TCP_SRC, TpPort.tpPort(port)); |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * Creates a TCP src modification. |
| 369 | * |
| 370 | * @param port the TCP port number to modify to |
| 371 | * @return a L4 modification |
| 372 | */ |
| 373 | public static L4ModificationInstruction modTcpSrc(TpPort port) { |
| 374 | checkNotNull(port, "Src TCP port cannot be null"); |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 375 | return new ModTransportPortInstruction(L4SubType.TCP_SRC, port); |
| 376 | } |
| 377 | |
| 378 | /** |
| 379 | * Creates a TCP dst modification. |
| 380 | * |
| 381 | * @param port the TCP port number to modify to |
| 382 | * @return a L4 modification |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 383 | * @deprecated in Drake release |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 384 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 385 | @Deprecated |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 386 | public static L4ModificationInstruction modTcpDst(short port) { |
| 387 | checkNotNull(port, "Dst TCP port cannot be null"); |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 388 | return new ModTransportPortInstruction(L4SubType.TCP_DST, TpPort.tpPort(port)); |
| 389 | } |
| 390 | |
| 391 | /** |
| 392 | * Creates a TCP dst modification. |
| 393 | * |
| 394 | * @param port the TCP port number to modify to |
| 395 | * @return a L4 modification |
| 396 | */ |
| 397 | public static L4ModificationInstruction modTcpDst(TpPort port) { |
| 398 | checkNotNull(port, "Dst TCP port cannot be null"); |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 399 | return new ModTransportPortInstruction(L4SubType.TCP_DST, port); |
| 400 | } |
| 401 | |
| 402 | /** |
| 403 | * Creates a UDP src modification. |
| 404 | * |
| 405 | * @param port the UDP port number to modify to |
| 406 | * @return a L4 modification |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 407 | * @deprecated in Drake release |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 408 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 409 | @Deprecated |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 410 | public static L4ModificationInstruction modUdpSrc(short port) { |
| 411 | checkNotNull(port, "Src UDP port cannot be null"); |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 412 | return new ModTransportPortInstruction(L4SubType.UDP_SRC, TpPort.tpPort(port)); |
| 413 | } |
| 414 | |
| 415 | /** |
| 416 | * Creates a UDP src modification. |
| 417 | * |
| 418 | * @param port the UDP port number to modify to |
| 419 | * @return a L4 modification |
| 420 | */ |
| 421 | public static L4ModificationInstruction modUdpSrc(TpPort port) { |
| 422 | checkNotNull(port, "Src UDP port cannot be null"); |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 423 | return new ModTransportPortInstruction(L4SubType.UDP_SRC, port); |
| 424 | } |
| 425 | |
| 426 | /** |
| 427 | * Creates a UDP dst modification. |
| 428 | * |
| 429 | * @param port the UDP port number to modify to |
| 430 | * @return a L4 modification |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 431 | * @deprecated in Drake release |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 432 | */ |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 433 | @Deprecated |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 434 | public static L4ModificationInstruction modUdpDst(short port) { |
| 435 | checkNotNull(port, "Dst UDP port cannot be null"); |
Hyunsun Moon | cf732fb | 2015-08-22 21:04:23 -0700 | [diff] [blame] | 436 | return new ModTransportPortInstruction(L4SubType.UDP_DST, TpPort.tpPort(port)); |
| 437 | } |
| 438 | |
| 439 | /** |
| 440 | * Creates a UDP dst modification. |
| 441 | * |
| 442 | * @param port the UDP port number to modify to |
| 443 | * @return a L4 modification |
| 444 | */ |
| 445 | public static L4ModificationInstruction modUdpDst(TpPort port) { |
| 446 | checkNotNull(port, "Dst UDP port cannot be null"); |
Hyunsun Moon | c8bd97c | 2015-07-18 22:47:33 -0700 | [diff] [blame] | 447 | return new ModTransportPortInstruction(L4SubType.UDP_DST, port); |
| 448 | } |
| 449 | |
| 450 | /** |
Yuta HIGUCHI | 6a47964 | 2015-02-08 01:28:50 -0800 | [diff] [blame] | 451 | * Drop instruction. |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 452 | */ |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 453 | public static final class DropInstruction implements Instruction { |
Yuta HIGUCHI | 6a47964 | 2015-02-08 01:28:50 -0800 | [diff] [blame] | 454 | |
| 455 | private DropInstruction() {} |
| 456 | |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 457 | @Override |
| 458 | public Type type() { |
| 459 | return Type.DROP; |
| 460 | } |
alshabib | 99b8fdc | 2014-09-25 14:30:22 -0700 | [diff] [blame] | 461 | |
| 462 | @Override |
| 463 | public String toString() { |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 464 | return toStringHelper(type().toString()).toString(); |
alshabib | 99b8fdc | 2014-09-25 14:30:22 -0700 | [diff] [blame] | 465 | } |
alshabib | 8ca5390 | 2014-10-07 13:11:17 -0700 | [diff] [blame] | 466 | |
| 467 | @Override |
| 468 | public int hashCode() { |
Thomas Vachuska | 6c8eff3 | 2015-05-27 16:11:44 -0700 | [diff] [blame] | 469 | return Objects.hash(type().ordinal()); |
alshabib | 8ca5390 | 2014-10-07 13:11:17 -0700 | [diff] [blame] | 470 | } |
| 471 | |
| 472 | @Override |
| 473 | public boolean equals(Object obj) { |
| 474 | if (this == obj) { |
| 475 | return true; |
| 476 | } |
| 477 | if (obj instanceof DropInstruction) { |
Yuta HIGUCHI | 6a47964 | 2015-02-08 01:28:50 -0800 | [diff] [blame] | 478 | return true; |
alshabib | 8ca5390 | 2014-10-07 13:11:17 -0700 | [diff] [blame] | 479 | } |
| 480 | return false; |
| 481 | } |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 482 | } |
| 483 | |
Yuta HIGUCHI | 6a47964 | 2015-02-08 01:28:50 -0800 | [diff] [blame] | 484 | /** |
| 485 | * Output Instruction. |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 486 | */ |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 487 | public static final class OutputInstruction implements Instruction { |
| 488 | private final PortNumber port; |
| 489 | |
| 490 | private OutputInstruction(PortNumber port) { |
| 491 | this.port = port; |
| 492 | } |
| 493 | |
| 494 | public PortNumber port() { |
| 495 | return port; |
| 496 | } |
| 497 | |
| 498 | @Override |
| 499 | public Type type() { |
| 500 | return Type.OUTPUT; |
| 501 | } |
alshabib | 99b8fdc | 2014-09-25 14:30:22 -0700 | [diff] [blame] | 502 | @Override |
| 503 | public String toString() { |
| 504 | return toStringHelper(type().toString()) |
| 505 | .add("port", port).toString(); |
| 506 | } |
alshabib | 8ca5390 | 2014-10-07 13:11:17 -0700 | [diff] [blame] | 507 | |
| 508 | @Override |
| 509 | public int hashCode() { |
Thomas Vachuska | 6c8eff3 | 2015-05-27 16:11:44 -0700 | [diff] [blame] | 510 | return Objects.hash(type().ordinal(), port); |
alshabib | 8ca5390 | 2014-10-07 13:11:17 -0700 | [diff] [blame] | 511 | } |
| 512 | |
| 513 | @Override |
| 514 | public boolean equals(Object obj) { |
| 515 | if (this == obj) { |
| 516 | return true; |
| 517 | } |
| 518 | if (obj instanceof OutputInstruction) { |
| 519 | OutputInstruction that = (OutputInstruction) obj; |
Yuta HIGUCHI | 4ce6529 | 2014-11-01 12:09:55 -0700 | [diff] [blame] | 520 | return Objects.equals(port, that.port); |
alshabib | 8ca5390 | 2014-10-07 13:11:17 -0700 | [diff] [blame] | 521 | |
| 522 | } |
| 523 | return false; |
| 524 | } |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 525 | } |
| 526 | |
Yuta HIGUCHI | 6a47964 | 2015-02-08 01:28:50 -0800 | [diff] [blame] | 527 | /** |
| 528 | * Group Instruction. |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 529 | */ |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 530 | public static final class GroupInstruction implements Instruction { |
| 531 | private final GroupId groupId; |
| 532 | |
| 533 | private GroupInstruction(GroupId groupId) { |
| 534 | this.groupId = groupId; |
| 535 | } |
| 536 | |
| 537 | public GroupId groupId() { |
| 538 | return groupId; |
| 539 | } |
| 540 | |
| 541 | @Override |
| 542 | public Type type() { |
| 543 | return Type.GROUP; |
| 544 | } |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 545 | |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 546 | @Override |
| 547 | public String toString() { |
| 548 | return toStringHelper(type().toString()) |
| 549 | .add("group ID", groupId.id()).toString(); |
| 550 | } |
| 551 | |
| 552 | @Override |
| 553 | public int hashCode() { |
Thomas Vachuska | 6c8eff3 | 2015-05-27 16:11:44 -0700 | [diff] [blame] | 554 | return Objects.hash(type().ordinal(), groupId); |
sangho | 8995ac5 | 2015-02-04 11:29:03 -0800 | [diff] [blame] | 555 | } |
| 556 | |
| 557 | @Override |
| 558 | public boolean equals(Object obj) { |
| 559 | if (this == obj) { |
| 560 | return true; |
| 561 | } |
| 562 | if (obj instanceof GroupInstruction) { |
| 563 | GroupInstruction that = (GroupInstruction) obj; |
| 564 | return Objects.equals(groupId, that.groupId); |
| 565 | |
| 566 | } |
| 567 | return false; |
| 568 | } |
| 569 | } |
| 570 | |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 571 | /** |
alshabib | 10c810b | 2015-08-18 16:59:04 -0700 | [diff] [blame] | 572 | * A meter instruction. |
| 573 | */ |
| 574 | public static final class MeterInstruction implements Instruction { |
| 575 | private final MeterId meterId; |
| 576 | |
| 577 | private MeterInstruction(MeterId meterId) { |
| 578 | this.meterId = meterId; |
| 579 | } |
| 580 | |
| 581 | public MeterId meterId() { |
| 582 | return meterId; |
| 583 | } |
| 584 | |
| 585 | @Override |
| 586 | public Type type() { |
| 587 | return Type.METER; |
| 588 | } |
| 589 | |
| 590 | @Override |
| 591 | public String toString() { |
| 592 | return toStringHelper(type().toString()) |
| 593 | .add("meter ID", meterId.id()).toString(); |
| 594 | } |
| 595 | |
| 596 | @Override |
| 597 | public int hashCode() { |
| 598 | return Objects.hash(type().ordinal(), meterId); |
| 599 | } |
| 600 | |
| 601 | @Override |
| 602 | public boolean equals(Object obj) { |
| 603 | if (this == obj) { |
| 604 | return true; |
| 605 | } |
| 606 | if (obj instanceof MeterInstruction) { |
| 607 | MeterInstruction that = (MeterInstruction) obj; |
| 608 | return Objects.equals(meterId, that.meterId); |
| 609 | |
| 610 | } |
| 611 | return false; |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | /** |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 616 | * Transition instruction. |
| 617 | */ |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 618 | public static class TableTypeTransition implements Instruction { |
| 619 | private final Integer tableId; |
| 620 | |
| 621 | TableTypeTransition(Integer tableId) { |
| 622 | this.tableId = tableId; |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 623 | } |
| 624 | |
| 625 | @Override |
| 626 | public Type type() { |
| 627 | return Type.TABLE; |
| 628 | } |
| 629 | |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 630 | public Integer tableId() { |
| 631 | return this.tableId; |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 632 | } |
| 633 | |
| 634 | @Override |
| 635 | public String toString() { |
| 636 | return toStringHelper(type().toString()) |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 637 | .add("tableId", this.tableId).toString(); |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 638 | } |
| 639 | |
| 640 | @Override |
| 641 | public int hashCode() { |
Thomas Vachuska | 6c8eff3 | 2015-05-27 16:11:44 -0700 | [diff] [blame] | 642 | return Objects.hash(type().ordinal(), tableId); |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 643 | } |
| 644 | |
| 645 | @Override |
| 646 | public boolean equals(Object obj) { |
| 647 | if (this == obj) { |
| 648 | return true; |
| 649 | } |
| 650 | if (obj instanceof TableTypeTransition) { |
| 651 | TableTypeTransition that = (TableTypeTransition) obj; |
alshabib | d17abc2 | 2015-04-21 18:26:35 -0700 | [diff] [blame] | 652 | return Objects.equals(tableId, that.tableId); |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 653 | |
| 654 | } |
| 655 | return false; |
| 656 | } |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 657 | } |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 658 | |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 659 | /** |
| 660 | * Metadata instruction. |
| 661 | */ |
| 662 | public static class MetadataInstruction implements Instruction { |
| 663 | private final long metadata; |
| 664 | private final long metadataMask; |
| 665 | |
| 666 | MetadataInstruction(long metadata, long metadataMask) { |
| 667 | this.metadata = metadata; |
| 668 | this.metadataMask = metadataMask; |
| 669 | } |
| 670 | |
| 671 | @Override |
| 672 | public Type type() { |
| 673 | return Type.METADATA; |
| 674 | } |
| 675 | |
| 676 | public long metadata() { |
| 677 | return this.metadata; |
| 678 | } |
| 679 | |
| 680 | public long metadataMask() { |
| 681 | return this.metadataMask; |
| 682 | } |
| 683 | |
| 684 | @Override |
| 685 | public String toString() { |
| 686 | return toStringHelper(type().toString()) |
| 687 | .add("metadata", Long.toHexString(this.metadata)) |
| 688 | .add("metadata mask", Long.toHexString(this.metadataMask)) |
| 689 | .toString(); |
| 690 | } |
| 691 | |
| 692 | @Override |
| 693 | public int hashCode() { |
Thomas Vachuska | 6c8eff3 | 2015-05-27 16:11:44 -0700 | [diff] [blame] | 694 | return Objects.hash(type().ordinal(), metadata, metadataMask); |
Saurav Das | 86af8f1 | 2015-05-25 23:55:33 -0700 | [diff] [blame] | 695 | } |
| 696 | |
| 697 | @Override |
| 698 | public boolean equals(Object obj) { |
| 699 | if (this == obj) { |
| 700 | return true; |
| 701 | } |
| 702 | if (obj instanceof MetadataInstruction) { |
| 703 | MetadataInstruction that = (MetadataInstruction) obj; |
| 704 | return Objects.equals(metadata, that.metadata) && |
| 705 | Objects.equals(metadataMask, that.metadataMask); |
| 706 | |
| 707 | } |
| 708 | return false; |
| 709 | } |
alshabib | 9af7007 | 2015-02-09 14:34:16 -0800 | [diff] [blame] | 710 | } |
Saurav Das | 73a7dd4 | 2015-08-19 22:20:31 -0700 | [diff] [blame] | 711 | |
alshabib | 55a55d9 | 2014-09-16 11:59:31 -0700 | [diff] [blame] | 712 | } |
alshabib | 8ca5390 | 2014-10-07 13:11:17 -0700 | [diff] [blame] | 713 | |
| 714 | |