proc EnableDisableSuppressArp { ports action } { # Description: # This API will disable or enable # suppress ARP for duplicate gateway on one # port or a list of ports with ipv4. # # port = 1/1 format. Not 1/1/1 # You can pass in a list of ports also. # action = true or false or enable or disable # This API will take the port number and do a lookup # for its vport -name because suppressArp API goes # by the name of the port rather than the physical port. if {$action == "enable"} { set action true } else { set action false } set root [ixNet getRoot] set globals $root\globals set globalTopology $globals/topology set globalTopologyIpv4 $globalTopology/ipv4 foreach port $ports { set vport [GetVportMapping $port] set portName [ixNet getAttribute $vport -name] # This is a list of all the ports and its name description set portNameList [ixNet getAttribute $globalTopologyIpv4 -rowNames] # Get the multi-value number set multiValue [ixNet getAttribute $globalTopologyIpv4 -suppressArpForDuplicateGateway] # The portIndex is not zero-based. Begins with 1. set portIndex [expr [lsearch $portNameList $portName] + 1] puts "\nEnableDisableSuppressArp: Set to $action" if {[SetNgpfCounterMultiValue $multiValue $portIndex $action]} { return 1 } } return 0 }