Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 1 | package org.openflow.protocol.match; |
| 2 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 3 | import org.openflow.types.ArpOpcode; |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 4 | import org.openflow.types.EthType; |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 5 | import org.openflow.types.ICMPv4Code; |
| 6 | import org.openflow.types.ICMPv4Type; |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 7 | import org.openflow.types.IPv4; |
| 8 | import org.openflow.types.IPv6; |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 9 | import org.openflow.types.IPv6FlowLabel; |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 10 | import org.openflow.types.IpDscp; |
| 11 | import org.openflow.types.IpEcn; |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 12 | import org.openflow.types.IpProtocol; |
| 13 | import org.openflow.types.MacAddress; |
Yotam Harchol | 161a5d5 | 2013-07-25 17:17:48 -0700 | [diff] [blame] | 14 | import org.openflow.types.Masked; |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 15 | import org.openflow.types.OFPort; |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 16 | import org.openflow.types.OFValueType; |
| 17 | import org.openflow.types.TransportPort; |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 18 | import org.openflow.types.VlanPcp; |
| 19 | import org.openflow.types.VlanVid; |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 20 | |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 21 | public class MatchField<F extends OFValueType<F>> { |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 22 | private final String name; |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 23 | public final MatchFields id; |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 24 | |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 25 | private MatchField(final String name, final MatchFields id) { |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 26 | this.name = name; |
| 27 | this.id = id; |
| 28 | } |
| 29 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 30 | public final static MatchField<OFPort> IN_PORT = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 31 | new MatchField<OFPort>("in_port", MatchFields.IN_PORT); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 32 | public final static MatchField<OFPort> IN_PHY_PORT = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 33 | new MatchField<OFPort>("in_phy_port", MatchFields.PHYSICAL_PORT); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 34 | public final static MatchField<OFPort> METADATA = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 35 | new MatchField<OFPort>("metadata", MatchFields.METADATA); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 36 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 37 | public final static MatchField<Masked<MacAddress>> ETH_DST = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 38 | new MatchField<Masked<MacAddress>>("eth_dst", MatchFields.ETH_DST); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 39 | public final static MatchField<Masked<MacAddress>> ETH_SRC = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 40 | new MatchField<Masked<MacAddress>>("eth_src", MatchFields.ETH_SRC); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 41 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 42 | public final static MatchField<EthType> ETH_TYPE = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 43 | new MatchField<EthType>("eth_type", MatchFields.ETH_TYPE); |
Yotam Harchol | 161a5d5 | 2013-07-25 17:17:48 -0700 | [diff] [blame] | 44 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 45 | public final static MatchField<Masked<VlanVid>> VLAN_VID = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 46 | new MatchField<Masked<VlanVid>>("vlan_vid", MatchFields.VLAN_VID); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 47 | public final static MatchField<VlanPcp> VLAN_PCP = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 48 | new MatchField<VlanPcp>("vlan_pcp", MatchFields.VLAN_PCP); |
Yotam Harchol | 161a5d5 | 2013-07-25 17:17:48 -0700 | [diff] [blame] | 49 | |
| 50 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 51 | public final static MatchField<IpDscp> IP_DSCP = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 52 | new MatchField<IpDscp>("ip_dscp", MatchFields.IP_DSCP); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 53 | public final static MatchField<IpEcn> IP_ECN = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 54 | new MatchField<IpEcn>("ip_dscp", MatchFields.IP_ECN); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 55 | public final static MatchField<IpProtocol> IP_PROTO = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 56 | new MatchField<IpProtocol>("ip_proto", MatchFields.IP_PROTO); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 57 | |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 58 | public final static MatchField<Masked<IPv4>> IPV4_SRC = |
| 59 | new MatchField<Masked<IPv4>>("ipv4_src", MatchFields.IPV4_SRC); |
| 60 | public final static MatchField<Masked<IPv4>> IPV4_DST = |
| 61 | new MatchField<Masked<IPv4>>("ipv4_dst", MatchFields.IPV4_DST); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 62 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 63 | public final static MatchField<TransportPort> TCP_SRC = new MatchField<TransportPort>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 64 | "tcp_src", MatchFields.TCP_SRC); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 65 | public final static MatchField<TransportPort> TCP_DST = new MatchField<TransportPort>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 66 | "tcp_dst", MatchFields.TCP_DST); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 67 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 68 | public final static MatchField<TransportPort> UDP_SRC = new MatchField<TransportPort>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 69 | "udp_src", MatchFields.UDP_SRC); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 70 | public final static MatchField<TransportPort> UDP_DST = new MatchField<TransportPort>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 71 | "udp_dst", MatchFields.UDP_DST); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 72 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 73 | public final static MatchField<TransportPort> SCTP_SRC = new MatchField<TransportPort>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 74 | "sctp_src", MatchFields.SCTP_SRC); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 75 | public final static MatchField<TransportPort> SCTP_DST = new MatchField<TransportPort>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 76 | "sctp_dst", MatchFields.SCTP_DST); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 77 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 78 | public final static MatchField<ICMPv4Type> ICMPV4_TYPE = new MatchField<ICMPv4Type>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 79 | "icmpv4_src", MatchFields.ICMPV4_TYPE); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 80 | public final static MatchField<ICMPv4Code> ICMPV4_CODE = new MatchField<ICMPv4Code>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 81 | "icmpv4_dst", MatchFields.ICMPV4_CODE); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 82 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 83 | public final static MatchField<ArpOpcode> ARP_OP = new MatchField<ArpOpcode>( |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 84 | "arp_op", MatchFields.ARP_OP); |
| 85 | public final static MatchField<Masked<IPv4>> ARP_SPA = |
| 86 | new MatchField<Masked<IPv4>>("arp_spa", MatchFields.ARP_SPA); |
| 87 | public final static MatchField<Masked<IPv4>> ARP_TPA = |
| 88 | new MatchField<Masked<IPv4>>("arp_tpa", MatchFields.ARP_TPA); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 89 | public final static MatchField<Masked<MacAddress>> ARP_SHA = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 90 | new MatchField<Masked<MacAddress>>("arp_sha", MatchFields.ARP_SHA); |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 91 | public final static MatchField<Masked<MacAddress>> ARP_THA = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 92 | new MatchField<Masked<MacAddress>>("arp_tha", MatchFields.ARP_THA); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 93 | |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 94 | public final static MatchField<Masked<IPv6>> IPV6_SRC = |
| 95 | new MatchField<Masked<IPv6>>("ipv6_src", MatchFields.IPV6_SRC); |
| 96 | public final static MatchField<Masked<IPv6>> IPV6_DST = |
| 97 | new MatchField<Masked<IPv6>>("ipv6_dst", MatchFields.IPV6_DST); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 98 | |
Yotam Harchol | d7b8420 | 2013-07-26 16:08:10 -0700 | [diff] [blame] | 99 | public final static MatchField<Masked<IPv6FlowLabel>> IPV6_FLABEL = |
Yotam Harchol | 5c9d6f4 | 2013-08-01 11:09:20 -0700 | [diff] [blame^] | 100 | new MatchField<Masked<IPv6FlowLabel>>("ipv6_flabel", MatchFields.IPV6_FLOWLABEL); |
Andreas Wundsam | 40e14f7 | 2013-05-06 14:49:08 -0700 | [diff] [blame] | 101 | |
| 102 | public String getName() { |
| 103 | return name; |
| 104 | } |
| 105 | |
| 106 | } |