Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 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.criteria; |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 17 | |
alshabib | 7b79549 | 2014-09-16 14:38:39 -0700 | [diff] [blame] | 18 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 19 | /** |
| 20 | * Representation of a single header field selection. |
| 21 | */ |
| 22 | public interface Criterion { |
| 23 | |
| 24 | /** |
| 25 | * Types of fields to which the selection criterion may apply. |
| 26 | */ |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 27 | // From page 75 of OpenFlow 1.5.0 spec |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 28 | public enum Type { |
| 29 | /** Switch input port. */ |
| 30 | IN_PORT, |
| 31 | /** Switch physical input port. */ |
| 32 | IN_PHY_PORT, |
| 33 | /** Metadata passed between tables. */ |
| 34 | METADATA, |
| 35 | /** Ethernet destination address. */ |
| 36 | ETH_DST, |
| 37 | /** Ethernet source address. */ |
| 38 | ETH_SRC, |
| 39 | /** Ethernet frame type. */ |
| 40 | ETH_TYPE, |
| 41 | /** VLAN id. */ |
| 42 | VLAN_VID, |
| 43 | /** VLAN priority. */ |
| 44 | VLAN_PCP, |
| 45 | /** IP DSCP (6 bits in ToS field). */ |
| 46 | IP_DSCP, |
| 47 | /** IP ECN (2 bits in ToS field). */ |
| 48 | IP_ECN, |
| 49 | /** IP protocol. */ |
| 50 | IP_PROTO, |
| 51 | /** IPv4 source address. */ |
| 52 | IPV4_SRC, |
| 53 | /** IPv4 destination address. */ |
| 54 | IPV4_DST, |
| 55 | /** TCP source port. */ |
| 56 | TCP_SRC, |
| 57 | /** TCP destination port. */ |
| 58 | TCP_DST, |
| 59 | /** UDP source port. */ |
| 60 | UDP_SRC, |
| 61 | /** UDP destination port. */ |
| 62 | UDP_DST, |
| 63 | /** SCTP source port. */ |
| 64 | SCTP_SRC, |
| 65 | /** SCTP destination port. */ |
| 66 | SCTP_DST, |
| 67 | /** ICMP type. */ |
| 68 | ICMPV4_TYPE, |
| 69 | /** ICMP code. */ |
| 70 | ICMPV4_CODE, |
| 71 | /** ARP opcode. */ |
| 72 | ARP_OP, |
| 73 | /** ARP source IPv4 address. */ |
| 74 | ARP_SPA, |
| 75 | /** ARP target IPv4 address. */ |
| 76 | ARP_TPA, |
| 77 | /** ARP source hardware address. */ |
| 78 | ARP_SHA, |
| 79 | /** ARP target hardware address. */ |
| 80 | ARP_THA, |
| 81 | /** IPv6 source address. */ |
| 82 | IPV6_SRC, |
| 83 | /** IPv6 destination address. */ |
| 84 | IPV6_DST, |
| 85 | /** IPv6 Flow Label. */ |
| 86 | IPV6_FLABEL, |
| 87 | /** ICMPv6 type. */ |
| 88 | ICMPV6_TYPE, |
| 89 | /** ICMPv6 code. */ |
| 90 | ICMPV6_CODE, |
| 91 | /** Target address for ND. */ |
| 92 | IPV6_ND_TARGET, |
| 93 | /** Source link-layer for ND. */ |
| 94 | IPV6_ND_SLL, |
| 95 | /** Target link-layer for ND. */ |
| 96 | IPV6_ND_TLL, |
| 97 | /** MPLS label. */ |
| 98 | MPLS_LABEL, |
| 99 | /** MPLS TC. */ |
| 100 | MPLS_TC, |
| 101 | /** MPLS BoS bit. */ |
| 102 | MPLS_BOS, |
| 103 | /** PBB I-SID. */ |
| 104 | PBB_ISID, |
| 105 | /** Logical Port Metadata. */ |
| 106 | TUNNEL_ID, |
| 107 | /** IPv6 Extension Header pseudo-field. */ |
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 108 | IPV6_EXTHDR, |
Pavlin Radoslavov | 320e6c9 | 2015-02-02 16:51:58 -0800 | [diff] [blame] | 109 | /** Unassigned value: 40. */ |
| 110 | UNASSIGNED_40, |
| 111 | /** PBB UCA header field. */ |
| 112 | PBB_UCA, |
| 113 | /** TCP flags. */ |
| 114 | TCP_FLAGS, |
| 115 | /** Output port from action set metadata. */ |
| 116 | ACTSET_OUTPUT, |
| 117 | /** Packet type value. */ |
| 118 | PACKET_TYPE, |
| 119 | |
| 120 | // |
| 121 | // NOTE: Everything below is defined elsewhere: ONOS-specific, |
| 122 | // extensions, etc. |
| 123 | // |
Marc De Leenheer | 4908775 | 2014-10-23 13:54:09 -0700 | [diff] [blame] | 124 | /** Optical channel signal ID (lambda). */ |
| 125 | OCH_SIGID, |
| 126 | /** Optical channel signal type (fixed or flexible). */ |
| 127 | OCH_SIGTYPE |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 128 | } |
| 129 | |
alshabib | 7b79549 | 2014-09-16 14:38:39 -0700 | [diff] [blame] | 130 | /** |
| 131 | * Returns the type of criterion. |
| 132 | * @return type of criterion |
| 133 | */ |
| 134 | public Type type(); |
| 135 | |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 136 | // TODO: Create factory class 'Criteria' that will have various factory |
| 137 | // to create specific criterions. |
| 138 | |
| 139 | } |