Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 1 | package org.projectfloodlight.openflow.protocol.match; |
| 2 | |
| 3 | import org.projectfloodlight.openflow.types.ArpOpcode; |
Rich Lane | eb21c4f | 2013-10-28 17:34:41 -0700 | [diff] [blame] | 4 | import org.projectfloodlight.openflow.types.ClassId; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 5 | import org.projectfloodlight.openflow.types.EthType; |
| 6 | import org.projectfloodlight.openflow.types.ICMPv4Code; |
| 7 | import org.projectfloodlight.openflow.types.ICMPv4Type; |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 8 | import org.projectfloodlight.openflow.types.IPv4Address; |
| 9 | import org.projectfloodlight.openflow.types.IPv6Address; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 10 | import org.projectfloodlight.openflow.types.IPv6FlowLabel; |
| 11 | import org.projectfloodlight.openflow.types.IpDscp; |
| 12 | import org.projectfloodlight.openflow.types.IpEcn; |
| 13 | import org.projectfloodlight.openflow.types.IpProtocol; |
Rich Lane | 376cafe | 2013-10-27 21:49:14 -0700 | [diff] [blame] | 14 | import org.projectfloodlight.openflow.types.LagId; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 15 | import org.projectfloodlight.openflow.types.MacAddress; |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 16 | import org.projectfloodlight.openflow.types.OFBitMask128; |
Sovietaced | 25021ec | 2014-12-31 15:44:21 -0500 | [diff] [blame] | 17 | import org.projectfloodlight.openflow.types.OFBitMask512; |
Rich Lane | 9c27b5d | 2013-10-30 17:14:32 -0700 | [diff] [blame] | 18 | import org.projectfloodlight.openflow.types.OFBooleanValue; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 19 | import org.projectfloodlight.openflow.types.OFMetadata; |
| 20 | import org.projectfloodlight.openflow.types.OFPort; |
| 21 | import org.projectfloodlight.openflow.types.OFValueType; |
Andreas Wundsam | 98a1863 | 2013-11-05 11:34:24 -0800 | [diff] [blame] | 22 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 23 | import org.projectfloodlight.openflow.types.TransportPort; |
Rich Lane | 9b17807 | 2014-05-19 15:31:55 -0700 | [diff] [blame] | 24 | import org.projectfloodlight.openflow.types.U16; |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 25 | import org.projectfloodlight.openflow.types.U32; |
Sovietaced | fbb8708 | 2015-07-21 17:55:59 -0400 | [diff] [blame] | 26 | import org.projectfloodlight.openflow.types.U64; |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 27 | import org.projectfloodlight.openflow.types.U8; |
Rich Lane | 53ddf5c | 2014-03-20 15:24:08 -0700 | [diff] [blame] | 28 | import org.projectfloodlight.openflow.types.UDF; |
Rich Lane | eb21c4f | 2013-10-28 17:34:41 -0700 | [diff] [blame] | 29 | import org.projectfloodlight.openflow.types.VRF; |
Andreas Wundsam | 98a1863 | 2013-11-05 11:34:24 -0800 | [diff] [blame] | 30 | import org.projectfloodlight.openflow.types.VlanPcp; |
Praseed Balakrishnan | 2ed6da0 | 2014-09-18 17:02:48 -0700 | [diff] [blame] | 31 | import org.projectfloodlight.openflow.types.CircuitSignalID; |
Yafit Hadar | f8caac0 | 2015-08-25 10:21:44 +0300 | [diff] [blame] | 32 | import org.projectfloodlight.openflow.types.OduSignalID; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 33 | |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 34 | public class MatchField<F extends OFValueType<F>> { |
| 35 | private final String name; |
| 36 | public final MatchFields id; |
| 37 | private final Prerequisite<?>[] prerequisites; |
| 38 | |
| 39 | private MatchField(final String name, final MatchFields id, Prerequisite<?>... prerequisites) { |
| 40 | this.name = name; |
| 41 | this.id = id; |
| 42 | this.prerequisites = prerequisites; |
| 43 | } |
| 44 | |
| 45 | public final static MatchField<OFPort> IN_PORT = |
| 46 | new MatchField<OFPort>("in_port", MatchFields.IN_PORT); |
| 47 | |
| 48 | public final static MatchField<OFPort> IN_PHY_PORT = |
| 49 | new MatchField<OFPort>("in_phy_port", MatchFields.IN_PHY_PORT, |
| 50 | new Prerequisite<OFPort>(MatchField.IN_PORT)); |
| 51 | |
| 52 | public final static MatchField<OFMetadata> METADATA = |
| 53 | new MatchField<OFMetadata>("metadata", MatchFields.METADATA); |
| 54 | |
| 55 | public final static MatchField<MacAddress> ETH_DST = |
| 56 | new MatchField<MacAddress>("eth_dst", MatchFields.ETH_DST); |
| 57 | |
| 58 | public final static MatchField<MacAddress> ETH_SRC = |
| 59 | new MatchField<MacAddress>("eth_src", MatchFields.ETH_SRC); |
| 60 | |
| 61 | public final static MatchField<EthType> ETH_TYPE = |
| 62 | new MatchField<EthType>("eth_type", MatchFields.ETH_TYPE); |
| 63 | |
Andreas Wundsam | 98a1863 | 2013-11-05 11:34:24 -0800 | [diff] [blame] | 64 | public final static MatchField<OFVlanVidMatch> VLAN_VID = |
| 65 | new MatchField<OFVlanVidMatch>("vlan_vid", MatchFields.VLAN_VID); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 66 | |
| 67 | public final static MatchField<VlanPcp> VLAN_PCP = |
| 68 | new MatchField<VlanPcp>("vlan_pcp", MatchFields.VLAN_PCP, |
Andreas Wundsam | 98a1863 | 2013-11-05 11:34:24 -0800 | [diff] [blame] | 69 | new Prerequisite<OFVlanVidMatch>(MatchField.VLAN_VID)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 70 | |
| 71 | public final static MatchField<IpDscp> IP_DSCP = |
| 72 | new MatchField<IpDscp>("ip_dscp", MatchFields.IP_DSCP, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 73 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 74 | |
| 75 | public final static MatchField<IpEcn> IP_ECN = |
Ronald Li | 8083dfa | 2013-11-20 15:00:05 -0800 | [diff] [blame] | 76 | new MatchField<IpEcn>("ip_ecn", MatchFields.IP_ECN, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 77 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 78 | |
| 79 | public final static MatchField<IpProtocol> IP_PROTO = |
| 80 | new MatchField<IpProtocol>("ip_proto", MatchFields.IP_PROTO, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 81 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 82 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 83 | public final static MatchField<IPv4Address> IPV4_SRC = |
| 84 | new MatchField<IPv4Address>("ipv4_src", MatchFields.IPV4_SRC, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 85 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 86 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 87 | public final static MatchField<IPv4Address> IPV4_DST = |
| 88 | new MatchField<IPv4Address>("ipv4_dst", MatchFields.IPV4_DST, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 89 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 90 | |
| 91 | public final static MatchField<TransportPort> TCP_SRC = new MatchField<TransportPort>( |
| 92 | "tcp_src", MatchFields.TCP_SRC, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 93 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.TCP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 94 | |
| 95 | public final static MatchField<TransportPort> TCP_DST = new MatchField<TransportPort>( |
| 96 | "tcp_dst", MatchFields.TCP_DST, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 97 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.TCP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 98 | |
| 99 | public final static MatchField<TransportPort> UDP_SRC = new MatchField<TransportPort>( |
| 100 | "udp_src", MatchFields.UDP_SRC, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 101 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.UDP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 102 | |
| 103 | public final static MatchField<TransportPort> UDP_DST = new MatchField<TransportPort>( |
| 104 | "udp_dst", MatchFields.UDP_DST, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 105 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.UDP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 106 | |
| 107 | public final static MatchField<TransportPort> SCTP_SRC = new MatchField<TransportPort>( |
| 108 | "sctp_src", MatchFields.SCTP_SRC, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 109 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.SCTP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 110 | |
| 111 | public final static MatchField<TransportPort> SCTP_DST = new MatchField<TransportPort>( |
| 112 | "sctp_dst", MatchFields.SCTP_DST, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 113 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.SCTP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 114 | |
| 115 | public final static MatchField<ICMPv4Type> ICMPV4_TYPE = new MatchField<ICMPv4Type>( |
Ronald Li | d7a63f0 | 2013-11-20 15:49:33 -0800 | [diff] [blame] | 116 | "icmpv4_type", MatchFields.ICMPV4_TYPE, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 117 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.ICMP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 118 | |
| 119 | public final static MatchField<ICMPv4Code> ICMPV4_CODE = new MatchField<ICMPv4Code>( |
Ronald Li | d7a63f0 | 2013-11-20 15:49:33 -0800 | [diff] [blame] | 120 | "icmpv4_code", MatchFields.ICMPV4_CODE, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 121 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.ICMP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 122 | |
| 123 | public final static MatchField<ArpOpcode> ARP_OP = new MatchField<ArpOpcode>( |
| 124 | "arp_op", MatchFields.ARP_OP, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 125 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 126 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 127 | public final static MatchField<IPv4Address> ARP_SPA = |
| 128 | new MatchField<IPv4Address>("arp_spa", MatchFields.ARP_SPA, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 129 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 130 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 131 | public final static MatchField<IPv4Address> ARP_TPA = |
| 132 | new MatchField<IPv4Address>("arp_tpa", MatchFields.ARP_TPA, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 133 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 134 | |
| 135 | public final static MatchField<MacAddress> ARP_SHA = |
| 136 | new MatchField<MacAddress>("arp_sha", MatchFields.ARP_SHA, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 137 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 138 | |
| 139 | public final static MatchField<MacAddress> ARP_THA = |
| 140 | new MatchField<MacAddress>("arp_tha", MatchFields.ARP_THA, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 141 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 142 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 143 | public final static MatchField<IPv6Address> IPV6_SRC = |
| 144 | new MatchField<IPv6Address>("ipv6_src", MatchFields.IPV6_SRC, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 145 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 146 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 147 | public final static MatchField<IPv6Address> IPV6_DST = |
| 148 | new MatchField<IPv6Address>("ipv6_dst", MatchFields.IPV6_DST, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 149 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 150 | |
| 151 | public final static MatchField<IPv6FlowLabel> IPV6_FLABEL = |
| 152 | new MatchField<IPv6FlowLabel>("ipv6_flabel", MatchFields.IPV6_FLABEL, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 153 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 154 | |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 155 | public final static MatchField<U8> ICMPV6_TYPE = |
| 156 | new MatchField<U8>("icmpv6_type", MatchFields.ICMPV6_TYPE, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 157 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.IPv6_ICMP)); |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 158 | |
| 159 | public final static MatchField<U8> ICMPV6_CODE = |
| 160 | new MatchField<U8>("icmpv6_code", MatchFields.ICMPV6_CODE, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 161 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.IPv6_ICMP)); |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 162 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 163 | public final static MatchField<IPv6Address> IPV6_ND_TARGET = |
| 164 | new MatchField<IPv6Address>("ipv6_nd_target", MatchFields.IPV6_ND_TARGET, |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 165 | new Prerequisite<U8>(MatchField.ICMPV6_TYPE, U8.of((short)135), U8.of((short)136))); |
| 166 | |
| 167 | public final static MatchField<MacAddress> IPV6_ND_SLL = |
| 168 | new MatchField<MacAddress>("ipv6_nd_sll", MatchFields.IPV6_ND_SLL, |
| 169 | new Prerequisite<U8>(MatchField.ICMPV6_TYPE, U8.of((short)135))); |
| 170 | |
| 171 | public final static MatchField<MacAddress> IPV6_ND_TLL = |
| 172 | new MatchField<MacAddress>("ipv6_nd_tll", MatchFields.IPV6_ND_TLL, |
| 173 | new Prerequisite<U8>(MatchField.ICMPV6_TYPE, U8.of((short)136))); |
| 174 | |
| 175 | public final static MatchField<U32> MPLS_LABEL = |
| 176 | new MatchField<U32>("mpls_label", MatchFields.MPLS_LABEL, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 177 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.MPLS_UNICAST, EthType.MPLS_MULTICAST)); |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 178 | |
| 179 | public final static MatchField<U8> MPLS_TC = |
| 180 | new MatchField<U8>("mpls_tc", MatchFields.MPLS_TC, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 181 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.MPLS_UNICAST, EthType.MPLS_MULTICAST)); |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 182 | |
Saurav Das | bc26674 | 2014-10-09 16:45:27 -0700 | [diff] [blame] | 183 | public final static MatchField<OFBooleanValue> MPLS_BOS = |
| 184 | new MatchField<OFBooleanValue>("mpls_bos", MatchFields.MPLS_BOS, |
| 185 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.MPLS_UNICAST, EthType.MPLS_MULTICAST)); |
| 186 | |
Sovietaced | 25021ec | 2014-12-31 15:44:21 -0500 | [diff] [blame] | 187 | public final static MatchField<U64> TUNNEL_ID = |
Byungjoon Lee | b4c38b8 | 2014-04-23 14:24:59 +0900 | [diff] [blame] | 188 | new MatchField<U64>("tunnel_id", MatchFields.TUNNEL_ID); |
| 189 | |
Rich Lane | 9f59504 | 2014-10-31 15:56:34 -0700 | [diff] [blame] | 190 | public final static MatchField<U16> IPV6_EXTHDR = |
| 191 | new MatchField<U16>("ipv6_exthdr", MatchFields.IPV6_EXTHDR); |
| 192 | |
| 193 | public final static MatchField<OFBooleanValue> PBB_UCA = |
| 194 | new MatchField<OFBooleanValue>("pbb_uca", MatchFields.PBB_UCA); |
Sovietaced | 25021ec | 2014-12-31 15:44:21 -0500 | [diff] [blame] | 195 | |
Ryan Izard | 712c4a1 | 2014-12-01 08:42:29 -0500 | [diff] [blame] | 196 | public final static MatchField<IPv4Address> TUNNEL_IPV4_SRC = |
| 197 | new MatchField<IPv4Address>("tunnel_ipv4_src", MatchFields.TUNNEL_IPV4_SRC, |
| 198 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4)); |
| 199 | |
| 200 | public final static MatchField<IPv4Address> TUNNEL_IPV4_DST = |
| 201 | new MatchField<IPv4Address>("tunnel_ipv4_dst", MatchFields.TUNNEL_IPV4_DST, |
| 202 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4)); |
Rich Lane | 9f59504 | 2014-10-31 15:56:34 -0700 | [diff] [blame] | 203 | |
Yotam Harchol | 2c53558 | 2013-10-01 15:50:20 -0700 | [diff] [blame] | 204 | public final static MatchField<OFBitMask128> BSN_IN_PORTS_128 = |
Ronald Li | a07b257 | 2013-11-18 13:54:08 -0800 | [diff] [blame] | 205 | new MatchField<OFBitMask128>("bsn_in_ports_128", MatchFields.BSN_IN_PORTS_128); |
Yotam Harchol | a11f38b | 2013-09-26 15:38:17 -0700 | [diff] [blame] | 206 | |
Sovietaced | 25021ec | 2014-12-31 15:44:21 -0500 | [diff] [blame] | 207 | public final static MatchField<OFBitMask512> BSN_IN_PORTS_512 = |
| 208 | new MatchField<OFBitMask512>("bsn_in_ports_512", MatchFields.BSN_IN_PORTS_512); |
| 209 | |
Rich Lane | 376cafe | 2013-10-27 21:49:14 -0700 | [diff] [blame] | 210 | public final static MatchField<LagId> BSN_LAG_ID = |
| 211 | new MatchField<LagId>("bsn_lag_id", MatchFields.BSN_LAG_ID); |
Rich Lane | 1424d0b | 2013-10-24 17:16:24 -0700 | [diff] [blame] | 212 | |
Rich Lane | eb21c4f | 2013-10-28 17:34:41 -0700 | [diff] [blame] | 213 | public final static MatchField<VRF> BSN_VRF = |
| 214 | new MatchField<VRF>("bsn_vrf", MatchFields.BSN_VRF); |
| 215 | |
Rich Lane | 9c27b5d | 2013-10-30 17:14:32 -0700 | [diff] [blame] | 216 | public final static MatchField<OFBooleanValue> BSN_GLOBAL_VRF_ALLOWED = |
| 217 | new MatchField<OFBooleanValue>("bsn_global_vrf_allowed", MatchFields.BSN_GLOBAL_VRF_ALLOWED); |
Rich Lane | eb21c4f | 2013-10-28 17:34:41 -0700 | [diff] [blame] | 218 | |
| 219 | public final static MatchField<ClassId> BSN_L3_INTERFACE_CLASS_ID = |
| 220 | new MatchField<ClassId>("bsn_l3_interface_class_id", MatchFields.BSN_L3_INTERFACE_CLASS_ID); |
| 221 | |
| 222 | public final static MatchField<ClassId> BSN_L3_SRC_CLASS_ID = |
| 223 | new MatchField<ClassId>("bsn_l3_src_class_id", MatchFields.BSN_L3_SRC_CLASS_ID); |
| 224 | |
| 225 | public final static MatchField<ClassId> BSN_L3_DST_CLASS_ID = |
| 226 | new MatchField<ClassId>("bsn_l3_dst_class_id", MatchFields.BSN_L3_DST_CLASS_ID); |
| 227 | |
Rich Lane | 917bb9a | 2014-03-11 17:49:56 -0700 | [diff] [blame] | 228 | public final static MatchField<ClassId> BSN_EGR_PORT_GROUP_ID = |
| 229 | new MatchField<ClassId>("bsn_egr_port_group_id", MatchFields.BSN_EGR_PORT_GROUP_ID); |
| 230 | |
Rich Lane | 75d235a | 2015-02-03 17:40:10 -0800 | [diff] [blame] | 231 | public final static MatchField<ClassId> BSN_INGRESS_PORT_GROUP_ID = |
| 232 | new MatchField<ClassId>("bsn_ingress_port_group_id", MatchFields.BSN_INGRESS_PORT_GROUP_ID); |
| 233 | |
Rich Lane | 53ddf5c | 2014-03-20 15:24:08 -0700 | [diff] [blame] | 234 | public final static MatchField<UDF> BSN_UDF0 = |
| 235 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF0); |
| 236 | |
| 237 | public final static MatchField<UDF> BSN_UDF1 = |
| 238 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF1); |
| 239 | |
| 240 | public final static MatchField<UDF> BSN_UDF2 = |
| 241 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF2); |
| 242 | |
| 243 | public final static MatchField<UDF> BSN_UDF3 = |
| 244 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF3); |
| 245 | |
| 246 | public final static MatchField<UDF> BSN_UDF4 = |
| 247 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF4); |
| 248 | |
| 249 | public final static MatchField<UDF> BSN_UDF5 = |
| 250 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF5); |
| 251 | |
| 252 | public final static MatchField<UDF> BSN_UDF6 = |
| 253 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF6); |
| 254 | |
| 255 | public final static MatchField<UDF> BSN_UDF7 = |
| 256 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF7); |
| 257 | |
Rich Lane | 9b17807 | 2014-05-19 15:31:55 -0700 | [diff] [blame] | 258 | public final static MatchField<U16> BSN_TCP_FLAGS = |
| 259 | new MatchField<U16>("bsn_tcp_flags", MatchFields.BSN_TCP_FLAGS); |
| 260 | |
Rich Lane | a5eeae3 | 2014-06-26 19:59:04 -0700 | [diff] [blame] | 261 | public final static MatchField<ClassId> BSN_VLAN_XLATE_PORT_GROUP_ID = |
| 262 | new MatchField<ClassId>("bsn_vlan_xlate_port_group_id", MatchFields.BSN_VLAN_XLATE_PORT_GROUP_ID); |
| 263 | |
Praseed Balakrishnan | 2ed6da0 | 2014-09-18 17:02:48 -0700 | [diff] [blame] | 264 | public final static MatchField<U8> OCH_SIGTYPE = |
| 265 | new MatchField<U8>("och_sigtype", |
Praseed Balakrishnan | f78068b | 2014-09-04 10:30:40 -0700 | [diff] [blame] | 266 | MatchFields.OCH_SIGTYPE); |
| 267 | |
Praseed Balakrishnan | 2ed6da0 | 2014-09-18 17:02:48 -0700 | [diff] [blame] | 268 | public final static MatchField<U8> OCH_SIGTYPE_BASIC = |
| 269 | new MatchField<U8>("och_sigtype_basic", |
| 270 | MatchFields.OCH_SIGTYPE_BASIC); |
Praseed Balakrishnan | db949d4 | 2014-12-02 14:28:20 -0800 | [diff] [blame] | 271 | |
Praseed Balakrishnan | db949d4 | 2014-12-02 14:28:20 -0800 | [diff] [blame] | 272 | public final static MatchField<CircuitSignalID> OCH_SIGID = |
| 273 | new MatchField<CircuitSignalID>("och_sigid", |
| 274 | MatchFields.OCH_SIGID); |
| 275 | |
| 276 | public final static MatchField<CircuitSignalID> OCH_SIGID_BASIC = |
| 277 | new MatchField<CircuitSignalID>("och_sigid_basic", |
| 278 | MatchFields.OCH_SIGID); |
BitOhenry | 83b5323 | 2015-11-18 17:26:55 +0800 | [diff] [blame] | 279 | |
Wilson Ng | 15efef9 | 2014-11-05 14:27:35 -0800 | [diff] [blame] | 280 | public final static MatchField<OFBooleanValue> BSN_L2_CACHE_HIT = |
| 281 | new MatchField<OFBooleanValue>("bsn_l2_cache_hit", MatchFields.BSN_L2_CACHE_HIT); |
Wilson Ng | a3483d6 | 2014-11-05 13:50:37 -0800 | [diff] [blame] | 282 | |
Ken Chiang | 8df4a11 | 2015-05-12 10:15:44 -0700 | [diff] [blame] | 283 | public final static MatchField<U32> BSN_VXLAN_NETWORK_ID = |
| 284 | new MatchField<U32>("bsn_vxlan_network_id", MatchFields.BSN_VXLAN_NETWORK_ID); |
| 285 | |
| 286 | public final static MatchField<MacAddress> BSN_INNER_ETH_DST = |
| 287 | new MatchField<MacAddress>("bsn_inner_eth_dst", MatchFields.BSN_INNER_ETH_DST); |
| 288 | |
| 289 | public final static MatchField<MacAddress> BSN_INNER_ETH_SRC = |
| 290 | new MatchField<MacAddress>("bsn_inner_eth_src", MatchFields.BSN_INNER_ETH_SRC); |
| 291 | |
Wilson Ng | 95afd51 | 2015-07-13 14:31:00 -0700 | [diff] [blame] | 292 | public final static MatchField<OFVlanVidMatch> BSN_INNER_VLAN_VID = |
| 293 | new MatchField<OFVlanVidMatch>("bsn_inner_vlan_vid", MatchFields.BSN_INNER_VLAN_VID); |
| 294 | |
Yafit Hadar | f8caac0 | 2015-08-25 10:21:44 +0300 | [diff] [blame] | 295 | public final static MatchField<OduSignalID> EXP_ODU_SIG_ID = |
| 296 | new MatchField<OduSignalID>("exp_odu_sig_id", MatchFields.EXP_ODU_SIG_ID); |
BitOhenry | 83b5323 | 2015-11-18 17:26:55 +0800 | [diff] [blame] | 297 | |
Yafit Hadar | f8caac0 | 2015-08-25 10:21:44 +0300 | [diff] [blame] | 298 | public final static MatchField<U8> EXP_ODU_SIGTYPE = |
| 299 | new MatchField<U8>("exp_odu_sigtype", MatchFields.EXP_ODU_SIGTYPE); |
BitOhenry | 83b5323 | 2015-11-18 17:26:55 +0800 | [diff] [blame] | 300 | |
Yafit Hadar | f8caac0 | 2015-08-25 10:21:44 +0300 | [diff] [blame] | 301 | public final static MatchField<CircuitSignalID> EXP_OCH_SIG_ID = |
| 302 | new MatchField<CircuitSignalID>("exp_och_sig_id", MatchFields.EXP_OCH_SIG_ID); |
BitOhenry | 83b5323 | 2015-11-18 17:26:55 +0800 | [diff] [blame] | 303 | |
Yafit Hadar | f8caac0 | 2015-08-25 10:21:44 +0300 | [diff] [blame] | 304 | public final static MatchField<U8> EXP_OCH_SIGTYPE = |
| 305 | new MatchField<U8>("exp_och_sigtype", MatchFields.EXP_OCH_SIGTYPE); |
| 306 | |
BitOhenry | 83b5323 | 2015-11-18 17:26:55 +0800 | [diff] [blame] | 307 | public final static MatchField<U32> REG0 = |
| 308 | new MatchField<U32>("reg0", MatchFields.REG0); |
| 309 | |
| 310 | public final static MatchField<U32> REG1 = |
| 311 | new MatchField<U32>("reg1", MatchFields.REG1); |
| 312 | |
| 313 | public final static MatchField<U32> REG2 = |
| 314 | new MatchField<U32>("reg2", MatchFields.REG2); |
| 315 | |
| 316 | public final static MatchField<U32> REG3 = |
| 317 | new MatchField<U32>("reg3", MatchFields.REG3); |
| 318 | |
| 319 | public final static MatchField<U32> REG4 = |
| 320 | new MatchField<U32>("reg4", MatchFields.REG4); |
| 321 | |
| 322 | public final static MatchField<U32> REG5 = |
| 323 | new MatchField<U32>("reg5", MatchFields.REG5); |
| 324 | |
| 325 | public final static MatchField<U32> REG6 = |
| 326 | new MatchField<U32>("reg6", MatchFields.REG6); |
| 327 | |
| 328 | public final static MatchField<U32> REG7 = |
| 329 | new MatchField<U32>("reg7", MatchFields.REG7); |
| 330 | |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 331 | public String getName() { |
| 332 | return name; |
| 333 | } |
| 334 | |
| 335 | public boolean arePrerequisitesOK(Match match) { |
| 336 | for (Prerequisite<?> p : this.prerequisites) { |
| 337 | if (!p.isSatisfied(match)) { |
| 338 | return false; |
| 339 | } |
| 340 | } |
| 341 | return true; |
| 342 | } |
| 343 | |
| 344 | } |