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; |
Rich Lane | 9c27b5d | 2013-10-30 17:14:32 -0700 | [diff] [blame] | 17 | import org.projectfloodlight.openflow.types.OFBooleanValue; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 18 | import org.projectfloodlight.openflow.types.OFMetadata; |
| 19 | import org.projectfloodlight.openflow.types.OFPort; |
| 20 | import org.projectfloodlight.openflow.types.OFValueType; |
Andreas Wundsam | 98a1863 | 2013-11-05 11:34:24 -0800 | [diff] [blame] | 21 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 22 | import org.projectfloodlight.openflow.types.TransportPort; |
Rich Lane | 9b17807 | 2014-05-19 15:31:55 -0700 | [diff] [blame] | 23 | import org.projectfloodlight.openflow.types.U16; |
Byungjoon Lee | b4c38b8 | 2014-04-23 14:24:59 +0900 | [diff] [blame] | 24 | import org.projectfloodlight.openflow.types.U64; |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 25 | import org.projectfloodlight.openflow.types.U32; |
| 26 | import org.projectfloodlight.openflow.types.U8; |
Rich Lane | 53ddf5c | 2014-03-20 15:24:08 -0700 | [diff] [blame] | 27 | import org.projectfloodlight.openflow.types.UDF; |
Rich Lane | eb21c4f | 2013-10-28 17:34:41 -0700 | [diff] [blame] | 28 | import org.projectfloodlight.openflow.types.VRF; |
Andreas Wundsam | 98a1863 | 2013-11-05 11:34:24 -0800 | [diff] [blame] | 29 | import org.projectfloodlight.openflow.types.VlanPcp; |
Praseed Balakrishnan | 2ed6da0 | 2014-09-18 17:02:48 -0700 | [diff] [blame] | 30 | import org.projectfloodlight.openflow.types.CircuitSignalID; |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 31 | |
| 32 | @SuppressWarnings("unchecked") |
| 33 | public class MatchField<F extends OFValueType<F>> { |
| 34 | private final String name; |
| 35 | public final MatchFields id; |
| 36 | private final Prerequisite<?>[] prerequisites; |
| 37 | |
| 38 | private MatchField(final String name, final MatchFields id, Prerequisite<?>... prerequisites) { |
| 39 | this.name = name; |
| 40 | this.id = id; |
| 41 | this.prerequisites = prerequisites; |
| 42 | } |
| 43 | |
| 44 | public final static MatchField<OFPort> IN_PORT = |
| 45 | new MatchField<OFPort>("in_port", MatchFields.IN_PORT); |
| 46 | |
| 47 | public final static MatchField<OFPort> IN_PHY_PORT = |
| 48 | new MatchField<OFPort>("in_phy_port", MatchFields.IN_PHY_PORT, |
| 49 | new Prerequisite<OFPort>(MatchField.IN_PORT)); |
| 50 | |
| 51 | public final static MatchField<OFMetadata> METADATA = |
| 52 | new MatchField<OFMetadata>("metadata", MatchFields.METADATA); |
| 53 | |
| 54 | public final static MatchField<MacAddress> ETH_DST = |
| 55 | new MatchField<MacAddress>("eth_dst", MatchFields.ETH_DST); |
| 56 | |
| 57 | public final static MatchField<MacAddress> ETH_SRC = |
| 58 | new MatchField<MacAddress>("eth_src", MatchFields.ETH_SRC); |
| 59 | |
| 60 | public final static MatchField<EthType> ETH_TYPE = |
| 61 | new MatchField<EthType>("eth_type", MatchFields.ETH_TYPE); |
| 62 | |
Andreas Wundsam | 98a1863 | 2013-11-05 11:34:24 -0800 | [diff] [blame] | 63 | public final static MatchField<OFVlanVidMatch> VLAN_VID = |
| 64 | new MatchField<OFVlanVidMatch>("vlan_vid", MatchFields.VLAN_VID); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 65 | |
| 66 | public final static MatchField<VlanPcp> VLAN_PCP = |
| 67 | new MatchField<VlanPcp>("vlan_pcp", MatchFields.VLAN_PCP, |
Andreas Wundsam | 98a1863 | 2013-11-05 11:34:24 -0800 | [diff] [blame] | 68 | new Prerequisite<OFVlanVidMatch>(MatchField.VLAN_VID)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 69 | |
| 70 | public final static MatchField<IpDscp> IP_DSCP = |
| 71 | new MatchField<IpDscp>("ip_dscp", MatchFields.IP_DSCP, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 72 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 73 | |
| 74 | public final static MatchField<IpEcn> IP_ECN = |
Ronald Li | 8083dfa | 2013-11-20 15:00:05 -0800 | [diff] [blame] | 75 | new MatchField<IpEcn>("ip_ecn", MatchFields.IP_ECN, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 76 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 77 | |
| 78 | public final static MatchField<IpProtocol> IP_PROTO = |
| 79 | new MatchField<IpProtocol>("ip_proto", MatchFields.IP_PROTO, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 80 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 81 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 82 | public final static MatchField<IPv4Address> IPV4_SRC = |
| 83 | new MatchField<IPv4Address>("ipv4_src", MatchFields.IPV4_SRC, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 84 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 85 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 86 | public final static MatchField<IPv4Address> IPV4_DST = |
| 87 | new MatchField<IPv4Address>("ipv4_dst", MatchFields.IPV4_DST, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 88 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 89 | |
| 90 | public final static MatchField<TransportPort> TCP_SRC = new MatchField<TransportPort>( |
| 91 | "tcp_src", MatchFields.TCP_SRC, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 92 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.TCP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 93 | |
| 94 | public final static MatchField<TransportPort> TCP_DST = new MatchField<TransportPort>( |
| 95 | "tcp_dst", MatchFields.TCP_DST, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 96 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.TCP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 97 | |
| 98 | public final static MatchField<TransportPort> UDP_SRC = new MatchField<TransportPort>( |
| 99 | "udp_src", MatchFields.UDP_SRC, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 100 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.UDP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 101 | |
| 102 | public final static MatchField<TransportPort> UDP_DST = new MatchField<TransportPort>( |
| 103 | "udp_dst", MatchFields.UDP_DST, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 104 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.UDP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 105 | |
| 106 | public final static MatchField<TransportPort> SCTP_SRC = new MatchField<TransportPort>( |
| 107 | "sctp_src", MatchFields.SCTP_SRC, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 108 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.SCTP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 109 | |
| 110 | public final static MatchField<TransportPort> SCTP_DST = new MatchField<TransportPort>( |
| 111 | "sctp_dst", MatchFields.SCTP_DST, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 112 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.SCTP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 113 | |
| 114 | public final static MatchField<ICMPv4Type> ICMPV4_TYPE = new MatchField<ICMPv4Type>( |
Ronald Li | d7a63f0 | 2013-11-20 15:49:33 -0800 | [diff] [blame] | 115 | "icmpv4_type", MatchFields.ICMPV4_TYPE, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 116 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.ICMP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 117 | |
| 118 | public final static MatchField<ICMPv4Code> ICMPV4_CODE = new MatchField<ICMPv4Code>( |
Ronald Li | d7a63f0 | 2013-11-20 15:49:33 -0800 | [diff] [blame] | 119 | "icmpv4_code", MatchFields.ICMPV4_CODE, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 120 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.ICMP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 121 | |
| 122 | public final static MatchField<ArpOpcode> ARP_OP = new MatchField<ArpOpcode>( |
| 123 | "arp_op", MatchFields.ARP_OP, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 124 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 125 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 126 | public final static MatchField<IPv4Address> ARP_SPA = |
| 127 | new MatchField<IPv4Address>("arp_spa", MatchFields.ARP_SPA, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 128 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 129 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 130 | public final static MatchField<IPv4Address> ARP_TPA = |
| 131 | new MatchField<IPv4Address>("arp_tpa", MatchFields.ARP_TPA, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 132 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 133 | |
| 134 | public final static MatchField<MacAddress> ARP_SHA = |
| 135 | new MatchField<MacAddress>("arp_sha", MatchFields.ARP_SHA, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 136 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 137 | |
| 138 | public final static MatchField<MacAddress> ARP_THA = |
| 139 | new MatchField<MacAddress>("arp_tha", MatchFields.ARP_THA, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 140 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.ARP)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 141 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 142 | public final static MatchField<IPv6Address> IPV6_SRC = |
| 143 | new MatchField<IPv6Address>("ipv6_src", MatchFields.IPV6_SRC, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 144 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 145 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 146 | public final static MatchField<IPv6Address> IPV6_DST = |
| 147 | new MatchField<IPv6Address>("ipv6_dst", MatchFields.IPV6_DST, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 148 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 149 | |
| 150 | public final static MatchField<IPv6FlowLabel> IPV6_FLABEL = |
| 151 | new MatchField<IPv6FlowLabel>("ipv6_flabel", MatchFields.IPV6_FLABEL, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 152 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv6)); |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 153 | |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 154 | public final static MatchField<U8> ICMPV6_TYPE = |
| 155 | new MatchField<U8>("icmpv6_type", MatchFields.ICMPV6_TYPE, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 156 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.IPv6_ICMP)); |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 157 | |
| 158 | public final static MatchField<U8> ICMPV6_CODE = |
| 159 | new MatchField<U8>("icmpv6_code", MatchFields.ICMPV6_CODE, |
Andreas Wundsam | 520c880 | 2013-10-08 22:05:23 -0700 | [diff] [blame] | 160 | new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.IPv6_ICMP)); |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 161 | |
Yotam Harchol | a289d55 | 2013-09-16 10:10:40 -0700 | [diff] [blame] | 162 | public final static MatchField<IPv6Address> IPV6_ND_TARGET = |
| 163 | new MatchField<IPv6Address>("ipv6_nd_target", MatchFields.IPV6_ND_TARGET, |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 164 | new Prerequisite<U8>(MatchField.ICMPV6_TYPE, U8.of((short)135), U8.of((short)136))); |
| 165 | |
| 166 | public final static MatchField<MacAddress> IPV6_ND_SLL = |
| 167 | new MatchField<MacAddress>("ipv6_nd_sll", MatchFields.IPV6_ND_SLL, |
| 168 | new Prerequisite<U8>(MatchField.ICMPV6_TYPE, U8.of((short)135))); |
| 169 | |
| 170 | public final static MatchField<MacAddress> IPV6_ND_TLL = |
| 171 | new MatchField<MacAddress>("ipv6_nd_tll", MatchFields.IPV6_ND_TLL, |
| 172 | new Prerequisite<U8>(MatchField.ICMPV6_TYPE, U8.of((short)136))); |
| 173 | |
| 174 | public final static MatchField<U32> MPLS_LABEL = |
| 175 | new MatchField<U32>("mpls_label", MatchFields.MPLS_LABEL, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 176 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.MPLS_UNICAST, EthType.MPLS_MULTICAST)); |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 177 | |
| 178 | public final static MatchField<U8> MPLS_TC = |
| 179 | new MatchField<U8>("mpls_tc", MatchFields.MPLS_TC, |
Andreas Wundsam | b70b044 | 2013-09-23 14:44:43 -0700 | [diff] [blame] | 180 | new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.MPLS_UNICAST, EthType.MPLS_MULTICAST)); |
Yotam Harchol | a86e425 | 2013-09-06 15:36:28 -0700 | [diff] [blame] | 181 | |
Byungjoon Lee | b4c38b8 | 2014-04-23 14:24:59 +0900 | [diff] [blame] | 182 | public final static MatchField<U64> TUNNEL_ID = |
| 183 | new MatchField<U64>("tunnel_id", MatchFields.TUNNEL_ID); |
| 184 | |
Yotam Harchol | 2c53558 | 2013-10-01 15:50:20 -0700 | [diff] [blame] | 185 | public final static MatchField<OFBitMask128> BSN_IN_PORTS_128 = |
Ronald Li | a07b257 | 2013-11-18 13:54:08 -0800 | [diff] [blame] | 186 | new MatchField<OFBitMask128>("bsn_in_ports_128", MatchFields.BSN_IN_PORTS_128); |
Yotam Harchol | a11f38b | 2013-09-26 15:38:17 -0700 | [diff] [blame] | 187 | |
Rich Lane | 376cafe | 2013-10-27 21:49:14 -0700 | [diff] [blame] | 188 | public final static MatchField<LagId> BSN_LAG_ID = |
| 189 | new MatchField<LagId>("bsn_lag_id", MatchFields.BSN_LAG_ID); |
Rich Lane | 1424d0b | 2013-10-24 17:16:24 -0700 | [diff] [blame] | 190 | |
Rich Lane | eb21c4f | 2013-10-28 17:34:41 -0700 | [diff] [blame] | 191 | public final static MatchField<VRF> BSN_VRF = |
| 192 | new MatchField<VRF>("bsn_vrf", MatchFields.BSN_VRF); |
| 193 | |
Rich Lane | 9c27b5d | 2013-10-30 17:14:32 -0700 | [diff] [blame] | 194 | public final static MatchField<OFBooleanValue> BSN_GLOBAL_VRF_ALLOWED = |
| 195 | new MatchField<OFBooleanValue>("bsn_global_vrf_allowed", MatchFields.BSN_GLOBAL_VRF_ALLOWED); |
Rich Lane | eb21c4f | 2013-10-28 17:34:41 -0700 | [diff] [blame] | 196 | |
| 197 | public final static MatchField<ClassId> BSN_L3_INTERFACE_CLASS_ID = |
| 198 | new MatchField<ClassId>("bsn_l3_interface_class_id", MatchFields.BSN_L3_INTERFACE_CLASS_ID); |
| 199 | |
| 200 | public final static MatchField<ClassId> BSN_L3_SRC_CLASS_ID = |
| 201 | new MatchField<ClassId>("bsn_l3_src_class_id", MatchFields.BSN_L3_SRC_CLASS_ID); |
| 202 | |
| 203 | public final static MatchField<ClassId> BSN_L3_DST_CLASS_ID = |
| 204 | new MatchField<ClassId>("bsn_l3_dst_class_id", MatchFields.BSN_L3_DST_CLASS_ID); |
| 205 | |
Rich Lane | 917bb9a | 2014-03-11 17:49:56 -0700 | [diff] [blame] | 206 | public final static MatchField<ClassId> BSN_EGR_PORT_GROUP_ID = |
| 207 | new MatchField<ClassId>("bsn_egr_port_group_id", MatchFields.BSN_EGR_PORT_GROUP_ID); |
| 208 | |
Rich Lane | 53ddf5c | 2014-03-20 15:24:08 -0700 | [diff] [blame] | 209 | public final static MatchField<UDF> BSN_UDF0 = |
| 210 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF0); |
| 211 | |
| 212 | public final static MatchField<UDF> BSN_UDF1 = |
| 213 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF1); |
| 214 | |
| 215 | public final static MatchField<UDF> BSN_UDF2 = |
| 216 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF2); |
| 217 | |
| 218 | public final static MatchField<UDF> BSN_UDF3 = |
| 219 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF3); |
| 220 | |
| 221 | public final static MatchField<UDF> BSN_UDF4 = |
| 222 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF4); |
| 223 | |
| 224 | public final static MatchField<UDF> BSN_UDF5 = |
| 225 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF5); |
| 226 | |
| 227 | public final static MatchField<UDF> BSN_UDF6 = |
| 228 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF6); |
| 229 | |
| 230 | public final static MatchField<UDF> BSN_UDF7 = |
| 231 | new MatchField<UDF>("bsn_udf", MatchFields.BSN_UDF7); |
| 232 | |
Rich Lane | 9b17807 | 2014-05-19 15:31:55 -0700 | [diff] [blame] | 233 | public final static MatchField<U16> BSN_TCP_FLAGS = |
| 234 | new MatchField<U16>("bsn_tcp_flags", MatchFields.BSN_TCP_FLAGS); |
| 235 | |
Rich Lane | a5eeae3 | 2014-06-26 19:59:04 -0700 | [diff] [blame] | 236 | public final static MatchField<ClassId> BSN_VLAN_XLATE_PORT_GROUP_ID = |
| 237 | new MatchField<ClassId>("bsn_vlan_xlate_port_group_id", MatchFields.BSN_VLAN_XLATE_PORT_GROUP_ID); |
| 238 | |
Praseed Balakrishnan | f78068b | 2014-09-04 10:30:40 -0700 | [diff] [blame] | 239 | |
Praseed Balakrishnan | 2ed6da0 | 2014-09-18 17:02:48 -0700 | [diff] [blame] | 240 | public final static MatchField<U8> OCH_SIGTYPE = |
| 241 | new MatchField<U8>("och_sigtype", |
Praseed Balakrishnan | f78068b | 2014-09-04 10:30:40 -0700 | [diff] [blame] | 242 | MatchFields.OCH_SIGTYPE); |
| 243 | |
Praseed Balakrishnan | 2ed6da0 | 2014-09-18 17:02:48 -0700 | [diff] [blame] | 244 | public final static MatchField<U8> OCH_SIGTYPE_BASIC = |
| 245 | new MatchField<U8>("och_sigtype_basic", |
| 246 | MatchFields.OCH_SIGTYPE_BASIC); |
Praseed Balakrishnan | db949d4 | 2014-12-02 14:28:20 -0800 | [diff] [blame^] | 247 | |
| 248 | |
| 249 | public final static MatchField<CircuitSignalID> OCH_SIGID = |
| 250 | new MatchField<CircuitSignalID>("och_sigid", |
| 251 | MatchFields.OCH_SIGID); |
| 252 | |
| 253 | public final static MatchField<CircuitSignalID> OCH_SIGID_BASIC = |
| 254 | new MatchField<CircuitSignalID>("och_sigid_basic", |
| 255 | MatchFields.OCH_SIGID); |
Praseed Balakrishnan | 2ed6da0 | 2014-09-18 17:02:48 -0700 | [diff] [blame] | 256 | |
Yotam Harchol | f3f1115 | 2013-09-05 16:47:16 -0700 | [diff] [blame] | 257 | public String getName() { |
| 258 | return name; |
| 259 | } |
| 260 | |
| 261 | public boolean arePrerequisitesOK(Match match) { |
| 262 | for (Prerequisite<?> p : this.prerequisites) { |
| 263 | if (!p.isSatisfied(match)) { |
| 264 | return false; |
| 265 | } |
| 266 | } |
| 267 | return true; |
| 268 | } |
| 269 | |
| 270 | } |