proc EnableDisablePimRouterIdNgpf { routerId action } { # NOTE: Don't get this API confused with PIM "Interface" # This API enables/disables PIMv4 router ID. # # 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 pimRouter [ixNet getList $deviceGroup pimRouter] { set listOfRouterIds [ixNet getAttribute $pimRouter -localRouterId] if {[lsearch $listOfRouterIds $routerId] != -1} { set routerIdIndex [expr [lsearch $listOfRouterIds $routerId] + 1] set activeMultiValue [ixNet getAttribute $pimRouter -active] puts "\nEnableDisablePimRouterIdNgpf: Setting PIM routerID $routerId to $action" if {[SetNgpfCounterMultiValue $activeMultiValue $routerIdIndex $action]} { return 1 } } } } } return 0 }