Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cropConfigDB.py]: Crop configDB based on yang models. #9

Closed

Conversation

praveen-li
Copy link
Collaborator

This is temp PR, At last this code will be merged in PLY.

- What I did
Crop Config DB file based on yang models.

- How I did it
using libyang, create a map [ConfigDBTable --> xpath of container for the table].

- How to verify it
---Test logs----
Original Config:

{
	"VLAN_INTERFACE": {
		"Vlan111|2a04:5555:45:6709::1/64": {
			"scope": "global",
			"family": "IPv6"
		},
		"Vlan111|10.222.10.65/26": {
			"scope": "global",
			"family": "IPv4"
		},
		"Vlan111|fe80::1/10": {
			"scope": "local",
			"family": "IPv6"
		},
		"Vlan777|2a04:5555:41:4e9::1/64": {
			"scope": "global",
			"family": "IPv6"
		},
		"Vlan777|10.111.58.65/26": {
			"scope": "global",
			"family": "IPv4"
		},
		"Vlan777|fe80::1/10": {
			"scope": "local",
			"family": "IPv6"
		}
	},
	"ACL_RULE": {
		"V4-ACL-TABLE|DEFAULT_DENY": {
			"PACKET_ACTION": "DROP",
			"IP_TYPE": "IPv4ANY",
			"PRIORITY": "0"
		},
		"V4-ACL-TABLE|Rule_20": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.222.72.0/26",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777780",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_40": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.222.72.64/26",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777760",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_60": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.222.80.0/26",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777740",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_80": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.222.80.64/26",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777720",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_111": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.152.17.52/32",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777700",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_120": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.252.208.41/32",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777880",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_140": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.148.128.245/32",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777860",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_160": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.222.1.245/32",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777840",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_180": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "10.252.222.21/32",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "777820",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_9000": {
			"PACKET_ACTION": "DROP",
			"DST_IP": "0.0.0.0/0",
			"SRC_IP": "10.222.0.0/15",
			"PRIORITY": "991110",
			"IP_TYPE": "IPv4ANY"
		},
		"V4-ACL-TABLE|Rule_11100": {
			"PACKET_ACTION": "FORWARD",
			"DST_IP": "0.0.0.0/0",
			"SRC_IP": "0.0.0.0/0",
			"PRIORITY": "990000",
			"IP_TYPE": "IPv4ANY"
		},
		"V6-ACL-TBLE|DEFAULT_DENY": {
			"PACKET_ACTION": "DROP",
			"IP_TYPE": "IPv6ANY",
			"PRIORITY": "0"
		},
		"V6-ACL-TBLE|Rule_20": {
			"PACKET_ACTION": "FORWARD",
			"IP_TYPE": "IPv6ANY",
			"SRC_IPV6": "2a04:5555:41::/48",
			"PRIORITY": "777780",
			"DST_IPV6": "2a04:5555:43:320::/64"
		},
		"V6-ACL-TBLE|Rule_40": {
			"PACKET_ACTION": "FORWARD",
			"IP_TYPE": "IPv6ANY",
			"SRC_IPV6": "2a04:5555:41::/48",
			"PRIORITY": "777760",
			"DST_IPV6": "2a04:5555:43:321::/64"
		},
		"V6-ACL-TBLE|Rule_60": {
			"PACKET_ACTION": "FORWARD",
			"IP_TYPE": "IPv6ANY",
			"SRC_IPV6": "2a04:5555:41::/48",
			"PRIORITY": "777740",
			"DST_IPV6": "2a04:5555:43:340::/64"
		},
		"V6-ACL-TBLE|Rule_80": {
			"PACKET_ACTION": "FORWARD",
			"IP_TYPE": "IPv6ANY",
			"SRC_IPV6": "2a04:5555:41::/48",
			"PRIORITY": "777720",
			"DST_IPV6": "2a04:5555:43:341::/64"
		},
		"V6-ACL-TBLE|Rule_111": {
			"PACKET_ACTION": "FORWARD",
			"IP_TYPE": "IPv6ANY",
			"SRC_IPV6": "2a04:5555:41::/48",
			"PRIORITY": "777700",
			"DST_IPV6": "2a04:5555:32:12::/64"
		},
		"V6-ACL-TBLE|Rule_9000": {
			"PACKET_ACTION": "DROP",
			"IP_TYPE": "IPv6ANY",
			"SRC_IPV6": "2a04:5555:41::/48",
			"PRIORITY": "991110",
			"DST_IPV6": "::/0"
		},
		"V6-ACL-TBLE|Rule_11100": {
			"PACKET_ACTION": "FORWARD",
			"IP_TYPE": "IPv6ANY",
			"SRC_IPV6": "::/0",
			"PRIORITY": "990000",
			"DST_IPV6": "::/0"
		}
	},
	"DEVICE_METADATA": {
		"localhost": {
			"mg_type": "ToR",
			"mac": "00:11:22:33:dd:5a",
			"hostname": "asw.dc",
			"bgp_asn": "64850",
			"hwsku": "Stone"
		}
	},
	"VLAN": {
		"Vlan111": {
			"description": "svlan",
			"dhcp_servers": [
				"10.222.72.116"
			],
			"vlanid": "111",
			"mtu": "9216",
			"admin_status": "up",
			"members": [
				"Ethernet8",
				"Ethernet3",
				"Ethernet0",
				"Ethernet1",
				"Ethernet6",
				"Ethernet4",
				"Ethernet5",
				"Ethernet9",
				"Ethernet65",
				"Ethernet2",
				"Ethernet49",
				"Ethernet47",
				"Ethernet45",
				"Ethernet42",
				"Ethernet41",
				"Ethernet60",
				"Ethernet7",
				"Ethernet38",
				"Ethernet39",
				"Ethernet32",
				"Ethernet30",
				"Ethernet31",
				"Ethernet36",
				"Ethernet37",
				"Ethernet34",
				"Ethernet68",
				"Ethernet91",
				"Ethernet33",
				"Ethernet94",
				"Ethernet95",
				"Ethernet90",
				"Ethernet92",
				"Ethernet93",
				"Ethernet35",
				"Ethernet29",
				"Ethernet77",
				"Ethernet21",
				"Ethernet20",
				"Ethernet23",
				"Ethernet22",
				"Ethernet27",
				"Ethernet26",
				"Ethernet75",
				"Ethernet72",
				"Ethernet73",
				"Ethernet89",
				"Ethernet88",
				"Ethernet83",
				"Ethernet82",
				"Ethernet81",
				"Ethernet61",
				"Ethernet87",
				"Ethernet86",
				"Ethernet85",
				"Ethernet84",
				"Ethernet18",
				"Ethernet19",
				"Ethernet14",
				"Ethernet15",
				"Ethernet16",
				"Ethernet17",
				"Ethernet10",
				"Ethernet11",
				"Ethernet12",
				"Ethernet13",
				"Ethernet62",
				"Ethernet69",
				"Ethernet28",
				"Ethernet50",
				"Ethernet57",
				"Ethernet51",
				"Ethernet52",
				"Ethernet53",
				"Ethernet54",
				"Ethernet55",
				"Ethernet58",
				"Ethernet59",
				"Ethernet56"
			]
		},
		"Vlan777": {
			"description": "pvlan",
			"dhcp_servers": [
				"10.222.72.116"
			],
			"vlanid": "777",
			"mtu": "9216",
			"admin_status": "up",
			"members": [
				"Ethernet9",
				"Ethernet2",
				"Ethernet8",
				"Ethernet27",
				"Ethernet14",
				"Ethernet35",
				"Ethernet91",
				"Ethernet64",
				"Ethernet82",
				"Ethernet67",
				"Ethernet66",
				"Ethernet57"
			]
		}
	},
	"DEVICE_NEIGHBOR": {
		"Ethernet112": {
			"name": "dccsw01.nw",
			"port": "Eth18"
		},
		"Ethernet114": {
			"name": "dccsw02.nw",
			"port": "Eth18"
		},
		"Ethernet116": {
			"name": "dccsw03.nw",
			"port": "Eth18"
		},
		"Ethernet118": {
			"name": "dccsw04.nw",
			"port": "Eth18"
		}
	},
	"PORT": {
		"Ethernet0": {
			"alias": "Eth1/1",
			"lanes": "65",
			"description": "",
			"speed": "11100"
		},
		"Ethernet1": {
			"alias": "Eth1/2",
			"lanes": "66",
			"description": "",
			"speed": "11100"
		},
		"Ethernet2": {
			"alias": "Eth1/3",
			"lanes": "67",
			"description": "",
			"speed": "11100"
		},
		"Ethernet3": {
			"alias": "Eth1/4",
			"lanes": "68",
			"description": "",
			"speed": "11100"
		},
		"Ethernet4": {
			"alias": "Eth2/1",
			"lanes": "69",
			"description": "",
			"speed": "11100"
		},
		"Ethernet5": {
			"alias": "Eth2/2",
			"lanes": "70",
			"description": "",
			"speed": "11100"
		},
		"Ethernet6": {
			"alias": "Eth2/3",
			"lanes": "71",
			"description": "",
			"speed": "11100"
		},
		"Ethernet7": {
			"alias": "Eth2/4",
			"lanes": "72",
			"description": "",
			"speed": "11100"
		},
		"Ethernet8": {
			"alias": "Eth3/1",
			"lanes": "73",
			"description": "",
			"speed": "11100"
		},
		"Ethernet9": {
			"alias": "Eth3/2",
			"lanes": "74",
			"description": "",
			"speed": "11100"
		},
		"Ethernet10": {
			"alias": "Eth3/3",
			"lanes": "75",
			"description": "",
			"speed": "11100"
		},
		"Ethernet11": {
			"alias": "Eth3/4",
			"lanes": "76",
			"description": "",
			"speed": "11100"
		},
		"Ethernet12": {
			"alias": "Eth4/1",
			"lanes": "77",
			"description": "",
			"speed": "11100"
		},
		"Ethernet13": {
			"alias": "Eth4/2",
			"lanes": "78",
			"description": "",
			"speed": "11100"
		},
		"Ethernet14": {
			"alias": "Eth4/3",
			"lanes": "79",
			"description": "",
			"speed": "11100"
		},
		"Ethernet15": {
			"alias": "Eth4/4",
			"lanes": "80",
			"description": "",
			"speed": "11100"
		},
		"Ethernet16": {
			"alias": "Eth5/1",
			"lanes": "33",
			"description": "",
			"speed": "11100"
		},
		"Ethernet17": {
			"alias": "Eth5/2",
			"lanes": "34",
			"description": "",
			"speed": "11100"
		},
		"Ethernet18": {
			"alias": "Eth5/3",
			"lanes": "35",
			"description": "",
			"speed": "11100"
		},
		"Ethernet19": {
			"alias": "Eth5/4",
			"lanes": "36",
			"description": "",
			"speed": "11100"
		},
		"Ethernet20": {
			"alias": "Eth6/1",
			"lanes": "37",
			"description": "",
			"speed": "11100"
		},
		"Ethernet21": {
			"alias": "Eth6/2",
			"lanes": "38",
			"description": "",
			"speed": "11100"
		},
		"Ethernet22": {
			"alias": "Eth6/3",
			"lanes": "39",
			"description": "",
			"speed": "11100"
		},
		"Ethernet23": {
			"alias": "Eth6/4",
			"lanes": "40",
			"description": "",
			"speed": "11100"
		},
		"Ethernet24": {
			"alias": "Eth7/1",
			"lanes": "41",
			"description": "",
			"speed": "11100"
		},
		"Ethernet25": {
			"alias": "Eth7/2",
			"lanes": "42",
			"description": "",
			"speed": "11100"
		},
		"Ethernet26": {
			"alias": "Eth7/3",
			"lanes": "43",
			"description": "",
			"speed": "11100"
		},
		"Ethernet27": {
			"alias": "Eth7/4",
			"lanes": "44",
			"description": "",
			"speed": "11100"
		},
		"Ethernet28": {
			"alias": "Eth8/1",
			"lanes": "45",
			"description": "",
			"speed": "11100"
		},
		"Ethernet29": {
			"alias": "Eth8/2",
			"lanes": "46",
			"description": "",
			"speed": "11100"
		},
		"Ethernet30": {
			"alias": "Eth8/3",
			"lanes": "47",
			"description": "",
			"speed": "11100"
		},
		"Ethernet31": {
			"alias": "Eth8/4",
			"lanes": "48",
			"description": "",
			"speed": "11100"
		},
		"Ethernet32": {
			"alias": "Eth9/1",
			"lanes": "49",
			"description": "",
			"speed": "11100"
		},
		"Ethernet33": {
			"alias": "Eth9/2",
			"lanes": "50",
			"description": "",
			"speed": "11100"
		},
		"Ethernet34": {
			"alias": "Eth9/3",
			"lanes": "51",
			"description": "",
			"speed": "11100"
		},
		"Ethernet35": {
			"alias": "Eth9/4",
			"lanes": "52",
			"description": "",
			"speed": "11100"
		},
		"Ethernet36": {
			"alias": "Eth10/1",
			"lanes": "53",
			"description": "",
			"speed": "11100"
		},
		"Ethernet112": {
			"alias": "Eth29/1",
			"lanes": "113,114",
			"description": "50G|dccsw01.nw|Eth18",
			"fec": "fc"
		}
	},
	"ACL_TABLE": {
		"V4-ACL-TABLE": {
			"type": "L3",
			"policy_desc": "V4-ACL-TABLE",
			"ports": [
				"Ethernet76",
				"Ethernet77",
				"Ethernet74",
				"Ethernet75",
				"Ethernet84"
			]
		},
		"V6-ACL-TBLE": {
			"type": "L3V6",
			"policy_desc": "V6-ACL-TBLE",
			"ports": [
				"Ethernet76",
				"Ethernet77",
				"Ethernet74",
				"Ethernet75",
				"Ethernet72",
				"Ethernet73",
				"Ethernet70",
				"Ethernet71",
				"Ethernet78",
				"Ethernet79",
				"Ethernet65",
				"Ethernet64",
				"Ethernet67",
				"Ethernet72",
				"Ethernet86",
				"Ethernet85",
				"Ethernet84"
			]
		}
	},
	"INTERFACE": {
		"Ethernet112|2a04:5555:40:a709::2/126": {
			"scope": "global",
			"family": "IPv6"
		},
		"Ethernet112|10.184.228.211/31": {
			"scope": "global",
			"family": "IPv4"
		},
		"Ethernet114|2a04:5555:40:a749::2/126": {
			"scope": "global",
			"family": "IPv6"
		},
		"Ethernet114|10.184.229.211/31": {
			"scope": "global",
			"family": "IPv4"
		},
		"Ethernet116|2a04:5555:40:a789::2/126": {
			"scope": "global",
			"family": "IPv6"
		},
		"Ethernet116|10.184.230.211/31": {
			"scope": "global",
			"family": "IPv4"
		},
		"Ethernet118|2a04:5555:40:a7c9::2/126": {
			"scope": "global",
			"family": "IPv6"
		},
		"Ethernet118|10.184.231.211/31": {
			"scope": "global",
			"family": "IPv4"
		}
	},
	"VLAN_MEMBER": {
		"Vlan111|Ethernet0": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet1": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet2": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet3": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet4": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet5": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet6": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet29": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet30": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet31": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet32": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet33": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet34": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet35": {
			"tagging_mode": "untagged"
		},
		"Vlan111|Ethernet36": {
			"tagging_mode": "untagged"
		}
	},
	"LOOPBACK_INTERFACE": {
		"Loopback0|2a04:5555:40:4::4e9/128": {
			"scope": "global",
			"family": "IPv6"
		},
		"Loopback0|10.184.8.233/32": {
			"scope": "global",
			"family": "IPv4"
		}
	},
	"CRM": {
		"Config": {
			"polling_interval": "0"
		}
	}
}

