Table Features are supported

This commit is contained in:
Eishun Kondoh 2017-11-22 15:55:04 +09:00
parent 5762231816
commit ab21f6e240
3 changed files with 94 additions and 13 deletions

View file

@ -132,9 +132,90 @@ defmodule Flay do
tables = [
TableFeatures.Body.new(
table_id: 0,
name: "Custom L2 Src",
max_entries: 8192,
config: [:table_miss_mask]
name: "classifier",
max_entries: 50,
config: [:table_miss_mask],
match: [
:in_port,
:eth_type,
:eth_src,
:masked_eth_dst,
:ip_proto,
:vlan_vid,
:ipv4_src,
:udp_dst,
:tcp_dst
],
wildcards: [
:in_port,
:eth_src
:eth_type,
:masked_eth_dst,
:vlan_vid,
:ip_proto,
:ipv4_src,
:udp_dst,
:tcp_dst,
],
instructions: [
Openflow.Instruction.GotoTable,
Openflow.Instruction.ApplyActions
],
apply_actions: [
Openflow.Action.Output,
Openflow.Action.PushVlan,
Openflow.Action.PopVlan,
Openflow.Action.SetField
],
apply_setfield: [
:eth_dst,
:vlan_vid
],
next_tables: [
1,
],
),
TableFeatures.Body.new(
table_id: 1,
name: "admission_control",
max_entries: 50,
config: [:table_miss_mask],
match: [
:in_port,
:eth_type,
:eth_src,
:vlan_vid,
:masked_eth_dst,
:ip_proto,
:udp_dst,
:tcp_dst,
],
wildcards: [
:in_port,
:eth_type,
:eth_src,
:masked_eth_dst,
:vlan_vid,
:ip_proto,
:udp_dst,
:tcp_dst,
],
instructions: [
Openflow.Instruction.GotoTable,
Openflow.Instruction.ApplyActions
],
apply_actions: [
Openflow.Action.Output,
Openflow.Action.PushVlan,
Openflow.Action.PopVlan,
Openflow.Action.SetField
],
apply_setfield: [
:eth_dst,
:vlan_vid,
:ipv4_src,
:ipv4_dst
],
)
]
TableFeatures.Request.new(tables)

View file

@ -2,9 +2,9 @@ defmodule FlogTest do
use ExUnit.Case, async: false
use Bitwise
@vlan_trunk_port "veth0" # FIXME:
@access_port "veth3" # FIXME:
@vxlan_port "veth4" # FIXME:
@vlan_trunk_port "1" # FIXME:
@access_port "2" # FIXME:
@vxlan_port "5" # FIXME:
@bootnet_vid 0x1000 ||| 5
@user_vid 0x1000 ||| 123
@vlan_present {0x1000, 0x1000}