X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-actions.h;h=799f64c8d19c6de57bd4f9f3bbee849f1368863c;hb=abcd4402fec44a473a19cc790a9a3f00444a123f;hp=5746a5a51ea76667dc9c19d0774281e835fb471b;hpb=b676167a6f6f5bad24cf2a198c504d6e1cca080b;p=sliver-openvswitch.git diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h index 5746a5a51..799f64c8d 100644 --- a/lib/ofp-actions.h +++ b/lib/ofp-actions.h @@ -70,7 +70,10 @@ DEFINE_OFPACT(SET_L4_DST_PORT, ofpact_l4_port, ofpact) \ DEFINE_OFPACT(REG_MOVE, ofpact_reg_move, ofpact) \ DEFINE_OFPACT(REG_LOAD, ofpact_reg_load, ofpact) \ + DEFINE_OFPACT(STACK_PUSH, ofpact_stack, ofpact) \ + DEFINE_OFPACT(STACK_POP, ofpact_stack, ofpact) \ DEFINE_OFPACT(DEC_TTL, ofpact_cnt_ids, cnt_ids) \ + DEFINE_OFPACT(SET_MPLS_TTL, ofpact_mpls_ttl, ofpact) \ DEFINE_OFPACT(DEC_MPLS_TTL, ofpact_null, ofpact) \ DEFINE_OFPACT(PUSH_MPLS, ofpact_push_mpls, ofpact) \ DEFINE_OFPACT(POP_MPLS, ofpact_pop_mpls, ofpact) \ @@ -91,11 +94,13 @@ /* Other. */ \ DEFINE_OFPACT(NOTE, ofpact_note, data) \ DEFINE_OFPACT(EXIT, ofpact_null, ofpact) \ + 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. */ @@ -194,7 +199,7 @@ struct ofpact_null { * Used for OFPAT10_OUTPUT. */ struct ofpact_output { struct ofpact ofpact; - uint16_t port; /* Output port. */ + ofp_port_t port; /* Output port. */ uint16_t max_len; /* Max send len, for port OFPP_CONTROLLER. */ }; @@ -213,7 +218,7 @@ struct ofpact_controller { * Used for OFPAT10_ENQUEUE. */ struct ofpact_enqueue { struct ofpact ofpact; - uint16_t port; + ofp_port_t port; uint32_t queue; }; @@ -243,7 +248,7 @@ struct ofpact_bundle { /* Slaves for output. */ unsigned int n_slaves; - uint16_t slaves[]; + ofp_port_t slaves[]; }; /* OFPACT_SET_VLAN_VID. @@ -303,6 +308,14 @@ struct ofpact_reg_move { struct mf_subfield dst; }; +/* OFPACT_STACK_PUSH. + * + * Used for NXAST_STACK_PUSH and NXAST_STACK_POP. */ +struct ofpact_stack { + struct ofpact ofpact; + struct mf_subfield subfield; +}; + /* OFPACT_REG_LOAD. * * Used for NXAST_REG_LOAD, OFPAT12_SET_FIELD. */ @@ -362,25 +375,33 @@ 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. */ struct ofpact_resubmit { struct ofpact ofpact; - uint16_t in_port; + ofp_port_t in_port; uint8_t table_id; }; /* Part of struct ofpact_learn, below. */ struct ofpact_learn_spec { - int n_bits; + int n_bits; /* Number of bits in source and dest. */ - int src_type; - struct mf_subfield src; - union mf_subvalue src_imm; + int src_type; /* One of NX_LEARN_SRC_*. */ + struct mf_subfield src; /* NX_LEARN_SRC_FIELD only. */ + union mf_subvalue src_imm; /* NX_LEARN_SRC_IMMEDIATE only. */ - int dst_type; - struct mf_subfield dst; + int dst_type; /* One of NX_LEARN_DST_*. */ + struct mf_subfield dst; /* NX_LEARN_DST_MATCH, NX_LEARN_DST_LOAD only. */ }; /* OFPACT_LEARN. @@ -430,6 +451,17 @@ struct ofpact_note { uint8_t data[]; }; +/* OFPACT_SAMPLE. + * + * Used for NXAST_SAMPLE. */ +struct ofpact_sample { + struct ofpact ofpact; + uint16_t probability; // Always >0. + uint32_t collector_set_id; + uint32_t obs_domain_id; + uint32_t obs_point_id; +}; + /* OFPACT_DEC_TTL. * * Used for OFPAT11_DEC_NW_TTL, NXAST_DEC_TTL and NXAST_DEC_TTL_CNT_IDS. */ @@ -441,6 +473,15 @@ struct ofpact_cnt_ids { uint16_t cnt_ids[]; }; +/* OFPACT_SET_MPLS_TTL. + * + * Used for NXAST_SET_MPLS_TTL */ +struct ofpact_mpls_ttl { + struct ofpact ofpact; + + uint8_t ttl; +}; + /* OFPACT_GOTO_TABLE * * Used for OFPIT11_GOTO_TABLE */ @@ -458,9 +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 *, int max_ports); + struct flow *, ofp_port_t max_ports); enum ofperr ofpacts_verify(const struct ofpact ofpacts[], size_t ofpacts_len); /* Converting ofpacts to OpenFlow. */ @@ -474,7 +516,7 @@ void ofpacts_put_openflow11_instructions(const struct ofpact[], /* Working with ofpacts. */ bool ofpacts_output_to_port(const struct ofpact[], size_t ofpacts_len, - uint16_t port); + ofp_port_t port); bool ofpacts_equal(const struct ofpact a[], size_t a_len, const struct ofpact b[], size_t b_len); @@ -568,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") \ @@ -606,6 +652,7 @@ ofpact_is_instruction(const struct ofpact *a) { /* XXX Write-Actions */ return a->type == OFPACT_CLEAR_ACTIONS + || a->type == OFPACT_METER || a->type == OFPACT_WRITE_METADATA || a->type == OFPACT_GOTO_TABLE; }