+
+/* Bits for 'flags' in struct nx_action_learn.
+ *
+ * If NX_LEARN_F_SEND_FLOW_REM is set, then the learned flows will have their
+ * OFPFF_SEND_FLOW_REM flag set.
+ *
+ * If NX_LEARN_F_DELETE_LEARNED is set, then removing this action will delete
+ * all the flows from the learn action's 'table_id' that have the learn
+ * action's 'cookie'. Important points:
+ *
+ * - The deleted flows include those created by this action, those created
+ * by other learn actions with the same 'table_id' and 'cookie', those
+ * created by flow_mod requests by a controller in the specified table
+ * with the specified cookie, and those created through any other
+ * means.
+ *
+ * - If multiple flows specify "learn" actions with
+ * NX_LEARN_F_DELETE_LEARNED with the same 'table_id' and 'cookie', then
+ * no deletion occurs until all of those "learn" actions are deleted.
+ *
+ * - Deleting a flow that contains a learn action is the most obvious way
+ * to delete a learn action. Modifying a flow's actions, or replacing it
+ * by a new flow, can also delete a learn action. Finally, replacing a
+ * learn action with NX_LEARN_F_DELETE_LEARNED with a learn action
+ * without that flag also effectively deletes the learn action and can
+ * trigger flow deletion.
+ *
+ * NX_LEARN_F_DELETE_LEARNED was added in Open vSwitch 2.4. */
+enum nx_learn_flags {
+ NX_LEARN_F_SEND_FLOW_REM = 1 << 0,
+ NX_LEARN_F_DELETE_LEARNED = 1 << 1,
+};
+
+#define NX_LEARN_N_BITS_MASK 0x3ff
+
+#define NX_LEARN_SRC_FIELD (0 << 13) /* Copy from field. */
+#define NX_LEARN_SRC_IMMEDIATE (1 << 13) /* Copy from immediate value. */
+#define NX_LEARN_SRC_MASK (1 << 13)
+
+#define NX_LEARN_DST_MATCH (0 << 11) /* Add match criterion. */
+#define NX_LEARN_DST_LOAD (1 << 11) /* Add NXAST_REG_LOAD action. */
+#define NX_LEARN_DST_OUTPUT (2 << 11) /* Add OFPAT_OUTPUT action. */
+#define NX_LEARN_DST_RESERVED (3 << 11) /* Not yet defined. */
+#define NX_LEARN_DST_MASK (3 << 11)
+