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

Add Mcast Rule for Underlay and TRM #169

Merged
merged 5 commits into from
Jul 29, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class Rule:
id = "202"
description = "Verify Fabric Underlay Supports Multicast for TRM"
severity = "HIGH"

@classmethod
def match(cls, inventory):
results = []
fabric_replication = False
fabric_mcast_mode = False
fabric_trm = False

if inventory.get("vxlan", None):
if inventory["vxlan"].get("underlay", None):
if inventory["vxlan"].get("underlay").get("general", None):
fabric_replication = inventory["vxlan"]["underlay"]["general"].get("replication_mode", False)

if inventory["vxlan"].get("underlay").get("multicast", None):
fabric_mcast_mode = inventory["vxlan"]["underlay"]["multicast"].get("rp_mode", False)
fabric_trm = inventory["vxlan"]["underlay"]["multicast"].get("trm_enable", False)

if fabric_replication:
if ((fabric_replication == "multicast" and fabric_mcast_mode == "bidir" and fabric_trm) or
(fabric_replication == "ingress" and fabric_trm)):
results.append(
"For vxlan.underlay.multicast.trm_enable to be enabled, "
"vxlan.underlay.general.replication_mode must be set to multicast and "
"vxlan.underlay.multicast.rp_mode must be set to asm."
)

return results