ofp-util: Add function to encode OFPT_SET_ASYNC messages.
[cascardo/ovs.git] / lib / ofp-util.h
index cb290c3..1c359b3 100644 (file)
@@ -140,22 +140,6 @@ enum ofputil_protocol {
                        OFPUTIL_P_ANY_OXM)
 };
 
-    /* Valid value of mask for asynchronous messages. */
-#define MAXIMUM_MASK_PACKET_IN ((1 << OFPR_N_REASONS) - 1)
-
-#define MAXIMUM_MASK_FLOW_REMOVED ((1 << OVS_OFPRR_NONE) - 1)
-
-#define MAXIMUM_MASK_PORT_STATUS ((1 << OFPPR_N_REASONS) - 1)
-
-#define MAXIMUM_MASK_ROLE_STATUS ((1 << OFPCRR_N_REASONS) - 1)
-
-#define MINIMUM_MASK_TABLE_STATUS (1 << OFPTR_VACANCY_DOWN)
-
-#define MAXIMUM_MASK_TABLE_STATUS ((1 << OFPTR_N_REASONS) - \
-                                   MINIMUM_MASK_TABLE_STATUS)
-
-#define MAXIMUM_MASK_REQUESTFORWARD ((1 << OFPRFR_N_REASONS) - 1)
-
 /* Protocols to use for flow dumps, from most to least preferred. */
 extern enum ofputil_protocol ofputil_flow_dump_protocols[];
 extern size_t ofputil_n_flow_dump_protocols;
@@ -1315,12 +1299,17 @@ enum ofperr ofputil_decode_tlv_table_reply(const struct ofp_header *,
 void ofputil_uninit_tlv_table(struct ovs_list *mappings);
 
 enum ofputil_async_msg_type {
+    /* Standard asynchronous messages. */
     OAM_PACKET_IN,              /* OFPT_PACKET_IN or NXT_PACKET_IN. */
     OAM_PORT_STATUS,            /* OFPT_PORT_STATUS. */
     OAM_FLOW_REMOVED,           /* OFPT_FLOW_REMOVED or NXT_FLOW_REMOVED. */
     OAM_ROLE_STATUS,            /* OFPT_ROLE_STATUS. */
     OAM_TABLE_STATUS,           /* OFPT_TABLE_STATUS. */
     OAM_REQUESTFORWARD,         /* OFPT_REQUESTFORWARD. */
+
+    /* Extension asynchronous messages (none yet--coming soon!). */
+#define OAM_EXTENSIONS 0        /* Bitmap of all extensions. */
+
     OAM_N_TYPES
 };
 const char *ofputil_async_msg_type_to_string(enum ofputil_async_msg_type);
@@ -1333,10 +1322,13 @@ struct ofputil_async_cfg {
 
 enum ofperr ofputil_decode_set_async_config(const struct ofp_header *,
                                             bool loose,
+                                            const struct ofputil_async_cfg *,
                                             struct ofputil_async_cfg *);
 
-struct ofpbuf *ofputil_encode_get_async_config(
+struct ofpbuf *ofputil_encode_get_async_reply(
     const struct ofp_header *, const struct ofputil_async_cfg *);
+struct ofpbuf *ofputil_encode_set_async_config(
+    const struct ofputil_async_cfg *, uint32_t oams, enum ofp_version);
 
 struct ofputil_async_cfg ofputil_async_cfg_default(enum ofp_version);