Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonic-mgmt-common: Support for L2 match fields for L2 ACL table #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions models/yang/sonic/sonic-acl.yang
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,21 @@ module sonic-acl {
type inet:ipv6-prefix;
}
}
case l2_src_dst {
when "(/sonic-acl/ACL_TABLE/ACL_TABLE_LIST[aclname=current()/aclname]/type = 'L2')";
leaf SRC_MAC {
mandatory true;
type string {
pattern "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}|[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}/[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}";
}
}
leaf DST_MAC {
mandatory true;
type string {
pattern "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}|[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}/[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}";
}
}
}
}

choice src_port {
Expand Down Expand Up @@ -215,6 +230,30 @@ module sonic-acl {
leaf DSCP {
type inet:dscp;
}

leaf VLAN_ID {
type uint16 {
range "1..4094" {
error-app-tag vlan-id-invalid;
}
}
}

leaf VLAN_PCP {
type string {
pattern "[0-7]|[0-7]/[0-7]" {
error-app-tag vlan-pcp-invalid;
}
}
}

leaf VLAN_DEI {
type uint8 {
range "0..1" {
error-app-tag vlan-dei-invalid;
}
}
}
}
}
}
Expand Down