Implement hash fields select group
[cascardo/ovs.git] / lib / meta-flow.h
index d07072e..265f066 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -415,6 +415,34 @@ enum OVS_PACKED_ENUM mf_field_id {
      */
     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
@@ -549,7 +577,7 @@ enum OVS_PACKED_ENUM mf_field_id {
 #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,
@@ -1343,7 +1371,7 @@ enum OVS_PACKED_ENUM mf_field_id {
      * 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.
      */
@@ -1357,7 +1385,7 @@ enum OVS_PACKED_ENUM mf_field_id {
      * 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.
      */
@@ -1371,7 +1399,7 @@ enum OVS_PACKED_ENUM mf_field_id {
      * 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.
      */
@@ -1546,6 +1574,12 @@ union mf_subvalue {
 };
 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);
 
@@ -1567,6 +1601,8 @@ void mf_get_mask(const struct mf_field *, const struct flow_wildcards *,
 /* 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)
@@ -1624,4 +1660,8 @@ void mf_format(const struct mf_field *,
                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 */