2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

OF11: push_vlan support

This implementes push_vlan with 802.1Q.
NOTE: 802.1AD (QinQ) is not supported. It requires another effort.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Isaku Yamahata
2012-10-26 13:43:19 +09:00
committed by Ben Pfaff
parent f43e80e023
commit 3e34fbdd62
8 changed files with 56 additions and 2 deletions

View File

@@ -384,6 +384,7 @@ parse_named_action(enum ofputil_action_code code, const struct flow *flow,
{
struct ofpact_tunnel *tunnel;
uint16_t vid;
uint16_t ethertype;
ovs_be32 ip;
uint8_t pcp;
uint8_t tos;
@@ -424,6 +425,15 @@ parse_named_action(enum ofputil_action_code code, const struct flow *flow,
ofpact_put_STRIP_VLAN(ofpacts);
break;
case OFPUTIL_OFPAT11_PUSH_VLAN:
ethertype = str_to_u16(arg, "ethertype");
if (ethertype != ETH_TYPE_VLAN_8021Q) {
/* TODO:XXXX ETH_TYPE_VLAN_8021AD case isn't supported */
ovs_fatal(0, "%s: not a valid VLAN ethertype", arg);
}
ofpact_put_PUSH_VLAN(ofpacts);
break;
case OFPUTIL_OFPAT10_SET_DL_SRC:
case OFPUTIL_OFPAT11_SET_DL_SRC:
str_to_mac(arg, ofpact_put_SET_ETH_SRC(ofpacts)->mac);