From 5cf79bbfb781180d43c5b4c1df4a9511e73d0457 Mon Sep 17 00:00:00 2001 From: ArthiGovindaraj Date: Mon, 21 Nov 2022 23:55:54 -0600 Subject: [PATCH] sonic-mgmt-common: Support for L2 match fields for L2 ACL table * Added SONIC yang for src mac, dst mac, vlan id, vlan pcp, vlan dei --- models/yang/sonic/sonic-acl.yang | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/models/yang/sonic/sonic-acl.yang b/models/yang/sonic/sonic-acl.yang index fba2aad4a..97ca8be09 100644 --- a/models/yang/sonic/sonic-acl.yang +++ b/models/yang/sonic/sonic-acl.yang @@ -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 { @@ -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; + } + } + } } } }