Support matching and modifying IP TTL.
[sliver-openvswitch.git] / lib / nx-match.def
1 /*                                                                -*- c -*-
2  * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
3  *
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:
7  *
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.
15  */
16
17 #define DEFINE_FIELD_M(HEADER, MFF_ID, WRITABLE)  \
18     DEFINE_FIELD(HEADER,     MFF_ID, WRITABLE)        \
19     DEFINE_FIELD(HEADER##_W, MFF_ID, false)
20
21 /*             NXM_ suffix    MFF_ field ID    rw? */
22 /*             ------------   ------------   ----- */
23 DEFINE_FIELD_M(NX_TUN_ID,     MFF_TUN_ID,     true)
24 DEFINE_FIELD  (OF_IN_PORT,    MFF_IN_PORT,   false)
25 DEFINE_FIELD_M(OF_ETH_DST,    MFF_ETH_DST,    true)
26 DEFINE_FIELD  (OF_ETH_SRC,    MFF_ETH_SRC,    true)
27 DEFINE_FIELD  (OF_ETH_TYPE,   MFF_ETH_TYPE,  false)
28 DEFINE_FIELD_M(OF_VLAN_TCI,   MFF_VLAN_TCI,   true)
29 DEFINE_FIELD  (OF_IP_TOS,     MFF_IP_DSCP,    true)
30 DEFINE_FIELD  (OF_IP_PROTO,   MFF_IP_PROTO,  false)
31 DEFINE_FIELD_M(OF_IP_SRC,     MFF_IPV4_SRC,   true)
32 DEFINE_FIELD_M(OF_IP_DST,     MFF_IPV4_DST,   true)
33 DEFINE_FIELD_M(NX_IP_FRAG,    MFF_IP_FRAG,   false)
34 DEFINE_FIELD  (OF_TCP_SRC,    MFF_TCP_SRC,    true)
35 DEFINE_FIELD  (OF_TCP_DST,    MFF_TCP_DST,    true)
36 DEFINE_FIELD  (OF_UDP_SRC,    MFF_UDP_SRC,    true)
37 DEFINE_FIELD  (OF_UDP_DST,    MFF_UDP_DST,    true)
38 DEFINE_FIELD  (OF_ICMP_TYPE,  MFF_ICMP_TYPE, false)
39 DEFINE_FIELD  (OF_ICMP_CODE,  MFF_ICMP_CODE, false)
40 DEFINE_FIELD  (OF_ARP_OP,     MFF_ARP_OP,    false)
41 DEFINE_FIELD_M(OF_ARP_SPA,    MFF_ARP_SPA,   false)
42 DEFINE_FIELD_M(OF_ARP_TPA,    MFF_ARP_TPA,   false)
43 DEFINE_FIELD  (NX_ARP_SHA,    MFF_ARP_SHA,   false)
44 DEFINE_FIELD  (NX_ARP_THA,    MFF_ARP_THA,   false)
45 DEFINE_FIELD_M(NX_IPV6_SRC,   MFF_IPV6_SRC,  false)
46 DEFINE_FIELD_M(NX_IPV6_DST,   MFF_IPV6_DST,  false)
47 DEFINE_FIELD  (NX_IPV6_LABEL, MFF_IPV6_LABEL,false)
48 DEFINE_FIELD  (NX_IP_ECN,     MFF_IP_ECN,     true)
49 DEFINE_FIELD  (NX_IP_TTL,     MFF_IP_TTL,     true)
50 /* XXX should we have MFF_ICMPV4_TYPE and MFF_ICMPV6_TYPE? */
51 DEFINE_FIELD  (NX_ICMPV6_TYPE,MFF_ICMP_TYPE, false)
52 DEFINE_FIELD  (NX_ICMPV6_CODE,MFF_ICMP_CODE, false)
53 DEFINE_FIELD  (NX_ND_TARGET,  MFF_ND_TARGET, false)
54 DEFINE_FIELD  (NX_ND_SLL,     MFF_ND_SLL,    false)
55 DEFINE_FIELD  (NX_ND_TLL,     MFF_ND_TLL,    false)
56
57 DEFINE_FIELD_M(NX_REG0,       MFF_REG0,       true)
58 #if FLOW_N_REGS >= 2
59 DEFINE_FIELD_M(NX_REG1,       MFF_REG1,       true)
60 #endif
61 #if FLOW_N_REGS >= 3
62 DEFINE_FIELD_M(NX_REG2,       MFF_REG2,       true)
63 #endif
64 #if FLOW_N_REGS >= 4
65 DEFINE_FIELD_M(NX_REG3,       MFF_REG3,       true)
66 #endif
67 #if FLOW_N_REGS >= 5
68 DEFINE_FIELD_M(NX_REG4,       MFF_REG4,       true)
69 #endif
70 #if FLOW_N_REGS > 5
71 #error
72 #endif
73
74 #undef DEFINE_FIELD