Add IP interface loopback action related content to YANG models. (#11012)

*Add IP interface loopback action related content to the required YANG models.
This commit is contained in:
Lior Avramov 2022-06-20 21:45:08 +03:00 committed by GitHub
parent 42576d2664
commit 467e005b4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 181 additions and 14 deletions

View File

@ -707,12 +707,13 @@ This kind of profiles will be handled by buffer manager and won't be applied to
### Data Plane L3 Interfaces ### Data Plane L3 Interfaces
IP configuration for data plane are defined in **INTERFACE**, IP configuration for data plane are defined in **INTERFACE**, **VLAN_SUB_INTERFACE**,
**PORTCHANNEL_INTERFACE**, and **VLAN_INTERFACE** table. The objects **PORTCHANNEL_INTERFACE** and **VLAN_INTERFACE** table. The objects
in all three tables have the interface (could be physical port, port in all four tables have the interface (could be physical port, port
channel, or vlan) that IP address is attached to as first-level key, and channel, vlan or vlan sub interface) that IP address is attached to as first-level key, and
IP prefix as second-level key. IP interface objects don't have any IP prefix as second-level key. IP interface address objects don't have any attributes.
attributes. IP interface attributes, resides in those tables as well, key is the interface name
and value is a list of field-values representing the interface attributes, e.g. loopback action.
``` ```
{ {
@ -720,21 +721,29 @@ attributes.
"Ethernet0|10.0.0.0/31": {}, "Ethernet0|10.0.0.0/31": {},
"Ethernet4|10.0.0.2/31": {}, "Ethernet4|10.0.0.2/31": {},
"Ethernet8|10.0.0.4/31": {} "Ethernet8|10.0.0.4/31": {}
... "Ethernet8": {
"loopback_action": "drop"
}
}, },
"PORTCHANNEL_INTERFACE": { "PORTCHANNEL_INTERFACE": {
"PortChannel01|10.0.0.56/31": {}, "PortChannel01|10.0.0.56/31": {},
"PortChannel01|FC00::71/126": {}, "PortChannel01|FC00::71/126": {},
"PortChannel02|10.0.0.58/31": {}, "PortChannel02|10.0.0.58/31": {},
"PortChannel02|FC00::75/126": {} "PortChannel02|FC00::75/126": {}
...
}, },
"VLAN_INTERFACE": { "VLAN_INTERFACE": {
"Vlan1000|192.168.0.1/27": {} "Vlan1000|192.168.0.1/27": {}
},
"VLAN_SUB_INTERFACE": {
"Ethernet4.1|10.0.0.2/31": {},
"Ethernet4.1": {
"loopback_action": "drop"
}
} }
} }
``` ```

View File

@ -117,7 +117,8 @@
}, },
"PORTCHANNEL_INTERFACE": { "PORTCHANNEL_INTERFACE": {
"PortChannel0003": { "PortChannel0003": {
"nat_zone": "1" "nat_zone": "1",
"loopback_action": "drop"
}, },
"PortChannel0004": {"vrf_name": "Vrf_blue"}, "PortChannel0004": {"vrf_name": "Vrf_blue"},
"PortChannel42|10.1.0.1/31": {}, "PortChannel42|10.1.0.1/31": {},
@ -132,7 +133,8 @@
}, },
"VLAN_INTERFACE": { "VLAN_INTERFACE": {
"Vlan111": { "Vlan111": {
"nat_zone": "0" "nat_zone": "0",
"loopback_action": "forward"
}, },
"Vlan777": {}, "Vlan777": {},
"Vlan111|2a04:5555:45:6709::1/64": { "Vlan111|2a04:5555:45:6709::1/64": {
@ -930,7 +932,8 @@
"Ethernet14": {}, "Ethernet14": {},
"Ethernet16": {}, "Ethernet16": {},
"Ethernet18": { "Ethernet18": {
"nat_zone": "1" "nat_zone": "1",
"loopback_action": "forward"
}, },
"Ethernet112|2a04:5555:40:a709::2/126": { "Ethernet112|2a04:5555:40:a709::2/126": {
"scope": "global", "scope": "global",
@ -967,7 +970,8 @@
}, },
"VLAN_SUB_INTERFACE": { "VLAN_SUB_INTERFACE": {
"Ethernet12.10": { "Ethernet12.10": {
"admin_status": "up" "admin_status": "up",
"loopback_action": "drop"
}, },
"Ethernet12.10|10.0.1.56/31": {}, "Ethernet12.10|10.0.1.56/31": {},
"Ethernet12.10|fc00::1:71/126": {}, "Ethernet12.10|fc00::1:71/126": {},

View File

@ -17,5 +17,10 @@
}, },
"INTERFACE_VALID_NAT_ZONE_RANGE": { "INTERFACE_VALID_NAT_ZONE_RANGE": {
"desc": "Configure valid value for nat zone." "desc": "Configure valid value for nat zone."
},
"INTERFACE_INVALID_LOOPBACK_ACTION": {
"desc": "INCORRECT LOOPBACK ACTION IN INTERFACE TABLE.",
"eStrKey" : "Pattern",
"eStr": ["drop|forward"]
} }
} }

View File

@ -58,5 +58,10 @@
}, },
"PORTCHANNEL_INTERFACE_VALID_NAT_ZONE_RANGE": { "PORTCHANNEL_INTERFACE_VALID_NAT_ZONE_RANGE": {
"desc": "Configure valid value for nat zone." "desc": "Configure valid value for nat zone."
},
"PORTCHANNEL_INTERFACE_INVALID_LOOPBACK_ACTION": {
"desc": "INCORRECT LOOPBACK ACTION IN PORTCHANNEL_INTERFACE TABLE.",
"eStrKey" : "Pattern",
"eStr": ["drop|forward"]
} }
} }

