proc EnableDisablePimInterfaceNgpf { routerId action } { # NOTE: Don't get this API confused with PIM "router ID" # This API enables/disables PIMv4 interfaaces # based on the router ID address. # # action = enable or disable if {$action == "enable"} { set action true } else { set action false } foreach topology [ixNet getList [ixNet getRoot] topology] { foreach deviceGroup [ixNet getList $topology deviceGroup] { foreach ethernet [ixNet getList $deviceGroup ethernet] { foreach ipv4 [ixNet getList $ethernet ipv4] { foreach pimInterface [ixNet getList $ipv4 pimV4Interface] { set listOfRouterIds [ixNet getAttribute $pimInterface -localRouterId] if {[lsearch $listOfRouterIds $routerId] != -1} { set routerIdIndex [expr [lsearch $listOfRouterIds $routerId] + 1] set activeMultiValue [ixNet getAttribute $pimInterface -active] puts "\nEnableDisablePimInterfaceNgpf: Setting PIM routerID $routerId to $action" if {[SetNgpfCounterMultiValue $activeMultiValue $routerIdIndex $action]} { return 1 } } } } } } } return 0 }