Skip to content

Commit

Permalink
SONIC-MGMT-COMMON : Support for L2 match fields for ACL
Browse files Browse the repository at this point in the history
* Added SONIC yang for src mac, dst mac, vlan id, vlan pcp, vlan dei

Signed-off-by: arthig <arthig@celestica.com>
  • Loading branch information
arthig committed Nov 21, 2022
1 parent 68e0341 commit b6d72d9
Showing 1 changed file with 39 additions and 0 deletions.
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

0 comments on commit b6d72d9

Please sign in to comment.