proc PortConfigProtocolIntHlt { portConfigParams } { # Call this API if you are configuring protocols on the port. # You could also use this for scaling, but using this API # will take up a lot of resource. # For scaling, it is better to use PortConfigStaticIp. # How to use this from a script: # set port 1/1/3 # set portConfig($port1,-mode) config # set portConfig($port1,-intf_ip_addr) 1.1.1.1 # set portConfig($port1,-connected_count) 1 # set portConfig($port1,-gateway) 1.1.1.2 # set portConfig($port1,-gateway_step) 0.0.0.0 # set portConfig($port1,-netmask) 255.255.255.0 # set portConfig($port1,-src_mac_addr) "0001.0101.0001" # set portConfig($port1,-src_mac_addr_step) 0000.0000.0001 # set portConfig($port1,-l23_config_type) static_endpoint # set portConfig($port1,-mtu) 1500 # set portConfig($port1,-vlan_id) 300 # set portConfig($port1,-vlan_id_count) 1 # set portConfig($port1,-vlan) 0 # set portConfig($port1,-vlan_id_step) 1 # set endpoint($port) [PortConfigProtocolIntHlt $port ::portConfig] # # For scaling: # You have to create a list like below and the list must align # with each list's index accordlingly. # # ports = {1/1/1 1/1/1 1/1/1} # # ipList = {1.1.1.1 1.1.1.2 1.1.1.3} # # gatewayList = {1.1.1.4 1.1.1.5 1.1.1.6} # # vlanList = {1001 1002 1003} # # macList = {same as above} upvar $portConfigParams params puts "\nPortConfigProtocolIntHlt: $port" foreach {properties values} [array get params $port,*] { set property [lindex [split $properties ,] end] append paramList "$property $values " } set interfaceConfigStatus [eval ::ixia::interface_config $paramList] if {[keylget interfaceConfigStatus status] != $::SUCCESS} { puts "\nError PortConfigProtocolInt:\n$interfaceConfigStatus\n" return 1 } # interface object = ::ixNet::OBJ-/vport:1/interface:1 set interfaceHandle [keylget interfaceConfigStatus interface_handle] return $interfaceHandle }