View File

@ -74,5 +74,10 @@
"VLAN_INTERFACE_INVALID_PROXY_ARP": { "VLAN_INTERFACE_INVALID_PROXY_ARP": {
"desc": "VLAN_INTERFACE with invalid proxy_arp value", "desc": "VLAN_INTERFACE with invalid proxy_arp value",
"eStrKey": "Pattern" "eStrKey": "Pattern"
},
"VLAN_INTERFACE_INVALID_LOOPBACK_ACTION": {
"desc": "INCORRECT LOOPBACK ACTION IN VLAN_INTERFACE TABLE.",
"eStrKey" : "Pattern",
"eStr": ["drop|forward"]
} }
} }

View File

@ -50,5 +50,10 @@
"VLAN_SUB_INTERFACE_INVALID_NAME_TEST": { "VLAN_SUB_INTERFACE_INVALID_NAME_TEST": {
"desc": "Configure invalid vlan sub interface name with no separator.", "desc": "Configure invalid vlan sub interface name with no separator.",
"eStrKey": "Pattern" "eStrKey": "Pattern"
},
"VLAN_SUB_INTERFACE_INVALID_LOOPBACK_ACTION": {
"desc": "INCORRECT LOOPBACK ACTION IN VLAN_SUB_INTERFACE TABLE.",
"eStrKey" : "Pattern",
"eStr": ["drop|forward"]
} }
} }

View File

@ -181,5 +181,33 @@
] ]
} }
} }
},
"INTERFACE_INVALID_LOOPBACK_ACTION": {
"sonic-interface:sonic-interface": {
"sonic-interface:INTERFACE": {
"INTERFACE_LIST": [
{
"name": "Ethernet8",
"loopback_action": "trap"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth8",
"description": "Ethernet8",
"fec": "rs",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet8",
"speed": 25000
}
]
}
}
} }
} }

View File

@ -374,5 +374,45 @@
] ]
} }
} }
},
"PORTCHANNEL_INTERFACE_INVALID_LOOPBACK_ACTION": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"admin_status": "up",
"members": [
"Ethernet0"
],
"min_links": "1",
"mtu": "9100",
"name": "PortChannel0001"
}
]
},
"sonic-portchannel:PORTCHANNEL_INTERFACE": {
"PORTCHANNEL_INTERFACE_LIST": [
{
"name": "PortChannel0001",
"loopback_action": "trap"
}
]
}
}
} }
} }

View File

@ -614,5 +614,17 @@
] ]
} }
} }
},
"VLAN_INTERFACE_INVALID_LOOPBACK_ACTION": {
"sonic-vlan:sonic-vlan": {
"sonic-vlan:VLAN_INTERFACE": {
"VLAN_INTERFACE_LIST": [
{
"name": "Vlan1000",
"loopback_action": "trap"
}
]
}
}
} }
} }

View File

@ -518,5 +518,32 @@
] ]
} }
} }
},
"VLAN_SUB_INTERFACE_INVALID_LOOPBACK_ACTION": {
"sonic-vlan-sub-interface:sonic-vlan-sub-interface": {
"sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": {
"VLAN_SUB_INTERFACE_LIST": [
{
"name": "Ethernet8.10",
"loopback_action": "trap"
}
]
}
},
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"admin_status": "up",
"alias": "Ethernet8/1",
"description": "Ethernet8",
"lanes": "45,46,47,48",
"mtu": 9000,
"speed": 100000
}
]
}
}
} }
} }

View File

@ -66,6 +66,7 @@ module sonic-interface {
} }
default "0"; default "0";
} }
leaf mpls { leaf mpls {
description "Enable/disable MPLS routing for the interface"; description "Enable/disable MPLS routing for the interface";
type enumeration { type enumeration {
@ -73,6 +74,11 @@ module sonic-interface {
enum disable; enum disable;
} }
} }
leaf loopback_action {
description "Packet action when a packet ingress and gets routed on the same IP interface";
type stypes:loopback_action;
}
} }
/* end of INTERFACE_LIST */ /* end of INTERFACE_LIST */

View File

@ -167,6 +167,11 @@ module sonic-portchannel {
} }
} }
leaf loopback_action {
description "Packet action when a packet ingress and gets routed on the same IP interface";
type stypes:loopback_action;
}
leaf nat_zone { leaf nat_zone {
description "NAT Zone for the portchannel interface"; description "NAT Zone for the portchannel interface";
type uint8 { type uint8 {

View File

@ -65,6 +65,11 @@ module sonic-vlan-sub-interface {
path "/vrf:sonic-vrf/vrf:VRF/vrf:VRF_LIST/vrf:name"; path "/vrf:sonic-vrf/vrf:VRF/vrf:VRF_LIST/vrf:name";
} }
} }
leaf loopback_action {
description "Packet action when a packet ingress and gets routed on the same IP interface";
type stypes:loopback_action;
}
} }
list VLAN_SUB_INTERFACE_IPPREFIX_LIST { list VLAN_SUB_INTERFACE_IPPREFIX_LIST {

View File

@ -101,6 +101,11 @@ module sonic-vlan {
pattern "enabled|disabled"; pattern "enabled|disabled";
} }
} }
leaf loopback_action {
description "Packet action when a packet ingress and gets routed on the same IP interface";
type stypes:loopback_action;
}
} }
/* end of VLAN_INTERFACE_LIST */ /* end of VLAN_INTERFACE_LIST */

View File

@ -117,6 +117,12 @@ module sonic-types {
} }
} }
typedef loopback_action {
type string {
pattern "drop|forward";
}
}
typedef admin_mode { typedef admin_mode {
type enumeration { type enumeration {
enum enabled; enum enabled;