openflow: Split OFPAT_* into OFPAT10_* and OFPAT11_*.
[sliver-openvswitch.git] / lib / ofp-util.h
index c2b0e2a..5004758 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdint.h>
 #include "classifier.h"
 #include "flow.h"
+#include "netdev.h"
 #include "openflow/nicira-ext.h"
 #include "openvswitch/types.h"
 
@@ -102,6 +103,9 @@ enum ofputil_msg_code ofputil_msg_type_code(const struct ofputil_msg_type *);
 const char *ofputil_msg_type_name(const struct ofputil_msg_type *);
 
 /* Port numbers. */
+enum ofperr ofputil_port_from_ofp11(ovs_be32 ofp11_port, uint16_t *ofp10_port);
+ovs_be32 ofputil_port_to_ofp11(uint16_t ofp10_port);
+
 enum ofperr ofputil_check_output_port(uint16_t ofp_port, int max_ports);
 bool ofputil_port_from_string(const char *, uint16_t *port);
 void ofputil_format_port(uint16_t port, struct ds *);
@@ -322,6 +326,10 @@ enum ofperr ofputil_decode_packet_out(struct ofputil_packet_out *,
                                       const struct ofp_packet_out *);
 struct ofpbuf *ofputil_encode_packet_out(const struct ofputil_packet_out *);
 
+/* OFPFF_* bits. */
+enum netdev_features ofputil_netdev_port_features_from_ofp10(ovs_be32 ofp10);
+ovs_be32 ofputil_netdev_port_features_to_ofp10(enum netdev_features);
+
 /* OpenFlow protocol utility functions. */
 void *make_openflow(size_t openflow_len, uint8_t type, struct ofpbuf **);
 void *make_nxmsg(size_t openflow_len, uint32_t subtype, struct ofpbuf **);
@@ -381,21 +389,21 @@ bool ofputil_frag_handling_from_string(const char *, enum ofp_config_flags *);
 
 /* The type of an action.
  *
- * For each implemented OFPAT_* and NXAST_* action type, there is a
+ * For each implemented OFPAT10_* and NXAST_* action type, there is a
  * corresponding constant prefixed with OFPUTIL_, e.g.:
  *
- * OFPUTIL_OFPAT_OUTPUT
- * OFPUTIL_OFPAT_SET_VLAN_VID
- * OFPUTIL_OFPAT_SET_VLAN_PCP
- * OFPUTIL_OFPAT_STRIP_VLAN
- * OFPUTIL_OFPAT_SET_DL_SRC
- * OFPUTIL_OFPAT_SET_DL_DST
- * OFPUTIL_OFPAT_SET_NW_SRC
- * OFPUTIL_OFPAT_SET_NW_DST
- * OFPUTIL_OFPAT_SET_NW_TOS
- * OFPUTIL_OFPAT_SET_TP_SRC
- * OFPUTIL_OFPAT_SET_TP_DST
- * OFPUTIL_OFPAT_ENQUEUE
+ * OFPUTIL_OFPAT10_OUTPUT
+ * OFPUTIL_OFPAT10_SET_VLAN_VID
+ * OFPUTIL_OFPAT10_SET_VLAN_PCP
+ * OFPUTIL_OFPAT10_STRIP_VLAN
+ * OFPUTIL_OFPAT10_SET_DL_SRC
+ * OFPUTIL_OFPAT10_SET_DL_DST
+ * OFPUTIL_OFPAT10_SET_NW_SRC
+ * OFPUTIL_OFPAT10_SET_NW_DST
+ * OFPUTIL_OFPAT10_SET_NW_TOS
+ * OFPUTIL_OFPAT10_SET_TP_SRC
+ * OFPUTIL_OFPAT10_SET_TP_DST
+ * OFPUTIL_OFPAT10_ENQUEUE
  * OFPUTIL_NXAST_RESUBMIT
  * OFPUTIL_NXAST_SET_TUNNEL
  * OFPUTIL_NXAST_SET_QUEUE
@@ -417,14 +425,14 @@ bool ofputil_frag_handling_from_string(const char *, enum ofp_config_flags *);
  * (The above list helps developers who want to "grep" for these definitions.)
  */
 enum ofputil_action_code {
-#define OFPAT_ACTION(ENUM, STRUCT, NAME)             OFPUTIL_##ENUM,
+#define OFPAT10_ACTION(ENUM, STRUCT, NAME)             OFPUTIL_##ENUM,
 #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM,
 #include "ofp-util.def"
 };
 
 /* The number of values of "enum ofputil_action_code". */
 enum {
-#define OFPAT_ACTION(ENUM, STRUCT, NAME)             + 1
+#define OFPAT10_ACTION(ENUM, STRUCT, NAME)             + 1
 #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1
     OFPUTIL_N_ACTIONS = 0
 #include "ofp-util.def"
@@ -452,7 +460,7 @@ void *ofputil_put_action(enum ofputil_action_code, struct ofpbuf *buf);
  *     Appends a new 'action', of length 'sizeof(struct <STRUCT>)', to 'buf',
  *     initializes it with ofputil_init_<ENUM>(), and returns it.
  */
-#define OFPAT_ACTION(ENUM, STRUCT, NAME)                \
+#define OFPAT10_ACTION(ENUM, STRUCT, NAME)              \
     void ofputil_init_##ENUM(struct STRUCT *);          \
     struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
 #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME)    \