/*
- * Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* OXM (e.g. "since OF1.3 and v1.10" if it was introduced in OpenFlow 1.3
* and first supported by Open vSwitch in version 1.10).
*
+ * Some fields have more than one OXM field assignment. For example,
+ * actset_output has an experimenter OXM assignment in OpenFlow 1.3 and a
+ * standard OXM assignment in OpenFlow 1.5. In such a case, specify both,
+ * separated by commas.
+ *
* OVS uses the start of the OXM field name to determine the correct OXM
* class. To support a new OXM class, edit the mapping table in
* build-aux/extract-ofp-fields.
* Flow hash computed in the datapath. Internal use only, not programmable
* from controller.
*
+ * The OXM code point for this is an attempt to test OXM experimenter
+ * support, which is otherwise difficult to test due to the dearth of use
+ * out in the wild. Because controllers can't add flows that match on
+ * dp_hash, this doesn't commit OVS to supporting this OXM experimenter
+ * code point in the future.
+ *
* Type: be32.
* Maskable: bitwise.
* Formatting: hexadecimal.
* Prerequisites: none.
* Access: read-only.
* NXM: NXM_NX_DP_HASH(35) since v2.2.
- * OXM: none.
+ * OXM: NXOXM_ET_DP_HASH(0) since OF1.5 and v2.4.
*/
MFF_DP_HASH,
*/
MFF_RECIRC_ID,
+ /* "conj_id".
+ *
+ * ID for "conjunction" actions. Please refer to ovs-ofctl(8)
+ * documentation of "conjunction" for details.
+ *
+ * Type: be32.
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: none.
+ * Access: read-only.
+ * NXM: NXM_NX_CONJ_ID(37) since v2.4.
+ * OXM: none. */
+ MFF_CONJ_ID,
+
/* "tun_id" (aka "tunnel_id").
*
* The "key" or "tunnel ID" or "VNI" in a packet received via a keyed
*/
MFF_TUN_TOS,
+ /* "tun_gbp_id".
+ *
+ * VXLAN Group Policy ID
+ *
+ * Type: be16.
+ * Maskable: bitwise.
+ * Formatting: decimal.
+ * Prerequisites: none.
+ * Access: read/write.
+ * NXM: NXM_NX_TUN_GBP_ID(38) since v2.4.
+ * OXM: none.
+ */
+ MFF_TUN_GBP_ID,
+
+ /* "tun_gbp_flags".
+ *
+ * VXLAN Group Policy flags
+ *
+ * Type: u8.
+ * Maskable: bitwise.
+ * Formatting: hexadecimal.
+ * Prerequisites: none.
+ * Access: read/write.
+ * NXM: NXM_NX_TUN_GBP_FLAGS(39) since v2.4.
+ * OXM: none.
+ */
+ MFF_TUN_GBP_FLAGS,
+
/* "metadata".
*
* A scratch pad value standardized in OpenFlow 1.1+. Initially zero, at
*/
MFF_IN_PORT_OXM,
+ /* "actset_output".
+ *
+ * Type: be32.
+ * Maskable: no.
+ * Formatting: OpenFlow 1.1+ port.
+ * Prerequisites: none.
+ * Access: read-only.
+ * NXM: none.
+ * OXM: ONFOXM_ET_ACTSET_OUTPUT(43) since OF1.3 and v2.4,
+ * OXM_OF_ACTSET_OUTPUT(43) since OF1.5 and v2.4.
+ */
+ MFF_ACTSET_OUTPUT,
+
/* "skb_priority".
*
* Designates the queue to which output will be directed. The value in
#if FLOW_N_XREGS == 4
/* "xreg<N>".
*
- * OpenFlow 1.5 (draft) ``extended register". Each extended register
+ * OpenFlow 1.5 ``extended register". Each extended register
* overlays two of the Nicira extension 32-bit registers: xreg0 overlays
* reg0 and reg1, with reg0 supplying the most-significant bits of xreg0
* and reg1 the least-significant. xreg1 similarly overlays reg2 and reg3,
* and so on.
*
+ * These registers were introduced in OpenFlow 1.5, but EXT-244 in the ONF
+ * JIRA also publishes them as a (draft) OpenFlow extension to OpenFlow
+ * 1.3.
+ *
* Type: be64.
* Maskable: bitwise.
* Formatting: hexadecimal.
* Prerequisites: none.
* Access: read/write.
* NXM: none.
- * OXM: OXM_OF_PKT_REG<N>(<N>) since OF1.5 and v2.4.
+ * OXM: OXM_OF_PKT_REG<N>(<N>) since OF1.3 and v2.4.
*/
MFF_XREG0,
MFF_XREG1,
* Maskable: bitwise.
* Formatting: hexadecimal.
* Prerequisites: IPv6.
- * Access: read-only.
+ * Access: read/write.
* NXM: NXM_NX_IPV6_LABEL(27) since v1.4.
* OXM: OXM_OF_IPV6_FLABEL(28) since OF1.2 and v1.7.
*/
* Prerequisites: TCP.
* Access: read-only.
* NXM: NXM_NX_TCP_FLAGS(34) since v2.1.
- * OXM: OXM_OF_TCP_FLAGS(42) since OF1.5 and v2.3.
+ * OXM: ONFOXM_ET_TCP_FLAGS(42) since OF1.3 and v2.4,
+ * OXM_OF_TCP_FLAGS(42) since OF1.5 and v2.3.
*/
MFF_TCP_FLAGS,
* Maskable: bitwise.
* Formatting: IPv6.
* Prerequisites: ND.
- * Access: read-only.
+ * Access: read/write.
* NXM: NXM_NX_ND_TARGET(23) since v1.1.
* OXM: OXM_OF_IPV6_ND_TARGET(31) since OF1.2 and v1.7.
*/
* Maskable: bitwise.
* Formatting: Ethernet.
* Prerequisites: ND solicit.
- * Access: read-only.
+ * Access: read/write.
* NXM: NXM_NX_ND_SLL(24) since v1.1.
* OXM: OXM_OF_IPV6_ND_SLL(32) since OF1.2 and v1.7.
*/
* Maskable: bitwise.
* Formatting: Ethernet.
* Prerequisites: ND advert.
- * Access: read-only.
+ * Access: read/write.
* NXM: NXM_NX_ND_TLL(25) since v1.1.
* OXM: OXM_OF_IPV6_ND_TLL(33) since OF1.2 and v1.7.
*/
};
BUILD_ASSERT_DECL(sizeof(union mf_value) == 16);
+/* An all-1-bits mf_value. Needs to be updated if struct mf_value grows.*/
#define MF_EXACT_MASK_INITIALIZER { IN6ADDR_EXACT_INIT }
+BUILD_ASSERT_DECL(sizeof(union mf_value) == sizeof(struct in6_addr));
/* Part of a field. */
struct mf_subfield {
* value" contains NXM_OF_VLAN_TCI[0..11], then one could access the
* corresponding data in value.be16[7] as the bits in the mask htons(0xfff). */
union mf_subvalue {
+ /* Access to full data. */
uint8_t u8[16];
ovs_be16 be16[8];
ovs_be32 be32[4];
ovs_be64 be64[2];
+
+ /* Convenient access to just least-significant bits in various forms. */
+ struct {
+ ovs_be64 dummy_integer;
+ ovs_be64 integer;
+ };
+ struct {
+ uint8_t dummy_mac[10];
+ uint8_t mac[6];
+ };
+ struct {
+ ovs_be32 dummy_ipv4[3];
+ ovs_be32 ipv4;
+ };
+ struct in6_addr ipv6;
};
BUILD_ASSERT_DECL(sizeof(union mf_value) == sizeof (union mf_subvalue));
+/* An array of fields with values */
+struct field_array {
+ struct mf_bitmap used;
+ union mf_value value[MFF_N_IDS];
+};
+
/* Finding mf_fields. */
const struct mf_field *mf_from_name(const char *name);
/* Prerequisites. */
bool mf_are_prereqs_ok(const struct mf_field *, const struct flow *);
void mf_mask_field_and_prereqs(const struct mf_field *, struct flow *mask);
+void mf_bitmap_set_field_and_prereqs(const struct mf_field *mf, struct
+ mf_bitmap *bm);
static inline bool
mf_is_l3_or_higher(const struct mf_field *mf)
struct ds *);
void mf_format_subvalue(const union mf_subvalue *subvalue, struct ds *s);
+/* Field Arrays. */
+void field_array_set(enum mf_field_id id, const union mf_value *,
+ struct field_array *);
+
#endif /* meta-flow.h */