run this script:

pchaudha@7cc26115656c:/sonic/src/sonic-yang-mgmt/tests/yang-model-tests/custom_code$ python cropConfigDB.py
['sonic-vlan', 'sonic-head', 'sonic-portchannel', 'sonic-acl', 'sonic-port', 'sonic-interface']
module: sonic-vlan is loaded successfully
module already exist: sonic-head
module: sonic-portchannel is loaded successfully
module: sonic-acl is loaded successfully
module already exist: sonic-port
module: sonic-interface is loaded successfully

Cropped config

{
    "VLAN_INTERFACE": {
        "Vlan777|fe80::1/10": {
            "scope": "local", 
            "family": "IPv6"
        }, 
        "Vlan777|10.111.58.65/26": {
            "scope": "global", 
            "family": "IPv4"
        }, 
        "Vlan111|10.222.10.65/26": {
            "scope": "global", 
            "family": "IPv4"
        }, 
        "Vlan777|2a04:5555:41:4e9::1/64": {
            "scope": "global", 
            "family": "IPv6"
        }, 
        "Vlan111|2a04:5555:45:6709::1/64": {
            "scope": "global", 
            "family": "IPv6"
        }, 
        "Vlan111|fe80::1/10": {
            "scope": "local", 
            "family": "IPv6"
        }
    }, 
    "ACL_RULE": {
        "V4-ACL-TABLE|Rule_20": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.222.72.0/26", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777780"
        }, 
        "V4-ACL-TABLE|Rule_111": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.152.17.52/32", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777700"
        }, 
        "V6-ACL-TBLE|Rule_80": {
            "PACKET_ACTION": "FORWARD", 
            "IP_TYPE": "IPv6ANY", 
            "SRC_IPV6": "2a04:5555:41::/48", 
            "DST_IPV6": "2a04:5555:43:341::/64", 
            "PRIORITY": "777720"
        }, 
        "V6-ACL-TBLE|Rule_40": {
            "PACKET_ACTION": "FORWARD", 
            "IP_TYPE": "IPv6ANY", 
            "SRC_IPV6": "2a04:5555:41::/48", 
            "DST_IPV6": "2a04:5555:43:321::/64", 
            "PRIORITY": "777760"
        }, 
        "V4-ACL-TABLE|Rule_180": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.252.222.21/32", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777820"
        }, 
        "V4-ACL-TABLE|Rule_140": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.148.128.245/32", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777860"
        }, 
        "V6-ACL-TBLE|Rule_60": {
            "PACKET_ACTION": "FORWARD", 
            "IP_TYPE": "IPv6ANY", 
            "SRC_IPV6": "2a04:5555:41::/48", 
            "DST_IPV6": "2a04:5555:43:340::/64", 
            "PRIORITY": "777740"
        }, 
        "V4-ACL-TABLE|Rule_80": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.222.80.64/26", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777720"
        }, 
        "V6-ACL-TBLE|Rule_11100": {
            "PACKET_ACTION": "FORWARD", 
            "IP_TYPE": "IPv6ANY", 
            "SRC_IPV6": "::/0", 
            "DST_IPV6": "::/0", 
            "PRIORITY": "990000"
        }, 
        "V4-ACL-TABLE|Rule_120": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.252.208.41/32", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777880"
        }, 
        "V4-ACL-TABLE|Rule_11100": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "0.0.0.0/0", 
            "SRC_IP": "0.0.0.0/0", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "990000"
        }, 
        "V4-ACL-TABLE|Rule_9000": {
            "PACKET_ACTION": "DROP", 
            "DST_IP": "0.0.0.0/0", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "991110"
        }, 
        "V4-ACL-TABLE|DEFAULT_DENY": {
            "PACKET_ACTION": "DROP", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "0"
        }, 
        "V6-ACL-TBLE|Rule_9000": {
            "PACKET_ACTION": "DROP", 
            "IP_TYPE": "IPv6ANY", 
            "SRC_IPV6": "2a04:5555:41::/48", 
            "DST_IPV6": "::/0", 
            "PRIORITY": "991110"
        }, 
        "V6-ACL-TBLE|DEFAULT_DENY": {
            "PACKET_ACTION": "DROP", 
            "IP_TYPE": "IPv6ANY", 
            "PRIORITY": "0"
        }, 
        "V4-ACL-TABLE|Rule_40": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.222.72.64/26", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777760"
        }, 
        "V4-ACL-TABLE|Rule_160": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.222.1.245/32", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777840"
        }, 
        "V6-ACL-TBLE|Rule_20": {
            "PACKET_ACTION": "FORWARD", 
            "IP_TYPE": "IPv6ANY", 
            "SRC_IPV6": "2a04:5555:41::/48", 
            "DST_IPV6": "2a04:5555:43:320::/64", 
            "PRIORITY": "777780"
        }, 
        "V4-ACL-TABLE|Rule_60": {
            "PACKET_ACTION": "FORWARD", 
            "DST_IP": "10.222.80.0/26", 
            "SRC_IP": "10.222.0.0/15", 
            "IP_TYPE": "IPv4ANY", 
            "PRIORITY": "777740"
        }, 
        "V6-ACL-TBLE|Rule_111": {
            "PACKET_ACTION": "FORWARD", 
            "IP_TYPE": "IPv6ANY", 
            "SRC_IPV6": "2a04:5555:41::/48", 
            "DST_IPV6": "2a04:5555:32:12::/64", 
            "PRIORITY": "777700"
        }
    }, 
    "VLAN": {
        "Vlan111": {
            "description": "svlan", 
            "dhcp_servers": [
                "10.222.72.116"
            ], 
            "vlanid": "111", 
            "mtu": "9216", 
            "admin_status": "up", 
            "members": [
                "Ethernet8", 
                "Ethernet3", 
                "Ethernet0", 
                "Ethernet1", 
                "Ethernet6", 
                "Ethernet4", 
                "Ethernet5", 
                "Ethernet9", 
                "Ethernet65", 
                "Ethernet2", 
                "Ethernet49", 
                "Ethernet47", 
                "Ethernet45", 
                "Ethernet42", 
                "Ethernet41", 
                "Ethernet60", 
                "Ethernet7", 
                "Ethernet38", 
                "Ethernet39", 
                "Ethernet32", 
                "Ethernet30", 
                "Ethernet31", 
                "Ethernet36", 
                "Ethernet37", 
                "Ethernet34", 
                "Ethernet68", 
                "Ethernet91", 
                "Ethernet33", 
                "Ethernet94", 
                "Ethernet95", 
                "Ethernet90", 
                "Ethernet92", 
                "Ethernet93", 
                "Ethernet35", 
                "Ethernet29", 
                "Ethernet77", 
                "Ethernet21", 
                "Ethernet20", 
                "Ethernet23", 
                "Ethernet22", 
                "Ethernet27", 
                "Ethernet26", 
                "Ethernet75", 
                "Ethernet72", 
                "Ethernet73", 
                "Ethernet89", 
                "Ethernet88", 
                "Ethernet83", 
                "Ethernet82", 
                "Ethernet81", 
                "Ethernet61", 
                "Ethernet87", 
                "Ethernet86", 
                "Ethernet85", 
                "Ethernet84", 
                "Ethernet18", 
                "Ethernet19", 
                "Ethernet14", 
                "Ethernet15", 
                "Ethernet16", 
                "Ethernet17", 
                "Ethernet10", 
                "Ethernet11", 
                "Ethernet12", 
                "Ethernet13", 
                "Ethernet62", 
                "Ethernet69", 
                "Ethernet28", 
                "Ethernet50", 
                "Ethernet57", 
                "Ethernet51", 
                "Ethernet52", 
                "Ethernet53", 
                "Ethernet54", 
                "Ethernet55", 
                "Ethernet58", 
                "Ethernet59", 
                "Ethernet56"
            ]
        }, 
        "Vlan777": {
            "description": "pvlan", 
            "dhcp_servers": [
                "10.222.72.116"
            ], 
            "vlanid": "777", 
            "mtu": "9216", 
            "admin_status": "up", 
            "members": [
                "Ethernet9", 
                "Ethernet2", 
                "Ethernet8", 
                "Ethernet27", 
                "Ethernet14", 
                "Ethernet35", 
                "Ethernet91", 
                "Ethernet64", 
                "Ethernet82", 
                "Ethernet67", 
                "Ethernet66", 
                "Ethernet57"
            ]
        }
    }, 
    "ACL_TABLE": {
        "V6-ACL-TBLE": {
            "type": "L3V6", 
            "policy_desc": "V6-ACL-TBLE", 
            "ports": [
                "Ethernet76", 
                "Ethernet77", 
                "Ethernet74", 
                "Ethernet75", 
                "Ethernet72", 
                "Ethernet73", 
                "Ethernet70", 
                "Ethernet71", 
                "Ethernet78", 
                "Ethernet79", 
                "Ethernet65", 
                "Ethernet64", 
                "Ethernet67", 
                "Ethernet72", 
                "Ethernet86", 
                "Ethernet85", 
                "Ethernet84"
            ]
        }, 
        "V4-ACL-TABLE": {
            "type": "L3", 
            "policy_desc": "V4-ACL-TABLE", 
            "ports": [
                "Ethernet76", 
                "Ethernet77", 
                "Ethernet74", 
                "Ethernet75", 
                "Ethernet84"
            ]
        }
    }, 
    "INTERFACE": {
        "Ethernet118|10.184.231.211/31": {
            "scope": "global", 
            "family": "IPv4"
        }, 
        "Ethernet118|2a04:5555:40:a7c9::2/126": {
            "scope": "global", 
            "family": "IPv6"
        }, 
        "Ethernet116|10.184.230.211/31": {
            "scope": "global", 
            "family": "IPv4"
        }, 
        "Ethernet112|10.184.228.211/31": {
            "scope": "global", 
            "family": "IPv4"
        }, 
        "Ethernet112|2a04:5555:40:a709::2/126": {
            "scope": "global", 
            "family": "IPv6"
        }, 
        "Ethernet114|10.184.229.211/31": {
            "scope": "global", 
            "family": "IPv4"
        }, 
        "Ethernet116|2a04:5555:40:a789::2/126": {
            "scope": "global", 
            "family": "IPv6"
        }, 
        "Ethernet114|2a04:5555:40:a749::2/126": {
            "scope": "global", 
            "family": "IPv6"
        }
    }, 
    "VLAN_MEMBER": {
        "Vlan111|Ethernet4": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet5": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet6": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet0": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet1": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet2": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet3": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet29": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet30": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet31": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet32": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet33": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet34": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet35": {
            "tagging_mode": "untagged"
        }, 
        "Vlan111|Ethernet36": {
            "tagging_mode": "untagged"
        }
    }, 
    "PORT": {
        "Ethernet35": {
            "alias": "Eth9/4", 
            "lanes": "52", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet8": {
            "alias": "Eth3/1", 
            "lanes": "73", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet9": {
            "alias": "Eth3/2", 
            "lanes": "74", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet2": {
            "alias": "Eth1/3", 
            "lanes": "67", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet3": {
            "alias": "Eth1/4", 
            "lanes": "68", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet0": {
            "alias": "Eth1/1", 
            "lanes": "65", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet1": {
            "alias": "Eth1/2", 
            "lanes": "66", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet6": {
            "alias": "Eth2/3", 
            "lanes": "71", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet7": {
            "alias": "Eth2/4", 
            "lanes": "72", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet4": {
            "alias": "Eth2/1", 
            "lanes": "69", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet5": {
            "alias": "Eth2/2", 
            "lanes": "70", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet18": {
            "alias": "Eth5/3", 
            "lanes": "35", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet19": {
            "alias": "Eth5/4", 
            "lanes": "36", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet14": {
            "alias": "Eth4/3", 
            "lanes": "79", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet15": {
            "alias": "Eth4/4", 
            "lanes": "80", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet16": {
            "alias": "Eth5/1", 
            "lanes": "33", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet17": {
            "alias": "Eth5/2", 
            "lanes": "34", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet10": {
            "alias": "Eth3/3", 
            "lanes": "75", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet11": {
            "alias": "Eth3/4", 
            "lanes": "76", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet12": {
            "alias": "Eth4/1", 
            "lanes": "77", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet13": {
            "alias": "Eth4/2", 
            "lanes": "78", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet32": {
            "alias": "Eth9/1", 
            "lanes": "49", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet33": {
            "alias": "Eth9/2", 
            "lanes": "50", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet112": {
            "alias": "Eth29/1", 
            "lanes": "113,114", 
            "description": "50G|dccsw01.nw|Eth18", 
            "fec": "fc"
        }, 
        "Ethernet30": {
            "alias": "Eth8/3", 
            "lanes": "47", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet31": {
            "alias": "Eth8/4", 
            "lanes": "48", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet36": {
            "alias": "Eth10/1", 
            "lanes": "53", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet29": {
            "alias": "Eth8/2", 
            "lanes": "46", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet28": {
            "alias": "Eth8/1", 
            "lanes": "45", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet34": {
            "alias": "Eth9/3", 
            "lanes": "51", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet21": {
            "alias": "Eth6/2", 
            "lanes": "38", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet20": {
            "alias": "Eth6/1", 
            "lanes": "37", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet23": {
            "alias": "Eth6/4", 
            "lanes": "40", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet22": {
            "alias": "Eth6/3", 
            "lanes": "39", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet25": {
            "alias": "Eth7/2", 
            "lanes": "42", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet24": {
            "alias": "Eth7/1", 
            "lanes": "41", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet27": {
            "alias": "Eth7/4", 
            "lanes": "44", 
            "description": "", 
            "speed": "11100"
        }, 
        "Ethernet26": {
            "alias": "Eth7/3", 
            "lanes": "43", 
            "description": "", 
            "speed": "11100"
        }
    }
}

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

