From cb6e2b01787b71c39678e9ef98e3b9374a7db378 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 25 Apr 2012 10:18:29 +0900 Subject: [PATCH] Add OXM_OF_* definitions These oxm_type definitions values will may be used when parsing serialising OXM TLVs. Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- include/openflow/openflow-1.2.h | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/include/openflow/openflow-1.2.h b/include/openflow/openflow-1.2.h index f600792f..3aaa056f 100644 --- a/include/openflow/openflow-1.2.h +++ b/include/openflow/openflow-1.2.h @@ -116,6 +116,64 @@ enum oxm12_ofb_match_fields { OFPXMT12_OFB_MPLS_TC, /* MPLS TC. */ }; +/* OXM implementation makes use of NXM as they are the same format + * with different field definitions + */ + +#define OXM_HEADER(FIELD, LENGTH) \ + NXM_HEADER(OFPXMC12_OPENFLOW_BASIC, FIELD, LENGTH) +#define OXM_HEADER_W(FIELD, LENGTH) \ + NXM_HEADER_W(OFPXMC12_OPENFLOW_BASIC, FIELD, LENGTH) + +#define OXM_OF_IN_PORT OXM_HEADER (OFPXMT12_OFB_IN_PORT, 4) +#define OXM_OF_IN_PHY_PORT OXM_HEADER (OFPXMT12_OFB_IN_PHY_PORT, 4) +#define OXM_OF_METADATA OXM_HEADER (OFPXMT12_OFB_METADATA, 8) +#define OXM_OF_ETH_DST OXM_HEADER (OFPXMT12_OFB_ETH_DST, 6) +#define OXM_OF_ETH_DST_W OXM_HEADER_W (OFPXMT12_OFB_ETH_DST, 6) +#define OXM_OF_ETH_SRC OXM_HEADER (OFPXMT12_OFB_ETH_SRC, 6) +#define OXM_OF_ETH_SRC_W OXM_HEADER_W (OFPXMT12_OFB_ETH_SRC, 6) +#define OXM_OF_ETH_TYPE OXM_HEADER (OFPXMT12_OFB_ETH_TYPE, 2) +#define OXM_OF_VLAN_VID OXM_HEADER (OFPXMT12_OFB_VLAN_VID, 2) +#define OXM_OF_VLAN_VID_W OXM_HEADER_W (OFPXMT12_OFB_VLAN_VID, 2) +#define OXM_OF_VLAN_PCP OXM_HEADER (OFPXMT12_OFB_VLAN_PCP, 1) +#define OXM_OF_IP_DSCP OXM_HEADER (OFPXMT12_OFB_IP_DSCP, 1) +#define OXM_OF_IP_ECN OXM_HEADER (OFPXMT12_OFB_IP_ECN, 1) +#define OXM_OF_IP_PROTO OXM_HEADER (OFPXMT12_OFB_IP_PROTO, 1) +#define OXM_OF_IPV4_SRC OXM_HEADER (OFPXMT12_OFB_IPV4_SRC, 4) +#define OXM_OF_IPV4_SRC_W OXM_HEADER_W (OFPXMT12_OFB_IPV4_SRC, 4) +#define OXM_OF_IPV4_DST OXM_HEADER (OFPXMT12_OFB_IPV4_DST, 4) +#define OXM_OF_IPV4_DST_W OXM_HEADER_W (OFPXMT12_OFB_IPV4_DST, 4) +#define OXM_OF_TCP_SRC OXM_HEADER (OFPXMT12_OFB_TCP_SRC, 2) +#define OXM_OF_TCP_DST OXM_HEADER (OFPXMT12_OFB_TCP_DST, 2) +#define OXM_OF_UDP_SRC OXM_HEADER (OFPXMT12_OFB_UDP_SRC, 2) +#define OXM_OF_UDP_DST OXM_HEADER (OFPXMT12_OFB_UDP_DST, 2) +#define OXM_OF_SCTP_SRC OXM_HEADER (OFPXMT12_OFB_SCTP_SRC, 2) +#define OXM_OF_SCTP_DST OXM_HEADER (OFPXMT12_OFB_SCTP_DST, 2) +#define OXM_OF_ICMPV4_TYPE OXM_HEADER (OFPXMT12_OFB_ICMPV4_TYPE, 1) +#define OXM_OF_ICMPV4_CODE OXM_HEADER (OFPXMT12_OFB_ICMPV4_CODE, 1) +#define OXM_OF_ARP_OP OXM_HEADER (OFPXMT12_OFB_ARP_OP, 2) +#define OXM_OF_ARP_SPA OXM_HEADER (OFPXMT12_OFB_ARP_SPA, 4) +#define OXM_OF_ARP_SPA_W OXM_HEADER_W (OFPXMT12_OFB_ARP_SPA, 4) +#define OXM_OF_ARP_TPA OXM_HEADER (OFPXMT12_OFB_ARP_TPA, 4) +#define OXM_OF_ARP_TPA_W OXM_HEADER_W (OFPXMT12_OFB_ARP_TPA, 4) +#define OXM_OF_ARP_SHA OXM_HEADER (OFPXMT12_OFB_ARP_SHA, 6) +#define OXM_OF_ARP_SHA_W OXM_HEADER_W (OFPXMT12_OFB_ARP_SHA, 6) +#define OXM_OF_ARP_THA OXM_HEADER (OFPXMT12_OFB_ARP_THA, 6) +#define OXM_OF_ARP_THA_W OXM_HEADER_W (OFPXMT12_OFB_ARP_THA, 6) +#define OXM_OF_IPV6_SRC OXM_HEADER (OFPXMT12_OFB_IPV6_SRC, 16) +#define OXM_OF_IPV6_SRC_W OXM_HEADER_W (OFPXMT12_OFB_IPV6_SRC, 16) +#define OXM_OF_IPV6_DST OXM_HEADER (OFPXMT12_OFB_IPV6_DST, 16) +#define OXM_OF_IPV6_DST_W OXM_HEADER_W (OFPXMT12_OFB_IPV6_DST, 16) +#define OXM_OF_IPV6_FLABEL OXM_HEADER (OFPXMT12_OFB_IPV6_FLABEL, 4) +#define OXM_OF_IPV6_FLABEL_W OXM_HEADER_W (OFPXMT12_OFB_IPV6_FLABEL, 4) +#define OXM_OF_ICMPV6_TYPE OXM_HEADER (OFPXMT12_OFB_ICMPV6_TYPE, 1) +#define OXM_OF_ICMPV6_CODE OXM_HEADER (OFPXMT12_OFB_ICMPV6_CODE, 1) +#define OXM_OF_IPV6_ND_TARGET OXM_HEADER (OFPXMT12_OFB_IPV6_ND_TARGET, 16) +#define OXM_OF_IPV6_ND_SLL OXM_HEADER (OFPXMT12_OFB_IPV6_ND_SLL, 6) +#define OXM_OF_IPV6_ND_TLL OXM_HEADER (OFPXMT12_OFB_IPV6_ND_TLL, 6) +#define OXM_OF_MPLS_LABEL OXM_HEADER (OFPXMT12_OFB_MPLS_LABEL, 4) +#define OXM_OF_MPLS_TC OXM_HEADER (OFPXMT12_OFB_MPLS_TC, 1) + /* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate * special conditions. */ -- 2.30.2