blob: 6110892e03daed4ac0a14fcc23d302ff13ee2928 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
alshabib7410fea2014-09-16 13:48:39 -070019package org.onlab.onos.net.flow.criteria;
tom8bb16062014-09-12 14:47:46 -070020
alshabib7b795492014-09-16 14:38:39 -070021
tom8bb16062014-09-12 14:47:46 -070022/**
23 * Representation of a single header field selection.
24 */
25public interface Criterion {
26
27 /**
28 * Types of fields to which the selection criterion may apply.
29 */
30 // From page 42 of OpenFlow 1.3.x spec
31 public enum Type {
32 /** Switch input port. */
33 IN_PORT,
34 /** Switch physical input port. */
35 IN_PHY_PORT,
36 /** Metadata passed between tables. */
37 METADATA,
38 /** Ethernet destination address. */
39 ETH_DST,
40 /** Ethernet source address. */
41 ETH_SRC,
42 /** Ethernet frame type. */
43 ETH_TYPE,
44 /** VLAN id. */
45 VLAN_VID,
46 /** VLAN priority. */
47 VLAN_PCP,
48 /** IP DSCP (6 bits in ToS field). */
49 IP_DSCP,
50 /** IP ECN (2 bits in ToS field). */
51 IP_ECN,
52 /** IP protocol. */
53 IP_PROTO,
54 /** IPv4 source address. */
55 IPV4_SRC,
56 /** IPv4 destination address. */
57 IPV4_DST,
58 /** TCP source port. */
59 TCP_SRC,
60 /** TCP destination port. */
61 TCP_DST,
62 /** UDP source port. */
63 UDP_SRC,
64 /** UDP destination port. */
65 UDP_DST,
66 /** SCTP source port. */
67 SCTP_SRC,
68 /** SCTP destination port. */
69 SCTP_DST,
70 /** ICMP type. */
71 ICMPV4_TYPE,
72 /** ICMP code. */
73 ICMPV4_CODE,
74 /** ARP opcode. */
75 ARP_OP,
76 /** ARP source IPv4 address. */
77 ARP_SPA,
78 /** ARP target IPv4 address. */
79 ARP_TPA,
80 /** ARP source hardware address. */
81 ARP_SHA,
82 /** ARP target hardware address. */
83 ARP_THA,
84 /** IPv6 source address. */
85 IPV6_SRC,
86 /** IPv6 destination address. */
87 IPV6_DST,
88 /** IPv6 Flow Label. */
89 IPV6_FLABEL,
90 /** ICMPv6 type. */
91 ICMPV6_TYPE,
92 /** ICMPv6 code. */
93 ICMPV6_CODE,
94 /** Target address for ND. */
95 IPV6_ND_TARGET,
96 /** Source link-layer for ND. */
97 IPV6_ND_SLL,
98 /** Target link-layer for ND. */
99 IPV6_ND_TLL,
100 /** MPLS label. */
101 MPLS_LABEL,
102 /** MPLS TC. */
103 MPLS_TC,
104 /** MPLS BoS bit. */
105 MPLS_BOS,
106 /** PBB I-SID. */
107 PBB_ISID,
108 /** Logical Port Metadata. */
109 TUNNEL_ID,
110 /** IPv6 Extension Header pseudo-field. */
Marc De Leenheer49087752014-10-23 13:54:09 -0700111 IPV6_EXTHDR,
112 /** Optical channel signal ID (lambda). */
113 OCH_SIGID,
114 /** Optical channel signal type (fixed or flexible). */
115 OCH_SIGTYPE
tom8bb16062014-09-12 14:47:46 -0700116 }
117
alshabib7b795492014-09-16 14:38:39 -0700118 /**
119 * Returns the type of criterion.
120 * @return type of criterion
121 */
122 public Type type();
123
tom8bb16062014-09-12 14:47:46 -0700124 // TODO: Create factory class 'Criteria' that will have various factory
125 // to create specific criterions.
126
127}