This is temp PR, At last this code will be merged in PLY.
@praveen-li
Copy link
Collaborator Author

I will raise the same on top of PR 10.

@praveen-li praveen-li closed this Nov 20, 2019
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Feb 9, 2021
* [submodule] update sonic-linux-kernel (sonic-net#2985)
* Fix many version strings
* Update minor version
* Update arista-drivers submodule (zhenggen-xu#9)
* Rebuild SDK on new kernel (zhenggen-xu#10)
li-pingmao pushed a commit to li-pingmao/sonic-buildimage that referenced this pull request Feb 23, 2022
* [BFN] Updated platform APIs impl

Signed-off-by: Andriy Kokhan <[email protected]>

* Extended BFN platform SFP APIs implementation

* Update sfp.py

* [BFN] Extended SFP platform plugin implementation

Signed-off-by: Andriy Kokhan <[email protected]>

* [BFN] Extended Fans platform plugin implementation

* [BFN] divided classes Fan and  FanDrawer into 2 files

* Signed-off-by: Vadym Yashchenko <[email protected]>

What I did
	Add get_model() function
	Add get_low_critical_threshold() function
	Change __get(...) function.
How I did it
	Differnece from previous implementation of __get(...) function is return real value or -9999.9 if value is not provided by thrift API

* Add get_presence() function and revised __get() function

Signed-off-by: Vadym Yashchenko <[email protected]>

* [BFN] Updated PSU platform APIs impl

Signed-off-by: Dmytro Lytvynenko <[email protected]>

* Added BFN PSU cache (zhenggen-xu#9)

Signed-off-by: Andriy Kokhan <[email protected]>

* [BFN]  Fans and Fantray platform APIs update (zhenggen-xu#7)

* [BFN] Updated SFP platform APIs (zhenggen-xu#10)

Signed-off-by: Volodymyr Boyko <[email protected]>

* [BFN] Updated platform API for thermal (zhenggen-xu#8)

* Signed-off-by: Vadym Yashchenko <[email protected]>

* Revert "[BFN]  Fans and Fantray platform APIs update (zhenggen-xu#7)" (zhenggen-xu#11)

This reverts commit c62a733.

* Add support health monitor system (zhenggen-xu#15)

Signed-off-by: Petro Bratash <[email protected]>

* Update chassis.py

* [BFN] Updated FANs and FAN Tray platform API (zhenggen-xu#14)

* Fix fix_alignment (zhenggen-xu#17)

Signed-off-by: Petro Bratash <[email protected]>

* [BFN] Improvement show environment (zhenggen-xu#16)

* Added PSU temperature skip into platform.json (zhenggen-xu#18)

Signed-off-by: Andriy Kokhan <[email protected]>

* Do not skip psud on Newport

Signed-off-by: Andriy Kokhan <[email protected]>

* [BFN] fix fan status from Not OK to Ok (zhenggen-xu#19)

* [BFN] Updated SFP platform plugin (zhenggen-xu#13)

Signed-off-by: Volodymyr Boyko <[email protected]>

* [DPB] Fix typo for Ethernet0 2x200G[100G,40G] breakout mode (zhenggen-xu#21)

Signed-off-by: Mykola Gerasymenko <[email protected]>

* [barefoot] Tmp fix vendor_rev (zhenggen-xu#22)

Signed-off-by: Volodymyr Boyko <[email protected]>

* Fixed python issues in sonic_platform/fan_drawer.py

Signed-off-by: Andriy Kokhan <[email protected]>

* Updated fan_drawer.py

* Fixing trailing white spaces in fan_drawer.py

* [BFN] Fix thrift for SFPs API

Signed-off-by: Volodymyr Boyko <[email protected]>

* In platform.json, replaced 'false' with '0' to workaround ast.literal_eval() issue

Signed-off-by: Andriy Kokhan <[email protected]>

* [Newport] Thermal manager  (zhenggen-xu#23)

* Signed-off-by: Vadym Yashchenko <[email protected]>

* Revert "In platform.json, replaced 'false' with '0' to workaround ast.literal_eval() issue"

This reverts commit 1e73127.

* Removed 'controllable' options from platform.json to fix factory default config generation

Signed-off-by: Andriy Kokhan <[email protected]>

* Update thermal_manager.py

* Migrated SFP plugin to sonic_xcvr API (zhenggen-xu#30)

Signed-off-by: Andriy Kokhan <[email protected]>

Co-authored-by: KostiantynYarovyiBf <[email protected]>
Co-authored-by: Vadym Yashchenko <[email protected]>
Co-authored-by: Dmytro Lytvynenko <[email protected]>
Co-authored-by: Volodymyr Boiko <[email protected]>
Co-authored-by: Petro Bratash <[email protected]>
Co-authored-by: Mykola Gerasymenko <[email protected]>
li-pingmao pushed a commit to li-pingmao/sonic-buildimage that referenced this pull request Feb 23, 2022
[sonic-linkmgrd][master] submodule update

Commits added:
0c23756 Jing Zhang      2022-01-19      Linkmgrd subscribing State DB route event  (zhenggen-xu#13)
12b9951 Longxiang Lyu   2021-12-13      Add TLV support to ICMP payload (zhenggen-xu#11)
3eedda3 Longxiang Lyu   2022-01-06      Add missing intermediate states (zhenggen-xu#16)
8da4982 Ying Xie        2022-01-04      [linkmgrd] update README, set coding style guidance (zhenggen-xu#15)
a897cf8 Longxiang Lyu   2021-12-13      Improve PR template (zhenggen-xu#16)
6fec701 Jing Zhang      2021-12-06      Add pull request template for linkmgrd repo (zhenggen-xu#9)


signed-off-by: Jing Zhang [email protected]
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Oct 27, 2022
#### Why I did it
Update sonic-host-services submodule to include below commits:
```
bc8698d Merge pull request zhenggen-xu#21 from abdosi/feature
557a110 Fix the issue where if dest port is not specified in ACL rule than for multi-asic where we create NAT rule to forward traffic from Namespace to host fail with exception.
6e45acc (master) Merge pull request zhenggen-xu#14 from abdosi/feature
4d6cad7 Merge remote-tracking branch 'upstream/master' into feature
bceb13e Install libyang to azure pipeline (zhenggen-xu#20)
82299f5 Merge pull request zhenggen-xu#13 from SuvarnaMeenakshi/cacl_fabricns
15d3bf4 Merge branch 'master' into cacl_fabricns
de54082 Merge pull request zhenggen-xu#16 from ZhaohuiS/feature/caclmgrd_external_client_warning_log
b4b368d Add warning log if destination port is not defined
d4bb96d Merge branch 'master' into cacl_fabricns
35c76cb Add unit-test and fix typo.
17d44c2 Made Changes to be Python 3.7 compatible
978afb5 Aligning Code
1fbf8fb Merge remote-tracking branch 'upstream/master' into feature
7b8c7d1 Added UT for the changes
91c4c42 Merge pull request zhenggen-xu#9 from ZhaohuiS/feature/caclmgrd_external_client
7c0b56a Add 4 test cases for external_client_acl, including single port and port range for ipv4 and ipv6
b71e507 Merge remote-tracking branch 'origin/master' into HEAD
d992dc0 Merge branch 'master' into feature/caclmgrd_external_client
bd7b172 DST_PORT is configuralbe in json config file for EXTERNAL_CLIENT_ACL
f9af7ae [CLI] Move hostname, mgmt interface/vrf config to hostcfgd (zhenggen-xu#2)
70ce6a3 Merge pull request zhenggen-xu#10 from sujinmkang/cold_reset
29be8d2 Added Support to render Feature Table using Device running metadata. Also added support to render 'has_asic_scope' field of Feature Table.
3437e35 [caclmgrd][chassis]: Add ip tables rules to accept internal docker traffic from fabric asic namespaces.
8720561 Fix and add hardware reboot cause determination tests
0dcc7fe remove the empty bracket if no hardware reboot cause minor
e47d831 fix the wrong expected result comparision
ef86b53 Fix startswith Attribute error
8a630bb fix mock patch
8543ddf update the reboot cause logic and update the unit test
53ad7cd fix the mock patch function
7c8003d fix the reboot-cause regix for test
1ba611f fix typo
25379d3 Add unit test case
a56133b Add hardware reboot cause as actual reboot cause for soft reboot failed
c7d3833 Support Restapi/gnmi control plane acls
f6ea036 caclmgrd: Don't block traffic to mgmt by default
a712fc4 Update test cases
adc058b caclmgrd: Don't block traffic to mgmt by default
06ff918 Merge pull request zhenggen-xu#7 from bluecmd/patch-1
e3e23bc ci: Rename sonic-buildimage repository
e83a858 Merge pull request zhenggen-xu#4 from kamelnetworks/acl-ip2me-test
f5a2e50 [caclmgrd]: Tests for IP2ME rules generation
```
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Dec 23, 2022
[sonic-linkmgrd][master] submodule update

Commits added:
0c23756 Jing Zhang      2022-01-19      Linkmgrd subscribing State DB route event  (zhenggen-xu#13)
12b9951 Longxiang Lyu   2021-12-13      Add TLV support to ICMP payload (zhenggen-xu#11)
3eedda3 Longxiang Lyu   2022-01-06      Add missing intermediate states (zhenggen-xu#16)
8da4982 Ying Xie        2022-01-04      [linkmgrd] update README, set coding style guidance (zhenggen-xu#15)
a897cf8 Longxiang Lyu   2021-12-13      Improve PR template (zhenggen-xu#16)
6fec701 Jing Zhang      2021-12-06      Add pull request template for linkmgrd repo (zhenggen-xu#9)


signed-off-by: Jing Zhang [email protected]
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Dec 23, 2022
zhenggen-xu#9)

* CSCwa87284: Warm reboot changes for 3432D (iSAI0.107.6 + csaipd/platform debians + device files)

* CSCwd37098: Fix for traffic drop during warm reboot + latest device files

Signed-off-by: ankgoyal <[email protected]>
zhenggen-xu pushed a commit that referenced this pull request May 24, 2024
Why I did it
Advance dhcpmon to a3c5381 in 202305 branch.

a3c5381 - (HEAD, origin/master, origin/HEAD, master) Merge pull request src: Add libnl3 build.sh script #11 from jcaiMR/dev/jcai_fix_err_log (11 days ago) [StormLiangMS]
c5ef7e7 - Change common_libs dependencies from buster to bullseye (Updating docker-orchagent/syncd Dockerfile and start.sh #9)
824a144 - replace atoi with strtol (Rename hostname #6) (10 weeks ago) [Mai Bui]
32c0c3f - Fix libswsscommon package installation for non-amd64 (README.md leaves out docker-database #7) (10 weeks ago) [Saikrishna Arcot]
Work item tracking
Microsoft ADO (25048723):
How I did it
How to verify it
Run test_dhcp_relay.py, no failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant