Skip to content

Commit

Permalink
action: add raw VLAN push/pop actions
Browse files Browse the repository at this point in the history
These actions support multiple VLAN tags.
  • Loading branch information
rlane committed Dec 9, 2014
1 parent 1b5dadb commit d975e0e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/action/module/inc/action/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ void action_set_vlan_vid(struct action_context *ctx, uint16_t vlan_vid);
void action_set_vlan_pcp(struct action_context *ctx, uint8_t vlan_pcp);
void action_pop_vlan(struct action_context *ctx);
void action_push_vlan(struct action_context *ctx);
void action_pop_vlan_raw(struct action_context *ctx);
void action_push_vlan_raw(struct action_context *ctx, uint16_t vlan_tci);

/* IPv4 */

Expand Down
16 changes: 16 additions & 0 deletions modules/action/module/src/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,22 @@ action_push_vlan(struct action_context *ctx)
}
}

void
action_pop_vlan_raw(struct action_context *ctx)
{
nla_put_flag(ctx->msg, OVS_ACTION_ATTR_POP_VLAN);
}

void
action_push_vlan_raw(struct action_context *ctx, uint16_t vlan_tci)
{
struct ovs_action_push_vlan vlan = {
.vlan_tpid = htons(ETH_P_8021Q),
.vlan_tci = vlan_tci,
};
nla_put(ctx->msg, OVS_ACTION_ATTR_PUSH_VLAN, sizeof(vlan), &vlan);
}

/*
* IPv4 actions
*/
Expand Down

0 comments on commit d975e0e

Please sign in to comment.