2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

Support matching and modifying IP ECN bits.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
Justin Pettit
2011-11-02 23:34:15 -07:00
parent 9e44d71563
commit 530180fd5a
21 changed files with 146 additions and 72 deletions

View File

@@ -318,11 +318,19 @@ cls_rule_set_nw_dst_masked(struct cls_rule *rule, ovs_be32 ip, ovs_be32 mask)
}
void
cls_rule_set_nw_tos(struct cls_rule *rule, uint8_t nw_tos)
cls_rule_set_nw_dscp(struct cls_rule *rule, uint8_t nw_dscp)
{
rule->wc.tos_mask |= IP_DSCP_MASK;
rule->flow.tos &= ~IP_DSCP_MASK;
rule->flow.tos |= nw_tos & IP_DSCP_MASK;
rule->flow.tos |= nw_dscp & IP_DSCP_MASK;
}
void
cls_rule_set_nw_ecn(struct cls_rule *rule, uint8_t nw_ecn)
{
rule->wc.tos_mask |= IP_ECN_MASK;
rule->flow.tos &= ~IP_ECN_MASK;
rule->flow.tos |= nw_ecn & IP_ECN_MASK;
}
void
@@ -620,6 +628,9 @@ cls_rule_format(const struct cls_rule *rule, struct ds *s)
if (wc->tos_mask & IP_DSCP_MASK) {
ds_put_format(s, "nw_tos=%"PRIu8",", f->tos & IP_DSCP_MASK);
}
if (wc->tos_mask & IP_ECN_MASK) {
ds_put_format(s, "nw_ecn=%"PRIu8",", f->tos & IP_ECN_MASK);
}
switch (wc->frag_mask) {
case FLOW_FRAG_ANY | FLOW_FRAG_LATER:
ds_put_format(s, "frag=%s,",