X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-actions.h;h=b97afd0b42d0dd485cfcac8824b2a93aad065e04;hb=e3b5693319c461a5909507b9ede57db326c07df2;hp=4fc40b3db7d64f896094a5bb847d7fe3347e071d;hpb=4e022ec09e14ac89add74c1b4b8e3ff3873edbf0;p=sliver-openvswitch.git diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h index 4fc40b3db..b97afd0b4 100644 --- a/lib/ofp-actions.h +++ b/lib/ofp-actions.h @@ -97,9 +97,10 @@ DEFINE_OFPACT(SAMPLE, ofpact_sample, ofpact) \ \ /* Instructions */ \ + DEFINE_OFPACT(METER, ofpact_meter, ofpact) \ /* XXX Write-Actions */ \ - DEFINE_OFPACT(WRITE_METADATA, ofpact_metadata, ofpact) \ DEFINE_OFPACT(CLEAR_ACTIONS, ofpact_null, ofpact) \ + DEFINE_OFPACT(WRITE_METADATA, ofpact_metadata, ofpact) \ DEFINE_OFPACT(GOTO_TABLE, ofpact_goto_table, ofpact) /* enum ofpact_type, with a member OFPACT_ for each action. */ @@ -374,6 +375,14 @@ struct ofpact_metadata { ovs_be64 mask; }; +/* OFPACT_METER. + * + * Used for OFPIT13_METER. */ +struct ofpact_meter { + struct ofpact ofpact; + uint32_t meter_id; +}; + /* OFPACT_RESUBMIT. * * Used for NXAST_RESUBMIT, NXAST_RESUBMIT_TABLE. */ @@ -490,10 +499,10 @@ enum ofperr ofpacts_pull_openflow11_actions(struct ofpbuf *openflow, struct ofpbuf *ofpacts); enum ofperr ofpacts_pull_openflow11_instructions(struct ofpbuf *openflow, unsigned int instructions_len, - uint8_t table_id, struct ofpbuf *ofpacts); enum ofperr ofpacts_check(const struct ofpact[], size_t ofpacts_len, - const struct flow *, ofp_port_t max_ports); + struct flow *, ofp_port_t max_ports, + uint8_t table_id); enum ofperr ofpacts_verify(const struct ofpact ofpacts[], size_t ofpacts_len); /* Converting ofpacts to OpenFlow. */ @@ -601,6 +610,10 @@ void ofpact_pad(struct ofpbuf *); * It is enforced on parser from text string. */ #define OVS_INSTRUCTIONS \ + DEFINE_INST(OFPIT13_METER, \ + ofp13_instruction_meter, false, \ + "meter") \ + \ DEFINE_INST(OFPIT11_APPLY_ACTIONS, \ ofp11_instruction_actions, true, \ "apply_actions") \ @@ -633,18 +646,10 @@ enum { #undef DEFINE_INST }; - -static inline bool -ofpact_is_instruction(const struct ofpact *a) -{ - /* XXX Write-Actions */ - return a->type == OFPACT_CLEAR_ACTIONS - || a->type == OFPACT_WRITE_METADATA - || a->type == OFPACT_GOTO_TABLE; -} - -const char *ofpact_instruction_name_from_type(enum ovs_instruction_type type); -int ofpact_instruction_type_from_name(const char *name); +const char *ovs_instruction_name_from_type(enum ovs_instruction_type type); +int ovs_instruction_type_from_name(const char *name); +enum ovs_instruction_type ovs_instruction_type_from_ofpact_type( + enum ofpact_type); void ofpact_set_field_init(struct ofpact_reg_load *load, const struct mf_field *mf, const void *src);