#include "classifier.h"
#include "compiler.h"
#include "flow.h"
+#include "match.h"
#include "netdev.h"
#include "openflow/nicira-ext.h"
#include "openvswitch/types.h"
-struct cls_rule;
struct ofpbuf;
/* Port numbers. */
const char *ofputil_protocol_to_string(enum ofputil_protocol);
char *ofputil_protocols_to_string(enum ofputil_protocol);
enum ofputil_protocol ofputil_protocols_from_string(const char *);
-enum ofputil_protocol ofputil_usable_protocols(const struct cls_rule *);
+enum ofputil_protocol ofputil_usable_protocols(const struct match *);
struct ofpbuf *ofputil_encode_set_protocol(enum ofputil_protocol current,
enum ofputil_protocol want,
/* Work with ofp10_match. */
void ofputil_wildcard_from_ofpfw10(uint32_t ofpfw, struct flow_wildcards *);
-void ofputil_cls_rule_from_ofp10_match(const struct ofp10_match *,
- unsigned int priority,
- struct cls_rule *);
-void ofputil_normalize_rule(struct cls_rule *);
-void ofputil_normalize_rule_quiet(struct cls_rule *);
-void ofputil_cls_rule_to_ofp10_match(const struct cls_rule *,
- struct ofp10_match *);
+void ofputil_match_from_ofp10_match(const struct ofp10_match *,
+ struct match *);
+void ofputil_normalize_match(struct match *);
+void ofputil_normalize_match_quiet(struct match *);
+void ofputil_match_to_ofp10_match(const struct match *, struct ofp10_match *);
/* Work with ofp11_match. */
-enum ofperr ofputil_pull_ofp11_match(struct ofpbuf *, unsigned int priority,
- struct cls_rule *,
+enum ofperr ofputil_pull_ofp11_match(struct ofpbuf *, struct match *,
uint16_t *padded_match_len);
-enum ofperr ofputil_cls_rule_from_ofp11_match(const struct ofp11_match *,
- unsigned int priority,
- struct cls_rule *);
-void ofputil_cls_rule_to_ofp11_match(const struct cls_rule *,
- struct ofp11_match *);
+enum ofperr ofputil_match_from_ofp11_match(const struct ofp11_match *,
+ struct match *);
+void ofputil_match_to_ofp11_match(const struct match *, struct ofp11_match *);
/* dl_type translation between OpenFlow and 'struct flow' format. */
ovs_be16 ofputil_dl_type_to_openflow(ovs_be16 flow_dl_type);
* NXM Delete <used> <used> -
*/
struct ofputil_flow_mod {
- struct cls_rule cr;
+ struct match match;
+ unsigned int priority;
ovs_be64 cookie; /* Cookie bits to match. */
ovs_be64 cookie_mask; /* 1-bit in each 'cookie' bit to match. */
ovs_be64 new_cookie; /* New cookie to install or -1. */
/* Flow stats or aggregate stats request, independent of protocol. */
struct ofputil_flow_stats_request {
bool aggregate; /* Aggregate results? */
- struct cls_rule match;
+ struct match match;
ovs_be64 cookie;
ovs_be64 cookie_mask;
uint16_t out_port;
/* Flow stats reply, independent of protocol. */
struct ofputil_flow_stats {
- struct cls_rule rule;
+ struct match match;
ovs_be64 cookie;
uint8_t table_id;
uint32_t duration_sec;
uint32_t duration_nsec;
+ uint16_t priority;
uint16_t idle_timeout;
uint16_t hard_timeout;
int idle_age; /* Seconds since last packet, -1 if unknown. */
/* Flow removed message, independent of protocol. */
struct ofputil_flow_removed {
- struct cls_rule rule;
+ struct match match;
+ uint16_t priority;
ovs_be64 cookie;
uint8_t reason; /* One of OFPRR_*. */
uint32_t duration_sec;
OFPUTIL_A_GROUP = 1 << 24,
OFPUTIL_A_SET_NW_TTL = 1 << 25,
OFPUTIL_A_DEC_NW_TTL = 1 << 26,
+ OFPUTIL_A_SET_FIELD = 1 << 27,
};
/* Abstract ofp_switch_features. */
enum nx_flow_monitor_flags flags;
uint16_t out_port;
uint8_t table_id;
- struct cls_rule match;
+ struct match match;
};
int ofputil_decode_flow_monitor_request(struct ofputil_flow_monitor_request *,
uint16_t hard_timeout;
uint8_t table_id;
ovs_be64 cookie;
- struct cls_rule *match;
+ struct match *match;
+ uint16_t priority;
struct ofpact *ofpacts;
size_t ofpacts_len;
OFPUTIL_ACTION_INVALID,
#define OFPAT10_ACTION(ENUM, STRUCT, NAME) OFPUTIL_##ENUM,
#define OFPAT11_ACTION(ENUM, STRUCT, NAME) OFPUTIL_##ENUM,
+#define OFPAT12_ACTION(ENUM, STRUCT, NAME) OFPUTIL_##ENUM,
#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM,
#include "ofp-util.def"
};
enum {
#define OFPAT10_ACTION(ENUM, STRUCT, NAME) + 1
#define OFPAT11_ACTION(ENUM, STRUCT, NAME) + 1
+#define OFPAT12_ACTION(ENUM, STRUCT, NAME) + 1
#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1
OFPUTIL_N_ACTIONS = 1
#include "ofp-util.def"
#define OFPAT11_ACTION(ENUM, STRUCT, NAME) \
void ofputil_init_##ENUM(struct STRUCT *); \
struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
+#define OFPAT12_ACTION(ENUM, STRUCT, NAME) \
+ void ofputil_init_##ENUM(struct STRUCT *); \
+ struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \
void ofputil_init_##ENUM(struct STRUCT *); \
struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);