/* -*- c -*- * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #define DEFINE_FIELD_M(HEADER, MFF_ID, WRITABLE) \ DEFINE_FIELD(HEADER, MFF_ID, WRITABLE) \ DEFINE_FIELD(HEADER##_W, MFF_ID, false) /* NXM_ suffix MFF_ field ID rw? */ /* ------------ ------------ ----- */ DEFINE_FIELD_M(NX_TUN_ID, MFF_TUN_ID, true) DEFINE_FIELD (OF_IN_PORT, MFF_IN_PORT, false) DEFINE_FIELD_M(OF_ETH_DST, MFF_ETH_DST, true) DEFINE_FIELD (OF_ETH_SRC, MFF_ETH_SRC, true) DEFINE_FIELD (OF_ETH_TYPE, MFF_ETH_TYPE, false) DEFINE_FIELD_M(OF_VLAN_TCI, MFF_VLAN_TCI, true) DEFINE_FIELD (OF_IP_TOS, MFF_IP_DSCP, true) DEFINE_FIELD (OF_IP_PROTO, MFF_IP_PROTO, false) DEFINE_FIELD_M(OF_IP_SRC, MFF_IPV4_SRC, true) DEFINE_FIELD_M(OF_IP_DST, MFF_IPV4_DST, true) DEFINE_FIELD_M(NX_IP_FRAG, MFF_IP_FRAG, false) DEFINE_FIELD (OF_TCP_SRC, MFF_TCP_SRC, true) DEFINE_FIELD (OF_TCP_DST, MFF_TCP_DST, true) DEFINE_FIELD (OF_UDP_SRC, MFF_UDP_SRC, true) DEFINE_FIELD (OF_UDP_DST, MFF_UDP_DST, true) DEFINE_FIELD (OF_ICMP_TYPE, MFF_ICMP_TYPE, false) DEFINE_FIELD (OF_ICMP_CODE, MFF_ICMP_CODE, false) DEFINE_FIELD (OF_ARP_OP, MFF_ARP_OP, false) DEFINE_FIELD_M(OF_ARP_SPA, MFF_ARP_SPA, false) DEFINE_FIELD_M(OF_ARP_TPA, MFF_ARP_TPA, false) DEFINE_FIELD (NX_ARP_SHA, MFF_ARP_SHA, false) DEFINE_FIELD (NX_ARP_THA, MFF_ARP_THA, false) DEFINE_FIELD_M(NX_IPV6_SRC, MFF_IPV6_SRC, false) DEFINE_FIELD_M(NX_IPV6_DST, MFF_IPV6_DST, false) DEFINE_FIELD (NX_IPV6_LABEL, MFF_IPV6_LABEL,false) DEFINE_FIELD (NX_IP_ECN, MFF_IP_ECN, true) DEFINE_FIELD (NX_IP_TTL, MFF_IP_TTL, true) /* XXX should we have MFF_ICMPV4_TYPE and MFF_ICMPV6_TYPE? */ DEFINE_FIELD (NX_ICMPV6_TYPE,MFF_ICMP_TYPE, false) DEFINE_FIELD (NX_ICMPV6_CODE,MFF_ICMP_CODE, false) DEFINE_FIELD (NX_ND_TARGET, MFF_ND_TARGET, false) DEFINE_FIELD (NX_ND_SLL, MFF_ND_SLL, false) DEFINE_FIELD (NX_ND_TLL, MFF_ND_TLL, false) DEFINE_FIELD_M(NX_REG0, MFF_REG0, true) #if FLOW_N_REGS >= 2 DEFINE_FIELD_M(NX_REG1, MFF_REG1, true) #endif #if FLOW_N_REGS >= 3 DEFINE_FIELD_M(NX_REG2, MFF_REG2, true) #endif #if FLOW_N_REGS >= 4 DEFINE_FIELD_M(NX_REG3, MFF_REG3, true) #endif #if FLOW_N_REGS >= 5 DEFINE_FIELD_M(NX_REG4, MFF_REG4, true) #endif #if FLOW_N_REGS > 5 #error #endif #undef DEFINE_FIELD