proc EnableTrafficItem { trafficItemName {disable true} } { foreach trafficItem [ixNet getList [ixNet getRoot]traffic trafficItem] { set currentTiName [ixNet getAttribute $trafficItem -name] if {$trafficItemName == $currentTiName} { puts "\nEnableTrafficItem: $trafficItemName\n" puts "[ixNet getAttribute $trafficItem -enabled]" ixNet setAttribute $trafficItem -enabled $disable ixNet commit return } } # Return 0 if Traffic Item is not found return 0 } isy chained chassis, port format must be $ixiaChassisIp1/1 # For -vlanId parameter: # Currently, you can only pass in one vlan ID for a single port or for # the list of ports. set argIndex 0 while {$argIndex < [llength $args]} { set currentArg [lindex $args $argIndex] switch -exact -- $currentArg { -port { # For a single chassis, port format can be 1/1/1 or $ixiaChassisIp/1/1 # For a daisy chained chassis, port format must be $ixiaChassisIp/1/1 set port [lindex $args [expr $argIndex + 1]] set portList {} foreach p $port { set port [join [lrange [split $p /] 1 end] /] lappend portList $port } incr argIndex 2 } -vlanId { set vlanId [lindex $args [expr $argIndex + 1]] incr argIndex 2 } default { puts "\nError GetProtocolIntObjects: No such parameter: $currentArg" return 1 } } } set interfaceObjList {} foreach vport [ixNet getList [ixNet getRoot] vport] { set currentPort [ixNet getAttribute $vport -assignedTo] set chassis [lindex [split $currentPort :] 0] set card [lindex [split $currentPort :] 1] set portNumber [lindex [split $currentPort :] 2] if {[lsearch $portList "$card/$portNumber"] != -1 || [lsearch $portList "$chassis/$card/$portNumber"] != -1} { # Get all the interface objects for the current $card/$portNumber. # Because a port can have a large scale of interfaces. foreach interface [ixNet getList $vport interface] { if {[info exists vlanId] == 0} { lappend interfaceObjList $interface } # User can bind a vlanID to a port. if {[info exists vlanId] == 1} { set currentVlanId [ixNet getAttribute $interface/vlan -vlanId] if {$vlanId == $currentVlanId} { lappend interfaceObjList $interface } } } } } if {$interfaceObjList != ""} { return $interfaceObjList } else { return 0 } }