lib ofctl_v1_2: add VLAN_ID setting means

This patch contains the following update for ofctl_v1_2 library.
 adding a means which sets up VLAN_ID.

 (I think that I will use this by a firewall Ryu application.)

Signed-off-by: TAKESHITA Noboru <takeshita.noboru@yes.nttcom.ne.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
竹下昇 2013-03-26 18:36:46 +09:00 committed by FUJITA Tomonori
parent 366da0b919
commit 4f94ae8c2b

View File

@ -69,6 +69,7 @@ def to_match(dp, attrs):
'dl_src': mac.haddr_to_bin,
'dl_dst': mac.haddr_to_bin,
'dl_type': int,
'dl_vlan': int,
'nw_src': to_match_ip,
'nw_dst': to_match_ip,
'nw_proto': int,
@ -79,6 +80,7 @@ def to_match(dp, attrs):
'dl_src': match.set_dl_src,
'dl_dst': match.set_dl_dst,
'dl_type': match.set_dl_type,
'dl_vlan': match.set_vlan_vid,
'nw_src': match.set_ipv4_src_masked,
'nw_dst': match.set_ipv4_dst_masked,
'nw_proto': match.set_ip_proto,
@ -145,6 +147,7 @@ def match_to_str(ofmatch):
ofproto_v1_2.OXM_OF_ETH_SRC: 'dl_src',
ofproto_v1_2.OXM_OF_ETH_DST: 'dl_dst',
ofproto_v1_2.OXM_OF_ETH_TYPE: 'dl_type',
ofproto_v1_2.OXM_OF_VLAN_VID: 'dl_vlan',
ofproto_v1_2.OXM_OF_IPV4_SRC: 'nw_src',
ofproto_v1_2.OXM_OF_IPV4_DST: 'nw_dst',
ofproto_v1_2.OXM_OF_IPV4_SRC_W: 'nw_src',