Skip to content

Commit b6d72d9

Browse files
author
arthig
committed
SONIC-MGMT-COMMON : Support for L2 match fields for ACL
* Added SONIC yang for src mac, dst mac, vlan id, vlan pcp, vlan dei Signed-off-by: arthig <[email protected]>
1 parent 68e0341 commit b6d72d9

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

models/yang/sonic/sonic-acl.yang

+39
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,21 @@ module sonic-acl {
168168
type inet:ipv6-prefix;
169169
}
170170
}
171+
case l2_src_dst {
172+
when "(/sonic-acl/ACL_TABLE/ACL_TABLE_LIST[aclname=current()/aclname]/type = 'L2')";
173+
leaf SRC_MAC {
174+
mandatory true;
175+
type string {
176+
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}";
177+
}
178+
}
179+
leaf DST_MAC {
180+
mandatory true;
181+
type string {
182+
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}";
183+
}
184+
}
185+
}
171186
}
172187

173188
choice src_port {
@@ -215,6 +230,30 @@ module sonic-acl {
215230
leaf DSCP {
216231
type inet:dscp;
217232
}
233+
234+
leaf VLAN_ID {
235+
type uint16 {
236+
range "1..4094" {
237+
error-app-tag vlan-id-invalid;
238+
}
239+
}
240+
}
241+
242+
leaf VLAN_PCP {
243+
type string {
244+
pattern "[0-7]|[0-7]/[0-7]" {
245+
error-app-tag vlan-pcp-invalid;
246+
}
247+
}
248+
}
249+
250+
leaf VLAN_DEI {
251+
type uint8 {
252+
range "0..1" {
253+
error-app-tag vlan-dei-invalid;
254+
}
255+
}
256+
}
218257
}
219258
}
220259
}

0 commit comments

Comments
 (0)