Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"eStrKey" : "Mandatory",
"eStr": ["ACL_RULE", "PRIORITY"]
},
"ACL_RULE_WITH_VALID_IN_PORTS": {
"desc": "Configure ACL_RULE with valid IN_PORTS."
},
"ACL_RULE_WITH_VALID_OUT_PORTS": {
"desc": "Configure ACL_RULE with valid OUT_PORTS."
},
"ACL_TABLE_EMPTY_PORTS": {
"desc": "Configure ACL_TABLE with empty ports."
},
Expand Down
108 changes: 108 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,114 @@
}
}
},
"ACL_RULE_WITH_VALID_IN_PORTS": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"IN_PORTS": "Ethernet0,Ethernet1",
"PACKET_ACTION": "FORWARD",
"PRIORITY": 9999,
"RULE_NAME": "Rule_20",
"SRC_IPV6": "2001::1/64"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "INGRESS",
"type": "L3"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "0,1,2,3",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"lanes": "4,5,6,7",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_RULE_WITH_VALID_OUT_PORTS": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_RULE": {
"ACL_RULE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"OUT_PORTS": "Ethernet0,Ethernet1",
"PACKET_ACTION": "FORWARD",
"PRIORITY": 9999,
"RULE_NAME": "Rule_20",
"SRC_IPV6": "2001::1/64"
}
]
},
"sonic-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [
{
"ACL_TABLE_NAME": "NO-NSW-PACL-V4",
"policy_desc": "Filter IPv4",
"ports": [
"Ethernet0",
"Ethernet1"
],
"stage": "EGRESS",
"type": "L3"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "0,1,2,3",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
},
{
"admin_status": "up",
"alias": "eth1",
"description": "Ethernet1",
"lanes": "4,5,6,7",
"mtu": 9000,
"name": "Ethernet1",
"speed": 25000
}
]
}
}
},
"ACL_TABLE_DEFAULT_VALUE_STAGE": {
"sonic-acl:sonic-acl": {
"sonic-acl:ACL_TABLE": {
Expand Down
12 changes: 6 additions & 6 deletions src/sonic-yang-models/yang-templates/sonic-acl.yang.j2
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ module sonic-acl {
}
}

leaf-list IN_PORTS {
/* Values in leaf list are UNIQUE */
type uint16;
leaf IN_PORTS {
/* Values is a list of SONiC port name (/port:sonic-port/port:PORT/port:PORT_LIST/port:name) joined by comma */
type string;
}

leaf-list OUT_PORTS {
/* Values in leaf list are UNIQUE */
type uint16;
leaf OUT_PORTS {
/* Values is a list of SONiC port name (/port:sonic-port/port:PORT/port:PORT_LIST/port:name) joined by comma */
type string;
}

choice src_port {
Expand Down