diff --git a/dep/tclclient.tgz b/dep/tclclient.tgz
deleted file mode 100644
index 96038ffcbf3bef07fab73fc6348c5b6caa73d28a..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/dep/tclclient/IxiaWish.tcl b/dep/tclclient/IxiaWish.tcl
new file mode 100644
index 00000000..9c70420c
--- /dev/null
+++ b/dep/tclclient/IxiaWish.tcl
@@ -0,0 +1,133 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# IxiaWish.tcl sets up the Tcl environment to use the correct multiversion-compatible 
+# applications, as specified by Application Selector.
+
+# Note: this file must remain compatible with tcl 8.3, because it will be sourced by scriptgen
+namespace eval ::ixiaInstall:: {
+    # For debugging, you can point this to an alternate location.  It should
+    # point to a directory that contains the "TclScripts" subdirectory.
+    set tclDir		"/root"
+
+    # For debugging, you can point this to an alternate location.  It should
+    # point to a directory that contains the IxTclHal.dll
+	set ixosTclDir	"/root"
+
+    set tclLegacyDir [file join $tclDir "../.."]
+
+    # Calls appinfo to add paths to IxOS dependencies (such as IxLoad or IxNetwork).
+    proc ixAddPathsFromAppinfo {installdir} {
+        package require registry
+        
+        set installInfoFound false
+        foreach {reg_path} [list "HKEY_LOCAL_MACHINE\\SOFTWARE\\Ixia Communications\\AppInfo\\InstallInfo" "HKEY_CURRENT_USER\\SOFTWARE\\Ixia Communications\\AppInfo\\InstallInfo"] {
+            if { [ catch {registry get $reg_path "HOMEDIR"} r] == 0 } {
+                set appinfo_path $r
+                set installInfoFound true
+                break
+            }
+        }
+        # If the registy information was not found in either place, warn the user
+        if { [string equal $installInfoFound "false"] } {        
+            return -code error "Could not find AppInfo registry entry"
+        }   
+         
+        # Call appinfo to get the list of all dependencies:
+        regsub -all "\\\\" $appinfo_path "/" appinfo_path      
+        set appinfo_executable [file attributes "$appinfo_path/Appinfo.exe" -shortname]
+        set appinfo_command "|$appinfo_executable --app-path \"$installdir\" --get-dependencies"
+        set appinfo_handle [open $appinfo_command r+ ]
+        set appinfo_session {}
+
+        while { [gets $appinfo_handle line] >= 0 } {
+            # Keep track of the output to report in the error message below
+            set appinfo_session "$appinfo_session $line\n"
+            
+            regsub -all "\\\\" $line "/" line
+            regexp "^(.+):\ (.*)$" $line all app_name app_path
+            # If there is a dependency listed, add the path.
+            if {![string equal $app_path ""] } {
+                # Only add it if it's not already present:
+                if { -1 == [lsearch -exact $::auto_path $app_path ] } {
+                    lappend ::auto_path $app_path
+                    lappend ::auto_path [file join $app_path "TclScripts/lib"]
+                    append ::env(PATH) [format ":%s" $app_path]                    
+                }
+            }
+        }
+        
+        # If appinfo returned a non-zero result, this catch block will trigger.
+        # In that case, show what we tried to do, and the resulting response.
+        if { [catch {close $appinfo_handle} r] != 0} {
+            return -code error "Appinfo error, \"$appinfo_command\" returned: $appinfo_session"
+        }        
+    }
+
+    # Adds all needed Ixia paths
+    proc ixAddPaths {installdir} {
+        set ::env(IXTCLHAL_LIBRARY) [file join $installdir "ixTcl1.0"]
+        set ::env(IXIA_VERSION) "6.20" 
+        lappend ::auto_path $installdir
+        #lappend ::auto_path [file join $installdir "TclScripts/lib"]
+        lappend ::auto_path [file join $installdir "ixTcl1.0"]
+        #if { [catch {::ixiaInstall::ixAddPathsFromAppinfo $installdir} result] } {
+            # Not necessarily fatal
+        #    puts [format "WARNING!!! Unable to add paths from Appinfo: %s" $result]
+        #}
+        append ::env(PATH) ":${installdir}"
+        
+        # Fall back to the old locations, in case a non-multiversion-aware 
+        # IxLoad or IxNetwork is installed.
+        #lappend ::auto_path [file join $installdir "../../TclScripts/lib"]
+        #append ::env(PATH) [format ";%s" [file join $installdir "../.."]]
+
+	#	if {![string equal $::ixiaInstall::tclDir $::ixiaInstall::ixosTclDir]} {
+	#		append ::env(PATH) [format ";%s" $::ixiaInstall::ixosTclDir]
+	#	}			
+    }
+}
+::ixiaInstall::ixAddPaths $::ixiaInstall::tclDir
+
+catch {
+    # Try to set things up for Wish.  
+    # This section will not run in IxExplorer or IxTclInterpreter, hence the catch block.
+    if {[lsearch [package names] "Tk"] >= 0} {
+        console show
+        wm iconbitmap . [file join $::ixiaInstall::tclDir "ixos.ico"]
+        
+        # It is not easy to tell ActiveState wish from the Ixia-compiled wish.
+        # The tcl_platform variable shows one difference: ActiveState implements threading
+        if {![info exists ::tcl_platform(threaded)]} {           
+            # Activestate prints this on its own, otherwise, we add it here:
+            puts -nonewline "(TclScripts) 1 % "
+        }        
+    }
+}
diff --git a/dep/tclclient/ixTcl1.0/Dap/dapconfiguration.tcl b/dep/tclclient/ixTcl1.0/Dap/dapconfiguration.tcl
new file mode 100644
index 00000000..3122079b
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Dap/dapconfiguration.tcl
@@ -0,0 +1,217 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 5.20
+#   
+#   File: dapconfiguration.tcl
+#
+#   This file contains the configuration parameters for running ixDapConfig::main.
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	11-14-02	Debby Stopp
+#
+########################################################################################
+
+source ixDapConfig.tcl
+logOn ixDapConfig.log
+
+##
+#  Application name
+#       Need to set the exact name of the application to be downloaded to each port
+##
+set applicationName      ""
+
+
+##
+#  Startup procedure/executable
+#       If there's a startup procedure that needs to be excuted after downloading, put the name
+#       of that executable here. The entire patch to the executable must be specified in the startupProcedureExe.
+#       No action taken if variable is set to ""
+##
+set startupProcedureExe  ""
+
+
+##
+#  Specify login name to use for taking ownership of ports.
+#  Ownership is *mandatory* for this application.
+##
+ixDapLogin "ixDapConfig"
+
+
+##
+# Chassis list
+#    Put chassis ip OR DNS host name; put in order of usage.
+#    First chassis == ID 1, second chassis == ID 2, etc... 
+##
+ixDapConfig::setChassisList {loopback}
+
+
+##
+# Port array & ip stuff - Configure port interface details 
+#                         <portId, macAddress, ipAddress, gateway, mask, enableVlan, vlanId>
+#   NOTE: 
+#       portID == {<chassisID> <cardID> <portID>}
+##
+ixDapAddPortInterface   -portId         {1 1 1} \
+                        -macAddress     "00 de bb 01 01 01" \
+                        -ipAddress      "198.18.1.100" \
+                        -gateway        "198.18.1.1" \
+                        -mask           "255.255.255.0" \
+                        -enableVlan     false \
+                        -vlanId         101
+
+ixDapAddPortInterface   -portId         {1 1 1} \
+                        -macAddress     "00 de bb 01 02 01" \
+                        -ipAddress      "198.18.2.100" \
+                        -gateway        "198.18.2.1" \
+                        -mask           "255.255.255.0" \
+                        -enableVlan     false \
+                        -vlanId         101
+
+ixDapAddPortInterface   -portId         {1 1 1} \
+                        -macAddress     "00 de bb 01 03 01" \
+                        -ipAddress      "198.18.3.100" \
+                        -gateway        "198.18.3.1" \
+                        -mask           "255.255.255.0" \
+                        -enableVlan     false \
+                        -vlanId         101
+
+ixDapAddPortInterface   -portId         {1 1 2} \
+                        -macAddress     "00 de bb 01 01 02" \
+                        -ipAddress      "198.18.1.102" \
+                        -gateway        "198.18.1.1" \
+                        -mask           "255.255.255.0" \
+                        -enableVlan     true \
+                        -vlanId         102
+
+ixDapAddPortInterface   -portId         {1 1 3} \
+                        -macAddress     "00 de bb 01 01 03" \
+                        -ipAddress      "198.18.1.103" \
+                        -gateway        "198.18.1.1" \
+                        -mask           "255.255.255.0" \
+                        -enableVlan     false \
+                        -vlanId         103
+
+ixDapAddPortInterface   -portId         {1 1 4} \
+                        -macAddress     "00 de bb 01 01 04" \
+                        -ipAddress      "198.18.1.104" \
+                        -gateway        "198.18.1.1" \
+                        -mask           "255.255.255.0" \
+                        -enableVlan     false \
+                        -vlanId         104
+
+
+##
+#  Config test network topology - Add route table details 
+#                         <portId, target(net or host), ipAddress, gateway, mask>
+##
+ixDapAddRouteTable      -portId         {1 1 1} \
+                        -target         "net" \
+                        -ipAddress      "198.20.0.0" \
+                        -gateway        "198.18.2.1" \
+                        -mask           "255.255.0.0"
+
+ixDapAddRouteTable      -portId         {1 1 1} \
+                        -target         "host" \
+                        -ipAddress      "198.20.1.100" \
+                        -gateway        "198.18.3.1" \
+                        -mask           "255.255.255.255"
+
+##
+#  Config port filter - Add port filter details 
+#                       <reset, port list, action, filter type, type valueList>
+##
+ixDapAddPortFilter      -reset      true \
+                        -portList   {{1 1 1} {1 1 2}} \
+                        -action     "enable" \
+                        -type       "ip-protocols" \
+                        -valueList  {4 17}
+
+ixDapAddPortFilter      -reset      false \
+                        -portList   {{1 1 1}} \
+                        -action      "disable" \
+                        -type       "udp-ports" \
+                        -valueList  {22-23 25}
+
+ixDapAddPortFilter      -reset      false \
+                        -portList   {{1 1 1}} \
+                        -action      "enable" \
+                        -type       "tcp-ports" \
+                        -valueList  {22-23 25}
+
+##
+# alternatively, set port list via loop:
+##
+#set firstChassisId   1
+#set lastChassisId    1
+#set firstCardId      3
+#set lastCardId       3
+#set firstPortId      5
+#set lastPortId       8
+#set ipAddress        "198.18.1.100"
+#set gateway          "198.18.1.1"
+#set mask             "255.255.255.0"
+#set incrSubnetByte   3
+#
+#for {set chassis $firstChassisId} {$chassis <= $lastChassisId} {incr chassis} {
+#    for {set card $firstCardId} {$card <= $lastCardId} {incr card} {
+#        for {set port $firstPortId} {$port <= $lastPortId} {incr port} {
+#            set macAddress [format "00 de bb %02x %02x %02x" $chassis $card $port]
+#            ixDapConfigPort $chassis $card $port $macAddress $ipAddress $gateway $mask
+#            set ipAddress [incrIpField $ipAddress $incrSubnetByte]
+#            set gateway   [incrIpField $gateway   $incrSubnetByte]
+#        }
+#    }
+#}
+
+#########################################################################################
+# end of user configuration stuff
+########################################################################################
+
+########################################################################################
+# execute config/download app here
+########################################################################################
+if {![ixDapConfig::main -appName $applicationName]} {
+    if {$startupProcedureExe != ""} {
+        if [catch {exec $startupProcedureExe &} error] {
+            logMsg $error
+        }
+    }
+
+    logMsg "\n*** Setup now complete!!! ***"
+}
+
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Dap/ixDapConfig.tcl b/dep/tclclient/ixTcl1.0/Dap/ixDapConfig.tcl
new file mode 100644
index 00000000..7971be46
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Dap/ixDapConfig.tcl
@@ -0,0 +1,1702 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 5.20
+#   
+#   File: ixDapConfig.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	11-14-02	Debby Stopp
+#
+########################################################################################
+
+package req IxTclServices
+
+namespace eval ixDapConfig {
+    variable chassisList
+    variable tclServer   ""
+    variable userName    "ixDapConfig"
+           
+    variable appName
+    variable defaultPortGroupId 1126
+
+    if [info exists interfaceArray] {
+        unset interfaceArray
+    }    
+    variable interfaceArray
+    variable interfacePortIdIndex       0 
+    variable interfaceMacAddressIndex   1 
+    variable interfaceIpAddressIndex    2
+    variable interfaceGwIndex           3
+    variable interfaceMaskIndex         4
+    variable interfaceEnableVlanIndex   5
+    variable interfaceVlanIdIndex       6
+
+    if [info exists routeArray] {
+        unset routeArray
+    }
+    variable routeArray
+    variable routePortIdIndex           0
+    variable routeTargetIndex           1 
+    variable routeIpAddressIndex        2 
+    variable routeGwIndex               3
+    variable routeMaskIndex             4
+
+    if [info exists filterArray] {
+        unset filterArray
+    }
+    variable filterArray
+    variable filterResetIndex           0
+    variable filterPortListIndex        1 
+    variable filterActionIndex          2 
+    variable filterTypeIndex            3
+    variable filterValueListIndex       4
+
+    variable logCmd    logMsg
+    variable errorCmd  errorMsg
+}
+
+proc ixDapConfigPort {chassis card port macAddress ipAddress gateway mask {enableVlan false} {vlanId 0}} \
+{
+    set retCode [ixDapAddPortInterface -portId [list $chassis $card $port] -macAddress $macAddress \
+                 -ipAddress $ipAddress -gateway $gateway -mask $mask  -enableVlan $enableVlan -vlanId $vlanId]
+    return $retCode
+}
+
+proc ixDapAddPortInterface {args} \
+{
+    set retCode [::ixDapConfig::addInterfaceToArray $args]
+    return $retCode
+}
+
+proc ixDapAddRouteTable {args} \
+{
+    set retCode [::ixDapConfig::addRouteToArray $args]
+    return $retCode
+}
+
+proc ixDapAddPortFilter {args} \
+{
+    set retCode [::ixDapConfig::addFilterToArray $args]
+    return $retCode
+}
+
+proc ixDapBaseIpAddresses {args} \
+{
+    set retCode $::TCL_ERROR
+    if {[ixConnectToChassis $args] == $::TCL_OK} {
+        set retCode [::ixDapConfig::validateBaseIpAddresses $args]
+    }
+
+    return $retCode
+}
+
+proc ixDapCleanUp       {}                                         {return [::ixDapConfig::cleanUp]}
+proc ixDapSetBaseIp     {chassisName ipAddress {mask 255.255.0.0}} {return [::ixDapConfig::setBaseIp $chassisName $ipAddress $mask]}
+proc ixDapAddRoute      {destination mask interface}               {return [::ixDapConfig::addRoute  $destination $mask $interface]}
+proc ixDapDelRoute      {destination}                              {return [::ixDapConfig::delRoute  $destination]}
+
+proc ixDapLogin         {userName}                                 {return [::ixDapConfig::login $userName]}
+
+proc ixDapConfig::Log {msg} {
+    variable logCmd; eval [concat $logCmd [list $msg]]
+}
+proc ixDapConfig::Error {msg} { 
+    variable errorCmd; eval [concat $errorCmd [list $msg]] 
+}
+
+
+########################################################################
+# Procedure: init
+#
+# This initializes the ixDapConfig namespace
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::init {{appName ""}} \
+{
+    set retCode $::TCL_OK
+
+    if {$appName != ""} {
+        setAppName $appName
+    } else {
+        set retCode $::TCL_ERROR
+        Error "No application name configured - check \"applicationName\""
+    } 
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: login
+#
+# This procedure logins the current user name; login will be enforced
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::login {{newUserName "ixDapConfig"}} \
+{
+    variable userName
+
+    if {$newUserName != ""} {
+        set userName $newUserName
+    }
+    ixLogin $userName
+}
+
+
+########################################################################
+# Procedure: printVersion
+#
+# This prints version info
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::printVersion {} \
+{
+    set versionString [format "\n\t%s\n\t%s\n\t%s\n\n" \
+                              [version cget -installVersion] \
+                              [version cget -productVersion] \
+                              [version cget -copyright] ]
+    Log $versionString
+}
+
+
+########################################################################
+# Procedure: viewRoutes
+#
+# This procedure prints the current route config "route print"
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::viewRoutes {baseIpAddressList} \
+{
+    set routeWindow .routeWindow
+
+    # we need to create a new one
+    if [winfo exists $routeWindow] {
+        catch {::destroy $routeWindow}
+    }
+
+    toplevel $routeWindow -class Dialog
+    wm withdraw $routeWindow
+    wm title $routeWindow "Route View"
+    wm resizable $routeWindow 0 0
+
+    set routeText [exec route print]
+    set height    [regsub -all "\n" $routeText "\n" temp]
+    set width     [string length [lindex $routeText 0]]
+
+    set routeTextBox [createViewFrame $baseIpAddressList .routeWindow $height $width]
+    
+    $routeTextBox insert end $routeText
+
+    wm deiconify $routeWindow
+}
+
+
+########################################################################
+# Procedure: addRoute
+#
+# This procedure adds a route config "route add"
+#
+# Arguments(s):
+#   destination - destination ip address, ie., 10.0.0.0
+#   mask        - associated mask, ie., 255.255.0.0
+#   interface   - to route through
+#
+########################################################################
+proc ixDapConfig::addRoute {destination mask interface} \
+{
+    set retCode $::TCL_OK
+
+    catch {exec route delete $destination}
+    if [catch {exec route add -p $destination mask $mask $interface} error] {
+        Log $error
+        set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: delRoute
+#
+# This procedure deletes a route config "route delete"
+#
+# Arguments(s):
+#   destination - destination ip address, ie., 10.0.0.0
+#
+########################################################################
+proc ixDapConfig::delRoute {destination} \
+{
+    set retCode $::TCL_OK
+
+    catch {exec route delete $destination}
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure:    ixDapConfig::createViewFrame
+#
+# Description:  Create frame for viewing stuff
+#
+# Arguments:    none
+#
+# Returns:      TCL_OK:     success
+#
+##################################################################################
+proc ixDapConfig::createViewFrame { baseIpAddressList parent {height 25} {width 80} {xpad 3} {ypad 2}} \
+{
+    
+    option add *font ansi
+    incr width $xpad
+    incr height $ypad
+
+    set width  [expr ($width < 80)  ? $width : 80]
+    set height [expr ($height < 50) ? $height : 50]
+
+    set labelFrame [frame $parent.routeViewFrame] 
+    set infoLabelFrame $labelFrame
+
+    grid $labelFrame     -row 0 -column 0 -padx 0 -pady 10 -sticky w
+
+    set numBaseIp [llength $baseIpAddressList]
+    if {$numBaseIp <= 1} {
+        set text1 "The Ixia port's management address is"
+        set text2 "Please ensure that your PC has a route to this network."
+    } else {
+        set text1 "The Ixia ports' management addresses are"
+        set text2 "Please ensure that your PC has routes to these networks."
+    }
+
+    set labelIndex 0
+    set infoLabel$labelIndex \
+        [label $labelFrame.infoLabel$labelIndex -text $text1 -font {ansi 8} -width 92]
+    grid [set infoLabel$labelIndex] -row $labelIndex -column 0 -padx 6 -pady 0  -sticky w
+
+    foreach baseIp $baseIpAddressList {
+        incr labelIndex        
+        set infoLabel$labelIndex \
+            [label $labelFrame.infoLabel$labelIndex -text "\t - $baseIp/16" -font {ansi 8} -width 92]
+        grid [set infoLabel$labelIndex] -row $labelIndex -column 0 -padx 6 -pady 0  -sticky w
+    }
+
+    incr labelIndex
+    set infoLabel$labelIndex \
+        [label $labelFrame.infoLabel$labelIndex -text $text2 -font {ansi 8} -width 92]
+    grid [set infoLabel$labelIndex] -row $labelIndex -column 0 -padx 6 -pady 0  -sticky w
+
+    set routeFrame [frame $parent.routeFrame]
+
+    # Create a list widget to contain all the route
+    set widgets(routeText) [text $routeFrame.routeText \
+            -height $height -width $width -wrap none -font {courier 8} -xscrollcommand "$routeFrame.xScroll set" \
+            -yscrollcommand "$routeFrame.yScroll set"]
+
+    set xScroll [scrollbar $routeFrame.xScroll -orient horizontal \
+            -command "$widgets(routeText) xview"]
+    set yScroll [scrollbar $routeFrame.yScroll -orient vertical \
+            -command "$widgets(routeText) yview"]
+
+    grid $widgets(routeText) -row 1 -column 0 -sticky news
+    grid $xScroll            -row 2 -column 0 -sticky we
+    grid $yScroll            -row 1 -column 1 -sticky ns
+    grid rowconfigure        $routeFrame 1 -weight 1
+    grid columnconfigure     $routeFrame 0 -weight 1
+
+    grid $infoLabelFrame -row 0 -column 0 -padx 16 -pady 10 -sticky w -columnspan 2
+    grid $routeFrame     -row 1 -column 0 -padx 20 -pady 10 -sticky wens
+    grid columnconfigure $parent 0 -weight 1
+    grid rowconfigure    $parent 1 -weight 1
+    grid columnconfigure $parent 1 -weight 1
+
+    Log "\n*** Please check the Route View window and make sure a route exist for the following network address.\n"
+    Log " Network Address: \{$baseIpAddressList\} "
+    return $widgets(routeText)
+}
+
+
+########################################################################
+# Procedure: setAppName
+#
+# This sets the appName for the ixDapConfig namespace
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::setAppName {userAppName} \
+{
+    variable appName
+    
+    set appName $userAppName
+}
+
+
+########################################################################
+# Procedure: setChassisList
+#
+# This sets the chassisList for the ixDapConfig namespace
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::setChassisList {userChassisList {userTclServer ""}} \
+{
+    variable chassisList
+    variable tclServer
+
+    set retCode $::TCL_OK
+
+    set chassisList $userChassisList
+    set tclServer   $userTclServer
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getBaseIpAddressList
+#
+# This gets the chassis baseIpAddressList. Once error getting any one of
+# chassis, reset baseIpAddressList to empty which means error happened.
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::getBaseIpAddressList {} \
+{
+    variable chassisList
+
+    set baseIpAddressList [list]
+
+    foreach chassis $chassisList {
+        if {![chassis get $chassis]} {
+            lappend baseIpAddressList [chassis cget -baseIpAddress]
+        } else {
+            Error "Error getting chassis $chassis"
+            set baseIpAddressList [list]
+            break
+        }
+    }
+
+    return $baseIpAddressList
+}
+
+
+########################################################################
+# Procedure: addInterfaceToArray
+#
+# This procedure add interface to interfaceArray
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::addInterfaceToArray {args} \
+{
+    variable      interfaceArray
+
+    set retCode   $::TCL_OK
+
+    set portId     none
+    set macAddress "00 00 00 00 00 00"
+    set ipAddress  "0.0.0.0"
+    set mask       "0.0.0.0"
+    set gateway    "0.0.0.0"
+    set enableVlan false
+    set vlanId     0
+
+    set arraySize [array size interfaceArray]
+    foreach arg [lindex $args 0] {
+        if {[regexp {^-[a-zA-Z].+} $arg]} {
+            #
+            # Current argument is preceeded by '-'.
+            #
+            switch -- $arg {
+                "-portId"      -
+                "-macAddress"  -
+                "-ipAddress"   -
+                "-mask"        -
+                "-gateway"     -
+                "-enableVlan"   -
+                "-vlanId"       {
+                    set currentOption [string trimleft $arg -]
+                    set currentAction getValue
+                }
+                default {
+                    Error "Invalid option \"$arg\""
+                    set retCode $::TCL_ERROR
+                    break
+                }
+            }
+        } else {
+            if {[info exists currentAction]} {
+                switch $currentAction {
+                    "getValue" {
+                        switch $currentOption {
+                            portId {
+                                set $currentOption $arg
+				            }
+                            macAddress {
+                                set $currentOption $arg
+                            }
+                            ipAddress  {
+                                set $currentOption $arg
+				            }
+                            mask      {
+                                set $currentOption $arg
+				            }
+                            gateway   {
+                                set $currentOption $arg
+				            }
+                            enableVlan   {
+                                set $currentOption $arg
+				            }
+                            vlanId   {
+                                set $currentOption $arg
+				            }
+                        }
+                        catch {unset currentOption}
+                        catch {unset currentAction}
+                    }
+                    default {
+                        set retCode $::TCL_ERROR
+                        break
+                    }
+                }
+            } else {
+                set retCode $::TCL_ERROR
+                break
+            }
+        }
+    }
+
+    if {$retCode == $::TCL_OK && $portId != "none"} {
+        set interfaceArray($arraySize) \
+            [list $portId $macAddress $ipAddress $gateway $mask $enableVlan $vlanId]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getInterfacePortList
+#
+# This procedure gets the port list to use w/this application
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::getInterfacePortList {{unique 1}} \
+{
+    variable interfaceArray
+    variable interfacePortIdIndex
+
+    set portList [list]
+    foreach {index interface} [array get interfaceArray] {
+        set port [lindex $interface $interfacePortIdIndex]
+        if {$unique == $::true} {
+            if {[lsearch $portList $port] == -1} {
+                lappend portList [join [split $port ',']]
+            }
+        } else {
+            lappend portList [join [split $port ',']]
+        }
+    }
+
+    return [lnumsort $portList]
+}
+
+
+
+########################################################################
+# Procedure: getSortListFromArray
+#
+# This procedure gets sort list from array like {0 caa 1 bbb 2 abc}
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::getSortListFromArray {arrayName} \
+{
+    variable $arrayName
+
+    set itemList {}
+
+    set arraySize [array get $arrayName]
+
+    foreach {index args} [array get $arrayName] {
+        if {[llength $itemList] == 0} {
+            lappend itemList $index $args
+        } else {
+            set insertIndex 0
+            foreach {tempIndex tempArgs} $itemList {
+                if {$index < $tempIndex} {
+                    set itemList [linsert $itemList $insertIndex $index $args]
+                } else {
+                    set insertIndex [expr $insertIndex + 2]
+                    if {[llength $itemList] == [expr $insertIndex]} {
+                        set itemList [linsert $itemList $insertIndex $index $args]
+                    }                         
+                }
+            }
+        }
+    }
+    
+    return $itemList
+}
+
+########################################################################
+# Procedure: removeInterfaceFromArray
+#
+# This procedure remove interface from interfaceArray
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::removeInterfaceFromArray {c l p} \
+{
+    variable interfaceArray
+    variable interfacePortIdIndex
+
+    foreach {index interface} [array get interfaceArray] {
+        set myPort [lindex $interface $interfacePortIdIndex]
+        if {$c == [lindex $myPort 0] && $l == [lindex $myPort 1] && $p == [lindex $myPort 2]} {
+            unset interfaceArray($index)
+        }
+    }
+}
+
+
+########################################################################
+# Procedure: addRouteToArray
+#
+# This procedure add route to routeArray
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::addRouteToArray {args} \
+{
+    variable routeArray
+
+    set retCode         $::TCL_OK
+    set portId          none
+    set target          "net"
+    set ipAddress       "0.0.0.0"
+    set gateway         "0.0.0.0"
+    set mask            "0.0.0.0"
+
+    set arraySize [array size routeArray]
+    foreach arg [lindex $args 0] {
+        if {[regexp {^-[a-zA-Z].+} $arg]} {
+            #
+            # Current argument is preceeded by '-'.
+            #
+            switch -- $arg {
+                "-portId"           -
+                "-target"           -
+                "-ipAddress"        -
+                "-mask"             -
+                "-gateway"          {
+                    set currentOption [string trimleft $arg -]
+                    set currentAction getValue
+                }
+                default {
+                    Error "Invalid option \"$arg\""
+                    set retCode $::TCL_ERROR
+                    break
+                }
+            }
+        } else {
+            if {[info exists currentAction]} {
+                switch $currentAction {
+                    "getValue" {
+                        switch $currentOption {
+                            portId {
+                                set $currentOption $arg
+				            }
+                            target {
+                                set $currentOption $arg
+				            }                                
+                            ipAddress  {
+                                set $currentOption $arg
+				            }
+                            mask      {
+                                set $currentOption $arg
+				            }
+                            gateway   {
+                                set $currentOption $arg
+				            }
+                        }
+                        catch {unset currentOption}
+                        catch {unset currentAction}
+                    }
+                    default {
+                        set retCode $::TCL_ERROR
+                        break
+                    }
+                }
+            } else {
+                set retCode $::TCL_ERROR
+                break
+            }
+        }
+    }
+
+    if {$retCode == $::TCL_OK && $portId != "none"} {
+        set routeArray($arraySize) [list $portId $target $ipAddress $gateway $mask]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: addFilterToArray
+#
+# This procedure add filter to filterArray
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::addFilterToArray {args} \
+{
+    variable filterArray
+
+    set retCode   $::TCL_OK
+
+    set reset       false 
+    set action      enable
+    set portList    none
+    set type        none
+    set valueList   none
+
+    set arraySize [array size filterArray]
+    foreach arg [lindex $args 0] {
+        if {[regexp {^-[a-zA-Z].+} $arg]} {
+            #
+            # Current argument is preceeded by '-'.
+            #
+            switch -- $arg {
+                "-reset"        -
+                "-action"       -
+                "-portList"     -
+                "-type"         -
+                "-valueList"    {
+                    set currentOption [string trimleft $arg -]
+                    set currentAction getValue
+                }
+                default {
+                    Error "Invalid option \"$arg\""
+                    set retCode $::TCL_ERROR
+                    break
+                }
+            }
+        } else {
+            if {[info exists currentAction]} {
+                switch $currentAction {
+                    "getValue" {
+                        switch $currentOption {
+                            reset {
+                                set $currentOption $arg
+				            }
+                            action {
+                                set $currentOption $arg
+                            }
+                            portList  {
+                                set $currentOption $arg
+				            }
+                            type      {
+                                set $currentOption $arg
+				            }
+                            valueList   {
+                                set $currentOption $arg
+				            }
+                        }
+                        catch {unset currentOption}
+                        catch {unset currentAction}
+                    }
+                    default {
+                        set retCode $::TCL_ERROR
+                        break
+                    }
+                }
+            } else {
+                set retCode $::TCL_ERROR
+                break
+            }
+        }
+    }
+
+    if {$retCode == $::TCL_OK && $portList != "none"} {
+        set filterArray($arraySize) [list $reset $portList $action $type $valueList]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getValueFromList
+#
+# This procedure gets value from itemList by passing index
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::getValueFromList {itemList index} \
+{
+    set retValue ""
+
+    if {$index < [llength $itemList]} {
+        set retValue [lindex $itemList $index]
+    }
+
+    return $retValue           
+}
+
+
+########################################################################
+# Procedure: isSubnetOverlapped
+#
+# This procedure checks for overlapping subnets, should be eventually
+# be moved into main code for 3.70.
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::isSubnetOverlapped {ipAddr1 mask1 ipAddr2 mask2} \
+{
+    set retCode $::false
+
+    set resultMask      [expr [ip2num $mask1] & [ip2num $mask2]]
+    set range1Subnet    [expr [ip2num $ipAddr1] & $resultMask]
+    set range2Subnet    [expr [ip2num $ipAddr2] & $resultMask]
+
+    if {$range1Subnet == $range2Subnet} {
+        set retCode $::true
+    } 
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: setBaseIp
+#
+# This procedure sets a new base IP address on the chassis
+#
+# Arguments(s):
+#   chassisName - name or ID of chassis
+#   ipAddress   - base ip address to use
+#   mask        - mask to use w/base ip address
+#
+# Return:
+#   returns TCL_OK if successful
+#
+########################################################################
+proc ixDapConfig::setBaseIp {chassisName ipAddress {mask 255.255.0.0}} \
+{
+    set retCode $::TCL_OK
+
+    if [chassis get $chassisName] {
+        if [ixConnectToChassis $chassisName] {
+            Error "Error - invalid chassis $chassisName specified."
+            return $::TCL_ERROR
+        }
+    }
+    
+    chassis config -baseIpAddress   $ipAddress
+    chassis config -baseAddressMask $mask
+    if [chassis setBaseIp $chassisName] {
+        Error "Unable to set base IP address $ipAddress/$mask."
+        set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: validateBaseIpAddresses
+#
+# This procedure validates & checks for overlapping ip addresses among
+# all base ip address in all chassis in chain
+#
+# Arguments(s):
+#
+# Return:
+#   returns TCL_OK if all valid base ip address & no overlap
+#
+########################################################################
+proc ixDapConfig::validateBaseIpAddresses {chassisList} \
+{
+    set currentBaseIp ""
+    set currentMask   ""
+    set overlapping   $::false
+
+    Log "\n**************************************************************"
+    foreach myChassis $chassisList {
+        if [chassis get $myChassis] {
+            Error "Error getting chassis $myChassis"
+            set retCode $::TCL_ERROR
+            break
+        }
+        set nextBaseIp [chassis cget -baseIpAddress]
+        set nextMask   [chassis cget -baseAddressMask]
+        Log "Chassis $myChassis base IP Address == $nextBaseIp/$nextMask"
+        if {$currentBaseIp != "" } {
+            if [isSubnetOverlapped $currentBaseIp $currentMask $nextBaseIp $nextMask] {
+                set overlapping $::true
+                break
+            }
+        }
+        set currentBaseIp $nextBaseIp
+        set currentMask   $nextMask
+    }
+
+    Log "**************************************************************\n"
+
+    if {$overlapping} {
+        Log "----> WARNING: Overlapping base ip address configuration detected in your chassis chain!!!"
+        Log "      Please verify base ip address configuration on all chassis in chain"
+        Log "      To modify/update the base ip address of a chassis, use the following command:\n"
+        Log " ixDapSetBaseIp <chassisNameOrId> <baseIpAddress>\n\n"
+    }
+
+    return [expr $overlapping?$::TCL_ERROR:$::TCL_OK]
+}
+
+
+########################################################################
+# Procedure: setupPortInterfaces
+#
+# This procedure adds the interfaces for the ixDapConfig
+#
+# Arguments(s): write    - write to hardware, default is write
+#
+########################################################################
+proc ixDapConfig::setupPortInterfaces {PortList {write write}} \
+{
+    upvar $PortList portList
+
+    variable interfaceArray
+    variable interfacePortIdIndex
+    variable interfaceMacAddressIndex
+    variable interfaceIpAddressIndex
+    variable interfaceGwIndex
+    variable interfaceMaskIndex
+    variable interfaceEnableVlanIndex
+    variable interfaceVlanIdIndex
+
+    set retCode $::TCL_OK
+
+    Log "" ;# empty line
+    ip setDefault
+    set configedPortList {}
+    set interfaceList [getSortListFromArray interfaceArray]
+
+    if [interfaceTable::setDefault portList] {
+        Error "Error setting interface table to default"
+        set retCode $::TCL_ERROR
+        break
+    }
+
+    foreach {index interface} $interfaceList {
+        set myPort      [getValueFromList $interface $interfacePortIdIndex]
+        set macAddress  [getValueFromList $interface $interfaceMacAddressIndex]
+        set ipAddress   [getValueFromList $interface $interfaceIpAddressIndex]
+        set gateway     [getValueFromList $interface $interfaceGwIndex]
+        set mask        [getValueFromList $interface $interfaceMaskIndex]
+        set enableVlan  [getValueFromList $interface $interfaceEnableVlanIndex]
+        set vlanId      [getValueFromList $interface $interfaceVlanIdIndex]
+
+        set c [lindex $myPort 0]
+        set l [lindex $myPort 1]
+        set p [lindex $myPort 2]
+        if {[lsearch $configedPortList $myPort] != -1} {
+            continue
+        } else {
+            lappend configedPortList $myPort
+        }
+
+        if [port get $c $l $p] {
+            Error "Error getting port $c $l $p"
+            set retCode $::TCL_ERROR
+            break
+        }
+
+        port config -MacAddress $macAddress
+
+        if {$enableVlan == "true"} {
+            # protocol cget -enable802dot1qTag is for all ports in configArp
+            # once one of ports is vlan enabled, we need to config enable802dot1qTag true
+            protocol config -enable802dot1qTag true
+            vlan config -vlanID $vlanId
+            if [vlanUtils::setPortTagged $c $l $p] {
+                Error "Error setting vlan tag for port $c $l $p"
+                set retCode $::TCL_ERROR
+                break
+            }            
+            if [vlan set $c $l $p] {
+                Error "Error setting vlan for port $c $l $p"
+                set retCode $::TCL_ERROR
+                break
+            }                
+        } else {
+            if [vlanUtils::setPortUntagged $c $l $p] {
+                Error "Error unsetting vlan tag for port $c $l $p"
+                set retCode $::TCL_ERROR
+                break
+            }
+            if [vlan set $c $l $p] {
+                Error "Error setting vlan for port $c $l $p"
+                set retCode $::TCL_ERROR
+                break
+            }                
+        }
+        
+        if [port set $c $l $p] {
+            Error "Error setting port $c $l $p"
+            set retCode $::TCL_ERROR
+            break
+        }
+
+        ip config -sourceIpAddr  $ipAddress
+        ip config -destDutIpAddr $gateway
+        ip config -sourceIpMask  $mask
+
+        if [ip set $c $l $p] {
+            Error "Error setting ip $c $l $p"
+            set retCode $::TCL_ERROR
+            break
+        }
+        Log "Adding an interface on port $c $l $p: MAC:$macAddress, IP:$ipAddress, GW:$gateway, Mask:$mask, Vlan Enable:$enableVlan, Vlan Id:$vlanId"
+    }
+
+    if {$retCode == $::TCL_OK} {
+        set retCode [configureArp configedPortList configedPortList nowrite]
+    }
+
+    if {$retCode == $::TCL_OK} {
+        set configedPortList {}
+        foreach {index interface} [array get interfaceArray] {
+            set myPort [getValueFromList $interface $interfacePortIdIndex]
+            if {[lsearch $configedPortList $myPort] == -1} {
+                lappend configedPortList $myPort
+                continue
+            } else {
+                set retCode [addPortInterface $interface $write]
+            }
+        }
+    }
+
+    if {$retCode == $::TCL_OK && $write == "write"} {
+        if [writeConfigToHardware configedPortList] {
+            Error "Error writing ports to hardware"
+            set retCode $::TCL_ERROR
+        }
+    }
+
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: addPortInterface
+#
+# This procedure add one interface
+#
+# Arguments(s): write - write to hardware, default is write
+#
+########################################################################
+proc ixDapConfig::addPortInterface {interface {write write}} \
+{
+    variable interfaceArray
+    variable interfacePortIdIndex
+    variable interfaceMacAddressIndex
+    variable interfaceIpAddressIndex
+    variable interfaceGwIndex
+    variable interfaceMaskIndex
+    variable interfaceEnableVlanIndex
+    variable interfaceVlanIdIndex
+
+    set retCode $::TCL_OK
+                            
+    set myPort      [getValueFromList $interface $interfacePortIdIndex]
+    set macAddress  [getValueFromList $interface $interfaceMacAddressIndex]
+    set ipAddress   [getValueFromList $interface $interfaceIpAddressIndex]
+    set gateway     [getValueFromList $interface $interfaceGwIndex]
+    set mask        [getValueFromList $interface $interfaceMaskIndex]
+    set enableVlan  [getValueFromList $interface $interfaceEnableVlanIndex]
+    set vlanId      [getValueFromList $interface $interfaceVlanIdIndex]
+    set maskWidth   [getIpV4MaskWidth $mask]
+
+    set c [lindex $myPort 0]
+    set l [lindex $myPort 1]
+    set p [lindex $myPort 2]
+    set portList [list $myPort]
+
+    # Add multiple interfaces into protocol interface table
+    if [interfaceTable  select  $c $l $p] {
+        Error "Error seleting port $c $l $p"
+        set retCode $::TCL_ERROR
+        break
+    }
+
+    interfaceEntry  clearAllItems     addressTypeIpV4
+    interfaceEntry  clearAllItems     addressTypeIpV6
+    interfaceIpV4   setDefault        
+    interfaceIpV4   config  -ipAddress          $ipAddress
+    interfaceIpV4   config  -gatewayIpAddress   $gateway
+    interfaceIpV4   config  -maskWidth          $maskWidth
+    if {[interfaceEntry  addItem addressTypeIpV4]} {
+        Error "Error adding item into interfaceEntry"
+        set retCode $::TCL_ERROR
+        break
+    }
+
+    interfaceEntry  setDefault        
+    interfaceEntry  config  -enable             true
+    interfaceEntry  config  -description        [interfaceTable::formatEntryDescription $c $l $p]
+    interfaceEntry  config  -macAddress         $macAddress
+    interfaceEntry  config  -enableVlan         $enableVlan
+    interfaceEntry  config  -vlanId             $vlanId
+    if {[interfaceTable  addInterface]} {
+        Error "Unable to add interface to Interface Table for port $c $l $p"
+        set retCode $::TCL_ERROR
+        break
+    }
+    interfaceEntry  clearAllItems     addressTypeIpV4
+    interfaceEntry  clearAllItems     addressTypeIpV6
+
+    Log "Adding an interface on port $c $l $p: MAC:$macAddress, IP:$ipAddress, GW:$gateway, Mask:$mask, VLAN Enable:$enableVlan, VLAN ID:$vlanId"
+    
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: setupRouteTable
+#
+# This procedure setup port routing table
+#
+# Arguments(s): None
+#
+########################################################################
+proc ixDapConfig::setupRouteTable {} \
+{
+    variable           routeArray
+    variable           routePortIdIndex
+    variable           routeTargetIndex
+    variable           routeIpAddressIndex
+    variable           routeGwIndex
+    variable           routeMaskIndex
+
+    set retCode        $::TCL_OK
+    set configPortList [getInterfacePortList]
+                            
+    Log "" ;# empty line
+    set routeList [getSortListFromArray routeArray]
+    foreach {index route} $routeList {
+        set myPort          [getValueFromList $route $routePortIdIndex]
+        set target          [getValueFromList $route $routeTargetIndex]
+        set ipAddress       [getValueFromList $route $routeIpAddressIndex]
+        set gateway         [getValueFromList $route $routeGwIndex]
+        set mask            [getValueFromList $route $routeMaskIndex]
+
+        set c [lindex $myPort 0]
+        set l [lindex $myPort 1]
+        set p [lindex $myPort 2]
+        set portList [list $myPort]
+
+        if {[lsearch $configPortList $myPort] == -1} {
+            Log "Port $myPort doesn't exist. Ignore adding a route on port $c $l $p:Target:$target, IP:$ipAddress, GW:$gateway, Mask:$mask"
+        } else {
+            # delete a route if it exists before adding it
+            managePcpuCommand portList [format "route del -%s %s gw %s netmask %s" $target $ipAddress $gateway $mask]
+            set errorInfo ""
+            if [managePcpuCommand portList [format "route add -%s %s gw %s netmask %s" $target $ipAddress $gateway $mask]] {
+                Error "Error adding a route for port $c $l $p:Target:$target, IP:$ipAddress, GW:$gateway, Mask:$mask"
+                set retCode $::TCL_ERROR
+                break
+            } else {
+                Log "Adding a route on port $c $l $p:Target:$target, IP:$ipAddress, GW:$gateway, Mask:$mask"
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: setupPortFilters
+#
+# This procedure sets up filter on ports
+#
+# Arguments(s): None
+#
+########################################################################
+proc ixDapConfig::setupPortFilters {} \
+{
+    variable           filterArray
+    variable           filterResetIndex
+    variable           filterPortListIndex
+    variable           filterActionIndex
+    variable           filterTypeIndex
+    variable           filterValueListIndex
+
+    set retCode        $::TCL_OK
+    set configPortList [getInterfacePortList]
+    
+    Log "" ;# empty line
+    set filterList [getSortListFromArray filterArray]
+    foreach {index filter} $filterList {
+        set reset       [getValueFromList $filter $filterResetIndex]
+        set portList    [getValueFromList $filter $filterPortListIndex]
+        set action      [getValueFromList $filter $filterActionIndex]
+        set type        [getValueFromList $filter $filterTypeIndex]
+        set valueList   [getValueFromList $filter $filterValueListIndex]
+
+        set removePortList {}
+        set newPortList    {}
+        foreach myPort $portList {
+            if {[lsearch $configPortList $myPort] == -1} {
+                lappend removePortList $myPort
+            } else {
+                lappend newPortList $myPort
+            }
+        }
+
+        if {[llength $removePortList] != 0} {
+            Log "Port $removePortList doesn't exist. Ignore adding a filter on port $removePortList: Reset:$reset, Action:$action, Type:$type, ValueList:$valueList"
+        }
+        if {[llength $newPortList] != 0} {
+            # Add a route on portList
+            if {$reset == "true"} {
+                if [managePcpuCommand newPortList "filter --reset"] {
+                    Error "Error resetting filter for port $newPortList"
+                    set retCode $::TCL_ERROR
+                    break
+                } else {
+                    Log "Resetting filter on port $newPortList"
+                }
+            }   
+
+            if [manageFilter newPortList $action $type $valueList] {
+                Error "Error adding filter on port $newPortList: Reset:$reset, Action:$action, Type:$type, ValueList:$valueList"
+                set retCode $::TCL_ERROR
+                break
+            } else {
+                Log "Adding a filter on port $newPortList: Reset:$reset, Action:$action, Type:$type, ValueList:$valueList"
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: manageFilter
+#
+# This procedure manage filter IP protocol pcpu command excuted on the ports
+#
+# Arguments(s): PortList   - port list
+#               action     - enable or disable
+#               type       - ip-protocols or icmp-types or udp-ports or tcp-ports
+#               valueList  - type value list something like {1 2 3} 
+#
+########################################################################
+proc ixDapConfig::manageFilter {PortList action type valueList} \
+{
+    upvar $PortList portList
+
+    set retCode $::TCL_OK
+    set action  [string tolower $action]
+    set type    [string tolower  $type]
+
+    if {$action != "enable" && $action != "disable"} {
+        Error "Valid action value is enable or disable"
+        set retCode $::TCL_ERROR
+    }
+
+    if {$type != "ip-protocols" && $type != "icmp-types" && \
+        $type != "udp-ports" && $type != "tcp-ports"} {
+        Error "Valid type value is ip-protocols, icmp-types, udp-ports or tcp-ports"
+        set retCode $::TCL_ERROR
+    }
+
+    if {$retCode == $::TCL_OK} {
+        set pcpuCommand [format "filter --%s-%s=%s" $action $type [join $valueList ,]]
+        set retCode [managePcpuCommand portList $pcpuCommand]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: managePcpuCommand
+#
+# This procedure manage pcpu command excuted on the ports
+#
+# Arguments(s): PortList      - port list
+#               pcpuCommand   - pcpuCommand in string such as ls
+#
+########################################################################
+proc ixDapConfig::managePcpuCommand {PortList pcpuCommand} \
+{
+    upvar $PortList portList
+    return [issuePcpuCommand portList $pcpuCommand]
+}
+
+
+########################################################################
+# Procedure: downloadPackage
+#
+# This procedure downloads the package to the ports
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::downloadPackage {portList} \
+{
+    return [managePackage $portList downloadPackage]
+}
+
+
+########################################################################
+# Procedure: deletePackage
+#
+# This procedure deletes downloaded package on the ports
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::deletePackage {portList} \
+{ 
+    return [managePackage $portList deletePackage -noverbose]
+}
+
+
+########################################################################
+# Procedure: managePackage
+#
+# This procedure is a utility for manager the package <download/delete>
+#
+# Arguments(s):
+#    portList
+#    action    - downloadPackage | deletePackage
+#
+########################################################################
+proc ixDapConfig::managePackage {portList action {verbose -verbose}} \
+{ 
+    variable defaultPortGroupId
+    variable appName
+    set retCode $::TCL_OK
+
+    # need a portgroup
+    portGroup destroy $defaultPortGroupId
+    if [portGroup create $defaultPortGroupId] {
+        Error "Error creating port group $defaultPortGroupId"
+        set retCode $::TCL_ERROR
+        return $retCode
+    }
+
+    foreach port $portList {
+        scan $port "%d %d %d" c l p
+        if [portGroup add $defaultPortGroupId $c $l $p] {
+            Error "Error adding port $c $l $p to port group $defaultPortGroupId"
+            set retCode $::TCL_ERROR
+            break
+        }
+    }
+    
+    if {$retCode == $::TCL_OK} {
+        switch $action {
+            "downloadPackage" {
+                if {$verbose == "-verbose"} {
+                    Log "\nDownloading application $appName on port list..."
+                }
+                if [serviceManager $action $appName $defaultPortGroupId] {
+                    # Get failed portList
+                    set failedPorts [list]
+                    foreach port $portList {
+                        scan $port "%d %d %d" c l p
+                        set installedPackages    [split [serviceManager getInstalledPackages $c $l $p] ,]
+                        if {[lsearch $installedPackages $appName] < 0} {
+                            lappend failedPorts [list $c $l $p]
+                        }
+                    }
+                    Error "Error downloading package $appName on port $failedPorts"
+                    set retCode $::TCL_ERROR
+                } else {
+                    if {$verbose == "-verbose"} {
+                        Log "Download complete"
+                    }
+                }
+            }
+            "deletePackage" {
+                if {$verbose == "-verbose"} {
+                    Log "\nDeleting application $appName on port list..."
+                }
+                serviceManager $action $appName $defaultPortGroupId
+                set retCode $::TCL_OK
+            }
+        }
+    }
+
+    portGroup destroy $defaultPortGroupId
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: pingBaseIpAddress
+#
+# This procedure ping chassis base Ip address.
+#
+# Arguments(s): retryTime: default value is 1
+#
+########################################################################
+proc ixDapConfig::pingBaseIpAddress {{retryTime 1}} \
+{
+    variable chassisList
+    
+    set retCode $::TCL_OK
+
+    foreach chassis $chassisList {
+        if {![chassis get $chassis]} {
+            set baseIpAddress [chassis cget -baseIpAddress]
+            regsub -all ".0$" $baseIpAddress ".1" baseIpAddress
+            set i 1
+	        Log ""  ;# empty line
+            while {$i <= $retryTime} {
+	        Log "Pinging $baseIpAddress for chassis $chassis - $i of $retryTime ..."
+                set replyMsg    "Reply from $baseIpAddress"
+                set pingResults [eval {exec ping $baseIpAddress}]
+                if [regexp $replyMsg $pingResults] {
+                    break
+                } else {
+                    if {$i == $retryTime} { 
+                        Error "Error pinging $baseIpAddress for chassis $chassis"
+                        set retCode $::TCL_ERROR
+                        break
+                    }
+                }
+                incr i
+            }
+        } else {
+            Error "Error getting chassis $chassis"
+            set retCode $::TCL_ERROR
+        }
+
+        if {$retCode} {
+            break
+        } else {
+	        Log "Ping to $baseIpAddress for chassis $chassis is successful"
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: cleanUp
+#
+# This procedure clean up global array.
+#
+# Arguments(s):
+#
+########################################################################
+proc ixDapConfig::cleanUp {} \
+{
+    variable interfaceArray
+    variable routeArray
+    variable filterArray
+
+    if [info exists interfaceArray] {
+        unset interfaceArray
+    }
+
+    if [info exists routeArray] {
+        unset routeArray
+    }
+    
+    if [info exists filterArray] {
+        unset filterArray
+    }
+
+    return $::TCL_OK
+}
+
+
+########################################################################
+# Procedure: main
+#
+# The main procedure for the ixDapConfig package
+#
+# Options:
+#
+#
+#	-appName _name_of_application_to_download_
+#
+#		name of application to download
+#
+#	-setFactoryDefaults _boolean_
+#		reset all the ports to factory defaults as part of the download
+#		process.
+#
+#	-checkLinkState _boolean_
+#
+#		check the link state of the target ports prior to
+#		starting the download process. if the link state is
+#		down on any of the target ports, the download process is
+#		stopped and $::TCL_ERROR is returned
+#
+#	-deletePackage _boolean_
+#
+#		delete downloaded package before downloading package
+#
+#	-verbose _boolean_
+#		be more verbose when logging status messages
+#
+#   The following options may merit removal
+#   since the application could employ them reasonably outside of main ??
+#
+#	-hideMainWindow _boolean_
+#		Hide the main Tk window "."
+#
+#	-pingBaseIpAddress _boolean_
+#
+#		ping the base ip addresses of all the chassis
+#		that are part of the download process. If 
+#		if any of the chassis do not repsoned to the ping
+#		then pop up a routeview window and return $::TCL_ERROR
+#
+# Logging and Error messages:
+#
+#	By default, logging and error messages are generated via the std.
+#	ixia API functions 'logMsg' and 'errorMsg'. These can be overridden
+#	by resetting the namespace varibles 
+#		ixDapConfig::logCmd
+#	and 
+#		ixDapConfig::errorCmd
+#
+#	Should be functions that allow one to set these variables ??
+#
+# Return Values:
+#
+#	$::TCL_ERROR on success
+#	$::TCL_OK on error
+#
+########################################################################
+proc ixDapConfig::main {args} \
+{
+    variable chassisList
+    variable tclServer   ""
+    
+    set retCode          $::TCL_OK
+
+    #
+    # option defaults
+    #
+    array set opts [list                 \
+	    -hideMainWindow         $::true  \
+    	-appName                ""       \
+	    -setFactoryDefaults     $::true  \
+	    -checkLinkState         $::false \
+        -deletePackage          $::true  \
+	    -pingBaseIpAddress      $::true  \
+	    -verbose                $::true  \
+    ]
+    
+    if {![string match "-*" [lindex $args 0]]} {
+    	set opts(-appName) [lindex $args 0]
+	    array set opts [lrange $args 1 end]
+    } else {
+	    if {[llength $args] == 1} {
+	        # Allow option pairs to be passed as a single list
+	        set args [lindex $args 0]
+	    }
+	    array set opts $args
+    }
+
+    if {$opts(-hideMainWindow)} {
+    	wm withdraw .
+    }
+
+    if {$opts(-verbose)} {
+	    printVersion
+    }
+
+    if [init $opts(-appName)] {
+        return $::TCL_ERROR
+    }
+
+
+    #****************************************************************
+    # Delete all chassis from the chain before connecting to them
+    # This is a bug workaround somewhere for something 
+    # downstream. See Debby Stopp for details
+    #****************************************************************
+    if {[info commands chassisChain] != ""} {
+        chassisChain removeAll
+    }
+    if [ixProxyConnect $tclServer $chassisList] {
+        return $::TCL_ERROR
+    }
+    #****************************************************************
+    
+    # Login is mandatory for this application... 
+    if {[session cget -userName] == ""} {
+        ixDapConfig::login
+    }
+
+    Log "Validating chassis base IP addresses..."
+    if [validateBaseIpAddresses $chassisList] {
+        return $::TCL_ERROR
+    }
+
+    set portIndex 0
+    set portList  [getInterfacePortList]
+    foreach myPort $portList {
+        scan $myPort "%d %d %d" c l p
+        
+        if {![port isValidFeature $c $l $p $::portFeatureLocalCPU]} {
+            Log "PortCPU not supported on port $c $l $p - removing port from list"
+            set portList [lreplace $portList $portIndex $portIndex]
+            removeInterfaceFromArray $c $l $p
+        } else {
+            incr portIndex
+        }
+    }
+
+    set portIndex 0
+    foreach myPort $portList {
+        scan $myPort "%d %d %d" c l p
+        if [ixPortTakeOwnership $c $l $p] {
+            set portList [lreplace $portList $portIndex $portIndex]
+            removeInterfaceFromArray $c $l $p
+        } else {
+            incr portIndex
+        }
+    }
+
+    if {[llength $portList] == 0} {
+        Log "No ports in port list"
+        return $::TCL_ERROR
+    }
+   
+    if {$opts(-setFactoryDefaults)} {
+        Log "Setting factory defaults on all ports in port list..."
+        if [setFactoryDefaults $portList] {
+            Error "Error setting factory defaults on one or more ports"
+            return $::TCL_ERROR
+        }
+
+        if [ixWritePortsToHardware portList] {
+            Error "Error writing ports to hardware"
+            return $::TCL_ERROR
+        }
+    }
+
+    if {$opts(-checkLinkState)} {
+        if [ixCheckLinkState portList] {
+            return $::TCL_ERROR
+        }
+    }
+
+    if [setupPortInterfaces portList] {
+        return $::TCL_ERROR
+    }
+
+    if [setupRouteTable] {
+        return $::TCL_ERROR
+    }
+
+    if [setupPortFilters] {
+        return $::TCL_ERROR
+    }
+
+
+    if {$opts(-deletePackage)} {
+        if [deletePackage $portList] {
+            return $::TCL_ERROR
+        }
+    }
+
+    if [downloadPackage $portList] {
+        return $::TCL_ERROR
+    }
+
+    # Ping chassis base ip address. If failed after retryTime, launch viewRoutes.
+    if {$opts(-pingBaseIpAddress)} {
+        set retryTime 3
+        if {[pingBaseIpAddress $retryTime]} {
+	        set retCode $::TCL_ERROR
+            # Move viewRoutes gui here and make it behind wish console
+            # If baseIpAddressList is empty, we don't show viewRoutes gui.
+            set baseIpAddressList [getBaseIpAddressList]
+            if {[llength $baseIpAddressList] > 0 } {
+                viewRoutes [getBaseIpAddressList]
+                console hide
+                console show
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/actions.tcl b/dep/tclclient/ixTcl1.0/Generic/actions.tcl
new file mode 100644
index 00000000..409153f6
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/actions.tcl
@@ -0,0 +1,3241 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: actions.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	12-30-1998	DS
+#
+# Description: This file contains common procs used for specific actions,
+#              such as startTx, stopTx, etc
+#
+##################################################################################
+
+
+########################################################################
+# Procedure: clearStatsAndTransmit
+#
+# This command clears the stat counters, starts capture & starts transmit
+#
+# Arguments(s):
+#   TxRxArray       - array of ports to transmit, ie. one2oneArray
+#   duration        - approximate time of transmit
+#   staggeredStart  - if set to 'staggeredStart' the transmit will be staggered
+#   calcAvgRates    - "yes" if we want to get the rates while transmitting
+#   avgRateArray    - array containing the average running rate for tx/rx ports
+#
+########################################################################
+proc clearStatsAndTransmit {TxRxArray duration {staggeredStart notStaggeredStart} {calcAvgRates no} \
+                            {AvgRateArray ""} {calcQosRates no} {QosRateArray ""} {calcTxRxRates no} \
+							{delay delay}} \
+{
+    upvar $TxRxArray		txRxArray
+	upvar $AvgRateArray		arArray
+	upvar $QosRateArray		qosRateArray
+
+    set txPorts [getTxPorts txRxArray]
+    
+    if {[advancedTestParameter cget -primeDut] == $::true} {
+		startTx txRxArray $staggeredStart
+        after 2000
+		stopTx txRxArray
+    }
+
+    set retCode [prepareToTransmit txRxArray]
+
+	if {$retCode == 0} {
+		set retCode [startTx txRxArray $staggeredStart]
+	}
+
+    if {$retCode == 0 && $delay == "delay"} {     
+	    if {$duration > 0} {
+	        logMsg "Transmitting frames for $duration seconds"
+        } else {
+	        logMsg "Transmitting frames for < 1 second"
+        }
+       
+	    if {$calcAvgRates == "yes"} {
+            if {$calcQosRates == "yes" && $calcTxRxRates == "no" } {
+                upvar $QosRateArray qosAvgRateArray
+                set retCode [collectRates txRxArray arArray $duration qosRate qosAvgRateArray ]
+            } elseif { $calcQosRates == "yes" && $calcTxRxRates == "yes" } {
+                upvar $QosRateArray qrArray
+				# Note: We need to get rid of this method when we get rid of cable modem suite              
+                set retCode [getRunRatePerSecond txRxArray arArray qrArray $duration]
+
+            } else {
+                set retCode [collectRates txRxArray arArray $duration]
+            }
+        } else {
+	        # Wait for all frames to be transmitted, print msg to screen while waiting..
+            if [writeWaitForTransmit $duration] {
+	            if [stopTx txPorts] {
+		            errorMsg "Error stopping Tx on one or more ports."
+                    set retCode 1
+	            }
+                set ::ixStopTest 1
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: transmitAndCollectRxRatesPerSecond
+#
+# This command starts transmit and collecting those receive rates we want
+#
+# Arguments(s):
+#   TxRxArray       - array of ports to transmit, ie. one2oneArray
+#	RateArray		- array of rates we want
+#	args			- list of stat names we want to get rate of
+#   duration        - approximate time of transmit
+#   staggeredStart  - if set to 'staggeredStart' the transmit will be staggered
+#
+########################################################################
+proc transmitAndCollectRxRatesPerSecond {TxRxArray RxRateArray rxRateArgs duration {staggeredStart notStaggeredStart}} \
+{
+    upvar $TxRxArray    txRxArray
+	upvar $RxRateArray	rxRateArray
+    
+    set retCode		[prepareToTransmit txRxArray]
+
+	if {$retCode == 0} {
+		set retCode [startTx txRxArray $staggeredStart]
+	}
+
+	if {$duration > 0} {
+		logMsg "Transmitting frames for $duration seconds"
+    } else {
+		logMsg "Transmitting frames for < 1 second"
+    }
+   
+	set retCode [collectRxRatesPerSecond txRxArray rxRateArray $rxRateArgs $duration]
+
+	# Wait for all frames to be transmitted, print msg to screen while waiting..
+	if [writeWaitForTransmit $duration] {
+		if [stopTx txRxArray] {
+			errorMsg "Error stopping Tx on one or more ports."
+			set retCode 1
+		}
+	}
+   
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: collectRxRatesPerSecond
+#
+# This command starts transmit and collecting those receive rates we want
+#
+# Arguments(s):
+#   TxRxArray       - array of ports to transmit
+#	RxRateArray		- array of receive rates we want
+#	rxRateArgs		- list of stat names we want to get receive rate of
+#   duration        - approximate time of transmit
+#
+########################################################################
+proc collectRxRatesPerSecond {TxRxArray RxRateArray rxRateArgs duration} \
+{
+    upvar $TxRxArray    txRxArray
+	upvar $RxRateArray	rxRateArray
+
+    set retCode             0
+    set count               0
+
+    set rxPortList  [getRxPorts txRxArray]
+ 
+    if [createDialog "Transmit Status"] {
+        set cmd logMsg
+    } else {
+        set cmd writeDialog
+    }
+
+    set timeStart   [clock seconds]
+    set getStatTime 0
+
+    for {set timeCtr 1} {$timeCtr <= $duration} {incr timeCtr} {
+        $cmd  "Transmitted $timeCtr of $duration seconds"
+        mpincr count				
+        if [getRunningRate $rxPortList rxRateArray $rxRateArgs $count] {
+            set retCode 1
+        }
+        set getStatTime [mpexpr [clock seconds] - $timeStart]
+        if {$getStatTime <= $timeCtr} {
+    		after 1000
+        }
+    }
+    debugMsg "rxRateArray: [array get rxRateArray]"
+
+    incr timeCtr -1
+    if {$duration != $timeCtr} {
+        logMsg "******* Test terminated by user after $timeCtr seconds"
+    }
+
+    logMsg "Done transmitting for $duration seconds...\n"
+
+    # destroy the dialog box if it is created
+    if {$cmd == "writeDialog"} {
+        destroyDialog
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: prepareToTransmit
+#
+# This command stops current transmision, clears the stat counters.
+#
+# Arguments(s):
+#   TxRxArray       - array of ports to transmit, ie. one2oneArray
+#
+########################################################################
+proc prepareToTransmit {TxRxArray} \
+{
+    upvar $TxRxArray txRxArray
+   
+    set retCode $::TCL_OK
+
+    set allPorts    [getAllPorts txRxArray]
+    set rxPorts     [getRxPorts txRxArray]
+
+	if [stopTx allPorts] {
+		errorMsg "Error stopping Tx on one or more ports."
+		set retCode $::TCL_ERROR
+	}
+
+    if {$retCode == $::TCL_OK} {
+        set retCode [checkAllTransmitDone txRxArray]
+    }
+
+    set commandList [list resetStatistics clearTimeStamp]
+    if [issuePortGroupCommand $commandList allPorts] {
+	    errorMsg "Error: Unable to issue port group commands: $commandList"
+		set retCode $::TCL_ERROR
+	}
+
+    set commandList [list startCapture startPacketGroups]
+    if [issuePortGroupCommand $commandList rxPorts] {
+	    errorMsg "Error: Unable to issue port group commands: $commandList"
+		set retCode $::TCL_ERROR
+	}
+
+    return $retCode
+}
+
+
+
+########################################################################
+# Procedure: writeWaitForTransmit
+#
+# This command writes the transmit msg to a little text box
+#
+########################################################################
+proc writeWaitForTransmit {duration {destroy destroy}} \
+{
+    set retCode [writeWaitMessage "Transmit Status" "Transmitting" $duration $destroy]
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: writeWaitForPause
+#
+# This command writes the pause msg to a little text box
+#
+########################################################################
+proc writeWaitForPause {dialogName duration {destroy destroy}} \
+{
+    set retCode [writeWaitMessage $dialogName "Pausing" $duration $destroy]
+
+    return $retCode
+}
+
+
+
+########################################################################
+# Procedure: writeWaitMessage
+#
+# This command writes the msg to a little text box
+#
+########################################################################
+proc writeWaitMessage {dialogName messageType duration {destroy destroy}} \
+{
+    global ixStopTest
+
+    set retCode 0
+
+    debugMsg "Begin $messageType for $duration seconds...\n"
+    
+    set messageProc  writeDialog
+
+    if {$duration <= 1 || [createDialog $dialogName]} {
+        set messageProc  ixPuts
+    }
+
+    set currentTime [clock seconds]
+	for {set timeCtr 1} {$timeCtr <= $duration && $ixStopTest != 1} {incr timeCtr} {
+    	$messageProc "$messageType $timeCtr of $duration seconds"	
+
+        while {[expr {[clock seconds] - $currentTime}] < 1} {
+            update
+            after 20
+        }
+        set currentTime   [clock seconds]
+	}
+
+    incr timeCtr -1
+
+    if {$duration != $timeCtr} {
+        $messageProc "******* Test terminated by user after $timeCtr seconds"
+        set retCode 1
+    } else {
+        if {$duration < 1 } {
+            logMsg "Done after < 1 second.\n"
+        } else {
+            logMsg "Done after $duration seconds.\n"
+        }
+    }
+
+    if {$messageProc == "writeDialog" && $destroy == "destroy"} {
+        destroyDialog
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: issuePortGroupCommand
+#
+# This command builds a port group & issues the specified command, then
+# destroys the port group when it's done
+#
+########################################################################
+proc issuePortGroupCommand {command TxRxList {verbose noVerbose} {LastTimestamp ""} {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxList         txRxList
+    upvar $LastTimestamp    lastTimestamp
+
+    return [issuePortGroupMethod txRxList lastTimestamp -method setCommand -commandList $command  -groupId $groupId -$verbose -$create -$destroy]
+}
+
+
+########################################################################
+# Procedure: getPortGroupObject
+#
+# This command builds a port group & issues the specified command, then
+# destroys the port group when it's done
+#
+########################################################################
+proc getPortGroupObject {object TxRxList {verbose noVerbose} {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxList         txRxList
+
+    set lastTimestamp ""
+    return [issuePortGroupMethod txRxList lastTimestamp -method get -commandList $object -groupId $groupId -$verbose   -$create -$destroy]
+}
+
+
+########################################################################
+# Procedure: issuePortGroupMethod
+#
+# This command builds a port group & issues the specified command, then
+# destroys the port group when it's done
+#
+# Argument(s):
+#	PortArray	   either list of ports or array of ports
+#   args           options include:
+#                   -method              <portGroup method to be called>
+#                   -commandList         <list of commands to be executed>
+#                   -verbose             <turn on messages>
+#                   -noVerbose           <turn off messages, default>
+#                   -groupId             <groupId, default == 1126>
+#                   -create/-noCreate    <default = create, optionally create/don't create portGroup>
+#                   -destroy/-noDestroy  <default = destroy, optionally leave portGroup around when done>
+#                   -duration            <scheduled transmit duration, default == 0>        
+#
+########################################################################
+proc issuePortGroupMethod { PortArray LastTimestamp args } \
+{
+	upvar $PortArray        portArray
+    upvar $LastTimestamp    lastTimestamp
+
+	set retCode	$::TCL_OK
+
+    # default some vars here...
+    set method          setCommand
+    set commandList     [list]
+    set verbose         $::true
+    set groupId         710
+    set create          $::true
+    set destroy         $::true
+    set duration        0
+    set command         none
+    set finalCommandList [list]
+
+    foreach arg [join $args] {
+        # just go ahead & remove the '-', makes things easier
+        set dash [expr [regsub -all {^-} $arg "" arg]?"-":""]
+
+        if { $arg == "commandList" } {
+            set $command $arg
+            set command  commandList
+            continue
+        } else {
+            if { $command == "commandList" } {
+                if { $dash == "" && [lsearch $finalCommandList $arg] <= 0 } {
+                    lappend finalCommandList  $arg
+                    set command  commandList
+                    set $command $finalCommandList
+                    continue
+                } else {   
+                    set $command $finalCommandList
+                    set command  none
+                }
+            } 
+        }
+
+        switch $command {
+            method -
+            groupId -
+            duration -
+            noDestroy {
+                set $command $arg
+                set command  none
+            }
+
+            none {
+                switch $arg {
+                    method {
+                        set command method
+                    }
+                    duration {
+                        set command duration
+                    }
+                    groupId {
+                        set command groupId
+                    }
+                    verbose {
+                        set verbose $::true
+                    }
+                    noVerbose -
+                    noverbose {
+                        set verbose $::false
+                    }
+                    create {
+                        set create $::true
+                    }
+                    nocreate -
+                    noCreate {
+                        set create $::false
+                    }
+                    destroy {
+                        set destroy $::true
+                    }
+                    nodestroy -
+                    noDestroy {
+                        set destroy $::false
+                    }
+                    default {
+                        errorMsg "Parameter not supported: $dash$arg"
+                        set retCode $::TCL_ERROR
+                    }
+                }
+            }
+            default {
+                errorMsg "Error in parameters: $args"
+                set retCode $::TCL_ERROR
+            }
+        }
+    }
+    #logMsg "\n method:$method, verbose:$verbose, groupId:$groupId, duration:$duration, \
+    #        create:$create, destroy:$destroy, commandList:$commandList\n"
+
+
+    if [llength $portArray] {
+        set verbose "-$verbose"
+        if {$create == $::true} {
+            debugMsg "issuePortGroupCommand: create port group $groupId"
+            if [portGroup create $groupId] {
+                errorMsg $verbose "Error creating port group $groupId"
+                set retCode $::TCL_ERROR
+            }
+        }
+
+        if {$retCode == 0} {
+            set tx_l 0
+            set tx_p 0
+	        foreach tx_port $portArray {
+		        if {[scan $tx_port "%d %d %d" tx_c tx_l tx_p] != 3} {
+					errorMsg $verbose "Error in input port array: $tx_port"
+					set retCode $::TCL_ERROR
+				} else {
+					if [portGroup add $groupId $tx_c $tx_l $tx_p] {
+						errorMsg $verbose "Error adding [getPortId $tx_c $tx_l $tx_p] to Tx Port Group."
+						set retCode $::TCL_ERROR
+					}
+				}
+	        }
+
+            foreach command $commandList {
+                switch $method {
+                    setCommand {
+						debugMsg "issuePortGroupCommand: method:$method, Command -$command, portArray -$portArray"
+						
+						# We don't want to change the original return values ($::TCL_OK/$::TCL_ERROR) of issuePortGroupMethod.
+						set retVal	[portGroup $method $groupId $command]
+
+						switch $retVal \
+							$::ixTcl_notLicensed {
+								errorMsg "Error setting command $command for port group $groupId - ixTcl_notLicensed"
+								set retCode $::TCL_ERROR
+							}\
+							$::ixTcl_notAvailable   {               
+								errorMsg "Error setting command $command for port group $groupId - ixTcl_notAvailable"
+								set retCode $::TCL_ERROR
+							}\
+							$::ixTcl_generalError   {               
+								errorMsg "Error setting command $command for port group $groupId - ixTcl_generalError"
+								set retCode $::TCL_ERROR
+							}\
+							$::ixTcl_ok -\
+							default {
+							}
+                
+                        set lastTimestamp   [portGroup cget -lastTimestamp]
+                    }
+                    get {
+	                    if {[portGroup $method $groupId $command]} {
+		                    errorMsg $verbose "Error getting $method $command for port group $groupId"
+		                    set retCode $::TCL_ERROR
+	                    }
+                    }
+                    clearScheduledTransmitTime {
+                        if {[portGroup $method $groupId]} {
+		                    errorMsg $verbose "Error $method for port group $groupId"
+		                    set retCode $::TCL_ERROR
+	                    }
+                    }
+
+                    setScheduledTransmitTime {
+                        if {[portGroup $method $groupId $duration]} {
+		                    errorMsg $verbose "Error $method for port group $groupId"
+		                    set retCode $::TCL_ERROR
+	                    }
+                    }
+                }
+            }
+        }
+
+        if {$destroy == $::true} {
+            debugMsg "issuePortGroupCommand: destroy port group $groupId"
+            if [portGroup destroy $groupId] {
+                errorMsg $verbose "Error destroying port group $groupId"
+                set retCode $::TCL_ERROR
+            }
+        }
+    } else {
+        set retCode $::TCL_ERROR
+    }
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startTx
+#
+# This command arms each Tx port & then sends out a pulse to the master
+# to begin transmitting
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to start
+#                     transmit on
+#
+########################################################################
+proc startTx {TxRxArray {staggeredStart notStaggeredStart} {FirstTimestamp ""} {groupId 710} {create create} {destroy destroy}} \
+{
+    global ixgFirstTimeStamp
+
+	upvar $TxRxArray        txRxArray
+    upvar $FirstTimestamp   firstTimestamp
+
+	set retCode	        $::TCL_OK
+    set firstTimestamp  0
+
+    set txRxList    [getTxPorts txRxArray]
+
+    if {$staggeredStart == "notStaggeredStart" || $staggeredStart == "false"} {
+        set command  startTransmit
+    } else {
+        set command staggeredStartTransmit
+    }
+
+    if [issuePortGroupCommand $command txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting Transmission for port group"
+		set retCode $::TCL_ERROR
+	}
+
+    set ixgFirstTimeStamp   $firstTimestamp
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startStaggeredTx
+#
+# This command arms each Tx port & then sends out a pulse to the master
+# to begin transmitting
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to start
+#                     transmit on
+#
+########################################################################
+proc startStaggeredTx {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray        txRxArray
+
+	return [startTx txRxArray staggeredStart firstTimeStamp $groupId $create $destroy]
+}
+
+
+########################################################################
+# Procedure: stopTx
+#
+# This command arms each Tx port & then sends out a pulse to the master
+# to stop transmitting
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to stop
+#                     transmit on
+#
+########################################################################
+proc stopTx {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode	$::TCL_OK
+
+    set txRxList    [getTxPorts txRxArray]
+    if [issuePortGroupCommand stopTransmit txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping Transmission on port group"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startPortTx
+#
+# This command starts Tx on a single port; it will also stop transmit &
+# zero stats on this port before transmitting.
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc startPortTx {chassis lm port {FirstTimestamp ""} {groupId 710} {create create} {destroy destroy}} \
+{
+    upvar $FirstTimestamp   firstTimestamp
+	set retCode	$::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand startTransmit portList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting Transmission on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+    if [info exists firstTimestamp] {
+        debugMsg "startPortTx on port $chassis,$lm,$port: firstTimestamp = $firstTimestamp"
+	}
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: stopPortTx
+#
+# This command stops Tx on a single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc stopPortTx {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode	$::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand stopTransmit portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping Transmission on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startCapture
+#
+# This command turns on capture for each Rx port
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to start
+#                     capture on
+#
+########################################################################
+proc startCapture {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode 0
+
+    set txRxList    [getRxPorts txRxArray]
+    if [issuePortGroupCommand startCapture txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting Capture for port group"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startPrbsCapture
+#
+# This command turns on capture and Packet Groups for each Rx port
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to start
+#                     capture on
+#
+########################################################################
+proc startPrbsCapture {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode 0
+
+    set txRxList    [getRxPorts txRxArray]
+    if [issuePortGroupCommand startPrbsCapture txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting PRBS metric collection for port group"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: stopCapture
+#
+# This command stops capture for each Rx port
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to stop
+#                     capture on
+#
+########################################################################
+proc stopCapture {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode 0
+
+    set txRxList    [getRxPorts txRxArray]
+    if [issuePortGroupCommand stopCapture txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping Capture for port group"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+########################################################################
+# Procedure: stopPrbsCapture
+#
+# This command stops capture and Packet Groups for each Rx port
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to stop
+#                     capture on
+#
+########################################################################
+proc stopPrbsCapture {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode 0
+
+    set txRxList    [getRxPorts txRxArray]
+    if [issuePortGroupCommand stopPrbsCapture txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping PRBS metric collection for port group"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+########################################################################
+# Procedure: clearPrbsCapture
+#
+# This command clears PRBS capture for each Rx port
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to stop
+#                     capture on
+#
+########################################################################
+proc clearPrbsCapture {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode 0
+
+    set txRxList    [getRxPorts txRxArray]
+    if [issuePortGroupCommand clearPrbsCapture txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing PRBS capture for port group"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startPortCapture
+#
+# This command starts capture on a single port;
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc startPortCapture {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode	0
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand startCapture portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting Capture on port $chassis,$lm,$port"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startPortPrbsCapture
+#
+# This command starts capture and Packet Groups on a single port;
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc startPortPrbsCapture {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode	0
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand startPrbsCapture portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting PRBS metric collection on port $chassis,$lm,$port"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+
+########################################################################
+# Procedure: stopPortCapture
+#
+# This command stops capture on a single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	1 if OK, 0 if port not configured
+#
+########################################################################
+proc stopPortCapture {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode	0
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand stopCapture portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping Capture on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+########################################################################
+# Procedure: stopPortPrbsCapture
+#
+# This command stops capture and Packet Groups on a single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	1 if OK, 0 if port not configured
+#
+########################################################################
+proc stopPortPrbsCapture {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode	0
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand stopPrbsCapture portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping PRBS metric collection on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: clearPortPrbsCapture
+#
+# This command clears PRBS capture on a single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	1 if OK, 0 if port not configured
+#
+########################################################################
+proc clearPortPrbsCapture {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode	0
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand clearPrbsCapture portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing PRBS capture on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+########################################################################
+# Procedure: startPacketGroups
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to initiate packetGroup stats
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to start
+#                     capturing latency stats on
+#
+########################################################################
+proc startPacketGroups {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode $::TCL_OK
+
+    set txRxList    [getRxPorts txRxArray]
+
+    if [issuePortGroupCommand startPacketGroups txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting packetGroup stats for port group"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: stopPacketGroups
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to stop packetGroup stats
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to stop
+#                     capturing latency stats on
+#
+########################################################################
+proc stopPacketGroups {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode $::TCL_OK
+
+    set txRxList    [getRxPorts txRxArray]
+    if [issuePortGroupCommand stopPacketGroups txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping packetGroup stats for port group"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startPortPacketGroups
+#
+# This command starts packetGroup stats on a single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc startPortPacketGroups {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand startPacketGroups portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting packetGroup stats on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+########################################################################
+# Procedure: stopPortPacketGroups
+#
+# This command stops packetGroup stats on a single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc stopPortPacketGroups {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand stopPacketGroups portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping packetGroup stats on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+	return $retCode
+}
+
+########################################################################
+# Procedure: clearPacketGroups
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to clear packetGroup stats
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to stop
+#                     capturing latency stats on
+#
+########################################################################
+proc clearPacketGroups {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode $::TCL_OK
+
+    set txRxList    [getRxPorts txRxArray]
+    if [issuePortGroupCommand clearPacketGroups txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing packetGroup stats for port group"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+########################################################################
+# Procedure: clearPortPacketGroups
+#
+# This command clears packetGroup stats on a single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc clearPortPacketGroups {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand clearPacketGroups portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing packetGroup stats on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startCollisions
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to initiate collisions
+#
+# Arguments:
+#   TxRxArray	- either array or list containing ports to start collisions
+#
+########################################################################
+proc startCollisions {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode	0
+
+    set rxPortList    [getRxPorts txRxArray]
+
+    if [issuePortGroupCommand collisionStart rxPortList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting collisions stats for port group"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: stopCollisions
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to stop collisions
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to stop collisions
+#
+########################################################################
+proc stopCollisions {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode	0
+
+    set rxPortList    [getRxPorts txRxArray]
+    if [issuePortGroupCommand collisionStop rxPortList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stopping collisions stats for port group"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: startPortCollisions
+#
+# This command starts collisions on a single port
+#
+# Arguments(s):
+#	c	- chassis
+#	l	- card
+#	p	- port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc startPortCollisions {c l p {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode	0
+
+    set portList    [list [list $c $l $p]]
+	
+	if [startCollisions portList $groupId $create $destroy] {
+		errorMsg "Error starting collisions stats on port [getPortId $c $l $p]"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+########################################################################
+# Procedure: stopPortCollisions
+#
+# This command stops collisions on a single port
+#
+# Arguments(s):
+#	c	- chassis
+#	l	- card
+#	p	- port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc stopPortCollisions {c l p {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode	0
+
+    set portList    [list [list $c $l $p]]
+    if [stopCollisions portList $groupId $create $destroy] {
+	    errorMsg "Error stopping collisions stats on port [getPortId $c $l $p]"
+		set retCode 1
+	}
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: zeroStats
+#
+# This command zeros all stats
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to zero
+#                     stats on
+#
+########################################################################
+proc zeroStats {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode $::TCL_OK
+
+	logMsg "Resetting Statistics ..."
+
+    set txRxList    [getAllPorts txRxArray]
+    if [issuePortGroupCommand resetStatistics txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error resetting stats for port group"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: zeroPortStats
+#
+# This command zeros all stats on this port
+#
+# Argument(s):
+#	chassis		chassis ID
+#	lm			Load Module number
+#	port		port number
+#
+########################################################################
+proc zeroPortStats {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand resetStatistics portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error resetting stats on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: clearPerStreamTxStats
+#
+# This command zeros all stream Tx stats on all ports
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to zero
+#                     stats on
+#
+########################################################################
+proc clearPerStreamTxStats {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode $::TCL_OK
+
+    set txRxList    [getAllPorts txRxArray]
+    if [issuePortGroupCommand clearPerStreamTxStats txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing per stream Tx stats for port group"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: clearPerStreamTxPortStats
+#
+# This command zeros all stream Tx stats on this port
+#
+# Argument(s):
+#	chassis		chassis ID
+#	lm			Load Module number
+#	port		port number
+#
+########################################################################
+proc clearPerStreamTxPortStats {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand clearPerStreamTxStats portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing per stream Tx stats on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+########################################################################
+# Procedure: clearPcsLaneStatistics
+#
+# This command zeros all pcs data lane stats on all ports
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to zero
+#                     stats on
+#
+########################################################################
+proc clearPcsLaneStatistics {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode $::TCL_OK
+
+    set txRxList    [getAllPorts txRxArray]
+    if [issuePortGroupCommand clearPcsLaneStats txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing pcs lane stats for port group"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: clearPcsLanePortStatistics
+#
+# This command zeros all pcs data lane stats on this ports
+#
+# Argument(s):
+#	chassis		chassis ID
+#	lm			Load Module number
+#	port		port number
+#
+########################################################################
+proc clearPcsLanePortStatistics {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+	set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand clearPcsLaneStats portList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing pcs lane stats on port $chassis,$lm,$port"
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+
+########################################################################
+# Procedure: clearTimeStamp
+#
+# This command synchronizes the timestamp value among all chassis
+#
+# Arguments:
+#   TxRxArray   - either array or list containing ports to clear/synchronize
+#                 time stamp on
+#
+########################################################################
+proc clearTimeStamp {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray txRxArray
+
+	set retCode	0
+
+    set txRxList    [getAllPorts txRxArray]
+    if [issuePortGroupCommand clearTimeStamp txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing the time stamp for port group "
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: flushAddressTable
+#
+# This command writes MII in order to flush the address table. Note:
+# this may not work with all DUTs.
+#
+# Arguments(s):
+#   PortMap     one2oneArray, one2manyArray, many2oneArray or many2manyArray
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc flushAddressTable { PortMap {checkLink yes}} \
+{
+	upvar $PortMap portMap
+
+    set retCode $::TCL_OK
+
+    set portList  [getAllPorts portMap]
+
+    changePortLoopback portList $::true verbose
+    checkLinkState portMap portsToRemove messageOff
+    changePortLoopback portList $::false verbose
+
+	# check the link state of all ports; if down, remove from list
+    if {$checkLink == "yes"} {
+	    if [checkLinkState portList portsToRemove noMessage] {
+            if { [llength $portsToRemove] >0 && [advancedTestParameter cget -removePortOnLinkDown] == "true" } {
+                set retCode [removePorts portList $portsToRemove]
+            } else {
+                set errMsg   "Link down on one or more ports"
+                set retCode $::TCL_ERROR
+            }
+	    }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: enableArpResponse
+#
+# This command gets the MAC & IP addresses for that port, sets up the
+# address table and enables the arp response engine for all ports in
+# the portlist
+#
+# Arguments(s):
+#   mapType - either oneIpToOneMAC or manyIpToOneMAC
+#   PortMap - list or array of ports, ie. ixgSortMap
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc enableArpResponse { mapType PortMap {write nowrite}} \
+{
+    upvar $PortMap   portMap
+    set retCode 0
+
+    set portList    [getAllPorts portMap]
+    foreach myport $portList {
+		scan $myport "%d %d %d" c l p
+
+        if [enablePortArpResponse $mapType $c $l $p nowrite] {
+            set retCode 1
+        }
+    }
+
+    if {$retCode == 0 && $write == "write"} {
+        set retCode [writeConfigToHardware portMap]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: enablePortArpResponse
+#
+# This command gets the MAC & IP addresses for that port, sets up the
+# address table and enables the arp response engine for the specified port
+#
+# Arguments(s):
+#   mapType - either oneIpToOneMAC or manyIpToOneMAC
+#   chassis
+#   lm
+#   port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc enablePortArpResponse { mapType chassis lm port {write write}} \
+{
+    set retCode 0
+
+    protocolServer config -enableArpResponse true
+
+    if [protocolServer set $chassis $lm $port] {
+        errorMsg "Error setting protocol server on $chassis $lm $port"
+        set retCode 1
+    }
+
+    if {$write == "write" && $retCode == 0} {
+        if [protocolServer write $chassis $lm $port] {
+            errorMsg "Error writing protocol server on $chassis $lm $port"
+            set retCode 1
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: disableArpResponse
+#
+# This command disables the arp response engine for all ports in
+# the portlist
+#
+# Arguments(s):
+#   PortMap - list or array of ports, ie. ixgSortMap
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc disableArpResponse { PortMap {write nowrite}} \
+{
+    upvar $PortMap   portMap
+    set retCode 0
+
+    set portList    [getAllPorts portMap]
+    foreach myport $portList {
+		scan $myport "%d %d %d" c l p
+
+        if [disablePortArpResponse $c $l $p nowrite] {
+            set retCode 1
+        }
+    }
+
+    if {$retCode == 0 && $write == "write"} {
+        set retCode [writeConfigToHardware portMap]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: disablePortArpResponse
+#
+# This command disables the arp response engine for the specified port
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc disablePortArpResponse {chassis lm port {write write}} \
+{
+    set retCode 0
+
+    if [protocolServer get $chassis $lm $port] {
+        errorMsg "Error getting protocol server on $chassis $lm $port"
+        set retCode 1
+    }
+
+    protocolServer config -enableArpResponse false
+
+    if [protocolServer set $chassis $lm $port] {
+        errorMsg "Error setting protocol server on $chassis $lm $port"
+        set retCode 1
+    }
+
+    if {$write == "write" && $retCode == 0} {
+        if [protocolServer write $chassis $lm $port] {
+            errorMsg "Error writing protocol server on $chassis $lm $port"
+            set retCode 1
+        }
+    }
+
+    return $retCode
+}
+
+
+
+########################################################################
+# Procedure: transmitArpRequest
+#
+# This command transmits an Arp request via the protocol server.
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to transmit
+#                     arp request on
+#
+########################################################################
+proc transmitArpRequest {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray        txRxArray
+
+	set retCode	0
+
+    set txRxList    [getTxPorts txRxArray]
+    if [issuePortGroupCommand transmitArpRequest txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error transmitting arp request for port group"
+		set retCode 1
+	}
+
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: transmitPortArpRequest
+#
+# This command transmits an Arp request via the protocol server on a
+# single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc transmitPortArpRequest {chassis lm port} \
+{
+	set retCode	0
+
+    if [arpServer sendArpRequest $chassis $lm $port] {
+	    errorMsg "Error transmitting arp request on port $chassis,$lm,$port"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: clearArpTable
+#
+# This command clears the arp table via the protocol server.
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to clear
+#                     arp table on
+#
+########################################################################
+proc clearArpTable {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+	upvar $TxRxArray        txRxArray
+
+	set retCode	0
+
+    set txRxList    [getTxPorts txRxArray]
+    if [issuePortGroupCommand clearArpTable txRxList noVerbose lastTimestamp $groupId $create $destroy] {
+	    errorMsg "Error clearing arp for port group"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: clearPortArpTable
+#
+# This command clears the arp table on a single port
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc clearPortArpTable {chassis lm port} \
+{
+	set retCode	0
+
+    if [arpServer clearArpTable $chassis $lm $port] {
+	    errorMsg "Error clearing arp table on port $chassis,$lm,$port"
+		set retCode 1
+	}
+
+	return $retCode
+}
+
+
+
+########################################################################
+# Procedure: setDataIntegrityMode
+#
+# This command sets all the RX ports in the list or array to data 
+# integrity mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setDataIntegrityMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [changePortReceiveMode txRxArray $::portRxDataIntegrity $write]
+}
+
+########################################################################
+# Procedure: setPrbsMode
+#
+# This command sets all the RX ports in the list or array to data 
+# integrity mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setPrbsMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [changePortReceiveMode txRxArray $::portRxModePrbs $write]
+}
+
+########################################################################
+# Procedure: setPacketGroupMode
+#
+# This command sets all the RX ports in the list or array to packet
+# group mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setPacketGroupMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [changePortReceiveMode txRxArray $::portPacketGroup $write]
+}
+
+
+########################################################################
+# Procedure: setWidePacketGroupMode
+#
+# This command sets all the RX ports in the list or array to wide packet
+# group mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setWidePacketGroupMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [changePortReceiveMode txRxArray $::portRxModeWidePacketGroup $write]
+}
+
+
+########################################################################
+# Procedure: setCaptureMode
+#
+# This command sets all the RX ports in the list or array to capture
+# mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setCaptureMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [changePortReceiveMode txRxArray $::portCapture $write]
+}
+
+
+########################################################################
+# Procedure: setTcpRoundTripFlowMode
+#
+# This command sets all the RX ports in the list or array to round trip
+# tcp flow mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setTcpRoundTripFlowMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+    global portRxTcpRoundTrip
+
+    return [changePortReceiveMode txRxArray $portRxTcpRoundTrip $write]
+}
+
+
+########################################################################
+# Procedure: setPacketStreamMode
+#
+# This command sets all the TX ports in the list or array to packet
+# stream mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setPacketStreamMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+    global portTxPacketStreams
+
+    return [changePortTransmitMode txRxArray $portTxPacketStreams $write]
+}
+
+
+########################################################################
+# Procedure: setPacketFlowMode
+#
+# This command sets all the TX ports in the list or array to packet
+# flow mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setPacketFlowMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set retCode [changePortTransmitMode txRxArray $::portTxPacketFlows $write]
+    switch $retCode "
+        $::TCL_OK -
+        $::ixTcl_unsupportedFeature {
+            set retCode $::TCL_OK
+        }
+    "
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: setAdvancedStreamSchedulerMode
+#
+# This command sets all the TX ports in the list or array to use the
+# advanced scheduler
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setAdvancedStreamSchedulerMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set retCode [changePortTransmitMode txRxArray $::portTxModeAdvancedScheduler $write]
+    switch $retCode "
+        $::TCL_OK -
+        $::ixTcl_unsupportedFeature {
+            set retCode $::TCL_OK
+        }
+    "
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: setFirstLastTimestampMode
+#
+# This command sets all the TX ports in the list or array to PG TimeStamp
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setFirstLastTimestampMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+    global portRxFirstTimeStamp
+
+    return [changePortReceiveMode txRxArray $portRxFirstTimeStamp $write]
+}
+
+########################################################################
+# Procedure: setDataIntegrityMode
+#
+# This command sets all the TX ports in the list or array to Data integrity
+# Mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setDataIntegrityMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+    global portRxDataIntegrity
+
+    return [changePortReceiveMode txRxArray $portRxDataIntegrity $write]
+}
+
+
+########################################################################
+# Procedure: setSequenceCheckingMode
+#
+# This command sets all the TX ports in the list or array to Sequence
+# Checking Mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setSequenceCheckingMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [changePortReceiveMode txRxArray $::portRxSequenceChecking $write]
+}
+
+
+########################################################################
+# Procedure: changePortTransmitMode
+#
+# This command sets all the TX ports in the list or array to the
+# specified transmit mode & optionally writes it to hw
+#
+#   NOTE:  This proc does not affect oc12 cards because transmit modes
+#          are not yet supported on those cards.
+#
+#   NOTE:  For OC48, if the transmit mode is specifed as "packetFlows", 
+#          this proc will download the advancedScheduler fpga.
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   transmitMode    - either portTxPacketStreams or portTxPacketFlows
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc changePortTransmitMode {TxRxArray transmitMode {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode 0
+    set infoFlag 1
+
+	foreach tx_port [getTxPorts txRxArray] {
+		scan $tx_port "%d %d %d" tx_c tx_l tx_p
+        
+        # Check if the transmit mode is valid for the port, if it is not valid, just do nothing.
+        # Some tests use packetFlow mode, but it is not available for 10100DPM, OC48 and oc192
+        # (only packetStream & AdvancedScheduler modes applicable to 10100DPM, OC48 and oc192),
+        # in this case we still use packetStream mode.
+       
+        set retCode [port setTransmitMode $transmitMode $tx_c $tx_l $tx_p]
+
+        switch $retCode {
+            0 {
+                lappend modList [list $tx_c $tx_l $tx_p]
+            }
+            1 {
+                errorMsg "Error setting port [getPortId $tx_c $tx_l $tx_p]"
+                continue
+            }
+            100 {
+                errorMsg "Port [getPortId $tx_c $tx_l $tx_p] is unavailable, check ownership."
+                continue
+            }
+            101 {
+                # Note: we won't print out this warning msg temporarily.
+                # logMsg "!WARNING:[getTxRxModeString $transmitMode ] not supported on port\
+                #        [getPortId $tx_c $tx_l $tx_p], actual transmit rate may vary from configured rate."
+
+                set infoFlag 0
+                continue
+            }
+            200 {
+                set retCode 0
+                continue
+            }
+        }
+	}
+
+    if {$write == "write" && [info exists modList]} {
+        logMsg "Changing TX port mode - downloading FPGA, please wait ..."
+        set retCode [writePortsToHardware modList -noProtocolServer]
+    } else {
+        if {$infoFlag} {
+            logMsg "Configuring TX port mode to [getTxRxModeString $transmitMode]"
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: changePortReceiveMode
+#
+# This command sets all the RX ports in the list or array to the
+# specified Receive mode & optionally writes it to hw
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   receiveMode     -
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc changePortReceiveMode {TxRxArray receiveMode {write nowrite} {verbose yes} } \
+{
+    upvar $TxRxArray txRxArray
+    set retCode 0
+
+    set txRxList    [getRxPorts txRxArray]
+
+    # Checking link state here because if the link is coming up or not quite up yet when we do
+    # the port set, then the port gets set all wrong...
+    
+#    checkLinkState txRxList portsToRemove noMessage
+
+	foreach rx_port $txRxList {
+		scan $rx_port "%d %d %d" rx_c rx_l rx_p
+		set retCode [port setReceiveMode $receiveMode $rx_c $rx_l $rx_p]
+
+		switch $retCode {
+		    0 {
+		        lappend modList [list $rx_c $rx_l $rx_p]
+		    }
+		    1 {
+		        errorMsg "Error setting port [getPortId $rx_c $rx_l $rx_p]"
+		        continue
+		    }
+		    100 {
+		        errorMsg "Port [getPortId $rx_c $rx_l $rx_p] is unavailable, check ownership."
+		        continue
+		    }
+		    101 {
+		        errorMsg "!WARNING:[getTxRxModeString $receiveMode RX] mode not supported on port \
+                        [getPortId $rx_c $rx_l $rx_p]"
+		        continue
+		    }
+		    200 {
+                set retCode 0
+		        continue
+		    }
+		}
+    }
+
+    if {$write == "write" && [info exists modList]} {
+        logMsg "Changing RX port mode - downloading FPGA, please wait ..."
+        if [writePortsToHardware modList -noProtocolServer] {
+            set retCode 1
+        }
+        set retCode [checkLinkState modList]
+    } else {
+        if {$verbose == "yes" } {
+            logMsg "Configuring RX port mode to [getTxRxModeString $receiveMode RX]"
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: writeToHardware
+#
+# This command writes into hardware.
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc writeToHardware {PortArray args} \
+{
+    upvar $PortArray portArray
+    ixProfile
+    set retCode $::TCL_OK
+
+    set portList    [getAllPorts portArray]
+
+    # default some vars here...
+    set method  write
+    set verbose $::true
+    set groupId 1126
+    set create  $::true
+    set destroy $::true
+
+    # this one is *new*, set to false to avoid stopping the protocol server 
+    # when you really just want to write all streams + filters...
+    # default is to write protocolServer to support backwards compatibility
+    set writeProtocolServer $::true
+
+    set command none
+    foreach arg [join $args] {
+        # just go ahead & remove the '-', makes things easier
+        set dash [expr [regsub -all {^-} $arg "" arg]?"-":""]
+        switch $command {
+            method -
+            groupId -
+            noDestroy {
+                set $command $arg
+                set command  none
+            }
+            none {
+                switch $arg {
+                    method {
+                        set command method
+                    }
+                    protocolServer -
+                    writeProtocolServer {
+                        set writeProtocolServer $::true
+                    }
+                    noProtocolServer -                       
+                    noWriteProtocolServer {
+                        set writeProtocolServer $::false
+                    }
+                    verbose {
+                        set verbose $::true
+                    }
+                    noVerbose -
+                    noverbose {
+                        set verbose $::false
+                    }
+                    groupId {
+                        set command groupId
+                    }
+                    create {
+                        set create $::true
+                    }
+                    nocreate -
+                    noCreate {
+                        set create $::false
+                    }
+                    destroy {
+                        set destroy $::true
+                    }
+                    nodestroy -
+                    noDestroy {
+                        set destroy $::false
+                    }
+                    default {
+                        errorMsg "Parameter not supported: $dash$arg"
+                        set retCode $::TCL_ERROR
+                    }
+                }
+            }
+            default {
+                errorMsg "Error in parameters: $args"
+                set retCode $::TCL_ERROR
+            }
+        }
+    }
+    debugMsg "method:$method, writeProtocolServer:$writeProtocolServer, verbose:$verbose, groupId:$groupId, create:$create, destroy:$destroy"
+
+    if [llength $portList] {
+        if {$create} {
+            portGroup destroy $groupId
+            if [portGroup create $groupId] {
+                errorMsg "Error creating port group $groupId"
+                set retCode $::TCL_ERROR
+            }
+        }
+
+        if {$retCode == 0} {
+            if [catch {
+	            foreach tx_port $portList {
+		            scan $tx_port "%d %d %d" tx_c tx_l tx_p
+
+                    if [portGroup add $groupId $tx_c $tx_l $tx_p] {
+                        errorMsg "Error adding [getPortId $tx_c $tx_l $tx_p] to port group"
+                        set retCode $::TCL_ERROR
+                    }
+	            }
+
+                if {$verbose} {
+                    ixPuts "--->Writing configuration to hardware..."
+                }
+	            if [portGroup $method $groupId $writeProtocolServer] {
+		            errorMsg "Error writing configuration for port group $groupId"
+		            set retCode $::TCL_ERROR
+	            }
+
+                if {$verbose} {
+                    ixPuts "    done writing configuration to hardware..."
+                }
+            } error] {
+                errorMsg $error
+                set retCode $::TCL_ERROR
+            }
+        }
+        if {$destroy} {
+            if [portGroup destroy $groupId] {
+                errorMsg "Error destroying port group"
+                set retCode $::TCL_ERROR
+            }
+        }
+    } else {
+        errorMsg "No ports in port list/map"
+        set retCode $::TCL_ERROR
+    }
+
+    ixProfile
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: writeToHardwareAsChunks
+#
+# This command writes the ports, including speed, etc into hardware. It
+# differs from writeConfigToHardware because this command writes all
+# the phy as well as the configuration.
+#
+# Argument(s):
+#	PortArray	   either list of ports or array of ports
+#   action         write | writeConfig
+#   args           options include:
+#                   -verbose             <turn on messages>
+#                   -noVerbose           <turn off messages, default>
+#                   -writeProtocolServer <stops protocol server & writes 
+#                                         all associated objects, default>
+#                   -noProtocolServer    <no effect on protocol server,
+#                                         doesn't update protocol server objects>
+#                   -groupId             <groupId, default == 1126>
+#                   -create/-noCreate    <default = create, optionally create/don't create portGroup
+#                   -destroy/-noDestroy  <default = destroy, optionally leave portGroup around when done>        
+#
+########################################################################
+proc writeToHardwareAsChunks {PortArray action args} \
+{
+    upvar $PortArray portArray
+
+##############
+##  funky workaround to avoid sending too much crap at once to the server
+##############
+    set retCode $::TCL_OK
+
+    set chunkSize [advancedTestParameter cget -portWriteChunkSize]
+    set allPorts  [getAllPorts portArray]
+    set from      0
+
+    if {[llength $allPorts]} {
+
+		if {$chunkSize > 0} {
+			set to   [expr $chunkSize - 1]
+		} else {
+			set to   [llength $allPorts]
+		}
+		set actionGroup [lrange $allPorts $from $to]
+		set myArgs [concat $args "-noVerbose"]
+	
+		while {$actionGroup != ""} {
+			if {$to >= [llength $allPorts]} {
+				set myArgs $args
+			}
+			if [writeToHardware actionGroup [join [list -method $action [join $myArgs]]]] {
+				set retCode $::TCL_ERROR
+			}
+			if {$chunkSize > 0} {
+				incr from $chunkSize
+				incr to   $chunkSize
+
+				set actionGroup [lrange $allPorts $from $to]
+			} else {
+				set actionGroup ""
+			}
+		}
+	} else {
+        errorMsg "No ports in port list/map"
+        set retCode $::TCL_ERROR
+    } 	
+    
+    return $retCode    
+}
+
+
+
+########################################################################
+# Procedure: writePortsToHardware
+#
+# This command writes the ports, including speed, etc into hardware. It
+# differs from writeConfigToHardware because this command writes all
+# the phy as well as the configuration.
+#
+# Argument(s):
+#	PortArray	   either list of ports or array of ports
+#   args           options include:
+#                   -verbose             <turn on messages>
+#                   -noVerbose           <turn off messages, default>
+#                   -writeProtocolServer <stops protocol server & writes 
+#                                         all associated objects, default>
+#                   -noProtocolServer    <no effect on protocol server,
+#                                         doesn't update protocol server objects>
+#                   -groupId             <groupId, default == 1126>
+#                   -create/-noCreate    <default = create, optionally create/don't create portGroup
+#                   -destroy/-noDestroy  <default = destroy, optionally leave portGroup around when done>        
+#
+########################################################################
+proc writePortsToHardware {PortArray args} \
+{
+    upvar $PortArray portArray
+
+    return [writeToHardwareAsChunks portArray write [join $args]]
+}
+
+
+########################################################################
+# Procedure: writeConfigToHardware
+#
+# This command writes the port array into hardware
+#
+# Argument(s):
+#	PortArray	   either list of ports or array of ports
+#   args           options include:
+#                   -verbose             <turn on messages>
+#                   -noVerbose           <turn off messages, default>
+#                   -writeProtocolServer <stops protocol server & writes 
+#                                         all associated objects, default>
+#                   -noProtocolServer    <no effect on protocol server,
+#                                         doesn't update protocol server objects>
+#                   -groupId             <groupId, default == 1126>
+#                   -create/-noCreate    <default = create, optionally create/don't create portGroup
+#                   -destroy/-noDestroy  <default = destroy, optionally leave portGroup around when done>        
+#
+########################################################################
+proc writeConfigToHardware {PortArray args} \
+{
+    upvar $PortArray portArray
+
+    return [writeToHardwareAsChunks portArray writeConfig [join $args]]
+}
+
+
+########################################################################
+# Procedure: resetSequenceIndex
+#
+# This command reset the sequence index
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc resetSequenceIndex {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txRxList [getRxPorts txRxArray]
+    if [issuePortGroupCommand resetSequenceIndex txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error reseting the sequence index for port group"
+	    set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: resetPortSequenceIndex
+#
+# This command reset sequence index on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc resetPortSequenceIndex {chassis lm port {FirstTimestamp ""} {groupId 710} {create create} {destroy destroy}} \
+{
+    upvar $FirstTimestamp   firstTimestamp
+    set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand resetSequenceIndex portList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error reseting the sequence index on port $chassis,$lm,$port"
+	    set retCode $::TCL_ERROR
+	}
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: loadPoePulse
+#
+# This command loads the poe pulse
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc loadPoePulse {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txRxList [getAllPorts txRxArray]
+    if [issuePortGroupCommand loadPoePulse txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error loading the poe pulse for port group"
+	    set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: loadPortPoEPulse
+#
+# This command loads the poe pulse on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc loadPortPoePulse {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    return [loadPoePulse portList]
+}
+
+
+########################################################################
+# Procedure: armPoeTrigger
+#
+# This command arms the poe trigger
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc armPoeTrigger {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txRxList [getAllPorts txRxArray]
+    if [issuePortGroupCommand armPoeTrigger txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error arming the poe trigger for port group"
+	    set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: armPortPoeTrigger
+#
+# This command arms the poe trigger on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc armPortPoeTrigger {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    return [armPoeTrigger portList]
+}
+
+
+########################################################################
+# Procedure: abortPoeArm
+#
+# This command aborts the poe arm
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc abortPoeArm {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txRxList [getAllPorts txRxArray]
+    if [issuePortGroupCommand abortPoeArm txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error aborting the poe arm for port group"
+	    set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: abortPortPoeArm
+#
+# This command aborts the poe arm on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc abortPortPoeArm {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    return [abortPoeArm portList]
+}
+
+
+########################################################################
+# Procedure: resetSequenceIndex
+#
+# This command reset the sequence index
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc resetSequenceIndex {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode 0
+
+    set txRxList [getRxPorts txRxArray]
+    if [issuePortGroupCommand resetSequenceIndex txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error reseting the sequence index for port group"
+	    set retCode 1
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: resetPortSequenceIndex
+#
+# This command reset sequence index on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc resetPortSequenceIndex {chassis lm port {FirstTimestamp ""} {groupId 710} {create create} {destroy destroy}} \
+{
+    upvar $FirstTimestamp   firstTimestamp
+	set retCode	0
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand resetSequenceIndex portList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error reseting the sequence index on port $chassis,$lm,$port"
+		set retCode 1
+	}
+    if [info exists firstTimestamp] {
+        debugMsg "resetPortSequenceIndex on port $chassis,$lm,$port: firstTimestamp = $firstTimestamp"
+	}
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: loadPoEPulse
+#
+# This command loads the poe pulse
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc loadPoEPulse {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txRxList [getAllPorts txRxArray]
+    if [issuePortGroupCommand loadPoEPulse txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error loading the poe pulse for port group"
+	    set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: loadPortPoEPulse
+#
+# This command loads the poe pulse on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc loadPortPoEPulse {chassis lm port {FirstTimestamp ""} {groupId 710} {create create} {destroy destroy}} \
+{
+    upvar $FirstTimestamp   firstTimestamp
+    set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    if [issuePortGroupCommand loadPoEPulse portList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error loading the poe pulse on port $chassis,$lm,$port"
+	    set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+
+
+########################################################################
+# Procedure: restartAutoNegotiation
+#
+# This command restarts auto negotiation OR restarts PPP negotiation
+#
+# Argument(s):
+#	TxRxArray	    List of ports or array of ports
+#
+#   Results :       0 : No error found
+#                   1 : Error found
+#
+########################################################################
+proc restartAutoNegotiation {TxRxArray {groupId 710} {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txRxList [getAllPorts txRxArray]
+    if [issuePortGroupCommand restartAutoNegotiate txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error restarting auto negotiation"
+	    set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: rebootLocalCpu
+#
+# This command reboots the local Cpu on a port list
+#
+# Argument(s):
+#	PortArray	- either list of ports or array of ports
+#
+# Return:
+#	0 if OK, 1 if action failed
+#
+########################################################################
+proc rebootLocalCpu {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode		$::TCL_OK
+    set txRxList	[getAllPorts txRxArray]
+
+    foreach portItem $txRxList {
+        scan $portItem "%d %d %d" chassId cardId portId
+
+		set retValue [port isValidFeature $chassId $cardId $portId portFeatureLocalCPU]
+
+		switch $retValue {
+		    1 {
+		        lappend cpuPortList [list $chassId $cardId $portId]
+		    }
+		    0 {
+		        errorMsg "!WARNING: portFeatureLocalCPU is not supported on port [getPortId $chassId $cardId $portId]"
+		        continue
+		    }
+		}
+	}
+
+	if {[info exists cpuPortList]} {
+		logMsg "Rebooting port cpu, please wait ..."
+		if [issuePortGroupCommand rebootLocalCPU cpuPortList noVerbose firstTimestamp $groupId $create $destroy] {
+			errorMsg "Error rebooting local cpu for port group"
+			set retCode $::TCL_ERROR
+		}
+	}
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: rebootPortLocalCpu
+#
+# This command reboots the local Cpu on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if action failed
+#
+########################################################################
+proc rebootPortLocalCpu {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+    set retCode $::TCL_OK
+
+    set portList	[list [list $chassis $lm $port]]
+    return  [rebootLocalCpu portList $groupId $create $destroy] 
+}
+
+
+########################################################################
+# Procedure: simulatePhysicalInterfaceDown
+#
+# This command simulates physical interface down on a port list
+#
+# Argument(s):
+#	PortArray	- either list of ports or array of ports
+#
+# Return:
+#	0 if OK, 1 if action failed
+#
+########################################################################
+proc simulatePhysicalInterfaceDown {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode		$::TCL_OK
+    set txRxList	[getAllPorts txRxArray]
+
+    foreach portItem $txRxList {
+        scan $portItem "%d %d %d" chassId cardId portId
+
+		set retValue [port isValidFeature $chassId $cardId $portId portFeatureSimulateCableDisconnect]
+
+		switch $retValue {
+		    1 {
+		        lappend newPortList [list $chassId $cardId $portId]
+		    }
+		    0 {
+		        errorMsg "!WARNING: portFeatureSimulateCableDisconnect is not supported on port [getPortId $chassId $cardId $portId]"
+		        continue
+		    }
+		}
+	}
+
+	if {[info exists newPortList]} {
+		logMsg "Simulating physical interface down, please wait ..."
+		if [issuePortGroupCommand simulatePhysicalInterfaceDown newPortList noVerbose firstTimestamp $groupId $create $destroy] {
+			errorMsg "Error simulating physical interface down for port group"
+			set retCode $::TCL_ERROR
+		}
+	}
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: simulatePortPhysicalInterfaceDown
+#
+# This command simulates physical interface down on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if action failed
+#
+########################################################################
+proc simulatePortPhysicalInterfaceDown {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+    set retCode $::TCL_OK
+
+    set portList	[list [list $chassis $lm $port]]
+    return  [simulatePhysicalInterfaceDown portList $groupId $create $destroy] 
+}
+
+
+
+########################################################################
+# Procedure: simulatePhysicalInterfaceUp
+#
+# This command simulates physical interface up on a port list
+#
+# Argument(s):
+#	PortArray	- either list of ports or array of ports
+#
+# Return:
+#	0 if OK, 1 if action failed
+#
+########################################################################
+proc simulatePhysicalInterfaceUp {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode		$::TCL_OK
+    set txRxList	[getAllPorts txRxArray]
+
+    foreach portItem $txRxList {
+        scan $portItem "%d %d %d" chassId cardId portId
+
+		set retValue [port isValidFeature $chassId $cardId $portId portFeatureSimulateCableDisconnect]
+
+		switch $retValue {
+		    1 {
+		        lappend newPortList [list $chassId $cardId $portId]
+		    }
+		    0 {
+		        errorMsg "!WARNING: portFeatureSimulateCableDisconnect is not supported on port [getPortId $chassId $cardId $portId]"
+		        continue
+		    }
+		}
+	}
+
+	if {[info exists newPortList]} {
+		logMsg "Simulating physical interface up, please wait ..."
+		if [issuePortGroupCommand simulatePhysicalInterfaceUp newPortList noVerbose firstTimestamp $groupId $create $destroy] {
+			errorMsg "Error simulating physical interface up for port group"
+			set retCode $::TCL_ERROR
+		}
+	}
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: simulatePortPhysicalInterfaceUp
+#
+# This command simulates physical interface up on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if action failed
+#
+########################################################################
+proc simulatePortPhysicalInterfaceUp {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+    set retCode $::TCL_OK
+
+    set portList	[list [list $chassis $lm $port]]
+    return  [simulatePhysicalInterfaceUp portList $groupId $create $destroy] 
+}
+
+
+
+########################################################################
+# Procedure: startAtmOamTransmit
+#
+# This command starts the atm oam transmit
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc startAtmOamTransmit {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txRxList [getAllPorts txRxArray]
+    if [issuePortGroupCommand startAtmOamTx txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error starting Atm Oam transmit for port group"
+	    set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: startPortAtmOamTransmit
+#
+# This command starts the atm oam transmit on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc startPortAtmOamTransmit {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    return [startAtmOamTransmit portList]
+}
+
+
+########################################################################
+# Procedure: stopAtmOamTransmit
+#
+# This command starts the atm oam transmit
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc stopAtmOamTransmit {TxRxArray { groupId 710 } {create create} {destroy destroy}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txRxList [getAllPorts txRxArray]
+    if [issuePortGroupCommand stopAtmOamTx txRxList noVerbose firstTimestamp $groupId $create $destroy] {
+	    errorMsg "Error stoping Atm Oam transmit for port group"
+	    set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: stopPortAtmOamTransmit
+#
+# This command starts the atm oam transmit on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc stopPortAtmOamTransmit {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    set portList    [list [list $chassis $lm $port]]
+    return [stopAtmOamTransmit portList]
+}
+
+
+########################################################################
+# Procedure: setScheduledTransmitTime
+#
+# This command builds a port group, sets/clears the scheduled transmit
+# time and destroys the port group when it's done
+#
+########################################################################
+proc setScheduledTransmitTime {TxRxArray duration {groupId 710}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set txRxList        [getTxPorts txRxArray]
+    set object          [list noCommand]
+    set lastTimestamp   ""
+
+    if { $duration } {
+        return [issuePortGroupMethod txRxList lastTimestamp -method setScheduledTransmitTime -duration $duration \
+                -commandList $object -groupId $groupId -noVerbose  -create -destroy ]
+    } else {
+        return [issuePortGroupMethod txRxList lastTimestamp -method clearScheduledTransmitTime \
+                -commandList $object -groupId $groupId -noVerbose  -create -destroy ]
+
+    }
+}
+
+########################################################################
+# Procedure: setAutoInstrumentationMode
+#
+# This command sets all the RX ports in the list or array to packet
+# group mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc setAutoDetectInstrumentationMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+	set retCode $::TCL_OK
+
+    set portList		[getRxPorts txRxArray]
+	set validPortList	[list]
+
+	foreach portItem $portList {
+		scan $portItem "%d %d %d" chassId cardId portId
+
+		if {[port isValidFeature $chassId $cardId $portId $::portFeatureAutoDetectRx]} {
+			if {[port get $chassId $cardId $portId]} {
+				errorMsg "Error getting port [getPortId $chassId $cardId $portId]."
+				set retCode $::TCL_ERROR
+				break
+			}
+
+			if {[port isValidFeature $chassId $cardId $portId $::portFeatureRxWidePacketGroups]} {
+				set receiveMode	[expr ($::portRxModeWidePacketGroup | $::portRxDataIntegrity | $::portRxSequenceChecking)]
+			} else {				
+				set receiveMode	[expr ($::portPacketGroup | $::portRxDataIntegrity | $::portRxSequenceChecking)]
+			}			
+			 
+			port config -receiveMode					$receiveMode
+			port config -enableAutoDetectInstrumentation $::true
+
+			if {[port set $chassId $cardId $portId]} {
+				errorMsg "Error setting port [getPortId $chassId $cardId $portId]."
+				set retCode $::TCL_ERROR
+				break
+			}
+			lappend validPortList [list $chassId $cardId $portId]
+		}
+	}
+
+    if {$write == "write" && [llength $validPortList]} {
+        logMsg "Changing RX port mode to [getTxRxModeString $receiveMode RX] - please wait ..."
+        if [writePortsToHardware validPortList -noProtocolServer] {
+            set retCode 1
+        }
+        set retCode [checkLinkState validPortList]
+    } else {
+		logMsg "Configuring RX port mode to [getTxRxModeString $receiveMode RX]"
+    }
+
+    return $retCode
+}
+
+########################################################################
+# Procedure: enablePortIntrinsicLatencyAdjustment
+#
+# This command enables the  Intrinsic Latency Adjustment on the ports
+# that support the feature
+#
+# Arguments(s):
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc enablePortIntrinsicLatencyAdjustment { chassId cardId portId enable {write nowrite}} \
+{
+    set portList [list [list $chassId $cardId $portId]]
+
+    return [enableIntrinsicLatencyAdjustment portList $enable $write]
+}
+
+
+########################################################################
+# Procedure: enableIntrinsicLatencyAdjustment
+#
+# This command enables the  Intrinsic Latency Adjustment on the ports
+# that support the feature
+#
+# Arguments(s):
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc enableIntrinsicLatencyAdjustment { TxRxArray enable {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+	set retCode $::TCL_OK
+
+    set portList		[getAllPorts txRxArray]
+	set validPortList	[list]
+
+	if { $enable } {
+		set messageStr	"enabling"
+	} else {
+		set messageStr	"disabling"
+	}
+
+	foreach portItem $portList {
+		scan $portItem "%d %d %d" chassId cardId portId
+
+		set retCode	[ixUtils enableIntrinsicLatencyAdjustment $chassId $cardId $portId $enable]
+		if { $retCode != $::TCL_OK } {
+			logMsg "Error $messageStr of intrinsic latency adjustment for $chassId $cardId $portId"
+		} else {
+			lappend validPortList [list $chassId $cardId $portId]
+		}			
+	}
+
+	if { [llength $validPortList] } {
+		if {$write == "write" } {
+			logMsg "Enabling intrinsic latency adjustment on port(s) - please wait ..."
+			if {[writeConfigToHardware validPortList -noProtocolServer]} {
+				set retCode $::TCL_ERROR
+			}
+		} else {
+			logMsg "Configured $messageStr of intrinsic latency adjustment for port $chassId $cardId $portId"
+		}
+	} else {
+		logMsg "No valid ports in the list for intrinsic latency feature."
+	}
+
+
+    return $retCode
+}
+
+########################################################################
+# Procedure: isIntrinsicLatencyAdjustmentEnabled
+#
+# This command enables the  Intrinsic Latency Adjustment on the ports
+# that support the feature
+#
+# Arguments(s):
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc isIntrinsicLatencyAdjustmentEnabled { chassId cardId portId } \
+{
+    return [ixUtils isIntrinsicLatencyAdjustmentEnabled $chassId $cardId $portId]
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/addressTableUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/addressTableUtils.tcl
new file mode 100644
index 00000000..188ca8a8
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/addressTableUtils.tcl
@@ -0,0 +1,117 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: addressTableUtils.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	04/05/2000	DS
+#
+# Description: This file contains common procs used for ipAddressTable
+#              manipulation
+#
+##################################################################################
+
+
+########################################################################
+# Procedure: ipAddressSetDefault
+#
+# This command sets the ipAddressTable & iAddressTableItem to defaults
+#
+#
+########################################################################
+proc ipAddressSetDefault {} \
+{
+    ipAddressTable setDefault
+    ipAddressTableItem setDefault
+}
+
+
+########################################################################
+# Procedure: updateIpAddressTable
+#
+# This command updates the ipAddressTable w/current ip & port objects
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#
+########################################################################
+proc updateIpAddressTable {chassis card port {write nowrite}} \
+{
+    set retCode 0
+
+    if [ip get $chassis $card $port] {
+        errorMsg "Error getting ip on port $chassis $card $port"
+        set retCode 1
+    }
+
+    if [port get $chassis $card $port] {
+        errorMsg "Error getting port $chassis $card $port"
+        set retCode 1
+    }
+
+    ipAddressTableItem config -fromIpAddress            [ip cget -sourceIpAddr]
+    ipAddressTableItem config -gatewayIpAddress         [ip cget -destDutIpAddr]
+    ipAddressTableItem config -fromMacAddress           [port cget -MacAddress]
+    ipAddressTableItem config -numAddresses             [port cget -numAddresses]
+
+    if [ipAddressTableItem set] {
+        errorMsg "Error setting ipAddressTableItem"
+        set retCode 1
+    }
+
+    if [ipAddressTable addItem] {
+        errorMsg "Error adding item to ipAddressTable"
+        set retCode 1
+    }
+
+    ipAddressTable config -defaultGateway               [ipAddressTableItem cget -gatewayIpAddress]
+    if [ipAddressTable set $chassis $card $port] {
+        errorMsg "Error setting ipAddressTable on port $chassis $card $port"
+        set retCode 1
+    }
+
+    if {$write == "write" && $retCode == 0} {
+        if [protocolServer write $chassis $card $port] {
+            errorMsg "Error writing protocol server on $chassis $card $port"
+            set retCode 1
+        }
+    }
+
+    return $retCode
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/calculate.tcl b/dep/tclclient/ixTcl1.0/Generic/calculate.tcl
new file mode 100644
index 00000000..4dbdcdf2
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/calculate.tcl
@@ -0,0 +1,527 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: calculate.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	12-30-1998	DS
+#
+# Description: This file contains common procs used for calculating things
+#
+##################################################################################
+
+
+########################################################################
+# Procedure: mpincr
+#
+# This command uses mpexpr stuff to overlay the Tcl incr for use w/
+# 64-bit numbers.
+#
+########################################################################
+proc mpincr {Value {incrAmt 1}} \
+{
+    upvar $Value value
+
+    set value [mpexpr $value + $incrAmt]
+    return $value
+}
+
+########################################################################
+# Procedure: calculatePercentLossExact
+#
+# This command calculates the percent loss based on tx/rx frames -
+#    returns *exact* percent loss (not prettied up)
+#
+# Arguments(s):
+#   txFrames    - number of transmitted frames
+#   rxFrames    - number of received frames
+#
+########################################################################
+proc calculatePercentLossExact {txFrames rxFrames} \
+{
+    set loss 0.00
+
+	if [catch {mpexpr double($txFrames-$rxFrames)/$txFrames * 100.} loss] {
+        set loss    100.00
+    }
+
+    if {$loss < 0.} {
+        set loss 0.00
+    }
+
+    return $loss
+}
+
+
+########################################################################
+# Procedure: calculatePercentLoss
+#
+# This command calculates the percent loss based on tx/rx frames &
+# returns a formatted string of the form "%6.2f"
+#
+# Arguments(s):
+#   txFrames    - number of transmitted frames
+#   rxFrames    - number of received frames
+#
+########################################################################
+proc calculatePercentLoss {txFrames rxFrames} \
+{
+    set loss                [calculatePercentLossExact $txFrames $rxFrames]
+	set percentLossFormat   [advancedTestParameter cget -percentLossFormat]
+    set loss                [formatNumber $loss $percentLossFormat]
+
+    # check to see if we received more frames than we transmitted
+	# Since 32 bit counter (mpexpr) is used here, if we get a 32 bit long number (in binary) whose most 
+	# significant bit is 1, it will be recognized as a negtive number. So we use regexp
+    # to determinde wheather $txFrames - $rxFrames is a negative number.
+    if { [regexp {^-[0-9]+$} [mpexpr $txFrames - $rxFrames]] } {
+        set loss  "$loss - NOTE: Received more frames than tx'd"
+    }
+	#if {[mpexpr $txFrames-$rxFrames] < 0} {
+    #    set loss  "$loss - NOTE: Received more frames than tx'd"
+    #}
+
+    return $loss
+}
+
+
+########################################################################
+# Procedure: calculatePercentThroughput
+#
+# This command calculates the percent throughput based on tx/rx frames &
+# returns a formatted string of the form "%6.2f"
+#
+# Arguments(s):
+#   tputRate    - throughput rate
+#   maxRate     - max throughput rate
+#
+########################################################################
+proc calculatePercentThroughput {tputRate maxRate} \
+{
+    set thruput 0.00
+
+	if [catch {mpexpr ($tputRate*100.)/$maxRate} thruput] {
+        set thruput    0.
+    }
+
+    return  [format "%6.2f" $thruput]
+}
+
+
+########################################################################
+# Procedure: calculateDuration
+#
+# This command calculates the approximate transmit time
+#
+# Arguments(s):
+#   numTxFrames - total number of frames to transmit
+#   frameRate   - transmit rate
+#   numFrames   - the 'numFrame' value set to stream config -numFrames
+#   loopcount   - the loopcount
+#
+########################################################################
+proc calculateDuration {numTxFrames frameRate {numFrames 1} {loopcount 1}} \
+{
+    set duration 0
+
+    if {$frameRate > 0} {
+        if [catch {mpexpr $numTxFrames/$frameRate} duration] {
+            if [catch {mpexpr $numFrames/$frameRate * $loopcount} duration] {
+                logMsg "******* WARNING:::: duration is longer than 4294967295 seconds!!!"
+                set duration 4294967295
+            }
+        }
+    } else {
+        logMsg "****** WARNING:::: frameRate is set to 0, duration set to 0"
+    }
+
+    return $duration
+}
+
+
+########################################################################
+# Procedure: calculateTotalBursts
+#
+# This command calculates the number of bursts for the specified duration,
+#
+# Arguments(s):
+#   framerate   - in pps
+#   ifg         - in nanoseconds
+#   burstsize   - in fps
+#   ibg         - inter burst gap, in nanoseconds
+#   duration    - duration to calculate number of bursts over
+#
+# Returns:
+#   total number of bursts per this duration
+#
+########################################################################
+proc calculateTotalBursts {framerate ifg burstsize ibg {duration 1}} \
+{
+    set megabits    1000000.
+    set nanoseconds 1000000000.
+
+    if [catch {mpexpr $burstsize*((1./$framerate)* $nanoseconds)} packetTime] {
+        errorMsg "****** Error calculating packet time: $packetTime, packet time set to 0"
+        set packetTime  0
+    }
+
+    if [catch {mpexpr round(($duration*$nanoseconds)/(($packetTime - $ifg) + $ibg))} numBursts] {
+        errorMsg "****** Error calculating numBursts: $numBursts, numBursts set to 0"
+        set numBursts  0
+    }
+
+    return $numBursts
+}
+
+
+
+########################################################################
+# Procedure: calculateAvgLatency
+#
+# This command calculates the average latency of the latencies in the 
+# array
+#
+# Arguments(s):
+#	LatencyArray	- array containing latency values
+#
+########################################################################
+proc calculateAvgLatency {LatencyArray} \
+{
+	if [info exists LatencyArray] {
+		upvar $LatencyArray latencyArray
+	} else {
+		return 0
+	}
+
+	set avgLatency	0
+
+    set count	[llength [array names latencyArray]]
+	foreach txMap [lsort [array names latencyArray]] {
+        if {$latencyArray($txMap) == 0} {
+            mpincr count -1
+        }
+	}
+
+	if {$count > 0} {
+        foreach txMap [lsort [array names latencyArray]] {
+            if {$latencyArray($txMap) != 0} {               
+                if [catch {mpexpr round($avgLatency + ((double($latencyArray($txMap)))/$count))} temp] {
+                    logMsg "******* ERROR::: Port $txMap - $temp"
+                } else {
+                    set avgLatency  $temp
+                }
+            }
+		}
+    }
+
+	return $avgLatency
+}
+
+
+########################################################################
+# Procedure: calculateLoopCounterFromTxFrames
+#
+# This command calculates the loopcounter based on the numFrame parameter
+# used for stream.  Note that numFrame is a 24-bit number; if numFrame is
+# greater than 24 bits than loopcount must be used in conjuction.
+#
+# Arguments(s):
+#   totalFrames     - total number of frames to transmit
+#
+# Return:
+#   loopcount
+#
+########################################################################
+proc calculateLoopCounterFromTxFrames {totalFrames} \
+{
+    upvar $totalFrames  numFrames
+
+    set loopcount   1
+
+    if [catch {expr $numFrames & 0xffffff}] {
+        # bigger than 32 bit number
+        set loopcount   1
+        set numLength   [string length $numFrames]
+        while {$numLength > 9} {
+            set numFrames   [string range $numFrames 0 [expr $numLength - 2]]
+            set numLength   [string length $numFrames]
+            mpincr loopcount
+        }
+        mpincr loopcount -1
+        set loopcount   [mpexpr round(pow(10,$loopcount))]
+    } else {
+        set temp   $numFrames
+        while {[mpexpr $temp & 0xffffff] != $temp && $loopcount < 10} {
+            set temp [mpexpr $numFrames >> 1]
+            mpincr loopcount
+        }
+        set numFrames   [mpexpr $numFrames/$loopcount]
+    }
+
+    return $loopcount
+}
+
+
+########################################################################
+# Procedure: calculateStreamNumFrames
+#
+# This command calculates the stream numFrames value. Assumes a max 
+# numFrame value of 0xffffffff.
+#
+# Arguments(s):
+#   framerate   - fps
+#   duration    - seconds
+#
+# Return:
+#   numFrames; throws an exception if the duration gets modified.
+#
+########################################################################
+proc calculateStreamNumFrames {framerate Duration {maxNumFrames 0xffffffff}} \
+{
+    upvar $Duration duration
+
+    set numFrames [mpexpr $framerate * $duration]
+    if {[isNegative [mpexpr $maxNumFrames - $numFrames]]} {
+        set duration   [mpexpr $maxNumFrames/$framerate]
+
+        errorMsg "Error - selected duration $duration is too long - change to max duration of $duration"
+        set numFrames [mpexpr $framerate * $duration]
+
+        return -code error -errorinfo $numFrames
+    }
+
+    return $numFrames
+}
+
+
+########################################################################
+# Procedure: getTransmitTime
+#
+# This command calculates the total transmit time for the current stream
+# configuration from the pulse startTx time - the last frame captured.
+# If no frames were captured, it returns the original duration.
+#
+# Arguments(s):
+#   PortArray           - array of ports
+#   originalDuration    - original duration of test
+#
+# Returns:
+#   test duration calculated from captured frame or original duration
+#   if no frames captured.
+#
+########################################################################
+proc getTransmitTime {PortArray originalDuration {DurationArray ""} {Warnings ""}} \
+{
+    upvar $PortArray         portArray
+    upvar $DurationArray     durationArray
+    upvar $Warnings          warnings
+
+    set errorCode   0
+    set duration    $originalDuration
+    catch {unset durationArray}
+
+    requestStats portArray
+
+    # get the test duration
+    foreach txMap [array names portArray] {
+        scan $txMap "%d,%d,%d" tx_c tx_l tx_p
+
+        # initialize array
+        set durationArray($tx_c,$tx_l,$tx_p)   $originalDuration
+    
+        if [statList get $tx_c $tx_l $tx_p] {
+	        errorMsg "Error getting Tx statistics for [getPortId $tx_c $tx_l $tx_p]"
+            set errorCode 1
+            continue
+        }
+        if [catch {mpexpr [statList cget -transmitDuration]/1000000000.} tempDuration] {
+            if [catch {getDurationFromCapture portArray $tx_c $tx_l $tx_p $duration} tempDuration] {
+                set errorCode 1
+                continue
+            }
+
+        }
+
+        if {$tempDuration < $originalDuration} {
+            set duration $originalDuration
+        }
+
+        lappend durationList $duration
+        set durationArray($tx_c,$tx_l,$tx_p) $duration
+    }
+
+    if {($errorCode == 1) && ($warnings != "")} {
+        set warnings "\n\n***** Warning *****\n\
+                      Instrumented packets were dropped by the DUT and the rate\n\
+                      cannot be reliably measured on one or more ports.\n\n\
+                      To reliably measure rate, change the tolerance for dropped\n\
+                      packets to zero.\n"
+    }
+
+    if [info exists durationList] {
+        set duration    [lindex [lnumsort $durationList] 0]
+    }
+    if [info exists durationArray] {
+        debugMsg "getTransmitTime: [array get durationArray]"
+    }
+ 
+    return $duration
+}
+
+
+########################################################################
+# Procedure: getDurationFromCapture
+#
+# This command calculates the total transmit time using the capture buffer.
+# If no frames were captured, it returns the original duration.
+#
+# Arguments(s):
+#   originalDuration    - original duration of test
+#
+# Returns:
+#   test duration calculated from captured frame or original duration
+#   if no frames captured.
+#
+########################################################################
+proc getDurationFromCapture {PortArray tx_c tx_l tx_p  originalDuration} \
+{
+    upvar $PortArray         portArray
+
+    set maxDuration 0
+    foreach rxMap $portArray($tx_c,$tx_l,$tx_p) {
+        scan $rxMap "%d %d %d" rx_c rx_l rx_p
+
+        if [capture get $rx_c $rx_l $rx_p] {
+            set errorMessage "Error getting capture data on [getPortId $rx_c $rx_l $rx_p]"
+            set errorCode 1
+            continue
+        }
+        set numCapPackets   [capture cget -nPackets]
+
+        # get first packet
+        if [captureBuffer get $rx_c $rx_l $rx_p] {
+            set errorMessage "Error getting capture buffer for [getPortId $rx_c $rx_l $rx_p]"
+            set errorCode 1
+            continue
+        }
+
+        if [captureBuffer getframe 1] {
+            set errorMessage "Error getting frame from capture buffer for [getPortId $rx_c $rx_l $rx_p]"
+            set errorCode 1
+            continue
+        }
+        set firstTimeStamp  [captureBuffer cget -fir]
+        debugMsg "firstTimeStamp:$firstTimeStamp"
+        debugMsg "ixgFirstTimeStamp:$::ixgFirstTimeStamp"
+
+        if [captureBuffer get $rx_c $rx_l $rx_p $numCapPackets $numCapPackets] {
+            set errorMessage "Error getting capture buffer for [getPortId $rx_c $rx_l $rx_p]"
+            set errorCode 1
+            continue
+        }
+        if [captureBuffer getframe 1] {
+            set errorMessage "Error getting frame from capture buffer for [getPortId $rx_c $rx_l $rx_p]"
+            set errorCode 1
+            continue
+        }
+        set duration    [mpexpr ([captureBuffer cget -timestamp] - $firstTimeStamp)/1000000000.]
+        debugMsg "duration:$duration"
+
+        if {$duration < $originalDuration || $numCapPackets < [mpexpr $originalDuration * 2]} {
+            set duration $originalDuration
+        }
+        # get the max transmit time for TX ports that have more than one RX ports
+        if {$duration > $maxDuration} {
+            set maxDuration    $duration
+        }
+    }
+
+    if {$errorCode == 1} {
+		return -code error -errorinfo $errorMessage
+    } else {
+        return $maxDuration
+    }
+}
+ 
+namespace eval ixMath { 
+
+########################################################################
+# Procedure: min
+#
+# This command calculates the minimum value
+#
+# Arguments(s):
+########################################################################
+proc min {x y} \
+{
+    return [mpexpr ($x < $y) ? $x : $y ]
+}
+
+
+########################################################################
+# Procedure: max
+#
+# This command calculates the maximum value
+#
+# Arguments(s):
+########################################################################
+proc max {x y} \
+{
+    return [mpexpr ($x > $y) ? $x : $y ]
+}
+
+};# ixMath Namespace end
+
+########################################################################
+# Procedure: maxArray
+#
+# This command calculates the maximum value of an array.
+#
+# Arguments(s):
+########################################################################
+proc maxArray {NumArray} \
+{
+	upvar $NumArray numArray
+
+	set maxNum 0
+	for {set index 0} {$index < [llength [array names numArray]]} {incr index} {
+		set item [lindex [lnumsort [array names numArray]] $index]
+		set maxNum [ixMath::max $maxNum $numArray($item)]
+	}
+
+	return $maxNum
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/chassisUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/chassisUtils.tcl
new file mode 100644
index 00000000..5db3a95f
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/chassisUtils.tcl
@@ -0,0 +1,239 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: chassisUtils.tcl
+#   Copyright ©  IXIA.
+#   All Rights Reserved.
+#
+#       Revision Log:
+#       10/16/2000      DS      Genesis
+#
+# Description: This file contains general chassis management/connection procs.
+#
+##################################################################################
+
+
+########################################################################################
+# Procedure: connectToChassis
+#
+# Description: Attempts to connect to all chassis given in the list
+#
+# Arguments: chassisList - A list of chassis names
+#            cableLength - Optional.  A corresponding list of cable lengths for the given chassis
+#            chassisIdList - Optional.  A corresponding list of chassis id numbers for the given chassis
+#            chassisSeqList - Optional.  A corresponding list of sequence numbers for the given chassis
+#
+# Returns: A return code of 0 for success and different integers representing errors
+########################################################################################
+proc connectToChassis {chassisList {cableLengthList cable3feet} {chassisIdList ""} {chassisSeqList ""}} \
+{
+    set retCode 0
+
+    # If either of the id list or sequence list contains less items than the chassis list, 
+    # we will recreate these lists on our own starting from the number 1 until there are 
+    # enough items in the lists.
+    set numChassis [llength $chassisList]
+    if {[llength $chassisIdList] < $numChassis} {
+        catch {unset chassisIdList}
+        for {set id 1} {$id <= $numChassis} {incr id} {
+            lappend chassisIdList $id
+        }
+    }
+
+    if {[llength $chassisSeqList] < $numChassis} {
+        catch {unset chassisSeqList}
+        for {set sequence 1} {$sequence <= $numChassis} {incr sequence} {
+            lappend chassisSeqList $sequence
+        }
+    }
+
+    # If the cable length list contains only one item, then that value will be used for all lengths.
+    # If the list is greater than one, but less than the number of chassis, then cable3feet will be used
+    # to complete the list.
+    if {([llength $cableLengthList] == 1) && ($numChassis != 1)} {
+        set cableLength $cableLengthList
+        catch {unset cableLengthList}
+        foreach item $chassisList {
+            lappend cableLengthList $cableLength
+        }
+    } elseif {[llength $cableLengthList] < $numChassis} {
+        while {[llength $cableLengthList] < $numChassis} {
+            lappend cableLengthList "cable3feet"
+        }
+    }
+
+    foreach chassis $chassisList chassisId $chassisIdList sequence $chassisSeqList cableLength $cableLengthList {
+        logMsg "Connecting to Chassis $chassisId: $chassis ..."
+
+        # Connect may not work the first time. So try a few times until a connect succeeds
+        set maxConnectRetries [advancedTestParameter cget -maxConnectRetries]
+        if {$maxConnectRetries < 1} {
+            set maxConnectRetries 1
+        }
+
+        set retAddCode 1
+        for {set connectNum 1} {$connectNum <= $maxConnectRetries && $retAddCode != 0} {incr connectNum} {
+
+            set connectChassisFlag [getConnectChassisFlag]
+
+            if { ![string compare $connectChassisFlag "stop"] } {
+                #
+                # Progress dialog is canceled. Connecting to chassis should stop.
+                #
+                setConnectChassisFlag "continue"
+                set retAddCode 4
+                break
+            }
+
+            set retAddCode [chassis add $chassis]
+            switch $retAddCode "
+                $::TCL_OK {
+                    continue
+                }
+                $::ixTcl_versionMismatch {
+                    # if it is a version mismatch, do not bother going any further...
+                    logMsg \"Error: Version mismatch between IxServer and Tcl Client\"
+                    ixPuts $::ixErrorInfo
+                    chassis del $chassis                    
+                    break
+                }
+                $::ixTcl_HardwareConflict {
+                    # if it is a serial number conflict, do not bother going any further...
+                    chassis del $chassis
+                    logMsg \"Error: Hardware conflict detected. Please call customer support!\"
+                    break
+                }
+                default {                                  
+                    chassis del $chassis
+                    logMsg \"Error connecting to chassis. Retrying $connectNum of $maxConnectRetries retries ..\"
+                    after 20
+                    update
+                }
+            "
+        }
+
+        # dump out here if there was an error connecting to one of the chassis
+        switch $retAddCode "
+            $::TCL_OK {
+            }
+            $::TCL_ERROR {
+                logMsg \"Error connecting to chassis $chassis\"
+                return $retAddCode
+            }
+            $::ixTcl_chassisTimeout {
+                logMsg \"Timeout connecting to chassis $chassis. Try Again!\"
+                return $retAddCode
+            }
+            4 {
+                logMsg \"Connection was interrupted by user!\"
+                return $retAddCode
+            }
+            default {
+                return $retAddCode
+            }
+        "
+
+        chassis config -name        $chassis
+        chassis config -id          $chassisId
+        chassis config -sequence    $sequence
+        chassis config -cableLength $cableLength
+
+        if {[chassis set $chassis]} {
+            errorMsg "Error setting chassis $chassis"
+            return $::TCL_ERROR
+        }
+    }
+
+    # after connecting to all chassis, broadcast the topology of each chassis
+    # to all other chassis
+    chassisChain broadcastTopology
+
+    # now we need to verify that it is a valid chain (ie., there is at least one master)
+    if {[chassisChain validChain]} {
+        errorMsg "Error: Chassis chain is not valid - check for master chassis in chain"
+        set retCode $::ixTcl_invalidChassisChain
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: setConnectChassisFlag
+#
+# Description: Set the value that indicates whether connecting to chassis should continue.
+#
+# Argument(s): value - "continue" or "stop".
+#
+# Return:      Nothing
+#
+########################################################################################
+proc setConnectChassisFlag {value} \
+{
+    global ixgChassisContinueFlag
+
+    switch $value {
+        "continue" -
+        "stop" {
+            set ixgChassisContinueFlag $value
+        }
+        default {
+            set ixgChassisContinueFlag "continue"
+        }
+    }
+}
+
+
+########################################################################################
+# Procedure: getConnectChassisFlag
+#
+# Description: Get the value that indicates whether connecting to chassis should continue.
+#
+# Argument(s): None.
+#
+# Return:      "continue" or "stop".
+#
+########################################################################################
+proc getConnectChassisFlag {} \
+{
+    global ixgChassisContinueFlag
+
+    if { [info exists ixgChassisContinueFlag] } {
+        set retCode $ixgChassisContinueFlag
+    } else {
+        set retCode "continue"
+    }
+
+    return $retCode
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/clientUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/clientUtils.tcl
new file mode 100644
index 00000000..a8be073a
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/clientUtils.tcl
@@ -0,0 +1,319 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: clientUtils.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#    Revision Log:
+#    Date           Author                 Comments
+#    -----------    -------------------    --------------------------------------------
+#    10/25/2000     ds                      initial release
+#
+# Description:  This file contains utilities for the client side of the Tcl proxy
+#
+##################################################################################
+
+
+########################################################################################
+# Procedure:    clientOpen
+#
+# Description:  Open a connection to the ixTclServer.
+#                
+# Input:        server:        host name of server
+#               port:        port id of service
+#
+# Output:       socket handle
+#
+########################################################################################
+proc clientOpen {host port} \
+{
+    if [catch {socket $host $port} socketId] {
+        errorMsg "Error: $socketId"
+        set socketId {}
+    }
+
+    return $socketId
+}
+
+
+########################################################################################
+# Procedure:    clientClose
+#
+# Description:  Close connection from the client side.
+#                
+# Input:        socketId:    client-side socket
+#
+# Output:        0 if successful
+#                1 if error while attempting to close socket
+#
+########################################################################################
+proc clientClose {socketId} \
+{
+    set retCode 0
+
+    if [catch {close $socketId}] {
+        set retCode 1
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:    clientSend
+#
+# Description:  Send a command from the client side.
+#                
+# Input:        socketId:    client-side socket
+#                args:        TCL command to evaluate
+#
+# Returns:        Success:    TCL Return result
+#               Failure:    {}
+#
+# Remarks:  TCL procs can embed i/o.
+#
+########################################################################################
+proc clientSend {socketId args} \
+{
+    set retCode   1
+    set retResult 0
+
+    #
+    # send data over the socket
+    #
+    set buf [lindex $args 0]
+
+    #   
+    #   Return buffer is formatted as follows:
+    #
+    #   0 to final lf/cr -> Tcl Standard Output
+    #   final character  -> Tcl Return Code (TCL_OK, TCL_ERROR)
+    #   
+    if [catch { puts $socketId $buf ; 
+                flush $socketId ; 
+                #
+                # read the reply
+                #  the reply may have the format 
+                #       sOutput/r/nsTclResult/r/n    -- i/o output followed by TCL result
+                #                                                 /r/n -delimited
+                #       sTclresult/r/nsTclResultCode -- simple TCL result
+                #       null                         -- no TCL result available
+                
+                vwait tclServer::buffer
+                set retBuffer $tclServer::buffer
+                
+                set indexOfLastCrlf [string last "\r\n" $retBuffer]
+                if {$indexOfLastCrlf != -1 } {
+                    set lenBuffer [string length $retBuffer]
+                    set indexOfPenultimateCrlf [string last "\r\n" [string range $retBuffer 0 [expr $indexOfLastCrlf -1]]]
+                    if {$indexOfPenultimateCrlf != -1 } {
+                        set retResult [string range $retBuffer [expr $indexOfPenultimateCrlf + 2] $lenBuffer]
+                    } else {
+                        set length    [string length $retBuffer]
+                        set retCode   [string index $retBuffer [incr length -1]]
+                        set retResult [string range $retBuffer 0 [incr length -1]]
+                    }
+                } else {
+                    set length    [string length $retBuffer]
+                    set retCode   [string index $retBuffer [incr length -1]]
+                    set retResult [string range $retBuffer 0 [incr length -1]]
+                }
+            } 
+    ] {
+        errorMsg $::errorInfo
+        tclServer::disconnectTclServer
+        set retResult 1
+    }
+
+    #
+    # Force an error if the command returned TCL_ERROR.
+    #   Can't use the constant TCL_ERROR here since it is not defined at
+    #   this point in execution.
+    #
+    if {$retCode == 1} {
+        set retCommand [list error $retResult $retResult]
+    } else {
+        set retCommand [list return $retResult]
+    }
+
+    eval $retCommand
+}
+
+########################################################################################
+# Procedure:    remoteDefine
+#
+# Description:     Create a proc to proxy over a ixTclHal command.
+#                
+# Input:        commandList
+#
+# Output:        0 if successful
+#                1 if error
+#
+########################################################################################
+proc remoteDefine { commandList } \
+{
+    foreach procName $commandList {
+        eval [format   "proc %s {args} \
+                        {\
+                            global ixTclSvrHandle; \
+                            if \[catch { eval \"clientSend \$ixTclSvrHandle {%s \$args}\" } result\] {error \$result \$result}; \
+	                        if  {\$result != \"\"} {if \[catch { eval \"clientSend \$ixTclSvrHandle {set ixErrorInfo}\" } ::ixErrorInfo] {error \$::ixErrorInfo \$::ixErrorInfo}}; \
+                            return \$result \
+                        }" \
+        $procName $procName]
+    }
+    return 0
+}
+
+########################################################################################
+# Procedure:    getConstantsValue
+#
+# Description:     Get the list of constants from ixTclServer.
+#                
+# Input:        serverSocket
+#
+# Output:        0 if successful
+#                1 if error
+#
+########################################################################################
+proc getConstantsValue {serverSocket} \
+{
+    set retCode 0
+
+    set constList  [clientSend $serverSocket {array get ixConstants}]
+    if {[llength $constList] > 0} {
+        foreach {constName constVal} $constList {
+            global $constName
+            # The catch prevents the error message from flowing back on windows
+            catch {set $constName $constVal}
+        }
+    } else {
+        set retCode 1
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:    ixMasterSet
+#
+# Description:     No clue what this is here for, but I'm leaving it for backwards compatibility
+#
+# Input:
+#
+########################################################################################
+proc ixMasterSet {name element op} \
+{
+    upvar ${name}($element) master
+    tclServer::connectToTclServer $master errMsg
+}
+
+########################################################################################
+# Procedure:    redefineCommand
+#
+# Description:     Redefine the specified command to make its methods import and export work 
+#               for UNIX client.
+#
+# Input:        command - name of the command to be redefined.
+#
+########################################################################################
+proc redefineCommand {command} \
+{
+    set commandOld ${command}Old
+
+    if { [info command $command] != "" } {
+        if { [info command $commandOld] == "" } {
+            rename $command $commandOld
+        }
+    }
+    eval [format "proc %s {args} \
+          { \
+              set cmdLine %s ; \
+              set path \[file dirname \[lindex \$args 1\]\] ;\
+              set fileName \[file tail \[lindex \$args 1\]\] ;\ 
+              if { \$path == \".\" } { \
+                append cmdLine \" \$args\"; set path \$fileName } else { \
+                append cmdLine \" \[lindex \$args 0\] \$fileName \[lindex \$args 2\] \[lindex \$args 3\] \[lindex \$args 4\] \" }\
+
+              switch \[lindex \$args 0\] { \
+                  import { \
+                      doFileTransfer \"put\" \[lindex \$args 1\] \$fileName ; \
+                      eval \$cmdLine; \
+                  } \
+                  export { \
+                      set retCode \[eval \$cmdLine\]; \
+                      if \{\$retCode == 0\} \{ \
+                          doFileTransfer \"get\" \$fileName \[lindex \$args 1\]; \
+                          fileTransferClient::deleteFile \[tclServer::getTclServerName\] 4500 \$fileName \                       
+                          
+                      \} else \{ \
+                          return \$retCode; \
+                       \} \
+                  } \
+                  default { \
+                      eval \$cmdLine; \
+                  } \
+               } \
+           }" \
+    $command $commandOld]
+}
+
+########################################################################################
+# Procedure:    doFileTransfer
+#
+# Description:     Transfer files between client and chassis.
+#
+# Input:        action    - Has to be either put or get.
+#                            
+# Unix doesn't need the full path of the file, that is why it is based on the direction 
+# if it is put or get, we have to pass in two filenames, one for source the other for
+# destination  
+#               filename1  - Name of the file to be transfered.
+#               filename2  - Name of the file to be transfered. 
+#
+########################################################################################
+proc doFileTransfer {action filename1 filename2 {port 4500}} \
+{
+    set retCode 1
+
+    if [tclServer::isTclServerConnected] {
+        set retCode [fileTransferClient::${action}File [tclServer::getTclServerName] $port "$filename1" "$filename2"]
+    }
+
+    return $retCode
+}
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/constants.tcl b/dep/tclclient/ixTcl1.0/Generic/constants.tcl
new file mode 100644
index 00000000..d8bdc441
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/constants.tcl
@@ -0,0 +1,131 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: constants.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	12-30-1998	Hardev Soor
+#
+# Description: This file contains common constants
+#
+##################################################################################
+
+# -----------------------------------------------------
+# Hardcoded from HAL so that the connection TclSvrConnect 
+# can be made after the package require ->  if using UNIX
+# -----------------------------------------------------
+
+# protocol mapping
+set kProtocol(0)				mac
+set kProtocol(4)				ip
+set kProtocol(5)				udp
+set kProtocol(6)        		tcp
+set kProtocol(7)				ipx
+set kProtocol(31)				ipV6
+
+# IP address class mapping
+set kIpAddrClass(0)     		classA
+set kIpAddrClass(1)     		classB
+set kIpAddrClass(2)     		classC
+set kIpAddrClass(3)     		classD
+set kIpAddrClass(4)     		noClass
+
+
+# some generic frame constants
+set kFirSize			6
+set kCrcSize			4
+set kUdfSize			4
+
+
+# duplex mode mapping
+set kDuplexMode(0)		half
+set kDuplexMode(1)		full
+
+# levels of storing results
+set kResultLevel(test)      test
+set kResultLevel(iter)      iter
+set kResultLevel(port)      port
+set kResultLevel(portCat)   portCat
+set kResultLevel(portItem)  portItem
+
+# IPX constants
+set kSapOperation(request)                      1
+set kSapOperation(response)                     2    ;# General Service Response
+set kSapOperation(getNearestServerRequest)      3
+set kSapOperation(getNearestServerResponse)     4
+set kSapServiceType(unknown)                    {00 00}
+set kSapServiceType(printQueue)                 {00 03}
+set kSapServiceType(fileServer)                 {00 04}
+set kSapServiceType(jobServer)                  {00 05}
+set kSapServiceType(printServer)                {00 07}
+set kSapServiceType(archiveServer)              {00 09}
+set kSapServiceType(remoteBridgeServer)         {00 24}
+set kSapServiceType(advertisingPrintServer)     {00 47}
+set kRIPXOperation(request)                     1
+set kRIPXOperation(response)                    2
+set kBroadcastMacAddress                        {ff ff ff ff ff ff}
+set kSapSocket                                  0x452
+set kRipSocket                                  0x453
+set kHeaderLength(ip)	                        20
+set kHeaderLength(ipV6)	                        40
+set	kHeaderLength(udp)                      	8
+set	kHeaderLength(rip)	                        4
+set	kHheaderLength(icmp)                    	8
+set kIPXHeaderLength	                    	30
+
+if {![info exists TCL_OK]} {
+    set TCL_OK      0
+    set TCL_ERROR   1
+}
+
+
+### Mii constants for 10ge ###
+set miiPreemphasisNone      0   ;# 0x0000
+set miiPreemphasis18        1   ;# 0x4000 
+set miiPreemphasis38        2   ;# 0x8000
+set miiPreemphasis75        3   ;# 0xC000
+ 
+
+set miiLossOfSignal160mv    0   ;# 0x0000
+set miiLossOfSignal240mv    1   ;# 0x0010
+set miiLossOfSignal200mv    2   ;# 0x0020
+set miiLossOfSignal120mv    3   ;# 0x0030
+set miiLossOfSignal80mv     4   ;# 0x0040
+
+set miiRecoveredClock       0 
+set miiLocalRefClock        1   
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/conversions.tcl b/dep/tclclient/ixTcl1.0/Generic/conversions.tcl
new file mode 100644
index 00000000..2e78ed98
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/conversions.tcl
@@ -0,0 +1,275 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: conversions.tcl
+#
+# Copyright ©  IXIA
+# All Rights Reserved.
+#
+# Description: This file contains some utility procs for running the cable modem
+#              and ATP tests.
+#
+# Revision Log:
+#
+# Date		    Author				Comments
+# -----------	-------------------	--------------------------------------------
+# 2000/05/01	DS	                Genesis (for cable modem testing)
+# 2000/10/02	D. Heins-Gelder		Moved rate converters to Generic/converstions.tcl
+#
+##################################################################################
+
+
+
+########################################################################################
+# getPercentMaxRate
+#
+# Description:  Helper procedure which derives the percentMaxRate based on the
+#               user selected rate type (ie: percentMaxMate, kbps or fps)
+#
+# Input:        chassis card port
+#               framesize       : 
+#               rateType        : 
+#               rate            :
+#               loss            : default is NULL
+#
+# Output:       retCode         : 0 if invalid chassis-card-port, else
+#                                 percentMaxRate
+#
+########################################################################################
+proc getPercentMaxRate {chassis card port framesize rateType rate {preambleSize 8}} \
+{
+    set percentMaxRate  0
+
+    if [port get $chassis $card $port] {
+        errorMsg "Error getting $chassis $card $port"
+    } else {
+
+        switch $rateType {
+            percentMaxRate {
+                set percentMaxRate  $rate
+            }
+            kbpsRate {
+                set percentMaxRate [calculatePercentMaxRate $chassis $card $port [mpexpr $rate*1000./($framesize * 8.)] $framesize $preambleSize]
+            }
+            fpsRate {
+                set percentMaxRate [calculatePercentMaxRate $chassis $card $port $rate $framesize $preambleSize]
+            }
+            default {
+                set percentMaxRate  0.
+            }
+        }
+    }
+    
+    return [format %.6f $percentMaxRate]
+}
+
+
+########################################################################################
+########################################################################################
+#           Rate converters
+#           Note - these things live in the cablemodem.tcl file because they are really
+#                  only applicable to cablemodems.  Also, note that the getMaxFPS
+#                  proc will probably fall apart w/PoS implementations.
+########################################################################################
+########################################################################################
+#
+#
+#     Conversion formulae implemented in code (checked by David Selenkow 5/4/2000)
+#
+# Given rate=%maxRate, then:                                        as found in:
+#   percentMaxRate  = rate                                      convertPercentMaxRate
+#   kbps            = (maxFPS*(rate/100)*framesize*8) / 1000    convertKbpsRate
+#   fps             = (rate/100)*maxFPS                         convertFpsRate
+#
+# Given rate = kpbs, then:     
+#   percentMaxRate  = ((rate*1000)/(framesize*8*maxFPS)) * 100  convertPercentMaxRate 
+#   kpbs            = rate                                      convertKpbsRate
+#   fps             = (rate*1000)/(framesize*8)                 convertFpsRate
+#
+# Given rate=fps, then          
+#   percentMaxRate  = (rate/maxFPS)*100                         convertPercentMaxRate
+#   kbps            = (rate*framesize*8) / 1000                 convertKbpsRate
+#   fps             = rate                                      convertFpsRate
+
+########################################################################################
+
+
+
+########################################################################################
+# Procedure: getMaxFPS
+#
+# Description: Get the max fps rate based on speed/framesize, assuming a 96 bit minimum
+#              gap (802.3)
+#
+########################################################################################
+proc getMaxFPS {speed framesize {preambleSize 8}} \
+{
+   set expr    [unixCludgeGetExpr]
+
+   set minimumGap            96    ;# bits 
+    if [catch {$expr round((double($speed) * 1000000.) / (double($minimumGap) + (($preambleSize + $framesize)*8.)))} maxFps] {
+        set maxFps 0
+    }
+
+    return $maxFps
+}
+
+
+########################################################################################
+# Procedure: convertPercentMaxRate
+#
+# Description: Converts to the % rate based on speed/framesize, assuming a 96 bit
+#              minimum gap (802.3)
+#
+########################################################################################
+proc convertPercentMaxRate {framesize rateType rate speed {preambleSize 8}} \
+{
+    set expr    [unixCludgeGetExpr]
+
+    set maxRate [getMaxFPS $speed $framesize $preambleSize]
+
+    if {[isValidPartialFloat $framesize] && [isValidPartialFloat $rate] && [isValidPartialFloat $speed] && \
+            [isValidPartialFloat $preambleSize]} {
+        switch $rateType {
+            percentMaxRate {
+                set percentMaxRate  $rate
+            }
+            kbpsRate {
+                if [catch {$expr ($rate*1000./($framesize * 8. * $maxRate))*100.} percentMaxRate] {
+                    set percentMaxRate 1.0
+                }
+            }
+            fpsRate {
+                if [catch {$expr (($rate*100.)/$maxRate)} percentMaxRate] {
+                    set percentMaxRate 1.0
+                }
+            }
+            default {
+                set percentMaxRate 1.0
+            }
+        }
+    } else {
+        set percentMaxRate 1.0
+    }
+    return [format %.6f $percentMaxRate]
+}
+
+
+########################################################################################
+# Procedure: convertKbpsRate
+#
+# Description: Converts to the kbps rate based on speed/framesize, assuming a 96 bit
+#              minimum gap (802.3)
+#
+########################################################################################
+proc convertKbpsRate {framesize rateType rate speed {preambleSize 8}} \
+{
+    set expr    [unixCludgeGetExpr]
+
+    set kbpsRate 1.0
+
+    if {[isValidPartialFloat $framesize] && [isValidPartialFloat $rate] && [isValidPartialFloat $speed] && \
+            [isValidPartialFloat $preambleSize]} {
+        switch $rateType {
+            percentMaxRate {
+                set maxRate [getMaxFPS $speed $framesize $preambleSize]
+                set kbpsRate [$expr (($maxRate*($rate/100.)) * $framesize * 8.) / 1000.]
+            }
+            kbpsRate {
+                set kbpsRate $rate
+            }
+            fpsRate {
+                set kbpsRate [$expr ($rate * $framesize * 8.)/1000.]
+            }
+        }
+    }
+    return [format %.6f $kbpsRate]
+}
+
+
+########################################################################################
+# Procedure: convertFpsRate
+#
+# Description: Converts to the max fps rate based on speed/framesize, assuming a 96 bit
+#              minimum gap (802.3)
+#
+########################################################################################
+proc convertFpsRate {framesize rateType rate speed {preambleSize 8}} \
+{
+    set expr    [unixCludgeGetExpr]
+
+    set fpsRate 1.0
+
+    if {[isValidPartialFloat $framesize] && [isValidPartialFloat $rate] && [isValidPartialFloat $speed] && \
+            [isValidPartialFloat $preambleSize]} {
+        switch $rateType {
+            percentMaxRate {
+                set maxRate [getMaxFPS $speed $framesize $preambleSize]
+                if {[catch {$expr ($rate/100.)*$maxRate} fpsRate]} {
+                    set fpsRate 1.0
+                }
+            }
+            kbpsRate {
+                if {[catch {$expr ($rate/($framesize * 8.))*1000.} fpsRate]} {
+                    set fpsRate 1.0
+                }
+            }
+            fpsRate {
+                set fpsRate $rate
+            }
+        }
+    }
+    return [format %.6f $fpsRate]
+}
+
+
+########################################################################
+# Procedure: generateFullList
+#
+# Helper proc to generate the full list for the burstsize
+#
+########################################################################
+proc generateFullList { originalList {burstsize 10} } \
+{
+    set maxFramesize  0
+    foreach item $originalList {
+        for {set i 1} { $i <= 10} {incr i} {
+            lappend fullFrameSizeList $item
+        }
+    }
+
+    return $fullFrameSizeList
+}
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/dataValidation.tcl b/dep/tclclient/ixTcl1.0/Generic/dataValidation.tcl
new file mode 100644
index 00000000..9dccfdd5
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/dataValidation.tcl
@@ -0,0 +1,1855 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: dataValidation.tcl
+#
+# Copyright ©  IXIA
+# All Rights Reserved.
+#
+# Description: This file contains the namespace and its procedures that verify
+#              IXIA test parameters when a new test is started.
+#
+# Revision Log:
+#
+# Date		    Author				Comments
+# -----------	-------------------	-------------------------------------------
+# 2001/04/24	Scott Si	        Created
+#
+###############################################################################
+
+namespace eval dataValidation {} \
+{
+    #
+    # All the following ARRAYs are indexed by the name of TCL variable of IXIA
+    # test, such as numIterations (number of iterations) and percentMaxRate
+    # (max percent rate).
+    #
+    variable typeArray
+    variable validValuesArray
+    variable validRangeArray
+    variable validateProcArray
+    variable helpArray
+
+    #
+    # typePattern defines the valid types for all the test parameters, which
+    # are the following.
+    #     {integer, integerList, double, boolean, string, stringList, ipaddress, imixlist, macaddress, portlist}
+    #
+    variable typePattern {^integer$|^integerList$|^double$|^boolean$|^string$|^stringList$|^ipaddress$|^imixlist$|^macaddress$|^portlist$}
+
+    #
+    # booleanPattern defines the valid values for all the test parameters that is of
+    # the type boolean. The valide value must be one of the following.
+    #     {ture false yes no 1 0}
+    #
+    variable booleanPattern {^true$|^false$|^yes$|^no$|^1$|^0$}
+}
+
+###############################################################################
+#
+# dataValidation::initialize
+#
+# Description:  Initialize rules for data validation. This function should be
+#               invoked when a new test is selected.
+#
+# Input:        None
+#
+# Output:       None.
+#
+###############################################################################
+proc dataValidation::initialize {} \
+{
+    variable typeArray
+    variable validValuesArray
+    variable validRangeArray
+    variable validateProcArray
+    variable helpArray
+
+    variable errorString ""
+
+    catch {unset typeArray        }
+    catch {unset validValuesArray }
+    catch {unset validRangeArray  }
+    catch {unset validateProcArray}
+    catch {unset helpArray        }
+
+    #
+    # The following parameters are kept by the global array testConf.
+    #
+    setParameter -parameter hostname              -type stringList
+    setParameter -parameter cableLength           -type stringList  -validValues {cable3feet cable6feet cable9feet cable12feet cable15feet cable18feet cable21feet cable24feet}
+    setParameter -parameter chassisID             -type integerList -validRange  {0 NULL}
+    setParameter -parameter chassisSequence       -type integerList -validRange  {1 NULL}
+    set speedList [list 10 100 1000 usb oc3 oc12 stm1c stm4c oc48 stm16c oc192 stm64c "WAN (Sonet)" "WAN (SDH)" 10000 9294 Copper10 Copper100 Copper1000 Fiber1000]
+
+    setParameter -parameter speed                 -type string     -validValues $speedList -validateProc dataValidation::validatePortSpeed
+    setParameter -parameter RxPortSpeed           -type string     -validValues $speedList -validateProc dataValidation::validatePortSpeed
+    setParameter -parameter TxPortSpeed           -type string     -validValues $speedList -validateProc dataValidation::validatePortSpeed
+    setParameter -parameter serverSpeed           -type string     -validValues $speedList -validateProc dataValidation::validatePortSpeed
+    setParameter -parameter clientSpeed           -type string     -validValues $speedList -validateProc dataValidation::validatePortSpeed
+    setParameter -parameter PPPnegotiation        -type boolean
+    setParameter -parameter autoMapGeneration     -type boolean
+    setParameter -parameter autonegotiate         -type boolean
+    setParameter -parameter duplex                -type string     -validValues {full half}
+    setParameter -parameter incrIpAddrByteNum     -type integer    -validValues {1 2 3 4}
+    setParameter -parameter mapDirection          -type string     -validValues {unidirectional bidirectional}
+    setParameter -parameter sonetRxCRC            -type string     -validValues {sonetCrc16 sonetCrc32}
+    setParameter -parameter sonetTxCRC            -type string     -validValues {sonetCrc16 sonetCrc32}
+    setParameter -parameter supportsPOS           -type boolean
+    setParameter -parameter useMagicNumber        -type boolean
+    setParameter -parameter useRecoveredClock     -type boolean
+    setParameter -parameter dataScrambling        -type boolean
+    setParameter -parameter enable802dot1qTag     -type boolean
+    setParameter -parameter enableISLtag          -type boolean
+    setParameter -parameter firstDestDUTIpAddress -type ipaddress  
+    setParameter -parameter firstSrcIpxSocket     -type string
+    setParameter -parameter ethernetType          -type string     -validValues {noType ethernetII}
+    setParameter -parameter hdlcHeader            -type string     -validValues {ppp cisco}
+    setParameter -parameter maxPercentRate        -type double     -validRange  {0.0001 100}
+    setParameter -parameter responseTime          -type integer    -validRange  {0 NULL}
+    setParameter -parameter protocolName          -type string     -validValues {mac ip ipV6 ipx}
+}
+
+###############################################################################
+#
+# dataValidation::setParameter
+#
+# Description:  Create an entry in the data validation database.
+#
+# Input:        args - arguments that define the name, type, values, and command
+#                      for a test parameter in the following format.
+#
+#                      -parameter   $name   \
+#                      -type        $type   \
+#                      -validValues $values \
+#                      -validRange  $range  \
+#                      -command     $command
+#
+# Output:       status of the procedure
+#
+###############################################################################
+proc dataValidation::setParameter {args} \
+{
+    variable typeArray
+    variable validValuesArray
+    variable validRangeArray
+    variable validateProcArray
+    variable helpArray
+
+    variable typePattern
+
+    set retCode $::TCL_OK
+
+    #
+    # This one is different in that the args could contain multiple -validateProc.
+    #
+    set validateProcArg {}
+
+    foreach arg $args {
+
+        if {[regexp {^-[a-zA-Z].+} $arg]} {
+            #
+            # Current argument is preceeded by '-'.
+            #
+
+            # Remove the preceeding '-'.
+            regsub {^-} $arg "" option
+
+            switch $option {
+                parameter     -
+                type          -
+                validValues   -
+                validRange    -
+                validateProc  -
+                help {
+                    set currentOption $option
+                    set currentAction getValue
+                }
+                default {
+                    set retCode $::TCL_ERROR
+                    break
+                }
+            }
+        } else {
+            if {[info exists currentAction]} {
+                switch $currentAction {
+                    "getValue" {
+                        if {$currentOption == "validateProc"} {
+                            lappend ${currentOption}Arg $arg
+                        } else {
+                            set ${currentOption}Arg $arg
+                        }
+
+                        unset currentOption
+                        unset currentAction
+                    }
+                    default {
+                        set retCode $::TCL_ERROR
+                        break
+                    }
+                }
+            } else {
+                set retCode $::TCL_ERROR
+                break
+            }
+        }
+    }
+
+    if {$retCode == $::TCL_OK} {
+        #
+        # Parameter name, and parameter type are mandatory when setting a test parameter.
+        #
+        if {[info exists parameterArg] == 0} {
+        
+            set retCode $::TCL_ERROR
+        
+        } elseif {[info exists typeArg] == 0} {
+
+            set retCode $::TCL_ERROR
+
+        } elseif {[info exists validValuesArg] && [info exists validRangeArg]} {
+
+            set retCode $::TCL_ERROR
+
+        }
+    }
+
+    if {$retCode == $::TCL_ERROR} {
+        errorMsg "Invalid arguments: \"$args\"."
+        return $retCode
+    }
+
+    if {[info exists typeArg]} {
+        set typeArray($parameterArg) $typeArg
+    }
+
+    if {[info exists validValuesArg] && ($validValuesArg != "")} {
+        set validValuesArray($parameterArg) $validValuesArg
+    }
+
+    if {[info exists validRangeArg]} {
+        set validRangeArray($parameterArg) $validRangeArg
+    }
+
+    if {[info exists validateProcArg]} {
+        set validateProcArray($parameterArg) $validateProcArg
+    }
+
+    if {[info exists helpArg]} {
+        set helpArray($parameterArg) $helpArg
+    }
+
+    return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::getParameter
+#
+# Description:  Retrieve properties of test parameter(s).
+#
+# Input:        args - arguments of the following format
+#                      (-parameter parameter) (-type) (-validValues) (-validRange) (-help)
+#
+# Output:       Prints out all the rules if no arguments specified.
+#               Returns the rules for a parameter if only the parameter name 
+#               is specified. 
+#               Retruns the property if both the parameter name and the 
+#               property name are specified.
+#
+###############################################################################
+proc dataValidation::getParameter {args} \
+{
+    variable typeArray
+    variable validValuesArray
+    variable validRangeArray
+    variable validateProcArray
+    variable helpArray
+    variable command
+
+    set retCode $::TCL_OK
+
+    set numArgs [llength $args]
+
+    switch $numArgs {
+        0 {
+            #
+            # No arguments. Show everything.
+            #
+            showRules
+        }
+        2 {
+            #
+            # Has to be {-parameter $name}. Will return everything in a list of the
+            # format {{$type} {$value} {$command}}. Primarily for find out the
+            # general information the parameter about a parameter.
+            #
+            if {[lindex $args 0] == "-parameter"} {
+                set argName [lindex $args 1]
+                set retCode ""
+                if [info exists typeArray($argName)] {
+                    append retCode "-parameter $argName -type $typeArray($argName) "
+
+                    if [info exists validValuesArray($argName)] {
+                        append retCode "-validValues [list $validValuesArray($argName)] "
+                    }
+                    if [info exists validRangeArray($argName)] {
+                        append retCode "-validRange [list $validRangeArray($argName)] "
+                    }
+                    if [info exists validateProcArray($argName)] {
+                        append retCode "-validateProc $validateProcArray($argName)"
+                    }
+                    if [info exists helpArray($argName)] {
+                        append retCode "-help $helpArray($argName)"
+                    }
+                }
+            } else {
+                errorMsg "Invalid format \"$args\"."
+                set retCode $::TCL_ERROR
+            }
+        }
+        3 {
+            #
+            # Has to be "-parameter $name -{type|validValues|validRange|validateProc|help}". 
+            # Will return exactly what the caller wants.
+            #
+            if {[lindex $args 0] == "-parameter"} {
+                set argName [lindex $args 1]
+
+                if [info exists typeArray($argName)] {
+                    #
+                    # The specified parameter name exists.
+                    #
+                    set property [string trimleft [lindex $args 2] -]
+
+                    if {$property == "type"} {
+
+                        set retCode $typeArray($argName)
+
+                    } elseif {$property == "validValues"} {
+                        
+                        if [info exists validValuesArray($argName)] {
+                            set retCode $validValuesArray($argName)
+                        } else {
+                            set retCode ""
+                        }
+                    } elseif {$property == "validRange"} {
+                        
+                        if [info exists validRangeArray($argName)] {
+                            set retCode $validRangeArray($argName)
+                        } else {
+                            set retCode ""
+                        }
+                    } elseif {$property == "validateProc"} {
+
+                        if [info exists validateProcArray($argName)] {
+                            set retCode $validateProcArray($argName)
+                        } else {
+                            set retCode ""
+                        }
+                    } elseif {$property == "help"} {
+
+                        if [info exists helpArray($argName)] {
+                            set retCode $helpArray($argName)
+                        } else {
+                            set retCode ""
+                        }
+                    } else {
+                        errorMsg "Invalid type \"$args\"."
+                        set retCode $::TCL_ERROR
+                    }
+                } else {
+                    #
+                    # The specified parameter name does not exist.
+                    #
+                    debugMsg "The parameter \"$argName\" does not exist."
+                }
+            } else {
+                errorMsg "Invalid format \"$args\"."
+                set retCode $::TCL_ERROR
+            }
+        }
+        default {
+            #
+            # Error.
+            #
+            errorMsg "Invalid format \"$args\"."
+            set retCode $::TCL_ERROR
+        }
+    }
+    
+    return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::showRules
+#
+# Description:  This command displays the data validation database.
+#
+# Input:        None
+#
+# Output:       None
+#
+###############################################################################
+proc dataValidation::showRules {} \
+{    
+    variable typeArray
+    variable validValuesArray
+    variable validRangeArray
+    variable validateProcArray
+    variable helpArray
+    variable command
+
+    ixPuts "========================================================================"
+    ixPuts [format "%-24s %-10s %-80s %-s" "Parameter" "Type" "Values" "ValidateProc"]
+    ixPuts "========================================================================"
+
+    foreach name [lsort [array name typeArray]] {
+
+        set rule [format "%-24s %-10s" $name $typeArray($name)]
+        
+        if [info exists validValuesArray($name)] {
+            append rule [format " %-80s" $validValuesArray($name)]
+        }
+        if [info exists validRangeArray($name)] {
+            append rule [format " %-80s" $validRangeArray($name)]
+        }
+        if [info exists validateProcArray($name)] {
+            append rule [format " %-30s" $validateProcArray($name)]
+        }
+        if [info exists helpArray($name)] {
+            append rule [format " %-30s" $helpArray($name)]
+        }
+
+        ixPuts $rule
+    }
+}
+
+###############################################################################
+#
+# dataValidation::parseValues
+#
+# Description:  This command makes sure that the validateValues or validateRange
+#               comply with the given type. (NEED TO BE MODIFIED)
+#
+# Input:        
+#
+# Output:       
+#
+###############################################################################
+proc dataValidation::parseValues {type values} \
+{
+    if {[llength $values] != 2} {
+        errorMsg "Wrong format for values \"$values\"."
+        return $::TCL_ERROR
+    }
+
+    set retCode $::TCL_OK
+
+    set valueProperty [lindex $values 0]
+
+    switch $valueProperty {
+        enum {
+            set valueList [lindex $values 1]
+            set retCode   [areValuesOfTheType $type $valueList]
+        }
+        range {
+            set valueRange [lindex $values 1]
+
+            if {[llength $valueRange] != 2} {
+                errorMsg "Invalid range \"$valueRange\"."
+                set retCode $::TCL_ERROR
+            } else {
+                set lowerLimit [lindex $valueRange 0]
+                set upperLimit [lindex $valueRange 1]
+
+                if {($type == "integer") || ($type == "double")} {
+
+                    if {($lowerLimit != "NULL") && ($upperLimit != "NULL")} {
+                        if {([areValuesOfTheType $type $valueRange] == $::TCL_OK) &&
+                            ($lowerLimit >= $upperLimit)} {
+                            errorMsg "Invalid range \"$valueRange\"."
+                            set retCode $::TCL_ERROR
+                        }
+                    } elseif {$lowerLimit == "NULL"} {
+                        if {[areValuesOfTheType $type $upperLimit] != $::TCL_OK} {
+                            errorMsg "Invalid range \"$valueRange\"."
+                            set retCode $::TCL_ERROR
+                        }
+                    } elseif {$upperLimit == "NULL"} {
+                        if {[areValuesOfTheType $type $lowerLimit] != $::TCL_OK} {
+                            errorMsg "Invalid range \"$valueRange\"."
+                            set retCode $::TCL_ERROR
+                        }
+                    }
+                }
+            }
+        }
+        default {
+            errorMsg "Wrong value property for values \"$values\"."
+            set retCode $::TCL_ERROR
+        }
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+#
+# dataValidation::isPortList
+#
+# Description:  Find out if the given value is a valid port list.
+#
+# Input:        value to be checked.
+#
+# Output:       1 if yes.
+#               0 otherwise.
+#
+###############################################################################
+proc dataValidation::isPortList {value} \
+{
+    foreach args $value {
+        foreach arg $args {
+            if {$arg >=0 && [isInteger $arg]} {
+                return 1
+            } else {
+                return 0
+            }
+        }
+    }
+}
+
+###############################################################################
+#
+# dataValidation::isString
+#
+# Description:  Find out if the given value is a valid IP addresss.
+#
+# Input:        value to be checked.
+#
+# Output:       1 if yes.
+#               0 otherwise.
+#
+###############################################################################
+proc dataValidation::isString {value} \
+{
+#   return [regexp {^[a-zA-Z].+} $value]
+    return 1
+}
+
+###############################################################################
+#
+# dataValidation::isInteger
+#
+# Description:  Find out if the given value is a valid IP addresss.
+#
+# Input:        value to be checked.
+#
+# Output:       1 if yes.
+#               0 otherwise.
+#
+###############################################################################
+proc dataValidation::isInteger {value} \
+{
+    return [regexp {^[-]?[0-9]+$} $value]
+}
+
+###############################################################################
+#
+# dataValidation::isDouble
+#
+# Description:  Find out if the given value is a valid IP addresss.
+#
+# Input:        value to be checked
+#
+# Output:       1 if yes.
+#               0 otherwise.
+#
+###############################################################################
+proc dataValidation::isDouble {value} \
+{
+    set retCode 0
+
+    if { [string length $value] > 0 } { 
+        set retCode [regexp {^-?[0-9]*\.?[0-9]*$} $value]
+    } 
+    return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::areValuesOfTheType
+#
+# Description:  Find out if all the given values are of the given type.
+#
+# Input:        type  - integer, double, string, ipaddress, or portlist
+#               value - list of values to be checked
+#
+# Output:       TCL_OK    if no error
+#               TCL_ERROR otherwise
+#
+###############################################################################
+proc dataValidation::areValuesOfTheType {type value} \
+{
+    set retCode $::TCL_OK
+
+    if {[llength $value] == 0} {
+        set retCode $::TCL_ERROR
+	    return $retCode
+    }
+
+    set flagList 0
+        
+    switch $type {
+        integer   { set function isInteger        }
+        double    { set function isDouble         }
+        string    { set function isString         }
+        ipaddress { set function isIpAddressValid }
+        portlist  { set function portlist         }
+        integerList {
+            set function isInteger
+            set flagList 1
+        }
+        stringList {
+            set function isString
+            set flagList 1
+        }
+        default   {
+            errorMsg "Invalid type \"$type\"."
+            return $::TCL_ERROR
+        }
+    }
+
+    if { $flagList == 1 } {
+
+        foreach item $value {
+            if {[eval {$function $item}] == 0} {
+            set retCode $::TCL_ERROR
+                break
+            }
+        }
+
+    } else {
+
+        if {[eval {$function $value}] == 0} {
+            set retCode $::TCL_ERROR
+        }
+    }
+
+    return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::validateTest
+#
+# Description:  This command is invoked to validate the test parameters of the
+#               given test command.
+#
+# Input: 
+#   cmd     - test command
+#          
+#
+# Output:       TCL_OK    if no error
+#               TCL_ERROR otherwise       
+#
+###############################################################################
+proc dataValidation::validateTest {cmd {method cget}} \
+{
+    set retCode   $::TCL_OK
+    
+    catch {$cmd $method} paramList
+    foreach param [lsort [join $paramList]] {
+        if {$param == "-this"} {
+            continue
+        }
+        if {[string index $param 0] == "-"} {
+            set param   [string trim $param -]
+            if [validateCommandParameter $cmd $param] {
+                ixPuts "Invalid value specified for parameter -$param :[$cmd cget -$param], \
+                        Valid value(s):[getValidValueString $cmd $param]"
+                set retCode   $::TCL_ERROR
+            }
+        }
+    }
+    return $retCode    
+}
+
+###############################################################################
+#
+# dataValidation::getValidValueString
+#
+# Description:  This command is 
+#
+# Input:        
+#   cmd     - test command
+#   param   - command parameter
+#
+# Output:       
+#
+###############################################################################
+proc dataValidation::getValidValueString {cmd param} \
+{
+    set retCode   $::TCL_OK
+
+ 
+    return $retCode    
+}
+
+###############################################################################
+#
+# dataValidation::validateTestConfParameter
+#
+# Description:  This command validate the the specified parameter of testConf.
+#
+# Input:        parameter - name of the parameter
+#               value     - value of the parameter
+#
+# Output:       TCL_OK if no error.
+#               TCL_ERROR otherwise.
+#
+###############################################################################
+proc dataValidation::validateTestConfParameter {parameter value} \
+{
+    set retCode $::TCL_OK
+
+    switch $parameter {
+        hdlcHeader        -
+        duplex            -
+        speed             -
+        TxPortSpeed       -
+        RxPortSpeed       -
+        useMagicNumber    -
+        sonetRxCRC        -
+        sonetTxCRC        -
+        dataScrambling    -
+        useRecoveredClock -
+        autonegotiate     -
+        PPPnegotiation {
+
+            #
+            # The values of these parameters could be in a list of pairs (value interface).
+            #
+
+            # checking speed for 10GE WAN/OC192.
+            if {$parameter == "speed" && (($value == "WAN (Sonet)") || ($value == "WAN (SDH)"))} {
+                set retCode $::TCL_OK
+            } elseif {$parameter == "speed" && (($value == "Copper10") || ($value == "Copper100") || \
+                    ($value == "Copper1000") || ($value == "Fiber1000"))} {
+                set retCode $::TCL_OK
+            } else {
+                foreach elemOfValue $value {
+                    set currValue [lindex $elemOfValue 0]
+                    set retCode [doValidateTestConfParameter $parameter $currValue]
+                    if {$retCode != $::TCL_OK} {
+                        break
+                    }
+                }
+            }
+        }
+        default {
+            set retCode [doValidateTestConfParameter $parameter $value]
+        }
+    }
+
+    return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::doValidateTestConfParameter
+#
+# Description:  This command performs the validation of the specified parameter of testConf.
+#
+# Input:        parameter - name of the parameter
+#               value     - value of the parameter
+#
+# Output:       TCL_OK if no error.
+#               TCL_ERROR otherwise.
+#
+###############################################################################
+proc dataValidation::doValidateTestConfParameter {parameter value} \
+{
+    variable booleanPattern
+
+    set retCode $::TCL_OK
+
+    set parameterType [getParameter -parameter $parameter -type]
+    if {$parameterType == ""} {
+        return $::TCL_ERROR
+    }
+
+    switch $parameterType {
+        boolean {
+            if {[regexp $booleanPattern $value] == 0} {
+                set retCode $::TCL_ERROR
+            }
+        }
+        integer -
+        double {
+            set retCode [areValuesOfTheType $parameterType $value]
+            if {$retCode == $::TCL_OK} {
+                set retCode [validateNumber "testConfig" $parameter $value]
+            } 
+        }
+        integerList {
+            set retCode [areValuesOfTheType $parameterType $value]        
+            if {$retCode == $::TCL_OK} {
+                foreach valueOfList $value {
+                    set retCode [validateNumber "testConfig" $parameter $valueOfList]
+                    if { $retCode == $::TCL_ERROR } {
+                        break
+                    }
+                }
+            } 
+        }
+        string {
+            set validValues [getParameter -parameter $parameter -validValues]
+            if {$validValues != ""} {
+                if {[lsearch $validValues $value] == -1} {
+                    set retCode $::TCL_ERROR
+                }
+            }
+        }
+        stringList {
+            set validValues [getParameter -parameter $parameter -validValues]
+            if {$validValues != ""} {
+                foreach valueOfList $value {
+                    if {[lsearch $validValues $valueOfList] == -1} {
+                        set retCode $::TCL_ERROR
+                    }
+                }
+            }
+        }
+        ipaddress {
+            if {[testConfig::getTestConfItem protocolName] == "ip"} {
+                if {![isIpAddressValid $value]} {
+                    set retCode $::TCL_ERROR
+                }
+            }
+        }        
+        portlist {
+            if {[isPortList $value] == 0} {
+                set retCode $::TCL_ERROR
+            }
+        }
+        default {
+        }
+    }
+
+    if {[getParameter -parameter $parameter -validateProc] != ""} {
+        foreach validateProc [getParameter -parameter $parameter -validateProc] {
+            if {[info command "::$validateProc"] != ""} {
+                set cmdLine "::$validateProc $value"
+            } elseif {[info command "[namespace current]::$validateProc"] != ""} {
+                set cmdLine "$validateProc $value"
+            }
+
+            if {[info exists cmdLine]} {
+
+                set result [eval $cmdLine]
+
+                if {$result != $::TCL_OK} {
+
+                    if { $result == $::TCL_ERROR } {
+            
+                        setErrorString "Failed on $validateProc."
+            
+                    } else {
+    
+                        # If result is neither TCL_OK nor TCL_ERROR, it must contain a string of 
+                        # error message.
+                        #
+                        setErrorString $result
+                    }
+                }
+            }
+        }
+    }
+
+    return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::validateCommandParameter
+#
+# Description:  This command validate the parameters of the specified command.
+#
+# Input:        command   - name of the test commmand
+#               parameter - name of the parameter
+#               value     - value of the parameter
+#
+# Output:       TCL_OK if no error.
+#               TCL_ERROR otherwise.
+#
+###############################################################################
+proc dataValidation::validateCommandParameter {command parameter {value ""}} \
+{
+    variable booleanPattern
+    set retCode $::TCL_OK
+
+    set value         [$command cget    -$parameter]
+    set parameterType [$command getType -$parameter]
+
+    if {$parameterType == ""} {
+        return $::TCL_ERROR
+    }
+
+    switch $parameterType {
+        boolean {
+            if {[regexp -nocase $booleanPattern $value] == 0} {
+                set retCode $::TCL_ERROR
+            }
+
+        }
+        integer -
+        double {
+            set retCode [areValuesOfTheType $parameterType $value]
+            if {$retCode == $::TCL_OK} {
+                set retCode [validateNumber $command $parameter $value]
+            } 
+        }
+        integerList {
+            set retCode [areValuesOfTheType $parameterType $value]        
+            if {$retCode == $::TCL_OK} {
+                foreach valueOfList $value {
+                    set retCode [validateNumber $command $parameter $valueOfList]
+                    if { $retCode == $::TCL_ERROR } {
+                        break
+                    }
+                }
+            } 
+        }
+        string {
+            set validValues [$command getValidValues -$parameter]
+            if {$validValues != ""} {
+                if {[lsearch $validValues $value] == -1} {
+                    set retCode $::TCL_ERROR
+                }
+            }
+        }
+        stringList {
+            set validValues [$command getValidValues -$parameter]
+            if {$validValues != ""} {
+                foreach valueOfList $value {
+                    if {[lsearch $validValues $valueOfList] == -1} {
+                        set retCode $::TCL_ERROR
+                        break
+                    }
+                }
+            }
+        }
+        ipaddress {
+            if {[testConfig::getTestConfItem protocolName] == "ip"} {
+                if {![isIpAddressValid $value]} {
+                    set retCode $::TCL_ERROR
+                }
+            }
+        }
+        portlist {
+            if {[isPortList $value] == 0} {
+                set retCode $::TCL_ERROR
+            }
+        }
+        default {
+        }
+    }
+
+    if {[$command getValidateProc -$parameter] != ""} {
+        foreach validateProc [$command getValidateProc -$parameter] {
+            if {[info command "::$validateProc"] != ""} {
+                set cmdLine "::$validateProc $value"
+            } elseif {[info command "[namespace current]::$validateProc"] != ""} {
+                set cmdLine "$validateProc $value"
+            }
+
+            if {[info exists cmdLine]} {
+
+                set result [eval $cmdLine]
+
+                if {$result != $::TCL_OK} {
+
+                    if { $result == $::TCL_ERROR } {
+
+                        setErrorString "Failed on $validateProc."
+            
+                    } else {
+    
+                        # If result is neither TCL_OK nor TCL_ERROR, it must contain a string of 
+                        # error message.
+                        #
+                        setErrorString $result
+                        set retCode $::TCL_ERROR
+                    }
+                }
+            }
+        }
+    }
+
+    return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::setErrorString
+#
+# Description:  
+#
+# Input:        
+#
+# Output:       
+#
+###############################################################################
+proc dataValidation::setErrorString {line} {
+    variable errorString
+
+    set errorString $line
+}
+
+###############################################################################
+#
+# dataValidation::getErrorString
+#
+# Description:  
+#
+# Input:        
+#
+# Output:       
+#
+###############################################################################
+proc dataValidation::getErrorString {} {
+    variable errorString
+
+    set retVal $errorString
+    set errorString ""
+
+    return $retVal
+}
+
+###############################################################################
+#
+# dataValidation::isDataInRange
+#
+# Description:  This command finds out if a given value is in the specified range.
+#
+# Input:        data - data to be checked.
+#               range - the range to be checked against. Must be in the format of 
+#                       {lowerLimit, upperLimit}.
+#
+# Output:       TCL_OK if yes. TCL_ERROR otherwise.
+#
+###############################################################################
+proc dataValidation::isDataInRange {data range} \
+{
+    set retCode $::TCL_OK
+
+    set lowerLimit [lindex $range 0]
+    set upperLimit [lindex $range 1]
+
+    if {    (($lowerLimit != "NULL") && ($data < $lowerLimit)) || \
+            (($upperLimit != "NULL") && ($data > $upperLimit))} {
+        set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::validatePortSpeed
+#
+# Description:  
+#
+# Input:        
+#
+# Output:       
+#
+###############################################################################
+proc dataValidation::validatePortSpeed {args} \
+{
+    # puts "validating speed $args"
+    return $::TCL_OK
+}
+
+###############################################################################
+#
+# dataValidation::getProtocol
+#
+# Description:  This command finds out available protocols.
+#
+# Input:        
+#
+# Output: protocol list      
+#
+###############################################################################
+proc dataValidation::getProtocol {} \
+{
+    set protocolTable [imix cget -protocolTable]
+    set protocolList {}
+    foreach list $protocolTable {
+        lappend protocolList [lindex $list 0]
+    }
+
+    return $protocolList
+}
+
+###############################################################################
+#
+# dataValidation::checkIdentical
+#
+# Description:  This command finds out if a given value is identical to others.
+#               If it isn't, then add it to list.
+#
+# Input:        list      - available list
+#               args      - args to be checked.    
+#
+# Output:       list      
+#
+###############################################################################
+proc dataValidation::checkIdentical {list value} \
+{
+    set length [llength $list]
+	set different 0
+
+	if {$length == 0} {
+		lappend list $value
+		incr length
+	}
+
+	for {set index 0} {$index < $length} {incr index} {
+		if {$value != [lindex $list $index]} {
+			if {$index == [expr $length - 1]} {
+				set different 1
+			}
+			continue
+		} else {
+			break
+		}
+	}
+
+	if {$different == 1} {
+		lappend list $value
+	}
+
+	return $list
+
+}
+
+###############################################################################
+#
+# dataValidation::checkMatched
+#
+# Description:  This command finds out if a given value is match to list.
+#
+# Input:    list    - available list
+#           value   - value to be checked.   
+#
+# Output:  TCL_OK if yes. TCL_ERROR otherwise.      
+#
+###############################################################################
+proc dataValidation::checkMatched {list value} \
+{
+    set retCode $::TCL_OK
+
+    foreach arg $list {
+        if {$arg == $value } {
+            break
+        } elseif {$arg != $value && $arg == [lindex $list end]} {
+            set retCode $::TCL_ERROR
+        }
+    }
+            
+    return $retCode
+
+}
+
+
+###############################################################################
+#
+# dataValidation::frameSizeProtocolSame
+#
+# Description:  This command finds out if both frame size and protocol are same.
+#
+# Input:  args - args to be checked.      
+#
+# Output: TCL_OK if no. TCL_ERROR otherwise.     
+#
+###############################################################################
+proc dataValidation::frameSizeProtocolSame {args} \
+{
+    set retCode $::TCL_OK
+    set imixList [lindex $args 0]
+    debugMsg "imixList: $imixList"
+    set argsLength [llength $imixList]
+    set frameSizeProtocolList {}
+
+    foreach arg $imixList {
+        set length [llength [lindex $arg 0]]
+        if {$length == 1} {
+            lappend frameSizeProtocolList [lindex $arg 0]
+            lappend frameSizeProtocolList UDP
+        } else {
+            lappend frameSizeProtocolList [lindex [lindex $arg 0] 0]
+            lappend frameSizeProtocolList [lindex [lindex $arg 0] 1]
+        }
+    }
+
+    debugMsg "frameSizeProtocolList:$frameSizeProtocolList"
+
+    for {set index1 0} {$index1 < [expr 2 * $argsLength]} {incr index1 0} {
+        set frameSize1 [lindex $frameSizeProtocolList $index1]
+        incr index1
+        set protocol1 [lindex $frameSizeProtocolList $index1]
+        incr index1
+        for {set index2 $index1} {$index2 < [expr 2 * $argsLength]} {incr index2 0} {
+            set frameSize2 [lindex $frameSizeProtocolList $index2]
+            incr index2
+            set protocol2 [lindex $frameSizeProtocolList $index2]
+            incr index2
+
+            if {$frameSize1 == $frameSize2} {
+                if {[stringCompare -nocase $protocol1 $protocol2] == 0} {
+                    logMsg "Invalid for both frame size $frameSize1 and $frameSize2 have same protocols"
+                    set retCode $::TCL_ERROR
+                    break
+                }
+            }
+        }
+        if {$retCode == $::TCL_ERROR} {
+            break
+        }
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+#
+# dataValidation::validateImixList
+#
+# Description:  This command finds out if a given imixList is valid.
+#
+# Input:  args - args to be checked. For example:
+#                set list  {{{80     tcp           }         20} \
+#                           { 74                             20} \
+#                           {{570    udp           }         20} \
+#                           {{81     aaa           }         20} \
+#                           {570                             20}}     
+#
+# Output: TCL_OK if yes. TCL_ERROR otherwise.     
+#
+###############################################################################
+proc dataValidation::validateImixList {args} \
+{
+	set retCode $::TCL_OK
+    set sum 0
+    set bandwidthList {}
+
+    set imixList [lindex $args 0]
+    debugMsg "imixList= $imixList"
+
+    if [frameSizeProtocolSame $imixList] {
+        set retCode $::TCL_ERROR 
+        return $retCode
+    } 
+
+    foreach arg $imixList { 
+        debugMsg "--------------------------------------------"
+        debugMsg "arg:$arg"
+        for {set index2 0} {$index2 < 2} {incr index2} {
+            switch $index2 {
+                0 {
+                    set subArg [lindex $arg 0]
+                    set len3 [llength $subArg]
+                    for {set index3 0} {$index3 < $len3} {incr index3} {
+                        set parameter [lindex $subArg $index3]
+                        switch $index3 {
+                            0 {
+                                debugMsg "********** fs:$parameter ***********"
+                                if {[isInteger $parameter] == 0} {
+                                    debugMsg "fs:$parameter invalid which isnot an integer"
+                                    set retCode $::TCL_ERROR
+                                } elseif {$parameter < 0} {
+                                    debugMsg "fs:$parameter invalid which is less than 0"
+                                    set retCode $::TCL_ERROR
+                                } elseif {$parameter <70} {
+                                    set protocol [lindex $subArg 1]
+                                    debugMsg "subArg=$subArg"
+                                    debugMsg "protocol:$protocol"
+                                    if {[stringCompare -nocase "Ethernet" $protocol] == 0} {
+                                        debugMsg "fs:$parameter invalid which is less than 70 while using Ethernet"
+                                        set retCode $::TCL_ERROR
+                                    }
+                                }
+                            }
+                            1 {
+                                debugMsg "********** protocol:$parameter ***********"
+                                set protocolList [getProtocol]
+                                if {[checkMatched $protocolList $parameter] == 1} {
+                                    debugMsg "protocol:$parameter invalid which doesnot match your protocol list"
+                                    set retCode $::TCL_ERROR
+                                }                             
+                            }
+                            2 {
+                                debugMsg "********** precedence:$parameter ***********"
+                                if {[isInteger $parameter] == 0} {
+                                    debugMsg "precedence:$parameter invalid which isnot an integer"
+                                    set retCode $::TCL_ERROR
+                                } elseif {$parameter < 0} {
+                                    debugMsg "precedence:$parameter invalid which is less than 0"
+                                    set retCode $::TCL_ERROR
+                                }                                   
+                            }
+                        }
+                    }
+
+                }
+                1 {
+                    set parameter [lindex $arg 1]
+                    debugMsg "********** %bandwidth:$parameter ***********"
+                    if {[isDouble $parameter] == 0} {
+                        debugMsg "%bandwidth:$parameter invalid which isnot an integer or double"
+                        set retCode $::TCL_ERROR
+                    } elseif {$parameter < 0} {
+                        debugMsg "%bandwidth:$parameter invalid which is less than 0"
+                        set retCode $::TCL_ERROR
+                    } elseif {[expr $sum + $parameter] > 100} {
+                        debugMsg "%bandwidth:$parameter invalid which is more than [expr 100 - $sum]"
+                        set retCode $::TCL_ERROR
+                    } else {
+                        set sum [expr $sum + $parameter]
+                    }
+                }
+            }
+        }
+ 
+    }  
+    debugMsg "--------------------------------------------"
+
+	return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::validateProtocolTable
+#
+# Description:  This command finds out if a given protocolTable List is valid.
+#
+# Input:   args: - protocolTable List. For example:
+#                  protocolTable {{ tcp          tcp        0         0   } \
+#                                 { http         tcp        1053     80   } \
+#                                 { ftp          tcp        1054     21   } \
+#                                 { dns          udp        1055     22   } \
+#                                 { telnet       tcp        1056     23   } \
+#                                 { test1        egp        1057     24   } \
+#                                 { test2        icmp       1058     25   }}      
+#
+# Output:  TCL_OK if yes. TCL_ERROR otherwise.     
+#
+###############################################################################
+proc dataValidation::validateProtocolTable {args} \
+{
+    set retCode $::TCL_OK
+    debugMsg "protocol table: args= $args"
+    set argsList [lindex $args 0]
+    set len [llength $argsList]
+    set yourProtocolList {}
+    set standardProtocolList {http telnet ftp tcp udp icmp bgp ospf rsvp rvp ethernet}
+
+    foreach arg $argsList { 
+        debugMsg "--------------------------------------------"
+        debugMsg "arg:$arg"
+        for {set index 0} {$index < $len} {incr index} {
+            set parameter [lindex $arg $index]
+            switch $index {
+                0 {
+                    debugMsg "********** your protocol:$parameter **********"
+                    set length [llength $yourProtocolList]
+                    set yourProtocolList [checkIdentical $yourProtocolList $parameter]
+                    if {$length == [llength $yourProtocolList]} { 
+                        debugMsg "yourProtocol:$parameter invalid which is identical to others"
+                        set retCode $::TCL_ERROR
+                    }
+                }
+                1 {
+                    debugMsg "********** protocol:$parameter ***********"
+                    if {[checkMatched $standardProtocolList $parameter] == 1} {
+                        debugMsg "Protocol:$parameter invalid which is not a standard protocol"
+                        set retCode $::TCL_ERROR
+                    }
+                }
+                2 {
+                    debugMsg "********** srcPort:$parameter ***********"
+                    if {[isInteger $parameter] == 0} {
+                        debugMsg "srcPort:$parameter invalid which isnot an integer"
+                        set retCode $::TCL_ERROR
+                    } elseif {$parameter < 0} {
+                        debugMsg "srcPort:$parameter invalid which is less than 0"
+                        set retCode $::TCL_ERROR
+                    }
+                      
+                    
+                }
+                3 {
+                    debugMsg "********** destPort:$parameter **********"
+                    if {[isInteger $parameter] == 0} {
+                        debugMsg "destPort:$parameter invalid which isnot an integer"
+                        set retCode $::TCL_ERROR
+                    } elseif {$parameter < 0} {
+                        debugMsg "destPort:$parameter invalid which is less than 0"
+                        set retCode $::TCL_ERROR
+                    }
+                }
+            }
+     
+        }
+    }
+    debugMsg "--------------------------------------------"
+
+	return $retCode
+}
+
+###############################################################################
+#
+# dataValidation::validateCmFlowMix
+#
+# Description:  
+#
+# Input:        
+#
+# Output:       
+#
+###############################################################################
+proc dataValidation::validateCmFlowMix {args} \
+{
+}
+
+###############################################################################
+#
+# dataValidation::validateRunType
+#
+# Description:  
+#
+# Input:        
+#
+# Output:       
+#
+###############################################################################
+proc dataValidation::validateRunType {args} \
+{
+}
+
+
+###############################################################################
+#
+# dataValidation::validateNumber
+#
+# Description:  Validates a number that can be either integer or double.
+#
+# Input:  command   - name of the test commmand
+#         parameter - name of the parameter
+#         value     - value of the parameter
+#
+# Output: TCL_OK if yes. TCL_ERROR otherwise.     
+#
+###############################################################################
+proc dataValidation::validateNumber {command parameter value} \
+{
+    set retCode $::TCL_OK
+
+    set enumOrRange ""
+    if { $command == "testConfig" } {
+        set validValue [getParameter -parameter $parameter -validValues]
+    } else {
+        set validValue [$command getValidValues -$parameter]
+    }
+
+    if {$validValue != ""} {
+        set enumOrRange enum
+    } else {
+        if { $command == "testConfig" } {
+            set validValue [getParameter -parameter $parameter -validValues]
+        } else {
+            set validValue [$command getValidRange -$parameter]
+        }
+
+        if {$validValue != ""} {
+            set enumOrRange range
+        }
+    }
+                
+    if {$enumOrRange == "enum"} {
+        foreach elemOfValue $value {
+            if {[lsearch $validValue $elemOfValue] == -1} {
+                set retCode $::TCL_ERROR
+                break
+            }
+        }
+    } elseif {$enumOrRange == "range"} {
+        foreach elemOfValue $value {
+            set retCode [isDataInRange $elemOfValue $validValue]
+                if {$retCode == $::TCL_ERROR} {
+                break
+            }
+        }
+    }
+    
+	return $retCode
+}
+
+
+###############################################################################
+#
+# dataValidation::checkErrFrameFrameErrorList
+#
+# Description:  This command validates frame error list for 2889 error frame test.
+#
+# Input:        framesize
+#
+# Output:       TCL_OK, if no error
+#               Error string, otherwise
+#
+###############################################################################
+proc dataValidation::checkErrFrameFrameErrorList { frameErrorList } \
+{
+ 
+    set retCode $::TCL_OK
+
+    if { [llength $frameErrorList] == 0 } {
+
+        set retCode "frameErrorList must not be empty.\nAt least one type of the frame sizes\nhave to be selected."
+
+    } else {
+
+        set frameSizeCount 0
+
+        foreach item $frameErrorList {
+            switch $item {
+                undersize {
+                    incr frameSizeCount [llength [errframe cget -undersizeList]]
+                }
+                oversize {
+                    incr frameSizeCount [llength [errframe cget -oversizeList]]
+                }
+                default {
+                    incr frameSizeCount [llength [errframe cget -framesizeList]]
+                }
+            }
+        }
+
+        if { $frameSizeCount == 0 } {
+            set retCode "No valid frame sizes were selected\n\
+                         for current framesize option(s)"
+        }
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+#
+# dataValidation::checkCmatsIpAndMacAddress
+#
+# Description:  This command validates address of Cmats test.
+#               The address of cableModem command can be either IP address and
+#               MAC address. The last bit of the first byte has to be on if it
+#               is MAC address. 
+#
+# Input:        address
+#
+# Output:       TCL_OK, if no error
+#               Error string, otherwise
+#
+###############################################################################
+proc dataValidation::checkCmatsIpAndMacAddress { address } \
+{
+    global currContext
+
+    set retCode $::TCL_OK
+
+    if {![isIpAddressValid $address]} {
+        set retCode $::TCL_ERROR
+    }
+
+    if { $retCode == $::TCL_ERROR } {
+
+        # The address is not IP address. Let's see if it is MAC address.
+
+        if { [isMacAddressValid $address] == $::TCL_OK } {
+    
+            if { $currContext(testSubCat) == "eth01McastUpstream" || \
+                    $currContext(testSubCat) == "eth01McastDownstream" } {
+
+                # The last bit of the first byte has to be on.
+
+                set firstByte [lindex [split $address] 0]
+                if { [expr 0x$firstByte & 01] == 1 } {
+                    set retCode $::TCL_OK
+                }
+
+            } else {
+                set retCode $::TCL_OK
+            }
+        }
+    }
+
+    if { $retCode == $::TCL_ERROR } {
+        set retCode "Valid IP or MAC address."
+
+        if { $currContext(testSubCat) == "eth01McastUpstream" || \
+                $currContext(testSubCat) == "eth01McastDownstream" } {
+            append retCode "The last bit of the first byte has to be on for MAC address."
+        }
+    }
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure: dataValidation::isValidMulticastIp
+#
+# Description: 
+#   Helper proc to check if ipAddress is a valid IP by making sure it falls in the
+#   range (224.0.0.0 - 239.255.255.255).
+#
+# Arguments(s):
+#   ipAddress - IP address
+#
+# Returns:
+#   $::TCL_OK, if is valid unicast IP address
+#   Valid range, otherwise
+#
+##################################################################################
+proc dataValidation::isValidMulticastIp {ipAddress} \
+{
+    set retCode "\(224.0.0.0 - 239.255.255.255\)"
+
+    if {[isIpAddressValid $ipAddress]} {
+
+        set multicastIpStartNum [ip2num "224.0.0.0"]
+        set multicastIpEndNum   [ip2num "239.255.255.255"]
+        set ipNum               [ip2num $ipAddress]
+
+        if { ($ipNum >= $multicastIpStartNum) && ($ipNum <= $multicastIpEndNum) } {
+            set retCode $::TCL_OK
+        }
+    }
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure: dataValidation::isValidUnicastIp
+#
+# Description: 
+#   Helper proc to check if ipAddress accomplied with the following
+#       1) it is not 0.x.x.x
+#       2) it is not 255.255.255.255
+#       3) it is not loopback address (127.x.x.x)
+#       4) it is not multicast address (224.0.0.0 - 239.255.255.255, i.e first 4 bits not 1110)
+#       5) it is not reserved for future use (240.0.0.0 - 247.255.255.255)
+#       6) it is invalid when it is < 1.0.0.0 or >= 224.0.0.0 on port
+#
+# Arguments(s):
+#   ipAddress - IP address
+#
+# Returns:
+#   $::true     if is valid unicast IP address
+#   $::false    if is not valid unicast IP address
+#
+##################################################################################
+proc dataValidation::isValidUnicastIp {ipAddress} \
+{
+    set valid $::false
+
+    if {[isIpAddressValid $ipAddress]} {
+        set valid $::true
+
+        set multicastIpStartNum [ip2num "224.0.0.0"]
+        set ipNum               [ip2num $ipAddress]
+        
+        if {([lindex [split $ipAddress .] 0] == 127) || ([lindex [split $ipAddress .] 0] == 255) || \
+            ([lindex [split $ipAddress .] 0] == 0)} {
+            set valid $::false
+        }
+                
+        if { [mpexpr $ipNum >= $multicastIpStartNum] } {
+            set valid $::false
+        }
+    }
+
+    return $valid
+}
+
+##################################################################################
+# Procedure: dataValidation::isOverlappingIpAddress
+#
+# Description: 
+#   Helper proc to check if IP addresses are overlapping
+#
+# Arguments(s):
+#   ipAddress1  - ipAddress to compare to
+#   mask1       - net mask
+#   ipAddress2  - ipAddress to compare to
+#   mask2       - net mask
+#
+# Returns:
+#   $::true     - if overlapping
+#   $::false    - if not overlapping
+#
+##################################################################################
+proc dataValidation::isOverlappingIpAddress {ipAddress1 count1 ipAddress2 count2} \
+{
+    set overlap $::false
+
+    set firstIp1 [ip2num $ipAddress1]
+    set lastIp1  [mpexpr $firstIp1 + $count1 - 1]
+
+    set firstIp2 [ip2num $ipAddress2]
+    set lastIp2  [mpexpr $firstIp2 + $count2 - 1] 
+ 
+    if {($firstIp1 <= $firstIp2 && $firstIp2 <= $lastIp1) || \
+        ($firstIp1 <= $lastIp2 && $lastIp2 <= $lastIp1)} {
+        set overlap $::true
+    }           
+
+    if {($firstIp2 <= $firstIp1 && $firstIp1 <= $lastIp2) || \
+        ($firstIp2 <= $lastIp1 && $lastIp1 <= $lastIp2)} {
+        set overlap $::true
+    } 
+
+    return $overlap
+}
+
+##################################################################################
+# Procedure: dataValidation::isSameSubnet
+#
+# Description: 
+#   Helper proc to check if ports in two different user profiles are in the same subnet.
+#   Note that all ports in one user porfile are in the same subnet.
+#
+# Arguments(s):
+#   ipAddr1 - ipAddress to compare to
+#   mask1   - net mask
+#   ipAddr2 - ipAddress to compare to
+#   mask2   - net mask
+#
+# Returns:
+#   $::true if in same subnet
+#   $::false if not in same subnet
+#
+##################################################################################
+proc dataValidation::isSameSubnet {ipAddr1 mask1 ipAddr2 mask2} \
+{
+    set retCode $::true
+
+    set range1Subnet    [num2ip [expr [ip2num $ipAddr1] & [ip2num $mask1]]]
+    set range2Subnet    [num2ip [expr [ip2num $ipAddr2] & [ip2num $mask2]]]
+
+    if {[string compare $range1Subnet $range2Subnet] != 0} {
+        set retCode $::false
+    } 
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure: dataValidation::isValidNetMask
+#
+# Description: 
+#   Helper proc to check if net mask is valid. i.e. In binary form, the mask must 
+#   have consecutive 1's followed by consecutive 0's
+#
+# Arguments(s):
+#   mask - net mask
+#
+# Returns:
+#   $::true     - if valid mask
+#   $::false    - if not valid mask
+#
+##################################################################################
+proc dataValidation::isValidNetMask {mask} \
+{
+    set valid $::false
+
+    if {[isIpAddressValid $mask]} {
+        set numMask [ip2num $mask]
+
+        if {![catch {expr fmod(0x80000000, ($numMask ^ 0xffffffff) +1)} value] && $value == 0} {
+            set valid $::true
+        }            
+    }
+
+    return $valid
+}
+
+##################################################################################
+# Procedure: dataValidation::isValidHostPart
+#
+# Description: 
+#   Helper proc to check if ipAddress is valid within the net mask
+#               The host bits cannot be all 0s or 1s
+#
+# Arguments(s):
+#   ipAddress - IP address, net mask
+#
+# Returns:
+#   $::true     if is valid IP address within net mask
+#   $::false    if is not valid IP address within net mask
+#
+##################################################################################
+proc dataValidation::isValidHostPart {ipAddress mask} \
+{
+    set valid $::false
+
+    if {[isValidUnicastIp $ipAddress] && [isValidNetMask $mask]} {
+
+        set ipNum       [ip2num $ipAddress]
+        set maskNum     [ip2num $mask]
+
+        set valid  [expr ((1 + $ipNum) & (~$maskNum)) > 1]
+    }
+
+    return $valid
+}
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/defineCommand.tcl b/dep/tclclient/ixTcl1.0/Generic/defineCommand.tcl
new file mode 100644
index 00000000..43732bad
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/defineCommand.tcl
@@ -0,0 +1,441 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: defineCommand.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+# Revision Log:
+# 12-13-1999	DS	Genesis
+#
+# Description: This file contains the commands for all the tests. When a new test
+# is added, create a new proc for that test here.
+#
+##################################################################################
+
+
+
+########################################################################################
+# Namespace: defineCommand
+#
+# Description: This namespace is used to initialize the defineCommand commands
+#
+########################################################################################
+namespace eval defineCommand {} \
+{
+    variable commands
+    variable commandList
+    
+    set      commandList               {}
+    set      commands(config)          {}
+    set      commands(cget)            {}
+    set      commands(show)            {}
+    set      commands(setDefault)      {}
+
+    set      commands(getType)         {}
+    set      commands(getValidRange)   {}
+    set      commands(getValidValues)  {}
+    set      commands(getValidateProc) {}
+    set      commands(getHelp)         {}
+}
+
+########################################################################################
+# Procedure: initializeDefineCommand
+#
+# Description: This command is used to initialize the defineCommand commands
+#
+########################################################################################
+proc initializeDefineCommand {} \
+{
+    defineCommand::initialize
+}
+
+########################################################################################
+# Procedure: defineCommand::initialize
+#
+# Description: This command is used to initialize the defineCommand commands
+#
+########################################################################################
+proc defineCommand::initialize {} \
+{
+    set retCode 0
+
+    # once we get this one registered, then we can use its methods
+    registerCommand defineCommand
+    registerMethod defineCommand registerCommand
+    registerMethod defineCommand registerMethod
+
+    # now that we have registered the registerMethod, we can use it for the other methods
+    defineCommand registerMethod defineCommand isRegistered
+    defineCommand registerMethod defineCommand registerParameter
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: defineCommand::isRegistered
+#
+# Description: This command checks to see if a command is registered
+#
+########################################################################################
+proc defineCommand::isRegistered {testCmd} \
+{
+    set retCode 0
+
+    if [catch {$testCmd exists} retCode] {
+        set retCode 0
+    }
+    return [expr $retCode]
+}
+
+########################################################################################
+# Procedure: defineCommand::getAllRegisteredCommands
+#
+# Description: This command gets the Tcl command list
+#
+########################################################################################
+proc defineCommand::getAllRegisteredCommands { } \
+{
+    set retCode 0
+
+    variable commandList
+
+    return $commandList
+}
+
+########################################################################################
+# Procedure: defineCommand::registerCommand
+#
+# Description: This command registers a new Tcl command
+#
+########################################################################################
+proc defineCommand::registerCommand {testCmd} \
+{
+    set retCode 0
+
+    global   defineCommandParms
+    variable commands
+    variable commandList
+
+
+    if [isRegistered $testCmd] {
+        debugMsg "registerCommand: $testCmd is already registered"
+        set retCode 1
+    } else {
+
+        lappend commandList $testCmd
+
+        set parmArray   [format %sParms $testCmd]
+        set methodArray [format %sMethods $testCmd]
+        global $parmArray $methodArray
+       
+        #define namespace for testCmd
+        #NOTE: Not defined variable here, may define them in proc testCmd::setDefault later.
+        #      Defined results and dataVerify namespaces twice in two files. 
+        #      Defined tclClient and advancedTestParameter namespaces which we may not need.
+        #      We need modify those later.
+        namespace eval ::$testCmd {} {
+        }
+         
+        # assign global parms automatically on registration
+        foreach parm [array names defineCommandParms] {
+            set ${parmArray}($parm)   $defineCommandParms($parm)
+        }
+        foreach command [array names commands] {
+            set ${methodArray}($command)    $commands($command)
+        }
+        set cmdLine "proc ::$testCmd \{\{method_name \{\}\} \{args \{\}\}\} \{return \[parseCmd $testCmd \$method_name args\]\}"
+        eval $cmdLine
+
+        # create the default set of methods
+        foreach command [array names commands] {
+            registerMethod $testCmd $command
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:   defineCommand::registerMethod
+#
+# Description: This command registers a new method for this Tcl command
+#
+# Arguments:   
+#
+# Results:     0 if succeeded. 1 otherwise.
+#
+########################################################################################
+proc defineCommand::registerMethod {testCmd method {parameterList {}}} \
+{
+    set retCode 0
+
+    if {![isRegistered $testCmd]} {
+        puts "$testCmd is not yet registered, registering method failed."
+        set retCode 1
+    } else {
+        set methodArray [format %sMethods $testCmd]
+
+        global $methodArray
+
+        set method_name [format "%s_%s" $testCmd $method]
+
+        if [info exists ${methodArray}($method)] {
+            foreach parm $parameterList {
+                if {[lsearch [eval set ${methodArray}($method)] $parm] == -1} {
+                    lappend ${methodArray}($method) $parm
+                }
+            }
+        } else {
+            set ${methodArray}($method)     $parameterList
+        }
+
+        if [catch {info body $method_name}] {
+            if {$method == "setDefault"} {
+                set defaultArray    [format %sDefaultVals $testCmd]
+                set cmdLine "proc \:\:$testCmd\:\:$method \{\{args \{\}\}\} \{global $defaultArray; \
+                        foreach name \[array names ${defaultArray}\] { \
+                        $testCmd config -\$name  \$${defaultArray}(\$name); \
+                    }; \
+                    return 0\}"
+                eval $cmdLine
+            }
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: defineCommand::registerParameter
+#
+# Description: This command registers a new parameter for this Tcl command
+#
+# Arguments:   args - must be in the following format.
+#                       -command      command      \
+#                       -parameter    parameter    \
+#                       -type         type         \
+#                       -defaultValue defaultValue \
+#                       -validValues  validValues  \
+#                       -validRange   validRange   \
+#                       -validateProc validateProc \
+#                       -access       access
+#                     where -command, -parameter, and -type are mandatory.
+#
+# Results:     0 if succeeded. 1 otherwise.
+#
+########################################################################################
+proc defineCommand::registerParameter {args} \
+{
+    set retCode 0
+    
+    #
+    # If the argument comes in as a list. Take away the curly braces around it.
+    #
+    if {[regexp {^\{} $args]} {
+        regsub -all {(^{|}$)} $args "" args
+    }
+
+    #
+    # This one is different in that the args could contain multiple -validateProc.
+    #
+    set validateProcArg {}
+
+    foreach arg $args {
+
+        if {[regexp {^-[a-zA-Z].+} $arg]} {
+            #
+            # Current argument is preceeded by '-'.
+            #
+            switch -- $arg {
+                "-command"       -
+                "-parameter"     -
+                "-type"          -
+                "-defaultValue"  -
+                "-validValues"   -
+                "-validRange"    -
+                "-validateProc"  -
+                "-access"        -
+                "-help" {
+                    set currentOption [string trimleft $arg -]
+                    set currentAction getValue
+                }
+                default {
+                    set retCode 1
+                    break
+                }
+            }
+        } else {
+            if {[info exists currentAction]} {
+                switch $currentAction {
+                    "getValue" {
+                        if {$currentOption == "validateProc"} {
+                            lappend ${currentOption}Arg $arg
+                        } else {
+                            set ${currentOption}Arg $arg
+                        }
+
+                        unset currentOption
+                        unset currentAction
+                    }
+                    default {
+                        set retCode 1
+                        break
+                    }
+                }
+            } else {
+                set retCode 1
+                break
+            }
+        }
+    }
+
+    if {$retCode == 0} {
+        #
+        # Test command name, parameter name, and parameter type are mandatory when
+        # registring a test parameter.
+        #
+        if {[info exists commandArg] == 0} {
+
+            set retCode 1
+        
+        } elseif {[info exists parameterArg] == 0} {
+        
+            set retCode 1
+        
+        } elseif {[info exists typeArg] == 0} {
+
+            set retCode 1
+
+        } elseif {[info exists validValuesArg] && [info exists validRangeArg]} {
+
+            set retCode 1
+
+        }
+    }
+
+    if {$retCode == 1} {
+        puts "Invalid arguments: \"$args\"."
+        return $retCode
+    }
+
+    if {![isRegistered $commandArg]} {
+        puts "$commandArg is not yet registered, registering parameter failed."
+        set retCode 1
+    } else {
+
+        if {[info exists defaultValueArg] == 0} {
+            set defaultValueArg 0
+        }
+
+        #
+        # $parmArray         - contains the values defined by the option -parameter
+        # $methodArray       - contains the values defined by the option -command
+        # $validateArray     - contains the values defined by the option -validValues
+        # $defaultArray      - contains the values defined by the option -defaultValue
+        # $validRangeArray   - contains the values defined by the option -validRange
+        # $validateProcArray - contains the values defined by the option -validateProc
+        # $typeArray         - contains the values defined by the option -type
+        # $helpArray         - contains the values defined by the option -help
+        #
+        set parmArray         ${commandArg}Parms
+        set methodArray       ${commandArg}Methods
+        set validateArray     ${commandArg}ConfigVals
+        set defaultArray      ${commandArg}DefaultVals
+        set validRangeArray   ${commandArg}ValidRange
+        set validateProcArray ${commandArg}ValidateProc
+        set typeArray         ${commandArg}Type
+        set helpArray         ${commandArg}Help
+
+        global $parmArray $methodArray $validateArray $defaultArray
+        global $validRangeArray $validateProcArray $typeArray $helpArray
+
+        foreach parm $parameterArg {
+            set ${parmArray}($parm)    $defaultValueArg
+            set ${defaultArray}($parm) $defaultValueArg
+        }
+
+        if {[info exists access] == 0} {
+            set access rw
+        }
+
+        switch $access {
+            r {
+                defineCommand registerMethod $commandArg cget   $parameterArg
+            }
+            w {
+                defineCommand registerMethod $commandArg config $parameterArg
+            }
+            wr -
+            default {
+                defineCommand registerMethod $commandArg cget   $parameterArg
+                defineCommand registerMethod $commandArg config $parameterArg
+            }
+        }
+
+        if {[info exists validValuesArg] && ($validValuesArg != "")} {
+            foreach parm $parameterArg {
+                set ${validateArray}($parm) $validValuesArg
+            }
+        }
+
+        if {[info exists validRangeArg]} {
+            foreach parm $parameterArg {
+                set ${validRangeArray}($parm) $validRangeArg
+            }
+        }
+
+        if {[info exists validateProcArg]} {
+            foreach parm $parameterArg {
+                set ${validateProcArray}($parm) $validateProcArg
+            }
+        }
+
+        if {[info exists typeArg]} {
+            foreach parm $parameterArg {
+                set ${typeArray}($parm) $typeArg
+            }
+        }
+
+        if {[info exists helpArg]} {
+            foreach parm $parameterArg {
+                set ${helpArray}($parm) $helpArg
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/defineTest.tcl b/dep/tclclient/ixTcl1.0/Generic/defineTest.tcl
new file mode 100644
index 00000000..bb1db43f
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/defineTest.tcl
@@ -0,0 +1,161 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: defineTest.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+# Revision Log:
+# 12-13-1999	DS	Genesis
+#
+# Description: This file contains the commands for all the tests. When a new test
+# is added, create a new proc for that test here.
+#
+##################################################################################
+
+namespace eval defineTest {} \
+{
+    variable defaultParms
+    variable defaultParmType
+    variable defaultCommands
+
+#   moved parameter:numtrials to proc defineTest::registerCommand.
+#   set defaultParms(numtrials)		        1
+    set defaultParms(duration)		        20
+    set defaultParms(waitResidual)		    2
+    set defaultParms(testName) 		        ""
+    set defaultParms(framesize)		        64
+    set defaultParms(framesizeList)		    {}
+
+
+#   set defaultParmType(numtrials)	        integer
+    set defaultParmType(duration)	        integer
+    set defaultParmType(waitResidual)	    integer
+    set defaultParmType(testName) 	        string
+    set defaultParmType(framesize) 	        integer
+    set defaultParmType(framesizeList)      integerList
+
+    set defaultCommands(config)             [array names defaultParms]
+    set defaultCommands(cget)               [array names defaultParms]
+    set defaultCommands(registerResultVars) {}
+    set defaultCommands(start)              {}
+}
+
+########################################################################################
+# Procedure: initializeDefineTest
+#
+# Description: This command is used to initialize the defineTest commands
+#
+########################################################################################
+proc initializeDefineTest {} \
+{
+    defineTest::initialize
+}
+
+########################################################################################
+# Procedure: defineTest::initialize
+#
+# Description: This command is used to initialize the defineTest commands
+#
+########################################################################################
+proc defineTest::initialize {} \
+{
+    set retCode 0
+
+    defineCommand registerCommand defineTest
+    defineCommand registerMethod  defineTest registerCommand
+    defineCommand registerMethod  defineTest registerParameter
+    defineCommand registerMethod  defineTest registerTest
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: defineTest::registerCommand
+#
+# Description: This command registers a new Tcl test command
+#
+########################################################################################
+proc defineTest::registerCommand {testCmd} \
+{
+    variable defaultParms
+    variable defaultParmType
+    variable defaultCommands
+
+    set retCode 0
+
+    defineCommand registerCommand $testCmd
+
+    # assign global parms automatically on registration
+    foreach parm [array names defaultParms] {
+        defineCommand registerParameter -command $testCmd -parameter $parm -defaultValue $defaultParms($parm) -type $defaultParmType($parm)
+    }
+
+    defineTest registerParameter -command $testCmd -parameter numtrials      -defaultValue 1                 -type integer -validRange  {1 NULL}
+    defineTest registerParameter -command $testCmd -parameter staggeredStart -defaultValue notStaggeredStart -type string  -validValues {staggeredStart notStaggeredStart true false}
+    defineTest registerParameter -command $testCmd -parameter framesize      -defaultValue 64                -type integer 
+    defineTest registerParameter -command $testCmd -parameter framesizeList  -defaultValue {}                -type integerList
+
+    foreach method [array names defaultCommands] {
+        defineCommand registerMethod $testCmd $method $defaultCommands($method)
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: defineTest::registerParameter
+#
+# Description: This command registers a new parameter for this Tcl test command
+#
+########################################################################################
+proc defineTest::registerParameter {args} \
+{
+    return [defineCommand registerParameter $args]
+}
+
+
+########################################################################################
+# Procedure: defineTest::registerTest 
+#
+# Description: This command registers a new test (start command) for this Tcl command
+#
+########################################################################################
+proc defineTest::registerTest  {testCmd testSubCmd {testSubCmdParameterList ""}} \
+{
+    return [defineCommand registerMethod $testCmd start $testSubCmd]
+}
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/dhcpExchange.tcl b/dep/tclclient/ixTcl1.0/Generic/dhcpExchange.tcl
new file mode 100644
index 00000000..2b52ea7c
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/dhcpExchange.tcl
@@ -0,0 +1,2605 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: dhcpExchange.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	12-02-1998	Debby Stopp
+#
+# Description: This file contains procedures that send out DHCP exchange messages and
+#   conforms to the DHCP specifications RFC 2131 and RFC 1533 with the following
+#   exceptions:
+#
+#       Timers 1 & 2 not implemented in a port by port fashion
+#       Lease expiration not handled in a port by port fashion
+#       Release not implemented.
+#
+########################################################################################
+
+set nullIP       "0.0.0.0"
+set broadcastIP  "255.255.255.255"
+
+#
+#   Wrappers routines for dhcpClient namespace procedures
+#
+proc dhcpSetState               {chassis card port newState}        {dhcpClient::SetState $chassis $card $port $newState}
+proc dhcpGetState               {chassis card port}                 {dhcpClient::GetState $chassis $card $port}
+proc dhcpSetLease               {chassis card port lease}           {dhcpClient::SetLease $chassis $card $port $lease}
+proc dhcpGetLease               {chassis card port}                 {dhcpClient::GetLease $chassis $card $port}
+proc dhcpSetIP                  {chassis card port ip}              {dhcpClient::SetIP $chassis $card $port $ip}
+proc dhcpGetIP                  {chassis card port}                 {dhcpClient::GetIP $chassis $card $port}
+proc dhcpSetServer              {chassis card port server}          {dhcpClient::SetServer $chassis $card $port $server}
+proc dhcpGetServer              {chassis card port}                 {dhcpClient::GetServer $chassis $card $port}
+proc dhcpGetTimer               {timer}                             {dhcpClient::GetTimer $timer}
+proc dhcpStartTimers            {lease {timer1 0} {timer2 0}}       {dhcpClient::StartTimers $lease $timer1 $timer2}
+proc dhcpStartTimer             {timer lease}                       {dhcpClient::StartTimer $timer $lease}
+proc dhcpStopTimers             {}                                  {dhcpClient::StopTimers}
+proc dhcpStopTimer              {timer}                             {dhcpClient::StopTimer $timer}
+proc dhcpSetStreamRegion        {region}                            {dhcpClient::SetStreamRegion $region}
+proc dhcpGetStreamRegion        {}                                  {dhcpClient::GetStreamRegion}
+proc dhcpSetPortList            {portList}                          {dhcpClient::SetPortList $portList}
+proc dhcpGetPortList            {}                                  {dhcpClient::GetPortList}
+proc dhcpStop                   {}                                  {dhcpClient::Stop}
+proc dhcpStopPort               {chassis card port {release false}} {dhcpClient::StopPort $chassis $card $port $release}
+proc dhcpEnableStateMachine     {{stateList dhcpClient::stateList} \
+                                 {eventList dhcpClient::eventList} \
+                                 {actionList dhcpClient::actionList}} \
+                                                                    {dhcpClient::Initialize $stateList $eventList $actionList}
+proc dhcpDisableStateMachine    {{stateList dhcpClient::stateList} \
+                                 {eventList dhcpClient::eventList} \
+                                 {actionList {}}}                   {dhcpClient::Initialize $stateList $eventList $actionList}
+
+
+namespace eval dhcpClient {
+variable debugLevel
+#set debugLevel [list default state]
+#set debugLevel [list default]
+set debugLevel [list]
+#
+#   Public Procedures:  dhcpEnableStateMachine  (dhcpClient::Initialize)
+#                       dhcpDisableStateMachine (dhcpClient::Initialize)
+#                       dhcpStop                (dhcpClient::Stop)
+#                       dhcpSetState            (dhcpClient::SetState)
+#                       dhcpGetState            (dhcpClient::GetState)
+#                       dhcpSetLease            (dhcpClient::SetLease)   
+#                       dhcpGetLease            (dhcpClient::GetLease)
+#                       dhcpGetTimer            (dhcpClient::GetTimer)
+#                       dhcpStartTimers         (dhcpClient::StartTimers)
+#                       dhcpStartTimer          (dhcpClient::StartTimer)
+#                       dhcpStopTimers          (dhcpClient::StopTimers)
+#                       dhcpStopTimer           (dhcpClient::StopTimer)
+#                       dhcpSetIP               (dhcpClient::SetIP)
+#                       dhcpGetIP               (dhcpClient::GetIP)
+#                       dhcpSetServer           (dhcpClient::SetServer)
+#                       dhcpGetServer           (dhcpClient::GetServer)
+#                       dhcpSetStreamRegion     (dhcpClient::SetStreamRegion)
+#                       dhcpGetStreamRegion     (dhcpClient::GetStreamRegion)
+#                       dhcpSetPortList         (dhcpClient::SetPortList)
+#                       dhcpGetPortList         (dhcpClient::GetPortList)
+#												 dhcpClient::GetStateNames
+#												 dhcpClient::GetStateCodes
+#												 dhcpClient::GetStateName
+#												 dhcpClient::ValidState
+#												 dhcpClient::GetEventCodes
+#												 dhcpClient::GetEventName
+#												 dhcpClient::ValidEvent
+#												 dhcpClient::debug
+
+#
+#   Private Procedures: dhcpClient::StateLookup
+#                       dhcpClient::InitStateTable
+#                       dhcpClient::ActionNull
+#                       dhcpClient::ActionRenew
+#                       dhcpClient::ActionRebound
+#
+#   Private Variables:  dhcpClient::dhcpLeaseRecord
+#                       dhcpClient::stateList
+#                       dhcpClient::eventList
+#                       dhcpClient::actionList
+#                       dhcpClient::streamRegion
+#                       dhcpClient::portList
+#                       
+#
+#   DHCP Stream Building.
+#
+#   When a DHCP lease needs to renew, the client must interrupt it's current
+#       activities and send a renewal request.  This disrrupts the current
+#       stream construct in region 0.  Rather than use region 0, DHCP streams
+#       are constructed in region 1 and an asynchonous transmission is used for 
+#       the renewal process.
+#
+variable    streamRegion
+set         streamRegionMax 7
+set         streamRegionMin 0
+
+variable    portList
+#   
+#   DHCP timers.
+#
+#   Following the DHCP negotiation, the client has (hopefully) been supplied
+#       with: IP address, lease duration, and a DHCP server ID.  Each of
+#       these items are necessary for renewal of the IP lease.
+#
+#       Three time periods are associated with any given lease:
+#           Timer1 = lease * .50
+#           Timer2 = lease * .875
+#           Expiration = lease
+#
+#       At the expiry of timer1, a dhcp Client tries to renew from current server
+#       At the expiry of timer2, a dhcp Client tries to rebind from any server
+#       At the expiry of lease,  a dhcp Client returns to the Init state and starts discovery.
+#
+#       However, IXIA is not attempting to implement a DHCP client state 
+#           machine, and simply needs the insure that a renewal or rebind 
+#           request maintains an IP address so that performance testing may 
+#           resume.  A single timer, rather than a timer for each port, initiates 
+#           the renewal process for ALL ports.
+#
+variable dhcpLeaseRecord
+# dhcpLeaseRecord(timer1)       = identification of TCL timer (after), timer 1
+# dhcpLeaseRecord(timer2)       = identification of TCL timer (after), timer 2
+# dhcpLeaseRecord(leaseExpire)  = identification of TCL timer (after), lease expiration
+# dhcpLeaseRecord(c,l,p,state)  = dhcp state for this port
+# dhcpLeaseRecord(c,l,p,lease)  = duration of lease
+# dhcpLeaseRecord(c,l,p,ip)     = leased IP address
+# dhcpLeaseRecord(c,l,p,server) = dhcp server for leased IP address
+#
+#
+#   DHCP States:    A state table allows the dhcpClient to respond to 
+#                   background events (ie timers), the following are valid states:
+#
+#   Valid states:
+#       idle:       Entered after client initially boots or lease expires
+#       select:     Entered when client broadcasts for an IP address
+#       request:    Entered when client has accepted an IP lease offer
+#       bound:      Entered when client & server have agreed upon lease
+#       renew:      Entered when timer1 expires
+#       rebind:     Entered when/if timer2 expires
+#
+variable state
+set state(idle)     0
+set state(select)   1
+set state(request)  2
+set state(bound)    3
+set state(renew)    4
+set state(rebind)   5
+
+#
+#
+#   DHCP State Table.
+#
+#   The table is organized by state/event.  For each state, and for each
+#       potential event, there is a corresponding action.  If no action 
+#       is desired for a particular event, the table element should
+#       contain a referance to the NULL routine.
+#
+#       Currently this table is only being used with the renew & rebind 
+#       states.
+#
+#       Example:    State/
+#                   Event       Time Out            SomeEvent
+#
+#                   idle        dhcpActionNull      dhcpActionNull
+#                   select      dhcpActionNull      dhcpDoSomething
+#                   request     dhcpActionNull      dhcpDoSomething
+#                   bound       dhcpActionRenew     dhcpDoSomething
+#                   renew       dhcpActionRebind    dhcpDoSomething
+#                   rebind      dhcpActionInit      dhcpDoSomething
+#
+#       The stateList contains a list of all known states.
+#       The eventList contains a list of all potential events.
+#       The actionList contains a list of all possible actions for each
+#           state.  Note that an action *must* be listed for each event.
+#
+#
+#   IXIA's DHCP Client:
+#
+#   This is not a true DHCP client implementation (the DHCP Client state
+#       machine belongs in the protocol server).  IXIA requires
+#       DHCP only for the establishment of IP address so that performance
+#       testing may ensue.  Therefore, when timer1 expires, for any port, 
+#       the assumption is made that all port timers are about to expire and
+#       all ports are 'renewed' at that time.
+#
+variable stateTable
+variable stateList
+set stateList [list $state(idle) $state(select) $state(request) \
+                    $state(bound) $state(renew) $state(rebind)]
+#
+# Known events
+variable event
+set event(timeOut)  1
+#
+variable eventList
+set eventList [list $event(timeOut)]
+#
+# Action list by state.
+#   The # of actions per state must equal the size of the eventList.
+#   Set actionList [list] to disable the state machine.
+#
+#                         TimeOut      
+#                         ------------ 
+variable action
+set action(idle)    [list ActionNull  ]
+set action(select)  [list ActionNull  ]
+set action(request) [list ActionNull  ]
+set action(bound)   [list ActionRenew ]
+set action(renew)   [list ActionRebind]
+set action(rebind)  [list ActionInit  ]
+
+variable actionList
+set actionList      [list $action(idle) $action(select) $action(request) \
+                          $action(bound) $action(renew) $action(rebind)]  
+
+#   DHCP Option Parameter List.
+#    
+#   When the dhcp client issues a message, it has the option of specifying a 
+#       list of configuration parameters it is interested in recieving from the
+#       dhcp server.  The parameter list must be identical in all commands, except
+#       dhcpRelease where no parameter list is specified.  Refer to section 9.6 of
+#       RFC 1533.
+variable paramRequestList
+
+
+#   DHCP Magic Cookie
+#       As defined in RFC 2131 (section 3), the first 4 bytes of option data
+#       are always the dhcp magic cookie: 99,130, 83, 99.
+variable magicCookie
+set magicCookie {63 82 53 63}
+
+#   DHCP Start Time
+#       The time that the dhcp process was started.
+variable startTime
+
+}
+## End of DhcpClient namespace
+
+########################################################################################
+# Procedure: DHCPdiscoverIP
+#
+# Description: This procedure uses the DHCP protocol to get an IP address for each
+#              client
+#
+# Argument(s):
+#	PortList  list of ports, ie, ixgSortMap
+#   startState: The state to start in, default is state(discover):
+#               0 = discover    (issue discover message)
+#               1 = offer       (rx offer)
+#               2 = request     (issue request)
+#               3 = ack         (rx ack)
+#               4 = done        (dhcp exchange complete)
+#
+########################################################################################
+proc DHCPdiscoverIP {PortList {startState 0} {stateMachine disable}} \
+{
+    global dhcpAck dhcpNak dhcpOffer
+
+  	upvar $PortList portList
+
+    set retCode 0
+
+    # Initialize state variables
+    set state(discover) 0
+    set state(offer)    1
+    set state(request)  2
+    set state(ack)      3
+    set state(done)     4
+
+
+    # Save the port list.
+    set discoverList [getAllPorts portList]
+    dhcpSetPortList  $discoverList
+
+    # Enable/Disable state machine for IP renewal
+    if {$startState == $state(discover)} {
+        if {$stateMachine == "enable"} {
+            dhcpEnableStateMachine
+        } else {
+            dhcpDisableStateMachine
+        }
+    }
+
+    set discoverRetries 1
+    set maxRetries      3
+    set NAKCounter      0
+    set currState       $startState
+
+    # Start DHCP State Machine.
+    while {$currState != $state(done)} {
+        switch $currState { 
+            0 {
+                if [send_DHCP_discover $discoverList] {
+                    errorMsg "Error sending discover frames. Discover failed."
+                    set currState   $state(done)
+                    set retCode     1
+                } else {
+                    incr currState
+                }
+            }
+
+            1 {
+                if [get_DHCP_offer discoverList] {
+                    if {$discoverRetries < $maxRetries} {
+                        incr discoverRetries
+                        set currState   $state(discover)
+                        errorMsg "Discover failed on one or more ports, retrying discover $discoverRetries of $maxRetries times..."
+                    } else {
+                        errorMsg "Error receiving offer frames. Discover failed."
+                        set currState   $state(done)
+                        set retCode     1
+                    }
+                } else {
+                    incr currState
+                }
+            }
+
+            2 {
+                set requestList [getAllPorts portList]
+                if [send_DHCP_request $requestList] {
+                    errorMsg "Error sending request frames. Discover/Renew failed."
+                    set currState   $state(done)
+                    set retCode     1
+                } else {
+                    set currState $state(ack)
+                }
+            }
+
+            3 {
+                if [get_DHCP_ack $requestList command] {
+                    errorMsg "Error receiving ack frames. Discover failed.\n"
+                    set currState   $state(done)
+                    set retCode     1
+                } else {
+                    if {$command == $dhcpAck} {
+                        set NAKCounter 0
+                        set currState $state(done)
+                    }
+                    if {$command == $dhcpNak} {
+                        set discoverList $requestList
+                        incr NAKCounter 
+                        if {$NAKCounter >= 3} {
+                            set currState $state(done)
+                        } else {
+                            set currState $state(discover)
+                        }
+                    }
+                }
+            }
+
+            default {
+                errorMsg "Error - invalid state $currState"
+                set retCode 1
+                break
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: send_DHCP_discover
+#
+# Description: This command sends a DHCP discover frame (client broadcast to locate
+#              available servers)
+#
+# Argument(s):
+#   portList    list of ports to tx dhcp discover frames to
+#
+########################################################################################
+proc send_DHCP_discover {portList} \
+{
+    return [sendDhcpPacket $portList dhcpDiscover]
+}
+
+
+########################################################################################
+# Procedure: get_DHCP_offer
+#
+# Description: This command gets a DHCP offer frame sent from the DUT
+#
+# Argument(s):
+#   PortList    list of ports to tx dhcp discover frames to, removes ports from the
+#               portList if they received an offer.
+#
+########################################################################################
+proc get_DHCP_offer {PortList} \
+{
+	upvar $PortList portList
+
+    global dhcpOffer
+
+	set retCode $::TCL_OK
+
+	set wait    [learn cget -dhcpWaitTime]
+
+    foreach portMap [lnumsort $portList] {
+		scan $portMap "%d %d %d" chassis lm port
+
+        if  {[get_DHCP_packet $chassis $lm $port dhcpOffer $wait] == $dhcpOffer} {
+            if [ip get $chassis $lm $port] {
+				errorMsg "Error getting ip on port $chassis $lm $port"
+				continue
+            }
+            ip config -sourceIpAddr     [dhcp cget -yourIpAddr]
+
+			set msg	"DHCP Gateway"
+			if {![dhcp getOption dhcpGateways]} {
+			    if {[dhcp cget -optionDataLength] != 4} {
+				    errorMsg "Invalid IP address in $msg option"
+				    continue
+			    }
+
+                ip config -destDutIpAddr  [dhcp cget -optionData]
+			}
+
+			set msg "DHCP Server Identifer"
+			if {![dhcp getOption dhcpSvrIdentifier]} {
+			    if {[dhcp cget -optionDataLength] != 4} {
+				    errorMsg "Invalid IP address in $msg option"
+				    continue
+			    }
+
+                dhcp config -serverIpAddr   [dhcp cget -optionData]
+                if [dhcp set $chassis $lm $port] {
+                    errorMsg "Error setting dhcp on port $chassis $lm $port"
+		            continue
+	            }
+            }
+
+            ip config -ipProtocol       udp
+            if [ip set $chassis $lm $port] {
+                errorMsg "Error setting ip on port $chassis $lm $port"
+                continue
+	        }
+
+            set indx [lsearch $portList [list $chassis $lm $port]]
+            if {$indx != -1} {
+                set portList [lreplace $portList $indx $indx]
+            }
+            logMsg "Got DHCP OFFER on $chassis,$lm,$port, offered IP: [dhcp cget -yourIpAddr]"
+        }
+    }
+    logMsg ""
+
+    if {[llength $portList] > 0} {
+        set retCode $::TCL_ERROR
+    }
+
+	return $retCode
+}
+
+
+########################################################################################
+# Procedure: send_DHCP_request
+#
+# Description: This command sends a DHCP request frame to the DUT
+#
+# Argument(s):
+#   portList    list of ports to tx dhcp request frames to
+#
+########################################################################################
+proc send_DHCP_request {portList} \
+{
+    return [sendDhcpPacket $portList dhcpRequest]
+}
+
+
+########################################################################################
+# Procedure: get_DHCP_ack
+#
+# Description: This command gets a DHCP ack frame sent from the DUT
+#
+# Argument(s):
+#   portList    list of ports to tx dhcp request frames to
+#
+########################################################################################
+proc get_DHCP_ack {portList command} \
+{
+    global dhcpAck dhcpNak
+	variable dhcpClient::state
+
+    upvar $command Command
+
+	set retCode 0
+
+    ipAddressSetDefault
+
+    foreach portMap [lnumsort $portList] {
+		scan $portMap "%d %d %d" chassis lm port
+
+        #   Get the dhcp packet.
+        set messageType [get_DHCP_packet $chassis $lm $port [list dhcpAck dhcpNak]]
+        if  {$messageType != $dhcpAck && \
+             $messageType != $dhcpNak} {
+            set retCode 1
+            continue
+        }
+
+
+        # Reset the timers.
+        dhcpStopTimer timer1
+        dhcpStopTimer timer2
+        dhcpStopTimer leaseExpire
+
+        #   Handle DHCP ACK.
+        if {$messageType == $dhcpAck} {
+            
+            set Command $dhcpAck
+
+            #   Collect & validate the dhcp server id.
+            if  [dhcp getOption dhcpSvrIdentifier] {
+                errorMsg "DHCP Server Identifier option not found in dhcpAck frame"
+                set retCode 1
+                continue
+            }
+            set dhcpSvrIdentifier [dhcp cget -optionData]
+            
+            if {[dhcp cget -optionDataLength] != 4} {
+                errorMsg "Invalid IP address in DHCP Server ID option"
+                set retCode 1
+                continue
+            }
+            
+            
+            #   Collect and validate the lease duration.
+            if  [dhcp getOption dhcpIPAddrLeaseTime] {
+                errorMsg "DHCP IP Lease Duration option not found in dhcpAck frame"
+                set retCode 1
+                continue
+            }
+            set dhcpIPAddrLeaseTime [dhcp cget -optionData]
+
+            set dhcpRenewalTimeValue 0
+            if {![dhcp getOption dhcpRenewalTimeValue]} {
+                set dhcpRenewalTimeValue [dhcp cget -optionData]
+            }
+            set dhcpRebindingTimeValue 0
+            if {![dhcp getOption dhcpRebindingTimeValue]} {
+                set dhcpRebindingTimeValue [dhcp cget -optionData]
+            }
+
+            
+            # Set IP address into ip configuration.
+            if [ip get $chassis $lm $port] {
+		    	errorMsg "Error getting ip on port $chassis $lm $port"
+		    	set retCode 1
+		    	continue
+            }
+            ip config -sourceIpAddr     [dhcp cget -yourIpAddr]
+            
+                
+		    set msg	"DHCP Gateway"
+		    if {![dhcp getOption dhcpGateways]} {
+		    	if {[dhcp cget -optionDataLength] != 4} {
+		    		errorMsg "Invalid IP address in $msg option"
+		    		set retCode 1
+		    		continue
+		    	}
+            
+                ip config -destDutIpAddr  [dhcp cget -optionData]
+		    }
+            
+		    set msg "DHCP Server Identifer"
+		    if  {![dhcp getOption dhcpSvrIdentifier]} {
+		    	if {[dhcp cget -optionDataLength] != 4} {
+		    		errorMsg "Invalid IP address in $msg option"
+		    		set retCode 1
+		    		continue
+		    	}
+                set dhcpSvrIdentifier [dhcp cget -optionData]
+                dhcp config -serverIpAddr  $dhcpSvrIdentifier
+                if [dhcp set $chassis $lm $port] {
+                    errorMsg "Error setting dhcp on port $chassis $lm $port"
+		            set retCode 1
+		            continue
+	            }
+            }
+            
+            ip config -ipProtocol       udp
+            if [ip set $chassis $lm $port] {
+                errorMsg "Error setting ip on port $chassis $lm $port"
+		        set retCode 1
+		        continue
+	        }
+            logMsg "Got DHCP ACK on $chassis,$lm,$port, allocated IP: [ip cget -sourceIpAddr] \
+                    from server $dhcpSvrIdentifier"
+            
+            # add the new ip address to the ipAddressTable
+            ipAddressSetDefault
+            if [updateIpAddressTable $chassis $lm $port] {
+                set retCode 1
+                continue
+            }
+
+# TBD.
+#           interfaceTable::setDefault
+#  	        set protocolName    [getProtocolName [protocol cget -name]]
+#           switch $protocolName {
+#               ip {
+#                   set protocolList $::ipV4
+#                   if {[interfaceTable::configurePort $chassis $lm $port $protocolList]} {
+#                       set retCode $::TCL_ERROR
+#                       continue
+#                   }
+#               }
+#               ipV6 {
+#                   set protocolList $::ipV6                
+#                   if {[interfaceTable::configurePort $chassis $lm $port $protocolList]} {
+#                       set retCode $::TCL_ERROR
+#                       continue
+#                   }
+#               }
+#            }
+#            
+            #   
+            #   This could be a renewal of this IP address, if so, it will
+            #       already have a lease record with timers running.  Stop any
+            #       associated timers.
+            #
+            
+               
+            #   Create/Update dhcpLeaseRecord and start lease timers.
+            dhcpSetIP       $chassis $lm $port [dhcp cget -yourIpAddr]
+            dhcpSetServer   $chassis $lm $port $dhcpSvrIdentifier
+            dhcpSetLease    $chassis $lm $port $dhcpIPAddrLeaseTime
+            dhcpSetState    $chassis $lm $port $dhcpClient::state(bound)
+
+        }
+
+        # Handle dhcpNAK.
+        if {$messageType == $dhcpNak} {
+            set dhcpError ""
+            if ![dhcp getOption dhcpMessage] {
+                set dhcpError [dhcp cget -optionData]
+            }
+            logMsg "Got DHCP NAK on $chassis,$lm,$port, allocated. $dhcpError"
+
+            dhcpStopPort $chassis $lm $port
+            set Command $dhcpNak
+        }
+    }
+
+    if {$messageType == $dhcpAck} {
+        dhcpStartTimers \
+            $dhcpIPAddrLeaseTime $dhcpRenewalTimeValue $dhcpRebindingTimeValue 
+    }
+        
+
+    logMsg ""
+
+	return $retCode
+}
+
+
+########################################################################################
+# Procedure: send_DHCP_release
+#
+# Description: Given a portMap, sends a dhcpRelease to the DUT.
+#
+# Argument(s):
+#   chassis
+#   lm
+#   port
+#
+# Output:       retCode     : 0 if okay, else
+#                             1 if failure
+#
+########################################################################################
+proc send_DHCP_release {portList} \
+{
+    set retCode     [sendDhcpPacket $portList dhcpRelease]
+
+    return $retCode
+}
+
+
+
+########################################################################################
+############                    DHCP Utility Procedures                      ###########
+########################################################################################
+
+
+########################################################################################
+# Procedure: setupUDPbootp
+#
+# Description: This procedure sets up the UDP bootp ports
+#
+# Argument(s):
+#	chassis
+#   lm
+#   port
+#
+########################################################################################
+proc setupUDPbootp {chassis lm port} \
+{
+    set retCode 0
+
+    udp setDefault
+    udp config -sourcePort  bootpClientPort
+    udp config -destPort    bootpServerPort
+    if [udp set $chassis $lm $port] {
+        errorMsg "Error setting udp on port $chassis $lm $port"
+	    set retCode 1
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: setupDhcpBroadcastIP
+#
+# Description: This procedure sets up broadcast IP addr for destination & null IP for 
+#              source (don't know what our IP address is at this point).
+#
+# Argument(s):
+#	chassis
+#   lm
+#   port
+#   address     : defaults to broadcast,
+#
+########################################################################################
+proc setupDhcpBroadcastIP {chassis lm port} \
+{
+    global nullIP
+    global broadcastIP
+
+    set retCode 0
+
+    #ip setDefault
+    if [ip get $chassis $lm $port] {
+		errorMsg "Error getting ip on port $chassis $lm $port"
+		set retCode 1
+    }
+    ip config -sourceIpAddr $nullIP
+    ip config -destIpAddr   $broadcastIP
+    ip config -ipProtocol   udp
+    ip config -ttl          128
+    ip config -identifier   512
+    if [ip set $chassis $lm $port] {
+        errorMsg "Error setting ip on port $chassis $lm $port"
+		set retCode 1
+	}
+
+    return $retCode
+}
+
+########################################################################################
+# Procedure: setupDhcpUnicastIP
+#
+# Description: This procedure sets up a unicast IP addr for destination
+#
+# Argument(s):
+#	chassis
+#   lm
+#   port
+#   sourceIpAddr:   source Ip Address
+#   destIpAddr:     destination Ip Address
+#
+########################################################################################
+proc setupDhcpUnicastIP {chassis lm port sourceIpAddr destIpAddr} \
+{
+
+    set retCode 0
+
+    #ip setDefault
+    if [ip get $chassis $lm $port] {
+		errorMsg "Error getting ip on port $chassis $lm $port"
+		set retCode 1
+    }
+    ip config -sourceIpAddr $sourceIpAddr
+    ip config -destIpAddr   $destIpAddr
+    ip config -ipProtocol   udp
+    ip config -ttl          128
+    ip config -identifier   512
+    if [ip set $chassis $lm $port] {
+        errorMsg "Error setting ip on port $chassis $lm $port"
+		set retCode 1
+	}
+
+    return $retCode
+}
+
+
+
+
+########################################################################################
+# Procedure: setupDefaultDhcpParameters
+#
+# Description: This procedure sets up the default DHCP parameters for discover & request
+#
+# Argument(s):
+#	chassis
+#   lm
+#   port
+#   transactionID   - transaction ID
+#   txSA            - mac address of the chassis lm port
+#
+########################################################################################
+proc setupDefaultDhcpParameters {chassis lm port transactionID txSA {clientIpAddr "0.0.0.0"}} \
+{
+    global nullIP
+
+    dhcp setDefault
+    dhcp config -opCode           $::dhcpBootRequest
+    dhcp config -clientIpAddr     $clientIpAddr
+    dhcp config -yourIpAddr       $nullIP
+    dhcp config -serverIpAddr     $nullIP
+    dhcp config -relayAgentIpAddr $nullIP
+    dhcp config -clientHwAddr     $txSA
+    dhcp config -transactionID    $transactionID
+    dhcp config -seconds          [dhcpClient::getStartTime]
+}    
+
+
+########################################################################################
+# Procedure: setDhcpOptions
+#
+# Description: This procedure sets the options specified in the optionList
+#
+# Argument(s):
+#   OptionList  - list of options & data to set using dhcp setOption; data must be in
+#                 in the appropriate byte format before passing through to this proc
+#
+########################################################################################
+proc setDhcpOptions {OptionList} \
+{
+	upvar $OptionList optionList
+    set retCode 0
+
+    # make sure there's an 'end' at the back end of each set of options
+    lappend optionList dhcpEnd dhcpEnd
+
+    foreach {option data} $optionList {
+        dhcp config -optionData       $data
+        if [dhcp setOption $option] {
+            errorMsg "Error setting DHCP option <$option>"
+            set retCode 1
+            continue
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: sendDhcpPacket
+#
+# Description: This procedure sends a Dhcp packet to each Tx port in the map
+#
+# Argument(s):  portList:   list of ports to send DHCP packets: {{c l p} {c l p}}
+#               opcode:     operation to perform:   dhcpDiscover
+#                                                   dhcpRequest
+#                                                   dhcpRelease
+#
+# Returns:      0 if successful, else
+#               1 if failure
+#
+########################################################################################
+proc sendDhcpPacket {portList opcode} \
+{
+    set retCode     0
+
+    # save original protocol config
+    set tempApp     [protocol cget -appName]
+    set tempName    [protocol cget -name]
+    protocol config -appName    Dhcp
+    protocol config -name       ip
+
+    foreach portMap [lnumsort $portList] {
+		scan $portMap "%d %d %d" c l p
+
+        # Temporary workaround (DHCP was consumed by Protocol Server)
+        if [protocolServer get $c $l $p] {
+            errorMsg "Error getting protocolServer on port [getPortId $c $l $p]"
+            set retCode 1
+            continue
+        }
+
+        set enableArp   [protocolServer cget -enableArpResponse]
+        if {$enableArp} {
+            protocolServer config -enableArpResponse    false
+            if [protocolServer set $c $l $p] {
+                errorMsg "Error setting protocolServer on port [getPortId $c $l $p]"
+                set retCode 1
+            }
+        }
+
+        if [buildDhcpPacket $c $l $p $opcode] {
+            errorMsg "Error building dhcp packet for port [getPortId $c $l $p]"
+            set retCode 1
+            continue
+        }
+    }
+
+    # now put back original protocol config
+    protocol config -appName    $tempApp
+    protocol config -name       $tempName
+
+    # if this port was *ever* in packetGroup mode, change it or we won't be able to capture... 
+    if [setCaptureMode portList write] {
+		return -code error
+    }
+
+    if {![writeConfigToHardware portList] && ![zeroStats portList] && ![startCapture portList]} {
+        logMsg ""
+        foreach portMap [lnumsort $portList] {
+		    scan $portMap "%d %d %d" c l p
+
+	        logMsg "----->Sending $opcode frame from [getPortId $c $l $p] to DHCP server."
+
+	        if [startPortTx $c $l $p] {
+		        errorMsg "Error starting Tx on port [getPortId $c $l $p]"
+		        set retCode 1
+	        }
+        }
+        logMsg ""
+        if {[learn cget -waitTime] > 1000} {
+            logMsg "Waiting on DHCP response for [expr [learn cget -waitTime]/1000] second(s)..."
+        }
+	    after [learn cget -waitTime]
+
+    } else {
+        set retCode 1
+    }
+
+    # Temporary workaround (DHCP was consumed by Protocol Server)
+    # If arp was enabled in the first place, reenable it here...
+    if {$enableArp} {
+        foreach portMap [lnumsort $portList] {
+		    scan $portMap "%d %d %d" c l p
+
+            if [protocolServer get $c $l $p] {
+                errorMsg "Error getting protocolServer on port [getPortId $c $l $p]"
+                set retCode 1
+                continue
+            }
+
+            protocolServer config -enableArpResponse    true
+            if [protocolServer set $c $l $p] {
+                errorMsg "Error setting protocolServer on port [getPortId $c $l $p]"
+                set retCode 1
+            }
+        }
+    }
+       
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: buildDhcpPacket
+#
+# Description: This procedure builds a Dhcp packet
+#
+# Argument(s):
+#	chassis
+#   lm
+#   port
+#   opcode      opcode, ie, dhcpDiscover, dhcpRequest, dhcpRelease
+#            } else if {$state == $dhcpClient::state(rebind)} {
+#            if {$state == $dhcpClient::state(renew)} {
+#
+########################################################################################
+proc buildDhcpPacket {chassis lm port opcode} \
+{
+
+    global nullIP broadcastIP 
+    variable dhcpClient::state
+
+	set retCode 0
+
+    set clientIpAddr $nullIP
+    set txAddress    $nullIP
+
+    set ethernetType [protocol cget -ethernetType]
+    protocol config -ethernetType $::noType
+
+    set destMacAddress $::kBroadcastMacAddress
+
+    udf setDefault
+    dhcp setDefault
+    filter setDefault
+    stream setDefault
+    filterPallette setDefault
+
+    dhcpSetStreamRegion 0
+
+    # delete any existing streams first
+    if [port reset $chassis $lm $port] {
+        errorMsg "Error deleting streams on port $chassis $lm $port"
+        set retCode 1
+    }
+
+	# set the stream parameters.
+	set preambleSize		8
+	set framesize			[learn cget -framesize]
+
+	set streamName          $opcode
+    append streamName "Stream"
+
+    disableUdfs {1 2 3 4}
+
+    stream config -region    [dhcpGetStreamRegion]
+    stream config -rateMode  usePercentRate
+    stream config -name		 $streamName
+	stream config -framesize $framesize
+	stream config -dma		 stopStream
+	stream config -numFrames [learn cget -numDHCPframes]
+	stream config -fcs		 good
+    stream config -enableIbg false
+    stream config -enableIsg false
+    stream config -gapUnit   gapNanoSeconds
+
+	filter config -captureFilterError   errGoodFrame
+	filter config -captureTriggerError  errGoodFrame
+
+	if [port get $chassis $lm $port] {
+		errorMsg "port $chassis $lm $port has not been configured yet"
+		set retCode 1
+	}
+
+	set txSA	        [port cget -MacAddress]
+    set transactionID   [dhcpClient::getTransactionID $port]
+
+    set optionList      [list dhcpHostName [format "IxiaHost_%u.%u.%u" $chassis $lm $port]]
+
+
+    switch $opcode {
+        dhcpDiscover {
+#            set txAddress       $broadcastIP
+            lappend optionList  dhcpMessageType dhcpDiscover \
+                                dhcpClientId $txSA \
+                                dhcpParamRequestList [dhcpClient::getParameterRequestList]
+
+
+			# Capture Boot Replies with the dhcpMagicCookie
+#			filter config -captureTriggerPattern pattern1
+#			filter config -captureFilterPattern  pattern1
+#			filterPallette config -pattern1 [dhcpClient::getMagicCookie]
+#			filterPallette config -patternOffset1 {278}
+
+			filter config -captureTriggerPattern pattern1AndPattern2
+			filter config -captureFilterPattern  pattern1AndPattern2
+			filterPallette config -pattern1 [format "%02x" $::dhcpBootReply]
+			filterPallette config -pattern2 [dhcpClient::getMagicCookie]
+			filterPallette config -patternOffset1 {42}
+			filterPallette config -patternOffset2 {278}
+
+			if [filterPallette set $chassis $lm $port] {
+				errorMsg "Error setting filter pallette on $chassis,$lm,$port"
+			}
+        }
+
+        dhcpRequest {
+            if [ip get $chassis $lm $port] {
+		        errorMsg "port $chassis $lm $port has not been configured for IP yet"
+		        set retCode 1
+	        }
+            set txIP    [ip cget -sourceIpAddr]
+
+            # we need to use the same transaction ID for the complete dhcp transaction... if we don't have a dhcp object 
+            # for this port yet, setup a transaction ID for it using a random number, otherwise use the existing transactionID
+            # in the dhcp object.
+            if [dhcp get $chassis $lm $port] {
+		        errorMsg "Error getting dhcp configuration for port $chassis $lm $port"
+		        set retCode 1
+            } else {
+                set transactionID   [dhcp cget -transactionID]
+            }
+
+            #
+            #   Build option list based upon state (these are 
+            #       common to all dhcpRequest messages).
+            #
+            lappend optionList  dhcpMessageType dhcpRequest \
+                                dhcpParamRequestList [dhcpClient::getParameterRequestList]
+
+                                  
+            set portState [dhcpGetState $chassis $lm $port]
+            if ![dhcpClient::ValidState $portState] {
+                set portState 0
+            }
+
+            switch [dhcpClient::GetStateName $portState] {
+
+                renew {
+
+                    #         
+                    #   For state Renew, the following are required:
+                    #       - Server Id is not set
+                    #       - Requested IP is not set
+                    #       - ciaddr is set to Client's IP address
+                    #       - giaddr (dhcpRouter) is not set
+                    #         
+                    set clientIpAddr [dhcpGetIP $chassis $lm $port]
+                    set txAddress  [dhcp cget -serverIpAddr]
+                    set destMacAddress [port cget -DestMacAddress]
+
+                    lappend optionList dhcpClientId $txSA 
+                }
+                
+                
+                rebind {
+                    #         
+                    #   For state Rebind, the following are required:
+                    #       - Server Id is not set
+                    #       - Requested IP is not set
+                    #       - ciaddr is set to Client's IP address
+                    #         
+                    set clientIpAddr    [dhcpGetIP $chassis $lm $port]
+                    lappend optionList  dhcpClientId $txSA \
+                                        dhcpRouter [ip cget -destDutIpAddr] \
+                                        dhcpSvrIdentifier $nullIP \
+                                        dhcpRequestedIPAddr $nullIP 
+                
+                }
+                
+                default {
+                    #         
+                    #   For states Select, the following are required:
+                    #       - Server Id is set to address supplied in offer
+                    #       - Requested IP is set to address supplied in offer
+                    #       - ciaddr is not set
+                    #       - giaddr is set to relay agent
+                    #         
+                    lappend optionList  dhcpClientId $txSA \
+                                        dhcpRequestedIPAddr $txIP \
+                                        dhcpRouter [ip cget -destDutIpAddr] \
+                                        dhcpSvrIdentifier [dhcp cget -serverIpAddr]
+                }
+            }
+			# Capture Boot Replies
+			filter config -captureTriggerPattern pattern1
+			filter config -captureFilterPattern  pattern1
+			filterPallette config -pattern1 [format "%02x" $::dhcpBootReply]
+			filterPallette config -patternOffset1 {42}
+
+			if [filterPallette set $chassis $lm $port] {
+				errorMsg "Error setting filter pallette on $chassis,$lm,$port"
+			}
+
+        }
+        dhcpRelease {
+
+            # Collect the IP configuration on this port.
+            if [ip get $chassis $lm $port] {
+		        errorMsg "port $chassis $lm $port has not been configured for IP yet"
+		        set retCode 1
+	        }
+            set txIP    [ip cget -sourceIpAddr]
+            # Collect the current DHCP configuration on this port.
+            if [dhcp get $chassis $lm $port] {
+		        errorMsg "Error getting dhcp configuration for port $chassis $lm $port"
+		        set retCode 1
+            }
+
+
+            # Build DHCP packet.
+            set clientIpAddr    [dhcpGetIP $chassis $lm $port]
+            set serverIpAddr    [dhcp cget -serverIpAddr]
+            set txAddress       $serverIpAddr
+            set destMacAddress  [port cget -DestMacAddress]
+
+
+
+            lappend optionList  dhcpMessageType dhcpRelease \
+                                dhcpClientId $txSA \
+                                dhcpSvrIdentifier $serverIpAddr
+        }                                 
+        default {
+            errorMsg "Unsupported packet type"
+            return 1
+        }
+    }
+
+    if {$txAddress != $nullIP} {
+        setupDhcpUnicastIP $chassis $lm $port $txIP $txAddress
+    } else {
+        setupDhcpBroadcastIP $chassis $lm $port
+    }
+
+    setupUDPbootp $chassis $lm $port
+    setupDefaultDhcpParameters $chassis $lm $port $transactionID $txSA $clientIpAddr
+
+    setDhcpOptions optionList
+
+    if [dhcp set $chassis $lm $port] {
+        errorMsg "Error setting DHCP on port $chassis $lm $port"
+        set retCode 1
+    }
+
+	set speed	[port cget -speed]
+    
+	stream config -da		$destMacAddress
+	stream config -numDA	1
+
+  	stream config -sa		$txSA
+	stream config -numSA	1
+
+    stream config -frameSizeType    sizeAuto
+	if [stream set $chassis $lm $port 1] {
+		errorMsg "Error setting stream 1, port $chassis,$lm,$port for $opcode frames"
+		set retCode 1
+	}
+
+    # since we set this for autoframe size calc, get the calculated framesize to use
+    # in calculating the IFG.
+    set framesize [stream cget -framesize]
+    set learnPercentRate             [expr double([learn cget -rate])/[calculateMaxRate $chassis $lm $port $framesize]*100.]
+    stream config -percentPacketRate $learnPercentRate
+
+	if [stream set $chassis $lm $port 1] {
+		errorMsg "Error setting stream 1, port $chassis,$lm,$port for $opcode frames"
+		set retCode 1
+	}
+
+	# set the filter parameters for receiving the DHCP response
+    filter config -captureTriggerDA         any
+    filter config -captureFilterDA          any
+	filter config -captureFilterEnable		true
+	filter config -captureTriggerEnable		true
+	if [filter set $chassis $lm $port] {
+		errorMsg "Error setting filters on $chassis,$lm,$port"
+		set retCode 1
+	}
+
+    protocol config -ethernetType $ethernetType
+
+    return $retCode
+}
+
+
+
+########################################################################################
+# Procedure: get_DHCP_packet
+#
+# Description: This command gets a DHCP packet sent from the DUT & fills the dhcp command
+#              memory using dhcp decode $packet
+#
+# Argument(s):
+#	chassis
+#   lm
+#   port
+#   messageType -   name of DHCP message type to search.  Note that this can be a list
+#                   of message types, ie [list dhcpAck dhcpNak]
+#
+#   Output:         First message type (of messageType list) found in buffer:
+#                       0 if no match, else
+#                       dhcpMessageType (as defined in Dhcp.hpp)
+#
+########################################################################################
+proc get_DHCP_packet {chassis lm port messageType {wait 0}} \
+{
+    set retCode 0
+
+	# Wait till data in capture buffer, or timer expires.
+	set expire [expr [clock seconds] + $wait]
+	while {$expire > [clock seconds]} {
+		if {![stat get statCaptureFilter $chassis $lm $port]} {
+		    if {[stat cget -counterVal] > 0} {
+		       break
+		    }
+	    }
+	}
+
+    # make sure there's something there to look at first!
+    if {[captureBuffer get $chassis $lm $port 1 1000]} {
+		errorMsg "Error getting capture data on $chassis,$lm,$port"
+		return 0
+	}
+
+    # You have to have the transactionID before we can process any further...
+    if [dhcp get $chassis $lm $port] {
+        errorMsg "Error getting DHCP on port $chassis $lm $port"
+        return 0
+    }
+    set transactionID   [dhcp cget -transactionID]
+
+	set found 0
+    set nPackets [captureBuffer cget -numFrames]
+	for {set nFrame 1} {$nFrame <= $nPackets} {incr nFrame} {
+		if [captureBuffer getframe $nFrame] {
+			errorMsg "Error getting frame $nFrame from capture buffer for $chassis,$lm,$port"
+			continue
+		}
+		set capframe	[captureBuffer cget -frame]
+        if [dhcp decode $capframe $chassis $lm $port] {
+            continue
+        }
+
+		# What is the message type?
+        if {![dhcp getOption dhcpMessageType]} {
+            set dhcpMessageType [dhcp cget -optionData]
+        }
+
+        #   The transaction ID must match.
+        if {[dhcp cget -transactionID] == $transactionID} {
+
+            # The message type must match one in the list of message types.
+            foreach item $messageType {
+                global $item
+                upvar $item MessageType
+                if {$dhcpMessageType == $MessageType} {
+			        set found 1
+                    set retCode $MessageType
+			        break
+                }
+            }
+        }
+        # Break out of packet search loop.
+        if $found {
+            break
+        }
+
+	}
+
+	if {$found == 0} {
+		logMsg "No $messageType frames received on $chassis $lm $port"
+	} else {
+        set destinationAddr [lrange $capframe 6 11]        
+		if [port get $chassis $lm $port] {
+			errorMsg "Error getting port $chassis,$lm,$port"
+			set retCode 0
+		}
+		port config -DestMacAddress	$destinationAddr
+		if [port set $chassis $lm $port] {
+			errorMsg "Error setting port on $chassis,$lm,$port"
+			set retCode 0
+		}
+    }
+
+    return $retCode
+}
+
+
+
+########################################################################################
+# Procedure:    dhcpInitialize
+#
+# Description:  Setup dhcpClient initial settings.
+#
+# Input:        eventList: list of potential events
+#               stateList: list of all known states
+#               actionList: list of list of actions per state per event (can be an
+#                   empty list if state machine is to be disabled.
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::Initialize {   {stateList dhcpClient::stateList} \
+                                {eventList dhcpClient::eventList} \
+                                {actionList dhcpClient::actionList}} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    if [info exists dhcpLeaseRecord] {
+        unset dhcpLeaseRecord
+    }
+
+    # Initialize state table.
+    InitStateTable $stateList $eventList $actionList
+
+    # Set default stream region.
+    SetStreamRegion 0
+
+    # Create the default parameter request list used by dhcpDiscover & dhcpRequest.
+    clearParameterRequestList
+    setParameterRequestList dhcpSubnetMask
+    setParameterRequestList dhcpDomainName
+    setParameterRequestList dhcpGateways
+    setParameterRequestList dhcpNetBIOSNameSvr
+    setParameterRequestList dhcpNetBIOSNodeType
+    setParameterRequestList dhcpNetBIOSScope
+    setParameterRequestList dhcpDomainNameServer
+
+    # Record dhcp start-time.
+    setStartTime [clock seconds]
+
+}
+
+########################################################################################
+# Procedure:    dhcpStop
+#
+# Description:  Cancel any outstanding timers, remove dhcpLeaseRecord, release all
+#               IP addresses that are currently leased.
+#
+# Input:        None
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::Stop {} \
+{
+	debug 
+    variable dhcpLeaseRecord
+
+    foreach port [GetPortList] {
+        scan $port "%d %d %d" c l p
+        StopPort $c $l $p true
+    }
+    SetPortList {}
+    catch {unset dhcpLeaseRecord}
+
+    StopTimer timer1
+    StopTimer timer2
+    StopTimer leaseExpire
+}
+
+########################################################################################
+# Procedure:    dhcpStopPort
+#
+# Description:  Release IP address, unset dhcpLeaseRecord for a single port.
+#
+# Input:        chassis
+#               card
+#               port
+#               release:    true if IP address should be released, default is false
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::StopPort {chassis card port {release false}} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    if {$release == "true"} {
+        set portList [list [list $chassis $card $port]]
+        send_DHCP_release $portList
+    }
+
+    catch {unset dhcpLeaseRecord($chassis,$card,$port,ip)}
+    catch {unset dhcpLeaseRecord($chassis,$card,$port,server)}
+    catch {unset dhcpLeaseRecord($chassis,$card,$port,lease)}
+    catch {unset dhcpLeaseRecord($chassis,$card,$port,state)}
+
+}
+
+########################################################################################
+# Procedure:    dhcpSetState
+#
+# Description:  Store the current state of dhcp process.
+#
+# Input:        chassis-card-port
+#               state: discover, offer, request, ack, bound, renew, rebind, idle
+#
+# Output:       0, success, else
+#               1, failure (invalid state) 
+#
+########################################################################################
+proc dhcpClient::SetState {chassis card port newState} \
+{
+
+	debug
+
+    variable dhcpLeaseRecord
+
+    # Valid state?
+	if ![ValidState $newState] {
+        return 1
+    }
+            
+    set dhcpLeaseRecord($chassis,$card,$port,state) $newState
+
+    return 0
+}
+
+
+########################################################################################
+# Procedure:    dhcpGetState
+#
+# Description:  Get the current state for the given port.
+#
+# Input:        chassis
+#               card:
+#               port:
+#               lease:  duration of lease
+#
+# Output:       state (possible states are: idle, discover, offer, request, ack,
+#                   done, renew, rebind)
+#
+########################################################################################
+proc dhcpClient::GetState {chassis card port} \
+{
+    variable dhcpLeaseRecord
+
+    if [info exists dhcpLeaseRecord($chassis,$card,$port,state)] {
+        return $dhcpLeaseRecord($chassis,$card,$port,state)
+    }
+
+}
+
+########################################################################################
+# Procedure:    dhcpSetLease
+#
+# Description:  Set the DHCP lease.
+#
+# Input:        chassis
+#               card:
+#               port:
+#               lease:  duration of lease
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::SetLease {chassis card port lease} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    #   Store the lease
+    set dhcpLeaseRecord($chassis,$card,$port,lease) $lease
+}
+
+########################################################################################
+# Procedure:    dhcpGetLease
+#
+# Description:  Return the value of the lease for a given port
+#
+# Input:        chassis
+#               card:
+#               port:
+#
+# Output:       lease
+#
+########################################################################################
+proc dhcpClient::GetLease {chassis card port} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    if [info exists dhcpLeaseRecord($chassis,$card,$port,lease)] {
+        return $dhcpLeaseRecord($chassis,$card,$port,lease)
+    }
+
+}
+
+
+########################################################################################
+# Procedure:    dhcpStartTimers
+#
+# Description:  Start DHCP timers.
+#
+# Input:        lease:  duration of lease
+#
+# Output:       0 if successful, else
+#               1
+#
+########################################################################################
+proc dhcpClient::StartTimers {lease {timer1 0 } {timer2 0}} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    set returnCode 0
+
+    # If timers already running, don't restart.        
+    if [info exist dhcpLeaseRecord(timer1)] {
+        if {$dhcpLeaseRecord(timer1) != ""} {
+            return 1
+        }
+    }
+
+    # Start timer 1
+    if [StartTimer timer1 $lease $timer1] {
+        set returnCode 1
+    }
+
+    # Start timer 2
+    if [StartTimer timer2 $lease $timer2] {
+        set returnCode 1
+    }
+
+    # Start lease timer
+    if [StartTimer leaseExpire $lease] {
+        set returnCode 1
+    }
+
+
+    return $returnCode  
+}
+
+
+########################################################################################
+# Procedure:    dhcpStopTimers
+#
+# Description:  Stop DHCP timers.
+#
+# Input:        lease:  duration of lease
+#
+# Output:       0 if successful, else
+#               1
+#
+########################################################################################
+proc dhcpClient::StopTimers {} \
+{
+	debug
+    set returnCode 0
+
+    # Stop timer 1
+    if [StopTimer timer1] {
+        set returnCode 1
+    }
+
+    # Stop timer 2
+    if [StopTimer timer2] {
+        set returnCode 1
+    }
+
+    # Stop lease timer
+    if [StopTimer leaseExpire] {
+        set returnCode 1
+    }
+
+    return $returnCode
+}
+
+
+########################################################################################
+# Procedure:    dhcpStartTimer
+#
+# Description:  Initiate DHCP timers based upon the value supplied by the server.
+#                   TIMER 1 will expire at (lease * .50)
+#                   TIMER 2 will expire at (lease * .875)
+#
+# Input:        timer:  timer1, timer2 or leaseExpire
+#
+# Output:       0 if successful, else
+#               1
+#
+########################################################################################
+proc dhcpClient::StartTimer {timer lease {value 0}} \
+{
+	debug
+    variable dhcpLeaseRecord
+    variable event
+
+    # Initiate timers
+    switch $timer {
+
+        timer1 {
+            if $value {
+                set timerValue $value
+            } else {
+                set timerValue [expr round([mpexpr $lease * .50])]
+            }
+        }
+
+        timer2 {
+            if $value {
+                set timerValue $value
+            } else {
+                set timerValue [expr round([mpexpr $lease * .875])]
+            }
+        }
+
+        leaseExpire {
+            set timerValue $lease
+        }
+
+        default {
+            return 1
+        }
+
+    }
+
+    # Start the timer, set the timer Id into the lease record.
+    set portList [lindex [GetPortList] 0]
+    scan $portList "%d %d %d" c l p
+    set dhcpLeaseRecord($timer) \
+        [after [expr 1000 * $timerValue] \
+        [namespace current]::StateLookup $c $l $p $event(timeOut)]
+
+
+    return 0
+        
+}
+
+########################################################################################
+# Procedure:    dhcpStopTimer
+#
+# Description:  Cancels a given DHCP timer for a given port.
+#
+# Input:        timer:  timer1, timer2 or leaseExpire
+#
+#
+# Output:       0 if successful, else
+#               1
+#
+########################################################################################
+proc dhcpClient::StopTimer {timer} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    switch $timer {
+
+        timer1 -
+        timer2 -
+        leaseExpire {
+            if {[dhcpGetTimer $timer] != ""} {
+                after cancel [dhcpGetTimer $timer]
+                set dhcpLeaseRecord($timer) ""
+            }
+        }
+
+        default {
+            return 1
+        }
+    }
+
+    return 0
+        
+}
+
+
+########################################################################################
+# Procedure:    dhcpGetTimer
+#
+# Description:  Return the value of the timer id for a given port
+#
+# Input:        timer:  timer1, timer2 or leaseExpire
+#
+# Output:       timer Id 
+#
+########################################################################################
+proc dhcpClient::GetTimer {timer} \
+{
+	debug
+    variable dhcpLeaseRecord
+    set returnValue 0
+
+    switch $timer {
+
+        timer1 -
+        timer2 -
+        leaseExpire {
+            if [info exists dhcpLeaseRecord($timer)] {
+                set returnValue $dhcpLeaseRecord($timer)
+            }
+        }
+
+        default {
+            set returnValue 0
+        }
+    }
+
+    return $returnValue
+
+}
+
+
+########################################################################################
+# Procedure:    dhcpSetIP
+#
+# Description:  Set the DHCP IP address as offered by the dhcp server for a given
+#                   port.
+#
+# Input:        chassis
+#               card:
+#               port:
+#               ip:     IP address
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::SetIP {chassis card port ip} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    #   Store the IP address
+    set dhcpLeaseRecord($chassis,$card,$port,ip) $ip
+}
+
+########################################################################################
+# Procedure:    dhcpGetIP
+#
+# Description:  Return the leased IP address for a given port
+#
+# Input:        chassis
+#               card:
+#               port:
+#
+# Output:       lease
+#
+########################################################################################
+proc dhcpClient::GetIP {chassis card port} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    if [info exists dhcpLeaseRecord($chassis,$card,$port,ip)] {
+        return $dhcpLeaseRecord($chassis,$card,$port,ip)
+    }
+
+}
+
+
+########################################################################################
+# Procedure:    dhcpSetServer
+#
+# Description:  Set the DHCP Server address for a given port.
+#
+# Input:        chassis
+#               card:
+#               port:
+#               server: server address (that which offered the lease)
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::SetServer {chassis card port server} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    #   Store the server address
+    set dhcpLeaseRecord($chassis,$card,$port,server) $server
+}
+
+########################################################################################
+# Procedure:    dhcpGetServer
+#
+# Description:  Return the address of the dhcp server which leased this port an
+#                   IP address.
+#
+# Input:        chassis
+#               card:
+#               port:
+#
+# Output:       server address
+#
+########################################################################################
+proc dhcpClient::GetServer {chassis card port} \
+{
+	debug
+    variable dhcpLeaseRecord
+
+    if [info exists dhcpLeaseRecord($chassis,$card,$port,server)] {
+        return $dhcpLeaseRecord($chassis,$card,$port,server)
+    }
+
+}
+
+########################################################################################
+# Procedure:    dhcpSetStreamRegion
+#
+# Description:  Set the region that DHCP streams are build within.
+#
+# Input:        Region: 0 is default, else 1-7
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::SetStreamRegion {{region 0}} \
+{
+	debug
+
+    variable streamRegion
+    variable streamRegionMax
+    variable streamRegionMin
+
+    if {$region <= $streamRegionMax && \
+        $region >= $streamRegionMin} {
+        set streamRegion $region
+    }
+
+}
+
+########################################################################################
+# Procedure:    dhcpGetStreamRegion
+#
+# Description:  Returns the region that DHCP streams are build within.
+#
+# Input:        None
+#
+# Output:       region #
+#
+########################################################################################
+proc dhcpClient::GetStreamRegion {} \
+{
+	debug
+    variable streamRegion
+
+    if [info exists streamRegion] {
+        return $streamRegion
+    }
+
+}
+
+########################################################################################
+# Procedure:    dhcpSetPortList
+#
+# Description:  Store the list of ports working with DHCP addresses
+#
+# Input:        ports:  {{c l p} {c l p} ...}
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::SetPortList {ports} \
+{
+	debug
+    variable portList
+    set portList $ports
+}
+
+########################################################################################
+# Procedure:    dhcpGetPortList
+#
+# Description:  Returns the list of ports using DHCP addresses.
+#
+# Input:        None
+#
+# Output:       region #
+#
+########################################################################################
+proc dhcpClient::GetPortList {} \
+{
+    variable portList
+
+    if [info exists portList] {
+        return $portList
+    }
+
+}
+
+
+########################################################################################
+# Procedure:    dhcpInitStateTable
+#
+# Description:  Set the DHCP state table to it's initial value (all events in all
+#                   state are set to the NULL routine).
+#
+# Input:        eventList: list of potential events
+#               stateList: list of all known states
+#               actionList: list of list of actions per state per event (can be an
+#                   empty list if state machine is to be disabled.
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::InitStateTable { stateList eventList {actionList {}} } \
+{
+	debug
+    variable stateTable
+
+    upvar $stateList StateList
+    upvar $eventList EventList
+    if [catch "upvar $actionList ActionList"] {
+        set ActionList [list]
+    }
+
+    # Empty state list? If so, exit.
+    if {[llength $StateList] == 0} {
+        return
+    }
+
+    # Empty event list? If so, exit.
+    if {[llength $EventList] == 0} {
+        return
+    }
+
+    if [info exists stateTable] {
+        unset stateTable
+    }
+
+    # Empty Action List?  If so, fill stateTable with the NULL routine.
+    if {[llength $ActionList] == 0} {
+        foreach state $StateList {
+            foreach event $EventList {
+                set stateTable($state,$event) [namespace current]::ActionNull
+            }
+        }
+
+    # Otherwise, fill the stateTable w/given list of action routines.
+    } else {
+        set ActionList [join $ActionList]
+        set i 0
+
+        foreach state $StateList {
+            foreach event $EventList {
+                set stateTable($state,$event) [lindex $ActionList $i]
+                incr i
+            }
+        }
+    }
+}
+
+########################################################################################
+# Procedure:    dhcpClient::StateLookup
+#
+# Description:  Perform state table lookup, execute action routine.
+#
+# Input:        event:  event that resulted in this procedure call
+#               port:   port that event occurred on
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::StateLookup {chassis card port event} \
+{ 
+	debug
+    variable stateTable
+
+	if ![ValidEvent $event] {
+		return
+	}
+
+    set state [GetState $chassis $card $port]
+	if [ValidState $state] {
+		eval $stateTable($state,$event) [list [list $chassis $card $port]]
+	}
+}
+
+
+
+########################################################################################
+#
+#   DHCP State Machine - Action Routines
+#
+#   The following routines perform actions as a result of a background
+#       event.  Based on the state and the event, and action is looked-up and
+#       executed.
+#
+########################################################################################
+
+########################################################################################
+# Procedure:    dhcpClient::ActionNull
+#
+# Description:  Place holder for events which don't require handling.
+#
+# Input:        None
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::ActionNull {port} \
+{ 
+	debug
+}
+
+########################################################################################
+# Procedure:    dhcpClient::ActionRenew
+#
+# Description:  Perform 'renew' behavior as defined in the DHCP RFC for all
+#               ports in the port list.
+#                   - Set state = renew
+#                   - Request lease extension from the current dhcp server
+#
+#               The occurance of this action indicates that in a bound state
+#               a timeOut occurred indicating that it is time to renew the lease.
+#
+# Input:        None
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::ActionRenew {port} \
+{ 
+	debug
+    variable state
+
+    set portList [GetPortList]
+    foreach item [lnumsort $portList] {
+        scan $item "%d %d %d" c l p
+        SetState    $c $l $p $state(renew)
+    }
+
+    dhcpStopTimer timer1
+    DHCPdiscoverIP portList 2 enable
+
+}
+
+########################################################################################
+# Procedure:    dhcpClient::ActionRebind
+#
+# Description:  Perform 'rebind' behavior as defined in the DHCP RFC.
+#                   - Set state = rebind
+#                   - Request lease extension from the any dhcp server
+#
+#               The occurance of this action routine indicates that in state(renew)
+#               a timeout occurred indicated that no IP addresses were offered for
+#               renewal from the current dhcp server.
+#
+# Input:        None
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::ActionRebind {port} \
+{ 
+	debug $port
+    variable state
+
+    set portList [GetPortList]
+    foreach item [lnumsort $portList] {
+        scan $item "%d %d %d" c l p
+        SetState    $c $l $p $state(rebind)
+    }
+
+    dhcpStopTimer timer2
+    DHCPdiscoverIP portList 2 enable
+
+}
+
+########################################################################################
+# Procedure:    dhcpClient::ActionInit
+#
+# Description:  Perform 'discovery' behavior as defined in the DHCP RFC.
+#                   - Set state = idle
+#                   - Send discover message
+#
+#               The occurance of this action routine indicates that in state(rebind)
+#               a timeout occurred indicating that the IP lease expired.
+#
+# Input:        None
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::ActionInit {port} \
+{ 
+
+	debug $port
+
+    #   Release all ports, turn off timers.
+    set portList [GetPortList]
+    dhcpStop
+
+    #   Restart IP acquisition with Discovery.
+    DHCPdiscoverIP portList 0 enable
+}
+
+
+########################################################################################
+# Procedure:    dhcpClient::GetStateNames
+#
+# Description:  Returns a list of textual state names.
+#
+# Input:        None
+#
+# Output:       List of state names
+#
+########################################################################################
+proc dhcpClient::GetStateNames {} \
+{
+	variable state
+	return [array names state]
+}
+													 
+########################################################################################
+# Procedure:    dhcpClient::GetStateName
+#
+# Description:  Given a state code, return a textual state name.
+#
+# Input:        stateCode:	state code (refer to dhcpClient::state)
+#
+# Output:       state name
+#
+########################################################################################
+proc dhcpClient::GetStateName {stateCode} \
+{
+	variable state
+	set retValue ""
+
+	foreach {name value} [array get state] {
+		set stateNames($value) $name
+	}
+
+	if [info exists stateNames($stateCode)] {
+		set retValue $stateNames($stateCode)
+	}
+
+	return $retValue
+}
+
+########################################################################################
+# Procedure:    dhcpClient::GetStateCodes
+#
+# Description:  Returns a list of state codes.
+#
+# Input:        None
+#
+# Output:       List of state codes
+#
+########################################################################################
+proc dhcpClient::GetStateCodes {} \
+{
+	variable state
+
+	set states [list]
+	foreach {name value} [array get state] {
+		lappend states $value
+	}
+
+	return $states
+}
+
+########################################################################################
+# Procedure:    dhcpClient::ValidState
+#
+# Description:  True/False: Is the given state code a valid member of the list
+#					of state codes (dhcpClient::state)
+#
+# Input:        stateCode:	state code
+#
+# Output:       1 if valid, else
+#				0
+#
+########################################################################################
+proc dhcpClient::ValidState {stateCode} \
+{
+	if {[lsearch [GetStateCodes] $stateCode] < 0} {
+		return 0
+	}
+	return 1
+}
+
+
+########################################################################################
+# Procedure:    dhcpClient::GetEventName
+#
+# Description:  Given a event code, return a textual event name.
+#
+# Input:        eventCode:	event code (refer to dhcpClient::event)
+#
+# Output:       event name
+#
+########################################################################################
+proc dhcpClient::GetEventName {eventCode} \
+{
+	variable event
+	set retValue ""
+
+	foreach {name value} [array get event] {
+		set eventNames($value) $name
+	}
+
+	if [info exists eventNames($eventCode)] {
+		set retValue $eventNames($eventCode)
+	}
+
+	return $retValue
+}
+
+########################################################################################
+# Procedure:    dhcpClient::GetEventCodes
+#
+# Description:  Returns a list of event codes (dhcpClient::event).
+#
+# Input:        None
+#
+# Output:       List of event codes
+#
+########################################################################################
+proc dhcpClient::GetEventCodes {} \
+{
+	variable event
+
+	set events [list]
+	foreach {name value} [array get event] {
+		lappend events $value
+	}
+
+	return $events
+}
+
+########################################################################################
+# Procedure:    dhcpClient::ValidEvent
+#
+# Description:  True/False: Is the given event code a valid member of the list
+#					of event codes (dhcpClient::event)
+#
+# Input:        eventCode:	event code
+#
+# Output:       1 if valid, else
+#				0
+#
+########################################################################################
+proc dhcpClient::ValidEvent {eventCode} \
+{
+	if {[lsearch [GetEventCodes] $eventCode] < 0} {
+		return 0
+	}
+	return 1
+}
+
+########################################################################################
+# Procedure:    dhcpClient::getTransactionID
+#
+# Description:  Derive a unique transaction id, given a port id by adding the 
+#               the port # to the current system time in 'clicks'.
+#
+# Input:        port:   port id
+#
+# Output:       transaction id
+#
+########################################################################################
+proc dhcpClient::getTransactionID {port} \
+{
+    return [expr [clock clicks] + $port]
+}
+
+########################################################################################
+# Procedure:    dhcpClient::clearParameterRequestList
+#
+# Description:  Empty parameter request list.
+#
+# Input:        None
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::clearParameterRequestList {} \
+{
+    variable paramRequestList
+    set paramRequestList [list]
+}
+
+########################################################################################
+# Procedure:    dhcpClient::getParameterRequestList
+#
+# Description:  Return the values currently set into the list of requested DHCP 
+#                   options.  DHCP options are described in RFC 1533.
+#
+# Input:        None
+#
+# Output:       dhcpClient::paramRequestList
+#
+########################################################################################
+proc dhcpClient::getParameterRequestList {} \
+{
+    variable paramRequestList
+    return $paramRequestList
+}
+
+########################################################################################
+# Procedure:    dhcpClient::setParameterRequestList
+#
+# Description:  Set the list of requested DHCP options.  DHCP options are described
+#                   in RFC 1533, the parameter request list is described in section
+#                   9.6 of RFC 1533.
+#
+# Input:        option: name of dhcp option (refer to Tcl Development Guide - DHCP,
+#                       for a list of valid options or RFC 1533).
+#
+# Output:       0 if okay, else
+#               1
+#
+########################################################################################
+proc dhcpClient::setParameterRequestList {option} \
+{
+    variable paramRequestList
+    set retCode 1
+    
+    switch $option {
+        dhcpPad -
+        dhcpEnd -
+        dhcpSubnetMask -
+        dhcpTimeOffset -
+        dhcpGateways -
+        dhcpTimeServer -
+        dhcpNameServer -
+        dhcpDomainNameServer -
+        dhcpLogServer -
+        dhcpCookieServer -
+        dhcpLPRServer -
+        dhcpImpressServer -
+        dhcpResourceLocationServer -
+        dhcpHostName -
+        dhcpBootFileSize -
+        dhcpMeritDumpFile -
+        dhcpDomainName -
+        dhcpSwapServer -
+        dhcpRootPath -
+        dhcpExtensionPath -
+        dhcpIpForwardingEnable -
+        dhcpPolicyFilter -
+        dhcpMaxDatagramReassemblySize -
+        dhcpDefaultIpTTL -
+        dhcpPathMTUAgingTimeout -
+        dhcpPathMTUPlateauTable -
+        dhcpInterfaceMTU -
+        dhcpAllSubnetsAreLocal -
+        dhcpBroadcastAddress -
+        dhcpPerformMaskDiscovery -
+        dhcpMaskSupplier -
+        dhcpPerformRouterDiscovery -
+        dhcpRouterSolicitAddr -
+        dhcpStaticRoute -
+        dhcpTrailerEncapsulation -
+        dhcpARPCacheTimeout -
+        dhcpEthernetEncapsulation -
+        dhcpTCPDefaultTTL -
+        dhcpTCPKeepAliveInterval -
+        dhcpTCPKeepGarbage -
+        dhcpNISDomain -
+        dhcpNISServer -
+        dhcpMTPServer -
+        dhcpVendorSpecificInfo -
+        dhcpNetBIOSNameSvr -
+        dhcpNetBIOSDatagramDistSvr -
+        dhcpNetBiosNodeType -
+        dhcpNetBIOSScope -
+        dhcpXWINSysFontSvr -
+        dhcpRequestedIPAddr -
+        dhcpIPAddrLeaseTime -
+        dhcpOptionOverload -
+        dhcpTFTPSvrName -
+        dhcpBOOTFileName -
+        dhcpMessageType -
+        dhcpSvrIdentifier -
+        dhcpParamRequestList -
+        dhcpMessage -
+        dhcpMaxMessageSize -
+        dhcpRenerwalTimeValue -
+        dhcpRebindingTimeValue -
+        dhcpVendorClassId -
+        dhcpClientId -
+        dhcpXWinSysDisplayMgr -
+        dhcpNISplusDomain -
+        dhcpNISplusServer -
+        dhcpMobileIPHomeAgent -
+        dhcpSMTPSvr -
+        dhcpPOP3Svr -
+        dhcpNNTPSvr -
+        dhcpWWWSvr -
+        dhcpDefaultFingerSvr -
+        dhcpDefaulttIRCSvr -
+        dhcpStreetTalkSvr -
+        dhcpSTDASvr {
+            if {[lsearch $paramRequestList $option] < 0} {
+                set paramRequestList [lappend paramRequestList $option]
+            }
+            set retCode 0
+        }
+    }
+
+    return $retCode
+}
+
+########################################################################################
+# Procedure:    dhcpClient::getMagicCookie
+#
+# Description:  Return the dhcp magic cookie (defined in dhcpClient namespace)
+#
+# Input:        None
+#
+# Output:       magic cookie (hex value)
+#
+########################################################################################
+proc dhcpClient::getMagicCookie {} \
+{
+    variable magicCookie
+    return $magicCookie
+}
+
+########################################################################################
+# Procedure:    dhcpClient::setStartTime
+#
+# Description:  Record the start of dhcp processing.
+#
+# Input:        seconds:    start time in seconds
+#
+# Output:       None
+#
+########################################################################################
+proc dhcpClient::setStartTime {seconds} \
+{
+    variable startTime
+    set startTime $seconds
+}
+
+########################################################################################
+# Procedure:    dhcpClient::getStartTime
+#
+# Description:  Return the start time of dhcp processing in seconds.
+#
+# Input:        None
+#
+# Output:       start time.
+#
+########################################################################################
+proc dhcpClient::getStartTime {} \
+{
+    variable startTime
+    return $startTime
+}
+
+
+
+
+########################################################################################
+# Procedure:    dhcpClient::debug
+#
+# Description:  Depending upon the list of items contained in variable 
+#				dhcpClient::debugLevel, debug information is built and
+#				printed.
+#
+# Input:        args:	list of arguments, these are added to debug output
+#
+# Output:       Printable debug information
+#
+########################################################################################
+proc dhcpClient::debug {args} \
+{
+	variable debugLevel
+	if {[string length $debugLevel] == 0} {
+		return
+	}
+
+	set output ""
+	foreach item $debugLevel {
+
+		switch $item {
+
+			state {		
+				set stateName ""
+				set port [lindex [GetPortList] 0]
+				if {[string length $port] > 0} {
+					scan $port "%d %d %d" c l p
+					set stateName [GetStateName [GetState $c $l $p]]
+				}
+				append output "State: $stateName "
+			}
+
+			default {			
+				set procedure [info level [expr [info level]-1]]
+				set arguments [info args [lindex $procedure 0]]
+				set defaultInfo [string toupper [lindex $procedure 0]]
+				set procedure [lreplace $procedure 0 0]
+				
+				for {set i 0} {$i < [llength $procedure]} {incr i} {
+					set defaultInfo [lappend defaultInfo [lindex $arguments $i] \
+														 [lindex $procedure $i]]
+				}
+				append output "$defaultInfo "
+			}
+		}
+	}
+	append output "$args"
+
+	errorMsg "$output"
+}
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/dialogUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/dialogUtils.tcl
new file mode 100644
index 00000000..6458219b
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/dialogUtils.tcl
@@ -0,0 +1,230 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: dialogUtils.tcl
+#    Copyright ©  IXIA
+#    All Rights Reserved.
+#
+#    Revision Log:
+#    03-12-2001    DS    Genesis
+#
+# Description: Contains miscellaneous dialog for transmit/pause dialog procedures.
+#
+##################################################################################
+
+proc createDialog {dialogName {window textDialog}} \
+{
+    dialogUtils::create $dialogName $window
+}
+
+proc writeDialog {dialogText {window textDialog}} \
+{
+    dialogUtils::writeText $dialogText $window
+}
+
+proc destroyDialog {{window textDialog}} \
+{
+    dialogUtils::destroy $window
+}
+
+
+#######################################################################
+#
+# Procedure:    dialogUtils
+# Description:  
+# Argument(s):
+# Results:
+#
+#######################################################################
+namespace eval dialogUtils {} \
+{
+    variable state  [advancedTestParameter cget -dialogState]
+}
+
+########################################################################
+# Procedure: dialogUtils::init
+#
+# Description: This command doesn't do anything, just want to source this  
+# file when it is called.
+#
+########################################################################
+proc dialogUtils::init {} \
+{
+}
+
+########################################################################
+# Procedure: dialogUtils::create
+#
+# This command creates a dialog box of name "dialogName"
+#
+########################################################################
+proc dialogUtils::create {dialogName window} \
+{
+    variable state
+
+    set retCode $::TCL_OK
+
+    set window .$window
+
+    if {$state != "destroyedByUser"} {
+        if [regexp -nocase wish [file tail [info nameofexecutable]]] {
+
+            if {[winfo exists $window] == 0} {
+                toplevel     $window -class Dialog
+                wm resizable $window 0 1
+                wm withdraw  $window
+                wm title     $window $dialogName
+
+                text $window.text -width 40 -wrap word -yscrollcommand "$window.textScroll set"
+
+                # unix didn't look nice, so just set a different font here..
+                if {[isUNIX]} {
+                    createNamedFont application arial 7
+                    $window.text config -font application
+                }
+
+                scrollbar $window.textScroll -command "$window.text yview"
+
+                grid $window.text       -row 0 -column 0 -sticky snew
+                grid $window.textScroll -row 0 -column 1 -sticky sn
+                grid rowconfigure    $window 0 -weight 1
+                grid columnconfigure $window 0 -weight 1
+
+                wm geometry  $window 270x100+100+100
+                wm protocol  $window WM_DELETE_WINDOW "dialogUtils::destroyedByUser $window"
+
+                if {$state == "normal"} {
+                    wm deiconify $window
+                } else {
+                    wm iconify $window
+                }
+            } else {
+                $window.text delete 0.0 end
+            }
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: dialogUtils::writeText
+#
+# This command writes to a dialog box of name "window"
+#
+########################################################################
+proc dialogUtils::writeText {dialogText window} \
+{
+    set window .$window
+
+    if [catch {
+            $window.text insert end "$dialogText\n"
+            $window.text see end
+            update
+        } err] {
+        ixPuts $dialogText
+    }
+}
+
+########################################################################
+# Procedure: dialogUtils::getWindowState
+#
+# This command gets the state the dialog box of name "window"
+#
+########################################################################
+proc dialogUtils::getWindowState {window} \
+{
+    set windowState .$window
+
+    if [catch {wm state $windowState} state] {
+        set state   destroyedByUser
+    }
+
+    return $state
+}
+
+########################################################################
+# Procedure: dialogUtils::setWindowState
+#
+# This command sets the state variable for the dialog box
+#
+########################################################################
+proc dialogUtils::setWindowState {newState} \
+{
+    variable state
+
+    set state $newState
+
+    return $state
+}
+
+
+########################################################################
+# Procedure: dialogUtils::saveWindowState
+#
+# This command save the static state to bring the dialog back up in next time
+#
+########################################################################
+proc dialogUtils::saveWindowState {window} \
+{    
+    setWindowState [getWindowState $window]
+}
+
+
+########################################################################
+# Procedure: dialogUtils::destroyedByUser
+#
+# This command destroys the dialog box of name "window"
+#
+########################################################################
+proc dialogUtils::destroyedByUser {window} \
+{
+    catch {::destroy $window}
+    setWindowState destroyedByUser
+}
+
+
+########################################################################
+# Procedure: dialogUtils::destroy
+#
+# This command destroys the dialog box of name "dialogName"
+#
+########################################################################
+proc dialogUtils::destroy {window} \
+{    
+    saveWindowState $window
+
+    set window .$window
+    catch {::destroy $window}
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/eventHandler.tcl b/dep/tclclient/ixTcl1.0/Generic/eventHandler.tcl
new file mode 100644
index 00000000..9a7dc1a1
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/eventHandler.tcl
@@ -0,0 +1,124 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: eventHandler.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#       Revision Log:
+#       04-25-2000      DS      Genesis
+#
+# Description: The procedures in this file are used for handling events 
+#           
+#       NOTE:  THIS FILE NEEDS TO BE MOVED INTO SM LAND AS IT'S NOT USED
+#              BY IXTCLHAL GENERIC PROCS!!!
+#
+##################################################################################
+
+
+#################################################################################
+# Procedure:    setStopTestFlag
+#
+# Description:  Set the global variable ixStopTest to the given value.
+#
+# Argument(s):  The new value for ixStopTest.
+#
+# Output:
+#################################################################################
+proc setStopTestFlag { value } \
+{
+    global ixStopTest
+
+    set ixStopTest $value
+}
+
+
+#################################################################################
+# Procedure:    stopTest
+#
+# Description:  Handle the message stopTest that is sent from Scriptmate.
+#
+# Argument(s):
+#
+# Output:
+#################################################################################
+
+proc stopTest {} \
+{
+    global ixStopTest ixStopAction
+
+    set ixStopTest 1
+    switch $ixStopAction {
+        0 {
+            # close pipe & socket
+            catch { puts       "closePipe"   }
+            catch { putsServer "closeSocket" }
+            destroyDialog
+            exit
+        }
+        default {
+        }
+    }
+    
+    debugMsg "The test is being stopped!"
+}
+
+
+#################################################################################
+# Procedure:    isTestStopped
+#
+# Description:  Find out if the test is being stopped by looking at the flag ixStopTest.
+#
+# Argument(s):
+#
+# Output:
+#################################################################################
+proc isTestStopped {} {
+    global ixStopTest
+    return $ixStopTest
+}
+
+
+#################################################################################
+# Procedure:    informServerCurrentTestStopped
+#
+# Description:  Send the message "runningStatus:currentTestStoppedByUser" to Scriptmate.
+#
+# Argument(s):
+#
+# Output:
+#################################################################################
+proc informServerCurrentTestStopped {} \
+{
+    logMsg "runningStatus:currentTestStoppedByUser"
+}
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/featureUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/featureUtils.tcl
new file mode 100644
index 00000000..496fc32e
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/featureUtils.tcl
@@ -0,0 +1,324 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: featureUtils.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	07-31-2002	DS	Genesis
+#
+# Description: This file contains helper utilities that check for 
+#              specific features on a port or portArray.
+#
+########################################################################
+
+
+
+########################################################################
+# Procedure: IsPOSPort
+#
+# This command checks the port if it is a POS port
+#
+########################################################################
+proc IsPOSPort {c l p} \
+{
+    return [port isActiveFeature $c $l $p $::portFeaturePos]
+}
+
+
+########################################################################
+# Procedure: Is10GigEPort
+#
+# This command checks the port if it is a 10GigE port
+#
+########################################################################
+proc Is10GigEPort {c l p} \
+{
+    set retCode 0
+    
+    set interfaceType [port getInterface $c $l $p]
+
+    if {$interfaceType == $::interface10GigE } {
+        set retCode 1
+    }
+
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: IsGigabitPort
+#
+# This command checks card type against Gigabit card types
+#
+########################################################################
+proc IsGigabitPort {c l p} \
+{
+    set retCode 0
+
+    set interfaceType [port getInterface $c $l $p]
+    if {$interfaceType == $::interfaceGigabit} {
+        set retCode 1
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: any10100Ports
+#
+# This command check if there are any 10/100 cards in the map.
+# Returns 1 if there are 10/100 cards in the map.
+#
+# Argument(s):
+#
+########################################################################
+proc any10100Ports {TxRxArray} \
+{
+     upvar $TxRxArray txRxArray
+
+    return [anyPortsBySpeed txRxArray {10 100}]
+}
+
+
+########################################################################
+# Procedure: anyGigPorts
+#
+# This command checks if there are any gig cards in the map
+#
+# Argument(s):
+#
+########################################################################
+proc anyGigPorts {TxRxArray} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [anyPortsBySpeed txRxArray 1000]
+}
+
+
+########################################################################
+# Procedure: anyOc48Ports
+#
+# This command checks if there are any oc48 cards in the map
+#
+# Argument(s):
+#
+########################################################################
+proc anyOc48Ports {TxRxArray} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [anyPortsByInterface txRxArray interfaceOc48]
+}
+
+
+########################################################################
+# Procedure: anyOc192Ports
+#
+# This command checks if there are any oc192 cards in the map
+#
+# Argument(s):
+#
+########################################################################
+proc anyOc192Ports {TxRxArray} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [anyPortsByInterface txRxArray interfaceOc192]
+}
+
+
+########################################################################
+# Procedure: anyPortsByInterface
+#
+# This command checks if there are any ports of that interface type
+#
+# Argument(s):
+#
+########################################################################
+proc anyPortsByInterface {TxRxArray interface} \
+{
+    upvar $TxRxArray txRxArray
+
+    global $interface
+
+    set retCode 0
+    
+    foreach portMap [getAllPorts txRxArray] {
+        scan $portMap "%d %d %d" c l p
+        if {[port getInterface $c $l $p] == [set $interface]} {
+            set retCode 1
+            break
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: anyPortsBySpeed
+#
+# This command checks if there are any ports of that SPEED(list)
+#
+# Argument(s):
+#
+########################################################################
+proc anyPortsBySpeed {TxRxArray speed} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode 0
+    
+    foreach portMap [getAllPorts txRxArray] {
+        scan $portMap "%d %d %d" c l p
+
+        if {[lsearch $speed [stat getLineSpeed $c $l $p]] >= 0} {
+            set retCode 1
+            break
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: supportsProtocolServer
+#
+# This command checks if all the ports support protocol server
+#
+# Argument(s):
+#   TxRxArray   - port array or list
+#
+# Return:
+#   TRUE if all ports support protocol server
+#
+########################################################################
+proc supportsProtocolServer {TxRxArray} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [isValidFeature txRxArray $::portFeatureProtocols]
+}
+
+
+########################################################################
+# Procedure: supportsPortCPU
+#
+# This command checks if all the ports are portCPU-based
+#
+# Argument(s):
+#   TxRxArray   - port array or list
+#
+# Return:
+#   TRUE if all ports are portCPU-based
+#
+########################################################################
+proc supportsPortCPU {TxRxArray} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [isValidFeature txRxArray $::portFeatureLocalCPU]
+}
+
+
+########################################################################
+# Procedure:    isValidFeature
+#
+# Description:  TRUE/FALSE:  Is a feature valid for the ports in the given 
+#               port array?
+#
+# Arguments:    PortArray    array, map or list of ports to check feature on
+#               featureList  one or more features to validate port against
+#
+# Returns:      $::true is valid, else $::false
+#
+########################################################################
+proc isValidFeature {PortArray featureList} \
+{
+    upvar $PortArray portArray
+
+    set retCode $::true
+
+    foreach portMap [getAllPorts portArray] {
+        scan $portMap "%d %d %d" c l p
+        
+        foreach feature $featureList {
+            if {![port isValidFeature $c $l $p $feature]} {
+                set retCode $::false
+                break
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: isPacketFlowMode
+#
+# This command checks if the port is in packet flow mode 
+#
+# Argument(s):
+#
+########################################################################
+proc isPacketFlowMode {c l p} \
+{
+    return [port isActiveFeature $c $l $p $::portFeaturePacketFlows]
+}
+
+
+########################################################################
+# Procedure: isAdvancedStreamSchedulerMode
+#
+# This command checks if the port is in advanced streams mode 
+#
+# Argument(s):
+#
+########################################################################
+proc isAdvancedStreamSchedulerMode {c l p} \
+{
+	if {[port isValidFeature $c $l $p $::portTxModeAdvancedScheduler] || \
+		[port isValidFeature $c $l $p $::portTxModeAdvancedSchedulerCoarse]} {
+		return 1;
+	} else {
+		return 0;
+	}
+}
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/fileTransferClient.tcl b/dep/tclclient/ixTcl1.0/Generic/fileTransferClient.tcl
new file mode 100644
index 00000000..f98b72a8
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/fileTransferClient.tcl
@@ -0,0 +1,538 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: fileTransferClient.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+# Revision Log:
+#       5-14-2001       Andy Balogh created
+#
+# Description: 
+#	commands to transfer files using ixTclServer as the server
+#
+#   NOTE:  We use this mechanism because the ixTclServer is not setup
+#          to be a 'real' fully-functioning FTP server; it really only
+#          does some simple file transfer stuff.
+#
+########################################################################
+
+
+########################################################################
+# Protocol Description
+# 
+# bytes  reqd  description
+# -----  ----  ----------------------------------------
+#    20  Y     length of transaction
+#     1  Y     command 0=success, 1=error, 2=getFile, 3=putFile, 4=listDirectory, 5=deleteFile
+#    20  Y     length of command details
+# above  Y     command details, error=errorCode
+#                               getFile=fileName
+#                               putFile=fileName
+#                               listDirectory=directory
+#                               deleteFile=fileName
+#    20  Y     length of data
+# above  N     data for the command being executed, 
+#              error=text description of the error, 
+#              getFile=the file data, 
+#              putFile=the file Data, 
+#              listDirectory=the directory listing, 
+#              deleteFile=null
+#
+########################################################################
+namespace eval fileTransferClient {} \
+{
+    variable dataSocket
+    variable sourceFile
+    variable destinationFile
+        
+    variable transactionSize
+    variable commandId
+    variable commandDetailsSize
+    variable commandDetails
+    variable dataSize
+
+    variable totalBytesRead
+    variable buffer
+    variable destinationFileId
+    variable transferOutcome
+    variable transferOutcomeDetails
+
+    ### name of the log file in case we read more bytes then expected, used below in the method debug
+    variable debug_file_name
+}
+
+proc ::fileTransferClient::debug { mesg } {
+    variable debug_file_name
+    
+    # Print only explicit messages with debug "message"
+    if {[info exists debug_file_name]} {
+        set fid [open $debug_file_name "a+"]
+        puts $fid "$mesg"
+        close $fid
+    } else {
+        puts "$mesg"
+    }
+}
+
+set fileTransferClient::debug_file_name "/tmp/ixialog.log"
+
+
+########################################################################
+# Procedure: fileTransferClient::openConnectionToTclServer
+#
+# Description: This command connects to an ixTclServer
+#
+# Argument(s):
+#    hostname               - hostname of the ixTclServer
+#    port                   - port number, should be 4500
+#
+# Return Values: returns 0-success, 1-error
+########################################################################
+proc fileTransferClient::openConnectionToTclServer { hostname {port 4500} } \
+{
+    variable dataSocket
+    variable commandId
+
+    set returnValue 1
+
+    catch { set dataSocket [socket $hostname $port] }
+
+    if { $dataSocket != "" } {
+        
+        fconfigure $dataSocket -blocking  0
+        fconfigure $dataSocket -buffering none
+        fconfigure $dataSocket -buffersize 8192
+        
+        if { $commandId == 2 } {
+
+            fconfigure $dataSocket -translation {binary binary}
+            fconfigure $dataSocket -encoding binary
+        
+        } else {
+
+            fconfigure $dataSocket -encoding binary
+            fconfigure $dataSocket -translation {binary binary}
+        
+        }
+
+        set returnValue 0
+
+    }
+
+    return $returnValue
+}
+
+
+########################################################################
+# Procedure: fileTransferClient::closeTclServerConnection
+#
+# Description: This command closes the connection to an ixTclServer
+#              and optionally closes the destinationFileId if the
+#              command is a getFile
+#
+# Argument(s):
+#
+# Return Values: always returns 0
+########################################################################
+proc fileTransferClient::closeTclServerConnection {} \
+{
+    variable dataSocket
+    variable destinationFileId
+
+    close $dataSocket
+
+    if { $destinationFileId != "" } { 
+
+        close $destinationFileId
+
+    }
+
+    return 0
+}
+
+
+########################################################################
+# Procedure: fileTransferClient::sendTransactionToTclServer
+#
+# Description: This command sends a formatted transaction to an ixTclServer
+#
+# Argument(s):
+#
+# Return Values: returns 0-success, 1-error
+########################################################################
+proc fileTransferClient::sendTransactionToTclServer { transaction } \
+{
+    variable dataSocket
+    variable totalBytesRead 0
+    variable buffer ""
+    variable transferOutcomeDetails
+    variable transferOutcome
+    variable destinationFile
+    variable transactionSize 0
+    variable commandSize 0
+    variable commandDetails ""
+    variable commandDetailsSize 0
+    variable dataSize -1
+
+    set returnValue 1
+
+    if { $dataSocket != "" } {
+
+        fconfigure $dataSocket -blocking  1
+        set line [puts $dataSocket $transaction]
+        flush $dataSocket
+
+        set totalBytesRead [expr $totalBytesRead + [string length $line] ]
+        set buffer $line
+
+        set returnValue [fileTransferClient::getTransferOutcome]
+    }
+
+    return $returnValue
+}
+
+
+########################################################################
+# Procedure: fileTransferClient::sendTransactionToTclServer_ForDelete
+#
+# Description: This command sends a formatted transaction to an ixTclServer
+#
+# Argument(s):
+#
+# Return Values: returns 0-success, 1-error
+########################################################################
+proc fileTransferClient::sendTransactionToTclServer_ForDelete { transaction } \
+{
+    variable dataSocket
+    variable totalBytesRead 0
+    variable buffer ""
+    variable transferOutcomeDetails
+    variable transferOutcome
+    variable destinationFile
+    variable transactionSize 0
+    variable commandSize 0
+    variable commandDetails ""
+    variable commandDetailsSize 0
+    variable dataSize -1
+
+    set returnValue 0
+
+    if { $dataSocket != "" } {
+
+        fconfigure $dataSocket -blocking  1
+        set line [puts $dataSocket $transaction]
+        flush $dataSocket
+
+        set totalBytesRead [expr $totalBytesRead + [string length $line] ]
+        set buffer $line
+        closeTclServerConnection
+    }
+
+    return $returnValue
+}
+
+########################################################################
+# Procedure: fileTransferClient::getFile
+#
+# Description: This command gets a file using ixTclServer as the server
+#
+# Argument(s):
+#    hostname        - hostname of the ixTclServer
+#    port            - port number, should be 4500
+#    sourceFile      - name of the file to get, can be absolute or relative
+#    destinationFile - name of the file that the contents will be saved as
+#
+# Return Values: returns 0-success, 1-error
+########################################################################
+proc fileTransferClient::getFile { hostname port sourceFile destinationFile } \
+{
+    variable totalBytesRead 0
+    variable transactionSize 0
+    variable commandSize 0
+    variable commandDetails 0
+    variable destinationFileId ""
+    variable transferOutcomeDetails 0
+    variable commandId 2
+    
+    set returnValue 1
+
+    if { [openConnectionToTclServer $hostname $port] == 0 } { 
+
+        set commandDetails $sourceFile
+        set commandDetailsSize [format "%.20d" [string length $commandDetails]]
+        set transactionSize [format "%.20d" [expr 20 + [string length $commandId] + [string length $commandDetailsSize] + [string length $commandDetails]]]
+        set transaction $transactionSize$commandId$commandDetailsSize$commandDetails
+
+        set destinationFileId [ixFileUtils::open $destinationFile w]
+        if { $destinationFileId != "" } { 
+
+            fconfigure $destinationFileId -encoding binary
+            fconfigure $destinationFileId -eofchar { "" "" }
+            fconfigure $destinationFileId -translation { lf lf }
+            
+            set returnValue [sendTransactionToTclServer $transaction]
+        
+        } else { 
+        
+            closeTclServerConnection
+
+            set transferOutcomeDetails "Unable to open source file"
+        }
+    
+    } else {
+
+        set transferOutcomeDetails "Unable to open socket"
+    }
+
+    return $returnValue
+}
+
+########################################################################
+# Procedure: fileTransferClient::deleteFile
+#
+# Description: This command deletes a file using ixTclServer as the server
+#
+# Argument(s):
+#    hostname        - hostname of the ixTclServer
+#    port            - port number, should be 4500
+#    sourceFile      - name of the file to delete, can be absolute or relative
+#
+# Return Values: returns 0-success, 1-error
+########################################################################
+proc fileTransferClient::deleteFile { hostname port sourceFile  } \
+{
+    variable totalBytesRead 0
+    variable transactionSize 0
+    variable commandSize 0
+    variable commandDetails ""
+    variable transferOutcomeDetails 0
+    variable destinationFileId ""
+    variable commandId 5 
+    
+    set returnValue 1
+
+    if { [openConnectionToTclServer $hostname $port] == 0 } { 
+
+        set commandDetails $sourceFile
+        set commandDetailsSize [format "%.20d" [string length $commandDetails]]
+        set transactionSize [format "%.20d" [expr 20 + [string length $commandId] + [string length $commandDetailsSize] + [string length $commandDetails]]]
+        set transaction $transactionSize$commandId$commandDetailsSize$commandDetails
+        
+        set returnValue [sendTransactionToTclServer_ForDelete $transaction]
+    
+    } else {
+
+        set transferOutcomeDetails "Unable to open socket"
+    }
+    
+
+    return $returnValue
+}
+
+
+########################################################################
+# Procedure: fileTransferClient::putFile
+#
+# Description: This commands puts a file using ixTclServer as the server
+#
+# Argument(s):
+#    hostname        - hostname of the ixTclServer
+#    port            - port number, should be 4500
+#    sourceFile      - name of the file to get, can be absolute or relative
+#    destinationFile - name of the file that the contents will be saved as
+#
+# Return Values: always returns 0
+########################################################################
+proc fileTransferClient::putFile { hostname port sourceFile destinationFile } \
+{
+    variable totalBytesRead 0
+    variable transactionSize 0
+    variable commandSize 0
+    variable commandDetails ""
+    variable dataSize -1
+    variable buffer
+    variable destinationFileId ""
+    variable transferOutcomeDetails 0
+    variable commandId 3
+
+    set returnValue 1
+        
+    if { [openConnectionToTclServer $hostname $port] == 0 } { 
+
+        set commandDetails $destinationFile
+        set commandDetailsSize [format "%.20d" [string length $commandDetails]]
+        set dataSize [format "%.20d" [file size $sourceFile]] 
+
+        set sourceFileId [ixFileUtils::open $sourceFile r]
+
+        if { $sourceFileId != "" } { 
+ 
+            fconfigure $sourceFileId -translation { binary binary }
+            fconfigure $sourceFileId -encoding binary
+            set fileData [read -nonewline $sourceFileId]
+            close $sourceFileId
+
+            set transactionSize [format "%.20d" [expr 20 + [string length $commandId] + [string length $commandDetailsSize] + [string length $commandDetails] + [string length $dataSize] + [string length $fileData]]]
+            set transaction $transactionSize$commandId$commandDetailsSize$commandDetails$dataSize$fileData
+
+            set returnValue [sendTransactionToTclServer $transaction]
+
+        } else {
+
+            closeTclServerConnection
+
+            set transferOutcomeDetails "Unable to open source file"
+        }
+
+    } else {
+
+        set transferOutcomeDetails "Unable to open socket"
+    }
+
+    return $returnValue
+}
+
+
+########################################################################
+# Procedure: fileTransferClient::getTransferOutcome
+#
+# Description: This command reads the response from the ixTclServer
+#
+# Argument(s):
+#    dataSocket      - a connected socket 
+#
+# Return Values: always returns 0
+########################################################################
+proc fileTransferClient::getTransferOutcome {} \
+{
+    variable totalBytesRead 0
+    variable transactionSize 0
+    variable commandId -1
+    variable commandDetailsSize -1
+    variable commandDetails ""
+    variable dataSize -1
+    variable buffer ""
+    variable destinationFileId
+    variable transferOutcome
+    variable transferOutcomeDetails
+    variable dataSocket
+    variable hitTime ""
+    
+    fconfigure $dataSocket -blocking 0
+
+    set returnValue 1
+    set endSocketRead 0
+
+    while { $endSocketRead == 0 } {
+        
+        set line [read $dataSocket 2048]
+        set totalBytesRead [expr $totalBytesRead + [string length $line]]
+        append buffer $line
+
+        if { ( $transactionSize == 0 ) && ( [string length $buffer] >= 40 ) } {
+
+            set transactionSize [string range $buffer 0 19]
+            set transactionSize [string trimleft $transactionSize "0"]
+            set transactionSize [expr int( $transactionSize )]
+                
+            set commandId [string range $buffer 20 20]
+
+            set commandDetailsSize [string range $buffer 21 40]
+            set commandDetailsSize [string trimleft $commandDetailsSize "0"]
+            set commandDetailsSize [expr int( $commandDetailsSize )]
+        
+            set buffer [string range $buffer 41 [string length $buffer]]
+        
+        }
+
+        if { $commandDetailsSize > 0 && [string length $commandDetails] == 0 && $totalBytesRead >= [expr 41 + $commandDetailsSize] } {
+            set commandDetails [string range $buffer 0 [expr $commandDetailsSize - 1]]
+        
+            set buffer [string range $buffer $commandDetailsSize [string length $buffer]]
+        }
+
+        if { $commandId == 0 && $dataSize == -1 && $commandDetailsSize > 0 } {
+            set dataSize [string range $buffer 0 19]
+        
+            if { [string length $dataSize] > 0 } {
+    
+                set dataSize [string trimleft $dataSize "0"]
+                set dataSize [expr int( $dataSize )]
+                set buffer [string range $buffer 20 [string length $buffer]]
+    
+            } else {
+                set dataSize 0
+            }
+        }
+
+        if { $transactionSize > 0 && $totalBytesRead >= $transactionSize } { 
+            set endSocketRead 1
+            if { $totalBytesRead > $transactionSize } {
+                file delete -- $fileTransferClient::debug_file_name
+                set hitTime [clock format [clock seconds]]
+                debug "In PROC getTransferOutcome : hit endSocketRead"
+                debug "In PROC getTransferOutcome : the time is $hitTime"
+                debug "In PROC getTransferOutcome : totalBytesRead = $totalBytesRead, transactionSize = $transactionSize"
+                debug "In PROC getTransferOutcome : commandId = $commandId, commandDetailsSize = $commandDetailsSize"
+                debug "In PROC getTransferOutcome : commandDetails = $commandDetails"
+                debug "In PROC getTransferOutcome : bytes read are '$buffer'"
+            }
+        }
+
+       if { $destinationFileId != "" && $dataSize != -1 } {
+           puts -nonewline $destinationFileId $buffer
+	       flush $destinationFileId
+           set buffer ""
+       }
+    }
+    
+    closeTclServerConnection
+
+    if { $totalBytesRead - [expr 41 + $commandDetailsSize] >= $dataSize && $commandId == 0 } {
+
+        set transferOutcomeDetails "SUCCESS"
+        set returnValue 0
+
+    } else {
+        set transferOutcomeDetails $commandDetails
+    }
+
+    return $returnValue
+}
+
+
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/ftp.tcl b/dep/tclclient/ixTcl1.0/Generic/ftp.tcl
new file mode 100644
index 00000000..2241df90
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/ftp.tcl
@@ -0,0 +1,154 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: ftp.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Description:  This file contains utilities FileTransfer
+#
+#	Revision Log:
+#	Date		Author				Comments
+#	-----------	-------------------	--------------------------------------------
+#   10/25/2000  ds          		initial release
+#
+##################################################################################
+
+package require FTP
+
+########################################################################################
+# Procedure:	putFtpLogWindow
+#
+# Description: 	Write a message to the ftp log window
+#				
+# Input:		textEntry
+#
+########################################################################################
+proc putFtpLogWindow {textEntry} \
+{
+    logMsg $textEntry
+}
+
+
+########################################################################################
+# Procedure:	ixFileSend
+#
+# Description: 	FTP protocol stuff... 
+#
+# Input:
+#
+########################################################################################
+proc ixFileSend {ipAddress filename username password sourceDirectory destDirectory} \
+{
+    set retCode 0
+
+    global ftpDone
+
+    putFtpLogWindow "ipAddress=$ipAddress\nfilename=$filename\nusername=$username\npassword=$password\nsourceDirectory=$sourceDirectory\ndestDirectory=$destDirectory"
+
+    set retCode 1
+    if {[file isdirectory $destDirectory]} {
+        if {![FTP::Open $ipAddress $username $password  -mode passive]} {
+            putFtpLogWindow"Error opening FTP session"
+            set retCode 2
+        } else {
+            if {![FTP::Get $sourceDirectory$filename $destDirectory$filename]} {
+                putFtpLogWindow "Error getting file $sourceDirectory$filename"
+                set retCode 3
+            }
+        }
+        FTP::Close
+    } else {
+        putFtpLogWindow "Error - invalid destination directory $destDirectory"
+        set retCode 4
+    }
+
+    set ftpDone $retCode
+
+    if {$ftpDone == 1} {
+        set retCode 0
+    } else {
+        set retCode 1
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:	ixFileTransferStart
+#
+# Description: 	FTP protocol stuff... 
+#
+# Input:
+#
+########################################################################################
+proc ixFileTransferStart { ipAddress filename username password sourceDirectory destDirectory } \
+{
+    global ixTclSvrHandle ftpDone
+
+    set retCode 0
+
+    ixFileSend $ipAddress $filename $username $password $sourceDirectory $destDirectory
+
+    set ftpDone 0
+    while {$ftpDone==0} {
+        ;# Make a time out counter here
+        ;# probably count to about 100 then
+        ;# a failure should be returned
+        set x 0
+        after 1000 {set x 1}
+        vwait x
+    }
+  
+    switch $ftpDone {
+        1 {
+            ixPuts "File transfer complete."
+        }
+        2 {
+            ixPuts "Error opening FTP session on $ipAddress, username:$username."
+            set retCode 1
+        }
+        3 {
+            ixPuts "Error transferring file $sourceDirectory$filename to $destDirectory$filename."
+            set retCode 1
+        }
+        4 {
+            ixPuts "Error - invalid destination directory $destDirectory"
+            set retCode 1
+        }
+    }
+
+    return $retCode
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/highLevelAPI.tcl b/dep/tclclient/ixTcl1.0/Generic/highLevelAPI.tcl
new file mode 100644
index 00000000..3e822dc6
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/highLevelAPI.tcl
@@ -0,0 +1,2642 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: highLevelAPI.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#   Revision Log:
+#   04-28-1998  HS  Genesis
+#
+# Description:
+#   This file contains high level Tcl API commands.
+#
+###################################################################################
+
+
+###############################################################################
+# Procedure:    ixInitialize
+#
+# Description: This procedure loads the IXIA Tcl package, sets the name of log
+#              and debug files, and performs any other initializations, if necessary.
+#
+# Argument(s):
+#    chassisList - List of hostnames or IP addresses of chassis in a chain.
+#    cableLen    - Optional.  The cable length choice.  If not passed then cable3feet.
+#    logfilename - Optional.  The name of the file for the test logs output.
+#                  If not passed, then is blank.
+#    client      - Optional.  The name of the client.  Defaults to local.  Currently unused
+#
+# Returns:
+#    0 : if no error
+#    1 : if error connecting to chassis
+#    2 : if version mismatch
+#    3 : if chassis timeout occurred
+#    4 : if connection interrupted by user
+#    5 : if error connecting to Tcl server
+###############################################################################
+proc ixInitialize {chassisList {cableLen cable3feet} {logfilename ""} {client local}} \
+{
+    set tclServer [lindex $chassisList 0]
+    set retCode [ixProxyConnect $tclServer $chassisList $cableLen $logfilename]
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:   ixConnectToChassis
+#
+# Description: This procedure connects to a list of chassis. An ID number is assigned to
+#              the chassis in sequence starting from 1 in the order that the list is passed.
+#              The first chassis in the list is assigned as the master chassis.
+#
+# Argument(s):
+#    chassisList - The list of hostnames or IP addresses of chassis in a chain
+#    cableLength - Optional.  The length of the cables between the chassis.  If not passed in,
+#                  then uses cable3feet.  Note - may be a list of lengths, one for each chassis
+#                  in the chassisList.
+#
+# Returns:
+#    0 : if no error
+#    1 : if error connecting to chassis
+#    2 : if version mismatch, ixTcl_versionMismatch
+#    3 : if chassis timeout occurred, ixTcl_chassisTimeout
+#    4 : if connection interrupted by user
+########################################################################################
+proc ixConnectToChassis {chassisList {cableLength cable3feet}} \
+{
+    return [connectToChassis $chassisList $cableLength]
+}
+
+
+########################################################################################
+# Procedure:   ixConnectToTclServer
+#
+# Description: This procedure connects a unix  
+#
+# Argument(s):
+#    serverName - Ip addr/name of TclServer
+#
+# Returns:
+#    0 - if no error
+#    1 - if any error found
+########################################################################################
+proc ixConnectToTclServer {serverName} \
+{
+    return [tclServer::connectToTclServer $serverName errMsg]
+}
+
+
+########################################################################################
+# Procedure:   ixDisconnectTclServer
+#
+# Description: This procedure disconnects from the TclServer
+#
+# Argument(s): 
+#    serverName - UNUSED.  Still exists for backwards script support
+#
+# Returns:
+########################################################################################
+proc ixDisconnectTclServer {{serverName ""}} \
+{
+    return [tclServer::disconnectTclServer]
+}
+
+
+########################################################################################
+# Procedure:   ixGetChassisID
+#
+# Description: This procedure gets the chassis ID of the specified chassis name. It is
+#              useful when multiple chassis are chained together.
+#
+# Argument(s):
+#    chassisName - chassis name for which ID is to be obtained
+#
+# Returns:
+#    -1 - if error found
+#    chasissID - ID number of the chassis
+########################################################################################
+proc ixGetChassisID {chassisName} \
+{
+    if [chassis get $chassisName] {
+        ixPuts "Error getting parameters for chassis $chassisName"
+        return -1
+    }
+    set chassisID [chassis cget -id]
+    return $chassisID
+}
+
+
+########################################################################################
+# Procedure:   ixDisconnectFromChassis
+#
+# Description: Disconnects from input chassis or list of chassis; if no arg given, then
+#              will removeAll.
+#
+# Argument(s):
+#    args - list of chassis to del; if empty, removeAll
+#
+# Returns:
+#    0 - if no error
+#
+########################################################################################
+proc ixDisconnectFromChassis {args} \
+{
+    if {[llength $args] == 0} {
+        chassisChain removeAll
+    } else {
+        foreach host $args {
+            chassis del $host
+        }
+    }
+    return 0
+}
+
+
+########################################################################
+# Procedure:   ixGlobalSetDefault
+#
+# Description: This command calls the setDefault for all the stream/port related
+#              commands as a form of initialization.
+#
+# Arguments:   None
+#
+# Returns:     Nothing
+########################################################################
+proc ixGlobalSetDefault {} \
+{
+    globalSetDefault
+}
+
+
+########################################################################################
+# Procedure:   ixStartTransmit
+#
+# Description: Starts transmission on the specific ports
+#
+# Arguments:
+#    PortList - Represented in Chassis Card Port and can be a list also, example {1,1,1 1,1,2}
+#
+# Returns:
+########################################################################################
+proc ixStartTransmit {PortList} \
+{
+    upvar $PortList portList
+
+    return [startTx portList]
+}
+
+
+########################################################################
+# Procedure:   ixStartPortTransmit
+#
+# Description: This command starts Transmit on a single port; it will also stop transmit &
+#              zero stats on this port before transmitting.
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    0 if OK, 1 if port not configured
+########################################################################
+proc ixStartPortTransmit {chassis lm port} \
+{
+    return [startPortTx $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure:   ixStartStaggeredTransmit
+#
+# Description: This command arms each Tx port & then sends out a pulse to the master
+#              to begin transmitting
+#
+# Arguments:
+#    PortList - Represented in Chassis Card Port and can be a list also, for ex. {1,1,1 1,1,2}
+#
+# Returns:
+########################################################################
+proc ixStartStaggeredTransmit {PortList} \
+{
+    upvar $PortList portList
+
+    return [startStaggeredTx portList]
+}
+
+
+########################################################################################
+# Procedure:   ixStopTransmit
+#
+# Description: Stops transmission on the specific ports
+#
+# Arguments:
+#    PortList - Represented in Chassis Card Port and can be a list also, for ex. {1,1,1 1,1,2}
+#
+# Returns:
+########################################################################################
+proc ixStopTransmit {PortList} \
+{
+    upvar $PortList portList
+
+    return [stopTx portList]
+}
+
+
+########################################################################
+# Procedure:   ixStopPortTransmit
+#
+# Description: This command stops Tx on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:      0 if OK, 1 if port not configured
+########################################################################
+proc ixStopPortTransmit {chassis lm port} \
+{
+    return [stopPortTx $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure:   ixStartCapture
+#
+# Description: This command turns on capture for each Rx port
+#
+# Arguments:
+#    PortList - Represented in Chassis Card Port and can be a list also for ex. {1,1,1 1,1,2}
+#
+# Returns:
+########################################################################
+proc ixStartCapture {PortList} \
+{
+    upvar $PortList portList
+
+    return [startCapture portList]
+}
+
+
+########################################################################
+# Procedure:   ixStartPrbsCapture
+#
+# Description: This command turns on capture and Packet Groups for each Rx port
+#
+# Arguments:
+#    PortList - Represented in Chassis Card Port and can be a list also for ex. {1,1,1 1,1,2}
+#
+# Returns:
+########################################################################
+proc ixStartPrbsCapture {PortList} \
+{
+    upvar $PortList portList
+
+    return [startPrbsCapture portList]
+}
+
+
+########################################################################
+# Procedure: ixStopCapture
+#
+# This command stops capture for each Rx port
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixStopCapture {PortList} \
+{
+    upvar $PortList portList
+
+    return [stopCapture portList]
+}
+
+
+########################################################################
+# Procedure: ixStopPrbsCapture
+#
+# This command stops capture and Packet Groups for each Rx port
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixStopPrbsCapture {PortList} \
+{
+    upvar $PortList portList
+
+    return [stopPrbsCapture portList]
+}
+
+########################################################################
+# Procedure: ixClearPrbsCapture
+#
+# This command clears PRBS capture for each Rx port
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixClearPrbsCapture {PortList} \
+{
+    upvar $PortList portList
+
+    return [clearPrbsCapture portList]
+}
+
+
+########################################################################
+# Procedure: ixStartPortCapture
+#
+# This command starts capture on a single port;
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixStartPortCapture {chassis lm port} \
+{
+    return [startPortCapture $chassis $lm $port]
+}
+
+
+
+########################################################################
+# Procedure: ixStartPortPrbsCapture
+#
+# This command starts capture and Packet Groups on a single port;
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixStartPortPrbsCapture {chassis lm port} \
+{
+    return [startPortPrbsCapture $chassis $lm $port]
+}
+
+
+
+########################################################################
+# Procedure: ixStopPortCapture
+#
+# This command stops capture on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    1 if OK, 0 if port not configured
+#
+########################################################################
+proc ixStopPortCapture {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+    return [stopPortCapture $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixStopPortPrbsCapture
+#
+# This command stops capture and Packet Groups on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    1 if OK, 0 if port not configured
+#
+########################################################################
+proc ixStopPortPrbsCapture {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+    return [stopPortPrbsCapture $chassis $lm $port]
+}
+
+########################################################################
+# Procedure: ixClearPortPrbsCapture
+#
+# This command clears PRBS capture on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    1 if OK, 0 if port not configured
+#
+########################################################################
+proc ixClearPortPrbsCapture {chassis lm port {groupId 710} {create create} {destroy destroy}} \
+{
+    return [clearPortPrbsCapture $chassis $lm $port]
+}
+
+
+########################################################################################
+#  Procedure  :  ixClearStats
+#
+#  Description:  Clear statistics counters on the specific ports
+#
+#  Arguments  :
+#      ports     - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################################
+proc ixClearStats {PortList} \
+{
+    upvar $PortList portList
+
+    return [zeroStats portList]
+}
+
+
+########################################################################
+# Procedure: ixClearPortStats
+#
+# This command zeros all stats & stops the specified port if transmitting
+#
+# Argument(s):
+#    chassis     chassis ID
+#    lm          Load Module number
+#    port        port number
+#
+########################################################################
+proc ixClearPortStats {chassis lm port} \
+{
+    return [zeroPortStats $chassis $lm $port]
+}
+
+########################################################################################
+#  Procedure  :  ixClearPerStreamTxStats
+#
+#  Description:  Clear per stream Tx statistics counters on the portList
+#
+#  Arguments  :
+#      PortList     - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################################
+proc ixClearPerStreamTxStats {PortList} \
+{
+    upvar $PortList portList
+
+    return [clearPerStreamTxStats portList]
+}
+
+
+########################################################################
+# Procedure: ixClearPerStreamTxPortStats
+#
+# This command zeros all stream Tx stats on this port
+#
+# Argument(s):
+#    chassis     chassis ID
+#    lm          Load Module number
+#    port        port number
+#
+########################################################################
+proc ixClearPerStreamTxPortStats {chassis lm port} \
+{
+    return [clearPerStreamTxPortStats $chassis $lm $port]
+}
+
+
+########################################################################################
+# Procedure: ixRequestStats
+#
+# Description: This command combines the statGroup w/a portList or map array to request 
+#              stats for a list of ports. statList command must be used to retrieve stats
+#              after call completion.
+#
+# Arguments:
+#    TxRxArray - either list of ports or array of ports
+#                     
+# Returns:
+#       TCL_OK or TCL_ERROR
+#
+########################################################################################
+proc ixRequestStats {TxRxArray} \
+{
+    upvar $TxRxArray   txRxArray
+
+    return [requestStats txRxArray]
+}
+
+
+########################################################################
+# Procedure: ixClearTimeStamp
+#
+# This command synchronizes the timestamp value among all chassis
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixClearTimeStamp {PortList} \
+{
+    upvar $PortList portList
+
+    return [clearTimeStamp portList]
+}
+
+
+########################################################################
+# Procedure: ixStartPacketGroups
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to initiate packetGroup stats
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixStartPacketGroups {PortList} \
+{
+    upvar $PortList portList
+
+    return [startPacketGroups portList]
+}
+
+
+########################################################################
+# Procedure: ixStartPortPacketGroups
+#
+# This command starts packetGroup stats on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixStartPortPacketGroups {chassis lm port} \
+{
+    return [startPortPacketGroups $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixStopPacketGroups
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to stop packetGroup stats
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixStopPacketGroups {PortList} \
+{
+    upvar $PortList portList
+
+    return [stopPacketGroups portList]
+}
+
+
+########################################################################
+# Procedure: ixClearPacketGroups
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to clear packetGroup stats
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixClearPacketGroups {PortList} \
+{
+    upvar $PortList portList
+
+    return [clearPacketGroups portList]
+}
+
+
+########################################################################
+# Procedure: ixClearPortPacketGroups
+#
+# This command clears packetGroup stats on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixClearPortPacketGroups {chassis lm port} \
+{
+    return [clearPortPacketGroups $chassis $lm $port]
+}
+
+########################################################################
+# Procedure:   ixSetScheduledTransmitTime
+#
+# Description: This command sets scheduled transmit time on given port list
+#
+# Arguments:
+#    PortList - List of ports; for ex. {{1 1 1} {1 1 2}}
+#
+# Returns:
+########################################################################
+proc ixSetScheduledTransmitTime {PortList duration } \
+{
+    upvar $PortList portList
+
+    return [setScheduledTransmitTime portList $duration]
+}
+
+########################################################################
+# Procedure:   ixClearScheduledTransmitTime
+#
+# Description: This command clears/resets scheduled transmit time on given 
+#              port list
+#
+# Arguments:
+#    PortList - List of ports; for ex. {{1 1 1} {1 1 2}}
+#
+# Returns:
+########################################################################
+proc ixClearScheduledTransmitTime {PortList} \
+{
+    upvar $PortList portList
+
+    set duration 0
+    return [setScheduledTransmitTime portList $duration]
+}
+
+########################################################################
+# Procedure: ixStopPortPacketGroups
+#
+# This command stops packetGroup stats on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixStopPortPacketGroups {chassis lm port} \
+{
+    return [stopPortPacketGroups $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixStartCollisions
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to initiate collisions
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixStartCollisions {PortList} \
+{
+    upvar $PortList portList
+
+    return [startCollisions portList]
+}
+
+
+########################################################################
+# Procedure: ixStartPortCollisions
+#
+# This command starts packetGroup stats on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixStartPortCollisions {chassis lm port} \
+{
+    return [startPortCollisions $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixStopCollisions
+#
+# This command arms each Rx port & then sends out a pulse to the master
+# to stop collisions
+#
+# Arguments:
+#      PortList  - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#
+########################################################################
+proc ixStopCollisions {PortList} \
+{
+    upvar $PortList portList
+
+    return [stopCollisions portList]
+}
+
+
+########################################################################
+# Procedure: ixStopPortCollisions
+#
+# This command stops collisions on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:
+#    0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixStopPortCollisions {chassis lm port} \
+{
+    return [stopPortCollisions $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixLoadPoePulse
+#
+# This command loads the poe pulse
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc ixLoadPoePulse {PortList} \
+{
+    upvar $PortList portList
+
+    return [loadPoePulse portList]
+}
+
+
+########################################################################
+# Procedure: ixLoadPortPoePulse
+#
+# This command loads the poe pulse on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixLoadPortPoePulse {chassis lm port} \
+{
+    return [loadPortPoePulse $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixArmPoeTrigger
+#
+# This command arms the poe trigger
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc ixArmPoeTrigger {PortList} \
+{
+    upvar $PortList portList
+
+    return [armPoeTrigger portList]
+}
+
+
+########################################################################
+# Procedure: ixArmPortPoeTrigger
+#
+# This command arms the poe trigger on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixArmPortPoeTrigger {chassis lm port} \
+{
+    return [armPortPoeTrigger $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixAbortPoeArm
+#
+# This command aborts the poe trigger
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc ixAbortPoeArm {PortList} \
+{
+    upvar $PortList portList
+
+    return [abortPoeArm portList]
+}
+
+
+########################################################################
+# Procedure: ixAbortPortPoeArm
+#
+# This command aborts the poe trigger on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixAbortPortPoeArm {chassis lm port} \
+{
+    return [abortPortPoeArm  $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixStartAtmOamTransmit
+#
+# This command starts the atm oam transmit
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc ixStartAtmOamTransmit {PortList} \
+{
+    upvar $PortList portList
+
+    return [startAtmOamTransmit portList]
+}
+
+
+########################################################################
+# Procedure: ixStartPortAtmOamTransmit
+#
+# This command starts the atm oam transmit on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixStartPortAtmOamTransmit {chassis lm port} \
+{
+    return [startPortAtmOamTransmit $chassis $lm $port]
+}
+
+########################################################################
+# Procedure: ixStopAtmOamTransmit
+#
+# This command starts the atm oam transmit
+#
+# Argument(s):
+#	PortArray	            either list of ports or array of ports
+#
+########################################################################
+proc ixStopAtmOamTransmit {PortList} \
+{
+    upvar $PortList portList
+
+    return [stopAtmOamTransmit portList]
+}
+
+
+########################################################################
+# Procedure: ixStopPortAtmOamTransmit
+#
+# This command starts the atm oam transmit on a single port.
+# 
+#
+# Arguments(s):
+#	chassis
+#	lm
+#	port
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixStopPortAtmOamTransmit {chassis lm port} \
+{
+    return [stopPortAtmOamTransmit $chassis $lm $port]
+}
+
+
+
+
+########################################################################################
+#  Procedure  :  ixCreatePortListWildCard
+#
+#  Description:  This commands creates a list of ports in a sorted order based on the
+# physical slots. It accepts * as a wild card to indicate all cards or all ports on a
+# card. A wild card cannot be used for chassis ID. Also, if a combination of a list
+# element containing wild cards and port numbers are passed, then the port list passed
+# MUST be in a sorted order, otherwise the some of those ports might not make it in the
+# list. For example,
+# ixCreatePortListWildCard {1 * *} - all cards and all ports on chassis 1
+# ixCreatePortListWildCard {{1 1 *} {1 2 1} { 1 2 2}} - all ports on card 1 and
+#                           ports 1 and 2 on card 2.
+#
+#  Arguments  :
+#      portList         - Represented in Chassis Card Port and can be a list also
+#      excludePorts     - exclude these ports from the sorted port list
+#
+########################################################################################
+proc ixCreatePortListWildCard {portList {excludePorts {}}} \
+{
+    set retList {}
+
+    # If excludePorts is passed as a single list, then put braces around it
+    if {[llength $excludePorts] == 3 && [llength [lindex $excludePorts 0]] == 1} {
+        set excludePorts [list $excludePorts]
+    }
+
+    foreach portItem $portList {
+        scan [join [split $portItem ,]] "%s %s %s" ch fromCard fromPort
+    
+        set origFromPort    $fromPort
+
+        if { $ch == "*"} {
+            errorMsg "Chassis ID cannot be a wildcard. Enter a valid number"
+            return $retList
+        }
+
+        if [chassis getFromID $ch] {
+            errorMsg "Chassis ID $ch has not been added to chassis chain."
+            continue
+        }
+
+        set maxCardsInChassis   [chassis cget -maxCardCount]
+        if { $fromCard == "*"} {
+            set fromCard 1
+            set toCard   $maxCardsInChassis
+        } else {
+            set toCard   $fromCard
+        }
+
+        for {set l $fromCard} {$l <= $toCard} {incr l} {
+            if [card get $ch $l] {
+                #errorMsg "Error getting card $ch $l"
+                continue
+            }
+
+            set maxPorts    [card cget -portCount]
+
+            if { $origFromPort == "*"} {
+                set fromPort 1
+                set toPort   $maxPorts
+            } else {
+                set toPort   $fromPort
+            }
+
+            for {set p $fromPort} {$p <= $toPort} {incr p} {
+                if [port get $ch $l $p] {
+                    continue
+                }
+                if {[lsearch $excludePorts "$ch $l $p"] == -1 && [lsearch $retList "$ch $l $p"] == -1} {
+                    lappend retList [list $ch $l $p]
+                }
+
+            }
+        }
+    }
+    
+    if {[llength $retList] == 0} {
+		errorMsg "Port list wild card is empty"
+	}
+	
+    return [lnumsort $retList]
+}
+
+
+########################################################################################
+#  Procedure  :  ixCreateSortedPortList
+#
+#  Description:  This commands creates a list of ports in a sorted order based on the
+# range of ports passed.
+#
+# For example - to add all ports on cards 1 through 5:
+# ixCreateSortedPortList {{1 1 1} {1 5 4}}
+#
+#
+#  Arguments  :
+#       portListFrom     - First port
+#       portListTo       - Last port
+#
+########################################################################################
+proc ixCreateSortedPortList {portListFrom portListTo excludePortList} \
+{
+    scan $portListFrom "%d %d %d" fromChassis fromCard fromPort
+    scan $portListTo "%d %d %d" toChassis toCard toPort
+    set sortMap {}
+
+    for {set c $fromChassis} {$c <= $toChassis} {incr c} {
+        if [chassis get $c] {
+            errorMsg "Chassis ID $c has not been added to chassis chain."
+            continue
+        }
+
+        set maxCardsInChassis   [chassis cget -maxCardCount]
+
+        if {$c == $fromChassis} {
+            set firstCard   $fromCard
+        } else {
+            set firstCard   1
+        }
+        if {$c == $toChassis} {
+            if {$maxCardsInChassis < $toCard} {
+                set currLastCard    $maxCardsInChassis
+            } else {
+                set currLastCard    $toCard
+            }
+        } else {
+            set currLastCard    $maxCardsInChassis
+        }
+
+        for {set l $firstCard} {$l <= $currLastCard} {incr l} {
+            if [card get $c $l] {
+                ixPuts "Error getting card $l on chassis $c"
+                return 1
+            }
+            set numports    [card cget -portCount]
+            if {$numports == 0} {
+                continue
+            }
+
+            if {($c == $fromChassis) && ($l == $fromCard)} {
+                set firstPort   $fromPort
+            } else {
+                set firstPort   1
+            }
+
+            if {($c == $toChassis) && ($l == $toCard)} {
+                if {$numports < $toPort} {
+                    set currLastPort    $numports
+                } else {
+                    set currLastPort    $toPort
+                }
+            } else {
+                set currLastPort    [card cget -portCount]
+            }
+
+            for {set p $firstPort} {$p <= $currLastPort} {incr p} {
+                if {[lsearch $excludePortList "$c $l $p"] != -1} {
+                    continue
+                }
+                set sortMap [lappend sortMap [list $c $l $p]]
+            }
+        }
+    }
+    return $sortMap
+}
+
+
+########################################################################################
+#  Procedure : ixPuts
+#
+#  Description:  This command is similar to "puts" except that it has an update command
+# so that the output queue gets flushed and the message gets printed immediately. In
+# Window 95/NT platform, the "puts" command does not print the messages rightaway.
+#
+#  Arguments :
+#       args - Message to display
+#
+########################################################################################
+proc ixPuts {args} \
+{
+    catch {
+        if {[lindex $args 0] == "-nonewline"} {
+            set args [lreplace $args 0 0]
+            puts -nonewline [logger cget -ioHandle] [join $args " "]
+        } else {
+            puts [logger cget -ioHandle] [join $args " "]
+        }
+
+        # Reported that the update blocks the display on Solaris using wish8.0
+        # so use update idletasks instead
+        update
+    }
+}
+
+
+########################################################################################
+#  Procedure  :  ixiaPortSetParms
+#
+#  Description:  This procedure sets specific port parameters
+#
+#  Arguments  :  chassis - Chassis ID
+#                card    - Card Number
+#                port    - Port Number
+#                parm    - Parameter to be set
+#                value   - Value to set
+########################################################################################
+proc ixiaPortSetParms {chassis card port parm value} \
+{
+   if [port get $chassis $card $port]  {
+      ixPuts "Error getting port $chassis $card $port from HAL"
+      return 1
+   }
+
+   puts "port config -$parm $value"
+
+   port config -$parm $value
+
+   if [port set $chassis $card $port] {
+      ixPuts "Error setting port $chassis $card $port in HAL"
+      return 1
+   }
+   if [port write $chassis $card $port] {
+      ixPuts "Error writing port $chassis $card $port in Hardware"
+      return 1
+   }
+
+   return 0
+}
+
+
+########################################################################################
+#  Procedure  : ixiaReadWriteMII
+#
+#  Description: This procedure will read/write values from/to the MII <register>
+#               on <ports>.   4 character hex string and Action will be READ or
+#               WRITE.   register will be a value between 0 and 31
+#
+#  Arguments  :
+#      ports     - Represented in Chassis Card Port and can be a list also
+#                  for ex. {1,1,1 1,1,2}
+#      action    - READ or WRITE
+#      register  - Value between 0 and 31
+#      code      - 4 character hex string
+#
+########################################################################################
+
+proc ixiaReadWriteMII {ports action register code} \
+{
+
+  if {($action != "READ") && ($action != "WRITE")} {
+     ixPuts "Error: Action parameter error use READ or WRITE"
+     return 1
+     }
+  if {($register < 0) || ($register > 31)} {
+     ixPuts "Error: register parameter error - valid range between 0 - 31"
+     return 1
+     }
+
+  set retValues {}
+
+  foreach prt $ports {
+     scan $prt "%d %d %d" c l p
+     mii get $c $l $p
+
+     if {$action == "READ"} {
+        set val [mii cget -registerValue]
+        lappend retValues $val
+        }
+
+     mii configure -miiRegister $register
+     mii configure -registerValue $code
+     if {$action == "WRITE"} {
+        if [mii set $c $l $p] {
+           errorMsg "Error setting Mii [getPortId $c $l $p] in HAL."
+           return 1
+        }
+        if [mii write $c $l $p] {
+           errorMsg "Error setting Mii [getPortId $c $l $p] in HAL."
+           return 1
+        }
+     }
+  }
+
+#
+#  This procedure is set up to return a list of MII register values for multiple ports
+#  however if only one port is fed to it then one value will be return.  It works with
+#  either multiple ports or a single port in the $ports list
+#
+  if {$action == "READ"} {
+     return $retValues
+  } else {
+     return 0
+  }
+}
+
+
+########################################################################################
+# Procedure: ixTclSvrConnect
+#
+# Description: This procedure launches the Tcl Server on the chassis for multi-users.
+#
+# Argument(s):
+#       serverName         name of hostnames or IP address of chassis to connect to
+#
+########################################################################################
+proc ixTclSvrConnect { serverName } \
+{
+    return [tclServer::connectToTclServer $serverName errMsg]
+}
+
+
+########################################################################################
+# Procedure: ixTclSvrDisconnect
+#
+# Description: This procedure disconnects from the TclServer socket.
+#
+#
+########################################################################################
+proc ixTclSvrDisconnect {} \
+{
+    return [tclServer::disconnectTclServer]
+}
+
+
+########################################################################
+# Procedure: ixEnableArpResponse
+#
+# This command gets the MAC & IP addresses for that port, sets up the
+# address table and enables the arp response engine for all ports in
+# the portlist
+#
+# Arguments(s):
+#   mapType - either oneIpToOneMAC or manyIpToOneMAC
+#   PortMap - list or array of ports, ie. ixgSortMap
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixEnableArpResponse { mapType PortMap } \
+{
+    upvar $PortMap   portMap
+    return [enableArpResponse $mapType portMap write]
+}
+
+
+########################################################################
+# Procedure: ixEnablePortArpResponse
+#
+# This command gets the MAC & IP addresses for that port, sets up the
+# address table and enables the arp response engine for the specified port
+#
+# Arguments(s):
+#   mapType - either oneIpToOneMAC or manyIpToOneMAC
+#   chassis
+#   lm
+#   port
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixEnablePortArpResponse { mapType chassis lm port {write write}} \
+{
+    return [enablePortArpResponse $mapType $chassis $lm $port $write]
+}
+
+
+########################################################################
+# Procedure: ixDisableArpResponse
+#
+# This command disables the arp response engine for all ports in
+# the portlist
+#
+# Arguments(s):
+#   PortMap - list or array of ports, ie. ixgSortMap
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixDisableArpResponse { PortMap } \
+{
+    upvar $PortMap   portMap
+
+    return [disableArpResponse portMap write]
+}
+
+
+########################################################################
+# Procedure: ixTransmitArpRequest
+#
+# This command transmits an Arp request via the protocol server.
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to transmit
+#                     arp request on
+#
+########################################################################
+proc ixTransmitArpRequest {TxRxArray} \
+{
+    upvar $TxRxArray        txRxArray
+
+    return [transmitArpRequest txRxArray]
+}
+
+
+########################################################################
+# Procedure: ixClearArpTable
+#
+# This command clears the arp table via the protocol server.
+#
+# Arguments:
+#   TxRxArray       - either array or list containing ports to clear
+#                     arp table on
+#
+########################################################################
+proc ixClearArpTable {TxRxArray} \
+{
+    upvar $TxRxArray        txRxArray
+
+    return [clearArpTable txRxArray]
+}
+
+
+########################################################################
+# Procedure: ixDisablePortArpResponse
+#
+# This command disables the arp response engine for the specified port
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixDisablePortArpResponse {chassis lm port {write write}} \
+{
+    return [disablePortArpResponse $chassis $lm $port $write]
+}
+
+
+########################################################################
+# Procedure: ixTransmitPortArpRequest
+#
+# This command transmits an Arp request via the protocol server on a
+# single port
+#
+# Arguments(s):
+#       chassis
+#       lm
+#       port
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixTransmitPortArpRequest {chassis lm port} \
+{
+    return [transmitPortArpRequest $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixClearPortArpTable
+#
+# This command clears the arp table on a single port
+#
+# Arguments(s):
+#       chassis
+#       lm
+#       port
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixClearPortArpTable {chassis lm port} \
+{
+    return [clearPortArpTable $chassis $lm $port]
+}
+
+########################################################################
+# Procedure: ixSetPacketGroupMode
+#
+# This command sets all the RX ports in the list or array to packet
+# group mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixSetPacketGroupMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray    txRxArray
+
+    return [setPacketGroupMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortPacketGroupMode
+#
+# This command sets all the RX ports for this port to packet
+# group mode
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#   write           - write port to hw
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixSetPortPacketGroupMode {chassis lm port {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        errorMsg $txRxArray
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [setPacketGroupMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixSetAutoDetectInstrumentationMode
+#
+# This command sets all the RX ports in the list or array to 
+# all the autoinstrumentation modes PG/DataIntegrity/SequenceChecking
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixSetAutoDetectInstrumentationMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray    txRxArray
+
+    return [setAutoDetectInstrumentationMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortAutoDetectInstrumentationMode
+#
+# This command sets all the RX ports for this port to 
+# all the autoinstrumentation modes PG/DataIntegrity/SequenceChecking
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#   write           - write port to hw
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixSetPortAutoDetectInstrumentationMode {chassis lm port {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        errorMsg $txRxArray
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [setAutoDetectInstrumentationMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+########################################################################
+# Procedure: ixSetWidePacketGroupMode
+#
+# This command sets all the RX ports in the list or array to wide packet
+# group mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixSetWidePacketGroupMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray    txRxArray
+
+    return [setWidePacketGroupMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortWidePacketGroupMode
+#
+# This command sets all the RX ports for this port to wide packet
+# group mode
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#   write           - write port to hw
+#
+# Return:
+#       0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixSetPortWidePacketGroupMode {chassis lm port {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        errorMsg $txRxArray
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [setWidePacketGroupMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixSetCaptureMode
+#
+# This command sets all the RX ports in the list or array to capture
+# mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc ixSetCaptureMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [setCaptureMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortCaptureMode
+#
+# This command sets receive mode for the specified port to capture mode
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#   write           - write port to hw
+#
+########################################################################
+proc ixSetPortCaptureMode {chassis lm port {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        errorMsg $txRxArray
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [setCaptureMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixSetTcpRoundTripFlowMode
+#
+# This command sets all the RX ports in the list or array to tcp round 
+# trip flow mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc ixSetTcpRoundTripFlowMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [setTcpRoundTripFlowMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortTcpRoundTripFlowMode
+#
+# This command sets receive mode for the specified port to tcp round 
+# trip flow mode
+#
+# Arguments(s):
+#   c        - chassis
+#   l        - card
+#   p        - port
+#   write   - write port to hw
+#
+########################################################################
+proc ixSetPortTcpRoundTripFlowMode {c l p {write nowrite}} \
+{
+    set retCode 0
+
+    if [catch {format "%d,%d,%d" $c $l $p} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode 1
+    } else {
+        set retCode [setTcpRoundTripFlowMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixSetDataIntegrityMode
+#
+# This command sets all the RX ports in the list or array to Data Integrity 
+# mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc ixSetDataIntegrityMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [setDataIntegrityMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortDataIntegrityMode
+#
+# This command sets receive mode for the specified port to Data Integrity 
+# mode
+#
+# Arguments(s):
+#   c        - chassis
+#   l        - card
+#   p        - port
+#   write   - write port to hw
+#
+########################################################################
+proc ixSetPortDataIntegrityMode {c l p {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $c $l $p} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [setDataIntegrityMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+########################################################################
+# Procedure: ixSetPrbsMode
+#
+# This command sets all the RX ports in the list or array to Prbs mode 
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc ixSetPrbsMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [setPrbsMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortPrbsMode
+#
+# This command sets receive mode for the specified port to Prbs mode 
+#
+# Arguments(s):
+#   c        - chassis
+#   l        - card
+#   p        - port
+#   write   - write port to hw
+#
+########################################################################
+proc ixSetPortPrbsMode {c l p {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $c $l $p} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [setPrbsMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixSetSequenceCheckingMode
+#
+# This command sets all the TX ports in the list or array to Sequence
+# Checking Mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of RX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc ixSetSequenceCheckingMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [setSequenceCheckingMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortSequenceCheckingMode
+#
+# This command sets receive mode for the specified port to Sequence
+# Checking Mode
+#
+# Arguments(s):
+#   c        - chassis
+#   l        - card
+#   p        - port
+#   write   - write port to hw
+#
+########################################################################
+proc ixSetPortSequenceCheckingMode {c l p {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $c $l $p} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [setSequenceCheckingMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixSetPacketFlowMode
+#
+# This command sets all the TX ports in the list or array to packet
+# flow mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc ixSetPacketFlowMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [setPacketFlowMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortPacketFlowMode
+#
+# This command sets specified port to packet flow mode
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#   write           - write port to hw
+#
+########################################################################
+proc ixSetPortPacketFlowMode {c l p {write nowrite}} \
+{
+    set retCode 0
+
+    if [catch {format "%d,%d,%d" $c $l $p} txRxArray] {
+        logMsg "ixSetPortPacketFlowMode: $txRxArray"
+        set retCode 1
+    } else {
+        set retCode [setPacketFlowMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixSetPacketStreamMode
+#
+# This command sets all the TX ports in the list or array to packet
+# stream mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc ixSetPacketStreamMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [setPacketStreamMode txRxArray $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortPacketStreamMode
+#
+# This command sets specified port to packet stream mode
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#   write           - write port to hw
+#
+########################################################################
+proc ixSetPortPacketStreamMode {chassis lm port {write nowrite}} \
+{
+    set retCode 0
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        logMsg "ixSetPortPacketStreamMode: $txRxArray"
+        set retCode 1
+    } else {
+        set retCode [setPacketStreamMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixSetAdvancedStreamSchedulerMode
+#
+# This command sets all the TX ports in the list or array to packet
+# flow mode
+#
+# Arguments(s):
+#   TxRxArray       - list or array of TX ports to change
+#   write           - write ports to hw as they are modified
+#
+########################################################################
+proc ixSetAdvancedStreamSchedulerMode {TxRxArray {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [changePortTransmitMode txRxArray $::portTxModeAdvancedScheduler $write]
+}
+
+
+########################################################################
+# Procedure: ixSetPortAdvancedStreamSchedulerMode
+#
+# This command sets specified port to packet flow mode
+#
+# Arguments(s):
+#   chassis
+#   lm
+#   port
+#   write           - write port to hw
+#
+########################################################################
+proc ixSetPortAdvancedStreamSchedulerMode {c l p {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $c $l $p} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [setAdvancedStreamSchedulerMode txRxArray $write]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixWritePortsToHardware
+#
+# This command writes the ports, including speed, etc into hardware. It
+# differs from writeConfigToHardware because this command writes all
+# the phy as well as the configuration.
+#
+# Argument(s):
+#    PortArray      either list of ports or array of ports
+#    args           options include:
+#                   -verbose             <turn on messages>
+#                   -noVerbose           <turn off messages, default>
+#                   -writeProtocolServer <stops protocol server & writes 
+#                                         all associated objects, default>
+#                   -noProtocolServer    <no effect on protocol server,
+#                                         doesn't update protocol server objects>
+#
+########################################################################
+proc ixWritePortsToHardware {PortArray args} \
+{
+    upvar $PortArray portArray
+
+    return [writePortsToHardware portArray [join [list -noVerbose $args]]]
+}
+
+
+########################################################################
+# Procedure: ixWriteConfigToHardware
+#
+# This command writes the port array into hardware
+#
+# Argument(s):
+#    PortArray      either list of ports or array of ports
+#    args           options include:
+#                   -verbose             <turn on messages>
+#                   -noVerbose           <turn off messages, default>
+#                   -writeProtocolServer <stops protocol server & writes 
+#                                         all associated objects, default>
+#                   -noProtocolServer    <no effect on protocol server,
+#                                         doesn't update protocol server objects>
+#
+########################################################################
+proc ixWriteConfigToHardware {PortArray args} \
+{
+    upvar $PortArray portArray
+
+    return [writeConfigToHardware portArray [join [list -noVerbose $args]]]
+}
+
+
+########################################################################
+# Procedure: ixCheckTransmitDone
+#
+# This command polls the TX rate counters & returns when done transmitting
+#
+# Argument(s):
+#    PortArray                either list of ports or array of ports
+#
+########################################################################
+proc ixCheckTransmitDone {PortArray} \
+{
+    upvar $PortArray portArray
+
+    return [checkAllTransmitDone portArray]
+}
+
+
+########################################################################
+# Procedure: ixCheckPortTransmitDone
+#
+# This command polls the TX rate counters & returns the number of frames
+# transmitted
+#
+# Argument(s):
+#    chassis        chassis ID
+#    lm            Load Module number
+#    port        port number
+#
+########################################################################
+proc ixCheckPortTransmitDone {chassis lm port} \
+{
+    return [checkTransmitDone $chassis $lm $port]
+}
+
+
+########################################################################
+# Procedure: ixCheckLinkState
+#
+# This command checks the link state of all ports in parallel and labels
+# the ones that are down. Then it polls the links that are down for two
+# seconds and returns 1 if any port is still down and a 0 if all ports are
+# up.
+#
+# Arguments(s):
+#    PortArray    array or list of ports, ie, ixgSortMap
+#
+########################################################################
+proc ixCheckLinkState {PortArray {message messageOn}} \
+{
+    upvar $PortArray portArray
+
+    return [checkLinkState portArray]
+}
+
+
+########################################################################
+# Procedure: ixCheckPPPState
+#
+# This command checks the PPP state of all PoS ports in parallel and labels
+# the ones that are down. Then it polls the links that are down for two
+# seconds and returns 1 if any port is still down and a 0 if all ports are
+# up.
+#
+# Arguments(s):
+#    PortArray    array or list of ports, ie, ixgSortMap
+#
+########################################################################
+proc ixCheckPPPState {PortArray {message messageOn}} \
+{
+    upvar $PortArray portArray
+
+    return [checkPPPState portArray $message]
+}
+
+
+
+########################################################################
+# Procedure: ixCollectStats
+#
+# This command polls the RX counters for the specified stat
+#
+# Argument(s):
+#   rxList          - list of receive ports
+#   statName        - name of stat to poll (need cget name)
+#   RxNumFrames     - array containing the returned rx stats
+#   TotalRxFrames   - total received frames
+#
+########################################################################
+proc ixCollectStats {rxList statName RxNumFrames TotalRxFrames} \
+{
+    upvar $RxNumFrames        rxNumFrames
+    upvar $TotalRxFrames    totalRxFrames
+
+    return [collectStats $rxList $statName rxNumFrames totalRxFrames]
+}
+
+
+########################################################################################
+# Procedure:   ixProxyConnect
+#
+# Description: This command connects to the proxy server...
+#
+# Argument(s):
+#    tclServer   - The name of the machine that is running an ixTclServer to connect with
+#    chassisList - The list of hostnames or IP addresses of chassis in a chain
+#    cableLen    - The choice of the cable length between chassis.  Defaults to cable3feet is not given
+#    logFilename - The name of the file for the test logs output
+#
+# Returns:
+#    0 : if no error
+#    1 : if error connecting to chassis
+#    2 : if version mismatch
+#    3 : if chassis timeout occurred
+#    4 : if connection interrupted by user
+#    5 : if error connecting to Tcl server
+########################################################################################
+proc ixProxyConnect {tclServer chassisList {cableLen cable3feet} {logFilename ""}} \
+{
+    # Default return code to no error found
+    set retCode 0
+
+    if {[ixTclHal::isCleanUpDone]} {
+        debugMsg "ixProxyConnect: package req IxTclHal"
+        package req IxTclHal
+    }
+
+    if {[info exists logFilename] && ([string length $logFilename] > 0)} {
+        logOn $logFilename
+    }
+
+    if {[isUNIX]} {
+        set retCode [ixConnectToTclServer $tclServer]
+        if {$retCode == 1} {
+            # We need to change the return code, because it conflicts with the code from ixConnectToChassis
+            set retCode 5
+        }
+    }
+    if {$retCode == 0} {
+        set retCode [ixConnectToChassis $chassisList $cableLen]
+    }
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixResetSequenceIndex 
+#
+# This command reset the sequence index
+#
+# Argument(s):
+#    PortArray                either list of ports or array of ports
+#
+########################################################################
+proc ixResetSequenceIndex {PortArray} \
+{
+    upvar $PortArray portArray
+
+    return [resetSequenceIndex portArray]
+}
+
+
+########################################################################
+# Procedure:   ixResetPortSequenceIndex 
+#
+# Description: This command reset sequence index on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Return:      0 if OK, 1 if port not configured
+########################################################################
+proc ixResetPortSequenceIndex  {chassis lm port} \
+{
+    return [resetPortSequenceIndex $chassis $lm $port]
+}
+
+
+
+########################################################################
+# Procedure:   ixRestartAutoNegotiation
+#
+# Description: This command restarts auto negotiation
+#
+# Arguments:
+#    TxRxArray - either list of ports or array of ports
+#                     
+# Returns:     The return code from restartAutoNegotiation
+########################################################################
+proc ixRestartAutoNegotiation {TxRxArray} \
+{
+    upvar $TxRxArray      txRxArray
+
+    return [restartAutoNegotiation txRxArray]
+}
+
+########################################################################
+# Procedure:   ixRestartPortAutoNegotiation
+#
+# Description: This command restarts auto negotiation
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Returns:     The return code from restartAutoNegotiation
+########################################################################
+proc ixRestartPortAutoNegotiation {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [restartAutoNegotiation txRxArray]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure:   ixRestartPPPNegotiation
+#
+# Description: This command restarts PPP negotiation 
+#
+# Arguments:
+#    TxRxArray - either list of ports or array of ports
+#                     
+# Returns:     The return code from restartAutoNegotiation
+########################################################################
+proc ixRestartPPPNegotiation {TxRxArray} \
+{
+    upvar $TxRxArray      txRxArray
+
+    set allPorts [getAllPorts txRxArray]
+
+    ixStopTransmit allPorts
+    return [restartAutoNegotiation txRxArray]
+}
+
+
+########################################################################
+# Procedure:   ixRestartPortPPPNegotiation
+#
+# Description: This command restarts PPP negotiation 
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Returns:     The return code from restartAutoNegotiation
+########################################################################
+proc ixRestartPortPPPNegotiation {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode $::TCL_ERROR
+    } else {
+        ixStopPortTransmit $chassis $lm $port
+        set retCode [restartAutoNegotiation txRxArray]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure:   ixSimulatePhysicalInterfaceUp
+#
+# Description: This command simulates physical interface up on a port list
+#
+# Arguments:
+#    TxRxArray - either list of ports or array of ports
+#                     
+# Returns:     The return code from simulatePhysicalInterfaceUp
+########################################################################
+proc ixSimulatePhysicalInterfaceUp {TxRxArray} \
+{
+    upvar $TxRxArray      txRxArray
+
+    return [simulatePhysicalInterfaceUp txRxArray]
+}
+
+
+
+########################################################################
+# Procedure:   ixSimulatePortPhysicalInterfaceUp
+#
+# Description: This command simulates physical interface down on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Returns:     The return code from simulatePhysicalInterfaceUp
+########################################################################
+proc ixSimulatePortPhysicalInterfaceUp {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [simulatePhysicalInterfaceUp txRxArray]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure:   ixSimulatePhysicalInterfaceDown
+#
+# Description: This command simulates physical interface down on a port list
+#
+# Arguments:
+#    TxRxArray - either list of ports or array of ports
+#                     
+# Returns:     The return code from simulatePhysicalInterfaceDown
+########################################################################
+proc ixSimulatePhysicalInterfaceDown {TxRxArray} \
+{
+    upvar $TxRxArray      txRxArray
+
+    return [simulatePhysicalInterfaceDown txRxArray]
+}
+
+
+
+########################################################################
+# Procedure:   ixSimulatePortPhysicalInterfaceDown
+#
+# Description: This command simulates physical interface down on a single port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#
+# Returns:     The return code from simulatePhysicalInterfaceDown
+########################################################################
+proc ixSimulatePortPhysicalInterfaceDown {chassis lm port} \
+{
+    set retCode $::TCL_OK
+
+    if [catch {format "%d,%d,%d" $chassis $lm $port} txRxArray] {
+        errorMsg "$txRxArray"
+        set retCode $::TCL_ERROR
+    } else {
+        set retCode [simulatePhysicalInterfaceDown txRxArray]
+    }
+
+    return $retCode
+}
+
+
+
+##################################################################################
+# Procedure:   ixIsOverlappingIpAddress  
+#
+# Description: Check if IP addresses are overlapping.
+#
+# Arguments:   ipAddress1  - first IP address to compare to
+#              count1      - number of IP addresses starting from ipAddress1 to compare to
+#              ipAddress2  - first IP address to compare to
+#              count2      - number of IP addresses starting from ipAddress2 to compare to
+#
+# Returns:     1 - $::true
+#              0 - $::false
+#
+##################################################################################
+proc ixIsOverlappingIpAddress {ipAddress1 count1 ipAddress2 count2} \
+{
+    return [dataValidation::isOverlappingIpAddress $ipAddress1 $count1 $ipAddress2 $count2]
+}
+
+
+##################################################################################
+# Procedure:   ixIsSameSubnet   
+#
+# Description: Check if ip addresses are in the same subnet.
+#              Note that all ports in one user porfile should be in same subnet.
+#
+# Arguments:   ipAddr1 - ipAddress to compare to
+#              mask1   - net mask of ipAddr1
+#              ipAddr2 - ipAddress to compare to
+#              mask2   - net mask of ipAddr2
+#
+# Returns:     1 - $::true
+#              0 - $::false
+#
+##################################################################################
+proc ixIsSameSubnet {ipAddr1 mask1 ipAddr2 mask2} \
+{
+    return [dataValidation::isSameSubnet $ipAddr1 $mask1 $ipAddr2 $mask2]
+}
+
+
+##################################################################################
+# Procedure:   ixIsValidHost   
+#
+# Description: Check if the host part of an IP address is not all 0's or all 1's assuming
+#              its net mask is valid.
+#
+# Arguments:   ipAddr - ipAddress
+#              mask   - net mask
+#
+# Returns:     1 - $::true
+#              0 - $::false
+#
+##################################################################################
+proc ixIsValidHost {ipAddr mask} \
+{
+    return [dataValidation::isValidHostPart $ipAddr $mask]
+}
+
+
+##################################################################################
+# Procedure:   ixIsValidNetMask   
+#
+# Description: Check if net mask is valid. i.e. In binary form, the mask must 
+#              have consecutive 1's followed by consecutive 0's
+#
+# Arguments:   mask - net mask
+#
+# Returns:     1 - $::true
+#              0 - $::false
+#
+##################################################################################
+proc ixIsValidNetMask {mask} \
+{
+    return [dataValidation::isValidNetMask $mask]
+}
+
+
+##################################################################################
+# Procedure:   ixIsValidUnicastIp   
+#
+# Description: Check if ipAddress accomplied with the following
+#                   1) it is not 0.0.0.0
+#                   2) it is not 255.255.255.255
+#                   3) it is not loopback address (127.x.x.x)
+#                   4) it is not multicast address 
+#                      (224.0.0.0 - 239.255.255.255, i.e first 4 bits not 1110)
+#
+# Arguments:   ipAddr - IP address 
+#
+# Returns:     1 - $::true
+#              0 - $::false
+#
+##################################################################################
+proc ixIsValidUnicastIp {ipAddr} \
+{
+    return [dataValidation::isValidUnicastIp $ipAddr]
+}
+
+
+##################################################################################
+# Procedure:   ixConvertFromSeconds   
+#
+# Description: Convert seconds to hours, minutes, seconds
+#
+# Arguments:   seconds
+#               Hours   - returned
+#               Minutes - returned
+#               Seconds - returned
+#
+# Returns:     $::TCL_OK or $::TCL_ERROR
+#
+##################################################################################
+proc ixConvertFromSeconds {time Hours Minutes Seconds} \
+{
+    upvar $Hours   hours
+    upvar $Minutes minutes
+    upvar $Seconds seconds
+
+    return [convertFromSeconds $time hours minutes seconds]
+}
+
+
+##################################################################################
+# Procedure:   ixConvertToSeconds   
+#
+# Description: Convert time in hours:minutes:seconds format to seconds
+#
+# Arguments:   hours    - number of hours of time
+#              minutes  - number of minutes of time
+#              seconds  - number of seconds of time
+#
+# Returns:     number of seconds
+#
+##################################################################################
+proc ixConvertToSeconds {hours minutes seconds} \
+{
+    return [convertToSeconds $hours $minutes $seconds]
+}
+
+
+########################################################################
+# Procedure: ixEnablePortIntrinsicLatencyAdjustment
+#
+# This command enables the  Intrinsic Latency Adjustment on the ports
+# that support the feature
+#
+# Arguments(s):
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixEnablePortIntrinsicLatencyAdjustment { chassId cardId portId enable {write nowrite}} \
+{
+	set portList [list [list $chassId $cardId $portId]]
+    return [enableIntrinsicLatencyAdjustment portList $enable $write]
+}
+
+########################################################################
+# Procedure: ixEnableIntrinsicLatencyAdjustment
+#
+# This command enables the  Intrinsic Latency Adjustment on the ports
+# that support the feature
+#
+# Arguments(s):
+#
+# Return:
+#	0 if OK, 1 if port not configured
+#
+########################################################################
+proc ixEnableIntrinsicLatencyAdjustment { TxRxArray enable {write nowrite}} \
+{
+    upvar $TxRxArray txRxArray
+
+    return [enableIntrinsicLatencyAdjustment txRxArray $enable $write]
+}
+
+
+
+########################################################################
+# Procedure: ixIsIntrinsicLatencyAdjustmentEnabled
+#
+# This command returns the true if the  Intrinsic Latency is enabled
+#
+# Arguments(s):
+#
+# Return:
+#	1 if enabled, 0 if not
+#
+########################################################################
+proc ixIsIntrinsicLatencyAdjustmentEnabled { chassId cardId portId} \
+{
+    return [isIntrinsicLatencyAdjustmentEnabled $chassId $cardId $portId]
+}
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/interface.tcl b/dep/tclclient/ixTcl1.0/Generic/interface.tcl
new file mode 100644
index 00000000..0e786f41
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/interface.tcl
@@ -0,0 +1,262 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: interface.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+# Revision Log:
+# 01-23-1998    DS      Genesis
+#
+# Description: This is the main configuration interface file for all the commands.
+# If new commands or paramters are to be added, only this file needs to be updated.
+# The actual files containing the commands do not have to be touched.
+# The "config" commands contain all configurable parameters, that is,
+# read-write. The "cget parameters" are read-only. "cget" can be used to store
+# default values which the user cannot change.
+#
+# Included in this file are the user config params that are generic for all tests.
+#
+##################################################################################
+
+
+##################################################################################
+
+# A list containing all the commands. Used to display them when "help"
+# command is given
+#
+# **********NOTE*************
+# Update this list whenever a new command is added or an old one deleted.
+
+set allCommands {{Commands              Description} \
+                 {--------              ----------------------------------------------------------------------------} \
+                 {advancedTestParameter Configure advanced test parameters} \
+                 {fastpath              Configure fastpath configuration parameters} \
+                 {ipfastpath            Configure ipfastpath configuration parameters (deprecated)} \
+                 {learn                 Configure learn frames} \
+                 {logger                Configure and enable logging to files} \
+                 {map                   Configure the transmit and receive Chassis.Card.Port traffic mapping} \
+                 {tclClient             Configure the tclClient parameters} \
+                 {testProfile           Configure test parameters} }
+
+
+##################################
+# COMMAND: advancedTestParameter
+##################################
+proc initCommand_zz_advancedTestParameter {} \
+{
+    defineCommand registerCommand   advancedTestParameter
+
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   dialogState         -defaultValue normal             -validValues {normal iconic destroyedByUser}
+
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   maxConnectRetries   -defaultValue 3
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   streamPatternType   -defaultValue repeat             -validValues {incrByte incrWord decrByte decrWord patternTypeRandom repeat nonRepeat}
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   streamDataPattern   -defaultValue x00010203          -validValues {dataPatternRandom allOnes allZeroes xAAAA x5555 x7777 xDDDD xF0F0 x0F0F xFF00FF00 x00FF00FF xFFFF0000 x0000FFFF x00010203 x00010002 xFFFEFDFC xFFFFFFFE userpattern}
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   streamFrameType     -defaultValue {08 00}
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   streamPattern       -defaultValue {}
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   l2DataProtocol      -defaultValue {native}           -validValues {native ethernetII ip}
+    
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipProtocol          -defaultValue udp
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipFragment          -defaultValue may                -validValues {may dont}
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipLastFragment      -defaultValue last               -validValues {last more}
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   ipFragmentOffset    -defaultValue 0   
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipDelay             -defaultValue normalDelay        -validValues {normalDelay lowDelay}
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipThroughput        -defaultValue normalThruput      -validValues {normalThruput highThruput}
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipReliability       -defaultValue normalReliability  -validValues {normalReliability highReliability}
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   ipIdentifier        -defaultValue 0
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipCost              -defaultValue normalCost         -validValues {normalCost lowCost}
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipOptions           -defaultValue {}
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   ipTTL               -defaultValue 10              
+    
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   ipV6HopLimit        -defaultValue 255              
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   ipV6FlowLabel       -defaultValue 0              
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   ipV6TrafficClass    -defaultValue 3
+    
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   udpSourcePort       -defaultValue 7
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   udpDestPort         -defaultValue 7
+    
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   tcpSourcePort       -defaultValue 0     
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   tcpDestPort         -defaultValue 0
+
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   igmpReportMode      -defaultValue igmpReportToAllWhenQueried  -validValues {igmpReportToOneWhenQueried igmpReportToAllWhenQueried igmpReportToAllUnsolicited}
+    
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   ipxPacketType           -defaultValue typeIpx
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   vlanCFI                 -defaultValue resetCFI                -validValues {resetCFI setCFI}
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   removePortOnLinkDown    -defaultValue false
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   linkStateTimeout        -defaultValue 25
+    defineCommand registerParameter -command advancedTestParameter -type string  -parameter   savedTerminationOption  -defaultValue return                  -validValues {return exit}
+    defineCommand registerParameter -command advancedTestParameter -type double  -parameter   percentLossFormat       -defaultValue 7.3
+    defineCommand registerParameter -command advancedTestParameter -type double  -parameter   defaultFloatFormat      -defaultValue 12.3
+    defineCommand registerParameter -command advancedTestParameter -type boolean -parameter   verifyAllArpReply       -defaultValue false                    -validValues {true false}
+    defineCommand registerParameter -command advancedTestParameter -type boolean -parameter   useRxVlanId             -defaultValue true                    
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   dutDelay                -defaultValue 100
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   numAddressesPerPort     -defaultValue 1
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   octetToIncr             -defaultValue 4              
+    defineCommand registerParameter -command advancedTestParameter -type boolean -parameter   closeAllFilesInCleanUp  -defaultValue false
+    defineCommand registerParameter -command advancedTestParameter -type boolean -parameter   removeStreamsAtCompletion -defaultValue false
+    defineCommand registerParameter -command advancedTestParameter -type boolean -parameter   stopProcessesOnEarlyTermination -defaultValue false
+
+    defineCommand registerParameter -command advancedTestParameter -type boolean -parameter   primeDut                -defaultValue false
+    defineCommand registerParameter -command advancedTestParameter -type integer -parameter   portWriteChunkSize      -defaultValue 0               -validRange {0 1000}
+}
+
+
+##################################
+# COMMAND: fastpath
+##################################
+proc initCommand_zz_fastpath {} \
+{
+    defineCommand registerCommand   fastpath
+
+    # rate is in fps
+    defineCommand registerParameter -command fastpath -parameter    rate              -type integer -defaultValue 100   -validRange {1 2000000000}
+    defineCommand registerParameter -command fastpath -parameter    numframes         -type integer -defaultValue 10    -validRange {1 2000000000}
+    defineCommand registerParameter -command fastpath -parameter    framesize         -type integer -defaultValue 64    -validRange {12 2000000000}
+    defineCommand registerParameter -command fastpath -parameter    enable            -type boolean -defaultValue false
+    defineCommand registerParameter -command fastpath -parameter    calculateLatency  -type boolean -defaultValue no
+    defineCommand registerParameter -command fastpath -parameter    waitTime          -type integer -defaultValue 2000  -validRange {1 2000000000}
+}
+
+
+##################################
+# COMMAND: ipfastpath
+##################################
+proc initCommand_zz_ipfastpath {} \
+{
+    defineCommand registerCommand   ipfastpath
+
+    # rate is in fps
+    defineCommand registerParameter -command ipfastpath -parameter    rate              -type integer -defaultValue 100     -validRange {1 2000000000}
+    defineCommand registerParameter -command ipfastpath -parameter    numframes         -type integer -defaultValue 10      -validRange {1 2000000000}
+    defineCommand registerParameter -command ipfastpath -parameter    framesize         -type integer -defaultValue 64      -validRange {12 2000000000}
+    defineCommand registerParameter -command ipfastpath -parameter    enable            -type boolean -defaultValue false
+    defineCommand registerParameter -command ipfastpath -parameter    calculateLatency  -type boolean -defaultValue no
+    defineCommand registerParameter -command ipfastpath -parameter    waitTime          -type integer -defaultValue 2000    -validRange {1 2000000000}
+}
+
+
+##################################
+# COMMAND: learn
+##################################
+proc initCommand_zz_learn {} \
+{
+    defineCommand registerCommand   learn
+
+    defineCommand registerParameter -command learn -parameter when           -type string  -defaultValue oncePerFramesize -validValues {never once oncePerTest oncePerFramesize onIteration onTrial}
+    defineCommand registerParameter -command learn -parameter rate           -type integer -defaultValue 100            -validRange  {1 2000000000};# fps
+    defineCommand registerParameter -command learn -parameter numframes      -type integer -defaultValue 10			    -validRange  {1 2000000000}
+    defineCommand registerParameter -command learn -parameter retries        -type integer -defaultValue 20
+    defineCommand registerParameter -command learn -parameter type           -type string  -defaultValue default        -validValues {default mac ip ipx ipV6}
+    defineCommand registerParameter -command learn -parameter numDHCPframes  -type integer -defaultValue 1
+    defineCommand registerParameter -command learn -parameter framesize      -type integer -defaultValue 64             -validRange  {64 2000000000}
+    defineCommand registerParameter -command learn -parameter removeOnError  -type boolean -defaultValue false
+    defineCommand registerParameter -command learn -parameter snoopConfig    -type boolean -defaultValue false
+    defineCommand registerParameter -command learn -parameter duration       -type integer -defaultValue 0
+    defineCommand registerParameter -command learn -parameter waitTime       -type integer -defaultValue 1000           -validRange  {1 2000000000}
+    defineCommand registerParameter -command learn -parameter dhcpWaitTime   -type integer -defaultValue 2              -validRange  {1 200}     ;# seconds
+
+    # this command has been obsoleted, just around for backwards compatibility
+    defineCommand registerParameter -command learn -parameter errorAction    -type string  -defaultValue deprecated     -validValues {deprecated continue remove}
+}
+
+
+##################################
+# COMMAND: logger
+# General logger parameters
+##################################
+proc initCommand_zz_logger {} \
+{
+    global LOGS_DIR
+
+    defineCommand registerCommand   logger
+
+    defineCommand registerParameter -command logger -parameter fileBackup  -type boolean -defaultValue false
+    defineCommand registerParameter -command logger -parameter logFileName -type string  -defaultValue "defaultFile.log"
+    defineCommand registerParameter -command logger -parameter directory   -type string  -defaultValue $LOGS_DIR
+    defineCommand registerParameter -command logger -parameter startTime   -type string
+    defineCommand registerParameter -command logger -parameter endTime     -type string
+    defineCommand registerParameter -command logger -parameter fileID      -type string  -defaultValue stdout -access r
+    defineCommand registerParameter -command logger -parameter ioHandle    -type string  -defaultValue stdout
+
+    defineCommand registerMethod    logger on
+    defineCommand registerMethod    logger off
+    defineCommand registerMethod    logger message     priority
+}
+
+
+##################################
+# COMMAND: map
+# Traffic mapping configuration commands
+##################################
+proc initCommand_zz_map {} \
+{
+    defineCommand registerCommand   map
+
+    defineCommand registerParameter -command map -parameter echo -type boolean -defaultValue false
+    defineCommand registerParameter -command map -parameter type -type string  -defaultValue one2one                                  -validValues {one2one one2many many2one many2many}
+
+    defineCommand registerMethod    map new    {type}
+    defineCommand registerMethod    map add    {txChassis txLm txPort rxChassis rxLm rxPort}
+    defineCommand registerMethod    map del    {txChassis txLm txPort rxChassis rxLm rxPort}
+}
+
+
+##################################
+# COMMAND: tclClient
+##################################
+proc initCommand_zz_tclClient {} \
+{
+    defineCommand registerCommand   tclClient
+
+    defineCommand registerParameter -command tclClient -parameter enableStdout  -type boolean -defaultValue false
+    defineCommand registerParameter -command tclClient -parameter enableResults -type boolean -defaultValue true
+}
+
+
+##################################
+# COMMAND: advancedTestParameter
+##################################
+proc initCommand_zz_testProfile {} \
+{
+    defineCommand registerCommand   testProfile
+
+    defineCommand registerParameter -command testProfile -type string -parameter   chassisChain    -defaultValue {loopback}
+    defineCommand registerParameter -command testProfile -type string -parameter   serverName      -defaultValue ""
+    defineCommand registerParameter -command testProfile -type string -parameter   chassisID       -defaultValue {1}
+    defineCommand registerParameter -command testProfile -type string -parameter   syncCableLength -defaultValue {cable3feet}
+    defineCommand registerParameter -command testProfile -type string -parameter   chassisSequence -defaultValue {1}
+    defineCommand registerParameter -command testProfile -type string -parameter   timeSource      -defaultValue {tsInternal}
+    defineCommand registerParameter -command testProfile -type string -parameter   sntpAddress     -defaultValue ""
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/interfaceTableUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/interfaceTableUtils.tcl
new file mode 100644
index 00000000..ecc959d5
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/interfaceTableUtils.tcl
@@ -0,0 +1,850 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: interfaceTableUtils.tcl
+#
+# Copyright ©  IXIA
+# All Rights Reserved.
+#
+# Revision Log:
+# 2002/07/09
+#
+# Description: Utilities for maintaining the Inteface Table.
+#
+##################################################################################
+
+namespace eval interfaceTable {
+}
+
+########################################################################
+# Procedure:    setDefault
+#
+# Arguments:    None
+#
+# Returns:      TCL_OK
+#
+########################################################################
+proc interfaceTable::setDefault {PortArray} \
+{
+    upvar $PortArray portArray
+
+    interfaceIpV6       setDefault
+    interfaceIpV4       setDefault
+    interfaceEntry      setDefault
+
+    foreach portMap [getAllPorts portArray] {
+        scan $portMap "%d %d %d" c l p
+        interfaceTable select $c $l $p
+        interfaceTable clearAllInterfaces
+        interfaceEntry clearAllItems $::addressTypeIpV4
+        interfaceEntry clearAllItems $::addressTypeIpV6
+    }
+
+    return $::TCL_OK
+}
+
+########################################################################
+# Procedure:    configurePort
+#
+# Description:  Given a port, configure the interface table 
+#               with information stored in the port, ip and ipV6 objects.
+#
+# Arguments(s): chassis
+#               card
+#               port
+#               protocolList:   list of protocols to configure (default is all)
+#               write:          write or noWrite (default)
+#
+# Return:       TCL_OK or TCL_ERROR
+#
+########################################################################
+proc interfaceTable::configurePort "chassis card port {protocolList {$::ipV4 $::ipV6}} {numInterfaces 1} {write nowrite} {reset true}" \
+{
+    set portList [list [list $chassis $card $port]]
+    set retCode  [interfaceTable::configure portList $protocolList $numInterfaces $write $reset]
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure:    configure
+#
+# Description:  Given a list of ports, configure the interface table 
+#               with information stored in the port, ip and ipV6 objects.
+#
+# Arguments(s): portList        list of ports to configure
+#               protocolList:   list of protocols to configure (default is all)
+#               write:          write or noWrite (default)
+#
+# Return:       TCL_OK or TCL_ERROR
+#
+# NOTE:         This currently only builds one ipV6 table entry per port, however
+#               in future implementations it needs the capability to do multiple
+#               interfaces per port.
+#
+########################################################################
+proc interfaceTable::configure "PortList {protocolList {$::ipV4 $::ipV6}} {numInterfaces 1} {write nowrite} {reset true}" \
+{
+    set retCode $::TCL_OK
+    
+    upvar $PortList portList
+
+    if {$reset == "true"} {
+        setDefault portList
+    }
+
+    foreach port $portList {
+
+        scan $port "%d %d %d" c l p
+        if {[port get $c $l $p]} {
+            errorMsg "Error: Unable to get port: $c $l $p"
+            set retCode $::TCL_ERROR
+            break
+        }
+
+        if {![interfaceTable select $c $l $p]} {
+            if {[addEntry $c $l $p $protocolList $numInterfaces]} {
+                set retCode $::TCL_ERROR
+                break
+            }
+
+        } else {
+            set retCode $::TCL_ERROR
+            break
+        }
+    }
+
+    if {$retCode == $::TCL_OK} {
+        set lowerWrite [string tolower $write]
+        if {[stringCompare $lowerWrite "write"] == 0} {
+            set retCode [writeConfigToHardware portList]
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: addEntry
+#
+# Description:  Build and save an entry into the interface table with 
+#               information stored in the port, ip and ipV6 objects.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               protocolList:   list of protocols to configure
+#
+# Return:       TCL_OK or TCL_ERROR
+#
+########################################################################
+proc interfaceTable::addEntry "chassis card port {protocolList {$::ipV4 $::ipV6}} {numInterfaces 1} " \
+{
+    eval array set protocolFunctions \{ \
+        $::ipV4    interfaceTable::updateItemIpV4 \
+        $::ipV6    interfaceTable::updateItemIpV6 \
+    \}
+
+    set retCode $::TCL_OK
+
+    # If the interface already exists, then update it.
+    if {![interfaceTable getInterface [interfaceTable::formatEntryDescription $chassis $card $port]]} {
+        set retCode [updateEntry $chassis $card $port $protocolList]
+        
+    # Else, add new interface entry.
+    } else {
+
+        interfaceEntry setDefault
+        
+        # Build IPv4/IPv6 Entries.
+        set message ""
+        
+        set sourceIpAddr [ip cget -sourceIpAddr]
+        
+        # Build & Save General Entry.
+        
+        set portMacAddress  [port cget -MacAddress]
+        interfaceEntry config -description          [formatEntryDescription $chassis $card $port]
+        interfaceEntry config -macAddress           [port cget -MacAddress]
+        interfaceEntry config -enable               $::true
+        
+        for {set interfaceCount 0 } { $interfaceCount < $numInterfaces} { incr interfaceCount} {
+        
+            if {[vlanUtils::isPortTagged $chassis $card $port]} {
+                if {[protocol cget -enable802dot1qTag]} {
+                    if {![vlan get $chassis $card $port]} {
+                        interfaceEntry config -enableVlan       $::true
+                        interfaceEntry config -vlanId           [vlan cget -vlanID]
+                    } else {
+                        errorMsg "Error getting vlan parameters for $chassis $card $port"
+                        set retCode $::TCL_ERROR
+                    }
+                }
+            }
+            foreach protocol $protocolList {        
+                if {[info exists protocolFunctions($protocol)]} {
+                    set retCode [eval $protocolFunctions($protocol) $chassis $card $port message $interfaceCount]
+                }                    
+            } 
+        
+            if {[interfaceTable addInterface ]} {
+                errorMsg "Error: Unable to add interface to Interface Table for port: $chassis $card $port."
+                set retCode $::TCL_ERROR
+            }
+        
+            # Don't change the following order, otherwise the configuratin will be lost
+            interfaceEntry config -description          [formatEntryDescription $chassis $card $port]
+            interfaceEntry config -enable               $::true
+            incrMacAddress portMacAddress 1
+            interfaceEntry config -macAddress           $portMacAddress
+            set sourceIpAddr [incrIpField $sourceIpAddr 4]
+            ip config -sourceIpAddr         $sourceIpAddr       
+        }
+        
+        interfaceEntry clearAllItems $::addressTypeIpV4
+        interfaceEntry clearAllItems $::addressTypeIpV6
+    }
+     
+    return $retCode
+}
+
+
+
+########################################################################
+# Procedure: updateEntry
+#
+# Description:  Modify an existing entry and re-save (actually, delete and
+#               re-add) the entry.
+#
+#               In it's current state, this method doesn't handle multiple
+#               entries per interface.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               protocolList:   list of protocols to configure
+#
+# Return:       TCL_OK or TCL_ERROR
+#
+########################################################################
+proc interfaceTable::updateEntry "chassis card port {protocolList {$::ipV4 $::ipV6}}" \
+{
+    eval array set protocolFunctions \{ \
+        $::ipV4    interfaceTable::updateItemIpV4 \
+        $::ipV6    interfaceTable::updateItemIpV6 \
+    \}
+
+    set retCode $::TCL_ERROR
+
+    foreach protocol $protocolList {        
+        if {$protocol == $::ipV4} {
+            set addressType $::addressTypeIpV4
+            if {![interfaceEntry getFirstItem $addressType]} {
+                interfaceEntry delItem $addressType [interfaceIpV6 cget -ipAddress]
+            }
+        } else {
+            set addressType $::addressTypeIpV6
+            if {![interfaceEntry getFirstItem $addressType]} {
+                interfaceEntry delItem $addressType [interfaceIpV6 cget -ipAddress]
+            }
+        }
+        set retCode [eval $protocolFunctions($protocol) $chassis $card $port message]
+    }
+
+    if {$retCode == $::TCL_OK} {
+        if {![interfaceTable delInterface]} {
+            if {[interfaceTable addInterface]} {
+                set retCode [interfaceTable write]
+            }
+        }
+    }
+    
+    return $retCode
+}
+
+########################################################################
+# Procedure:    updateIpItemV4
+#
+# Description:  Updates the IPv4 entry of the interface table.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+
+# Return:       TCL_OK or TCL_ERROR
+#
+########################################################################
+proc interfaceTable::updateItemIpV4 {chassis card port Message {incrByte 0}} \
+{               
+    set retCode $::TCL_OK
+    
+    upvar $Message message
+    set message ""
+
+    if {![ip get $chassis $card $port]} {
+        interfaceIpV4 setDefault
+        set sourceIpAddr [ip cget -sourceIpAddr]
+        interfaceIpV4 config -ipAddress         [incrIpField $sourceIpAddr 4 $incrByte]
+        interfaceIpV4 config -gatewayIpAddress  [ip cget -destDutIpAddr]
+		interfaceIpV4 config -maskWidth			[getIpV4MaskWidth [ip cget -sourceIpMask]]
+
+        if {[interfaceEntry addItem $::addressTypeIpV4]} {
+            set retCode $::TCL_ERROR
+            set message "Error: Unable to add IPv4 Item for port $chassis $card $port"
+        } 
+
+     } else {
+        set retCode $::TCL_ERROR
+        set message "Error: Unable to get IP for port $chassis $card $port"
+    }
+        
+
+    return $retCode
+}
+
+########################################################################
+# Procedure:    updateIpItemV6
+#
+# Description:  Updates the IPv6 entry of the interface table.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#
+# Return:       TCL_OK or TCL_ERROR
+#
+########################################################################
+proc interfaceTable::updateItemIpV6 {chassis card port Message {numInterfaces 1} } \
+{
+    set retCode $::TCL_OK
+
+    upvar $Message message
+    set message ""
+
+    if {![ipV6 get $chassis $card $port]} {
+
+        interfaceIpV6 setDefault
+        interfaceIpV6 config -maskWidth        [ipV6 cget -sourceMask]
+        interfaceIpV6 config -ipAddress        [ipV6 cget -sourceAddr]
+
+        if {[interfaceEntry addItem $::addressTypeIpV6]} {
+            set retCode $::TCL_ERROR
+            set message "Error: Unable to add IPv6 Item for port $chassis $card $port"
+        }
+
+    } else {
+        set retCode $::TCL_ERROR
+        set message "Error: Unable to get IPv6 for port $chassis $card $port"
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: addEntries
+#
+# Description:  Build and save an entries into the interface table with 
+#               information stored in the port, ip V4, and vlan objects.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               protocolList:   list of protocols to configure
+#               numInterfaces   not used.  It is only for compatibility with addEntry proc
+#
+# Return:       TCL_OK or TCL_ERROR
+#
+########################################################################
+proc interfaceTable::addMultipleEntry "chassis card port {protocolList {$::ipV4}} {numInterfaces 1} " \
+{
+    eval array set protocolFunctions \{ \
+        $::ipV4    interfaceTable::addItemIpV4 \
+    \}
+
+    set retCode $::TCL_OK
+
+    interfaceEntry setDefault
+
+    # Build IPv4/IPv6 Entries.
+    set message ""
+
+    set sourceIpAddr [ip cget -sourceIpAddr]
+    set destDutIpAddr [ip cget -destDutIpAddr]
+    set octetToIncr [advancedTestParameter cget -octetToIncr]
+    set incrGateway no
+
+    if {[vlanUtils::isPortTagged $chassis $card $port] && [protocol cget -enable802dot1qTag]} {
+        set vlanSupport 1
+        if {![vlan get $chassis $card $port]} {
+            set vlanId  [vlan cget -vlanID]
+            set numInterfaces [vlan cget -repeat]
+            set incrGateway yes
+        } else {
+            errorMsg "Error getting vlan parameters for $chassis $card $port"
+            set retCode $::TCL_ERROR
+        }
+    } else {
+        set vlanSupport 0
+        set numInterfaces 1
+    }
+
+    # Build & Save General Entry.
+    set portMacAddress  [port cget -MacAddress]
+    interfaceEntry config -description          [formatEntryDescription $chassis $card $port]
+    interfaceEntry config -macAddress           [port cget -MacAddress]
+    interfaceEntry config -enable               $::true
+
+    for {set interfaceCount 0 } { $interfaceCount < $numInterfaces} { incr interfaceCount} {
+
+        if {$vlanSupport} {
+            interfaceEntry config -enableVlan       $::true
+            interfaceEntry config -vlanId           $vlanId
+            incr vlanId                                  
+        }
+        foreach protocol $protocolList {        
+            if {[info exists protocolFunctions($protocol)]} {
+                set retCode [eval $protocolFunctions($protocol) $chassis $card $port message \
+                                                                $octetToIncr $interfaceCount $incrGateway]
+            }                    
+        } 
+
+        if {[interfaceTable addInterface ]} {
+            errorMsg "Error: Unable to add interface to Interface Table for port: $chassis $card $port."
+            set retCode $::TCL_ERROR
+        }
+
+        # Don't change the following order, otherwise the configuratin will be lost
+        interfaceEntry config -description          [formatEntryDescription $chassis $card $port]
+        interfaceEntry config -enable               $::true
+        incrMacAddress portMacAddress               1
+        interfaceEntry config -macAddress           $portMacAddress    
+    }   
+    
+    interfaceEntry clearAllItems $::addressTypeIpV4
+     
+    return $retCode
+}
+
+
+########################################################################
+# Procedure:    interfaceTable
+#
+# Description:  Create new IPv4 entry of the interface table.  The IP source and gateway
+#                address is based on the sourceIpAddr and destDutIpAddr fields of the ip 
+#                command with the adjustments specified by "octetToIncr" and "incrValue"  
+#                parameters.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               octetToIncr - octet of the IP address to increment
+#               incrValue    - the number to increment
+#
+# Return:       TCL_OK or TCL_ERROR
+#
+########################################################################
+proc interfaceTable::addItemIpV4 {chassis card port Message {octetToIncr 3} {incrValue 0} {incrGateway no}}\
+{               
+    set retCode $::TCL_OK
+    
+    upvar $Message message
+    set message ""
+
+    if {![ip get $chassis $card $port]} {
+        interfaceIpV4 setDefault
+        set sourceIpAddr [ip cget -sourceIpAddr]  
+        interfaceIpV4 config -ipAddress         [incrIpField $sourceIpAddr $octetToIncr $incrValue]
+        set destDutIpAddr [ip cget -destDutIpAddr]
+        if {$incrGateway == "yes"} {
+            interfaceIpV4 config -gatewayIpAddress  [incrIpField $destDutIpAddr $octetToIncr $incrValue]
+        } else {
+            interfaceIpV4 config -gatewayIpAddress $destDutIpAddr
+        }
+		interfaceIpV4 config -maskWidth			[getIpV4MaskWidth [ip cget -sourceIpMask]]
+
+        if {[interfaceEntry addItem $::addressTypeIpV4]} {
+            set retCode $::TCL_ERROR
+            set message "Error: Unable to add IPv4 Item for port $chassis $card $port"
+        } 
+
+     } else {
+        set retCode $::TCL_ERROR
+        set message "Error: Unable to get IP for port $chassis $card $port"
+     }       
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure:    formatEntryDescription
+#
+# Description:  TBD.  
+#
+#               Currently, this procedure builds a description in the format
+#               of "card:port".  This will need to change later when 
+#               multiple interfaces are allowed per port.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               identifier: true/false: Prepend count id to description.
+#
+# Return:       Entry Description
+#
+########################################################################
+proc interfaceTable::formatEntryDescription {chassis card port {identifier "false"}} \
+{
+    set retValue {}
+
+    if {$identifier == "false"} {
+        set retValue [format "%02d:%02d" $card $port]
+#        set retValue [format "%02d:%02d ProtocolInterface" $card $port]
+    } else {
+        set id [getInterfaceCount $chassis $card $port]
+        set retValue [format "%d-%02d:%02d ProtocolInterface" $id $card $port]
+    }
+
+    return "$retValue"
+}
+
+########################################################################
+# Procedure:    getInterfaceId
+#
+# Description:  Given a port # and a MAC address, return the interface id.
+#               defined for that port.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               ipAddress:  Ip address associated with port interface,
+#                           if null, the id of the first interface is
+#                           returned.
+#
+# Return:       interface id
+#
+########################################################################
+proc interfaceTable::getInterfaceId {chassis card port {macAddress ""}} \
+{
+    set retValue 0
+
+    if {![interfaceTable select $chassis $card $port]} {
+
+        if {[string length $macAddress] == 0} {
+            if {![interfaceTable getFirstInterface]} {
+                set retValue [interfaceEntry cget -description]
+            }
+
+        } else {
+            if {![interfaceTable getFirstInterface]} {
+                set interfaceMacAddress [interfaceEntry cget -macAddress]
+                if {[stringCompare $macAddress $interfaceMacAddress] == 0} {
+                    set retValue [interfaceEntry cget -description]
+                } else {
+                    while {![interfaceTable getNextInterface]} {
+                        set interfaceMacAddress [interfaceEntry cget -macAddress]
+                        if {[stringCompare $macAddress $interfaceMacAddress] == 0} {
+                            set retValue [interfaceEntry cget -description]
+                            break
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    return $retValue
+}
+
+
+########################################################################
+# Procedure:    getInterfaceCount
+#
+# Description:  Given a port number, return the number of interfaces
+#               defined for that port.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#
+# Return:       # of interfaces
+#
+########################################################################
+proc interfaceTable::getInterfaceCount {chassis card port} \
+{
+    set retValue 0
+
+    if {![interfaceTable select $chassis $card $port]} {
+        if {![interfaceTable getFirstInterface]} {
+            incr retValue
+            while {![interfaceTable getNextInterface]} {
+                incr retValue
+            }
+        }
+    }
+    return $retValue
+}
+
+########################################################################
+# Procedure:    enableInterface
+#
+# Description:  Given a port number and interface Id, enable the interface.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               interfaceId:    See format returned by [formatEntryDescription]
+#
+# Return:       ::TCL_OK or ::TCL_ERROR
+#
+########################################################################
+proc interfaceTable::enableInterface {chassis card port interfaceId} \
+{
+    set retCode $::TCL_ERROR
+
+    if {![interfaceTable select $chassis $card $port]} {
+        if {![interfaceTable getInterface $interfaceId]} {
+            interfaceEntry config -enable true
+            interfaceTable write
+            set retCode $::TCL_OK
+        }
+    }
+    return $retCode
+}
+
+########################################################################
+# Procedure:    disableInterface
+#
+# Description:  Given a port number and interface Id, disable the interface.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               interfaceId:    See format returned by [formatEntryDescription]
+#
+# Return:       ::TCL_OK or ::TCL_ERROR
+#
+########################################################################
+proc interfaceTable::disableInterface {chassis card port interfaceId} \
+{
+    set retCode $::TCL_ERROR
+
+    if {![interfaceTable select $chassis $card $port]} {
+        if {![interfaceTable getInterface $interfaceId]} {
+            interfaceEntry config -enable false
+            interfaceTable write
+            set retCode $::TCL_OK
+        }
+    }
+    return $retCode
+}
+
+########################################################################
+# Procedure:    disableAllInterfaces
+#
+# Description:  Given a port number, disable the interfaces on that port.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#
+# Return:       ::TCL_OK or ::TCL_ERROR
+#
+########################################################################
+proc interfaceTable::disableAllInterfaces {chassis card port} \
+{
+    set retCode $::TCL_ERROR
+
+    if {![interfaceTable select $chassis $card $port]} {
+        if {![interfaceTable getFirstInterface]} {
+            interfaceEntry config -enable false
+            set retCode $::TCL_OK
+            while {![interfaceTable getNextInterface]} {
+                interfaceEntry config -enable false
+            }
+            interfaceTable write
+        }
+    }
+    return $retCode
+}
+
+########################################################################
+# Procedure:    deleteInterface
+#
+# Description:  Given a port number and interface Id, disable the interface.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               interfaceId:    See format returned by [formatEntryDescription]
+#
+# Return:       ::TCL_OK or ::TCL_ERROR
+#
+########################################################################
+proc interfaceTable::deleteInterface {chassis card port interfaceId} \
+{
+    set retCode $::TCL_ERROR
+
+    if {![interfaceTable select $chassis $card $port]} {
+        if {![interfaceTable getInterface $interfaceId]} {
+            interfaceTable delInterface
+            interfaceTable write
+            set retCode $::TCL_OK
+        }
+    }
+    return $retCode
+}
+
+########################################################################
+# Procedure:    getEntryList
+#
+# Description:  Given a port number and interface Id return a list
+#               of all entries in that interface.  Really just a debugging
+#               tool that I left in because I thought if might be useful.
+#
+# Arguments(s): chassis 
+#               card
+#               port
+#               interfaceId:    See format returned by [formatEntryDescription]
+#               typeList:       list of address types desired, default is all:
+#                                   addressTypeIpV4, addressTypeIpV6
+#
+# Return:       ::TCL_OK or ::TCL_ERROR
+#
+########################################################################
+proc interfaceTable::getEntryList "chassis card port interfaceId {typeList {$::addressTypeIpV4 $::addressTypeIpV6}}" \
+{
+    set interfaceList [list]
+
+    if {![interfaceTable select $chassis $card $port]} {
+
+        if {![interfaceTable getInterface $interfaceId]} {
+
+            foreach typeId $typeList {
+                if {![interfaceEntry getFirstItem $typeId]} {
+
+                    switch $typeId "
+                        $::addressTypeIpV4 {
+                            set command interfaceIpV4
+                        }
+                        $::addressTypeIpV6 {
+                            set command interfaceIpV6
+                        }
+                    "
+                    lappend interfaceList [eval $command cget -ipAddress]
+                    while {![interfaceEntry getNextItem $typeId]} {
+                        lappend interfaceList [eval $command cget -ipAddress]
+                    }
+                }                   
+            }                   
+        }
+    }
+
+    return $interfaceList
+}
+
+
+########################################################################
+# Procedure:    getGatewayList
+#
+# Description:  Given a port number, this proc returns a list of all gateway 
+#               entries in that port.  
+# Arguments(s): chassis 
+#               card
+#               port
+#               typeList:       list of address types desired, default is all:
+#                                   addressTypeIpV4, addressTypeIpV6
+#
+# Return:       ::TCL_OK or ::TCL_ERROR
+#
+########################################################################
+proc interfaceTable::getGatewayArray "GatewayArray portList {typeList {$::addressTypeIpV4 $::addressTypeIpV6}}" \
+{
+    upvar $GatewayArray gatewayArray
+
+    foreach txMap $portList {
+        scan $txMap "%d %d %d" c l p
+        set gatewayArray($c,$l,$p) [list]
+
+        if {![interfaceTable select $c $l $p]} {
+
+            if {![interfaceTable getFirstInterface]} {
+
+                foreach typeId $typeList {
+                    if {![interfaceEntry getFirstItem $typeId]} {
+
+                        switch $typeId "
+                            $::addressTypeIpV4 {
+                                set command interfaceIpV4
+                            }
+                            $::addressTypeIpV6 {
+                                set command interfaceIpV6
+                            }
+                        "
+                        lappend gatewayArray($c,$l,$p) [eval $command cget -gatewayIpAddress]
+            
+                        while {![interfaceEntry getNextItem $typeId]} {
+                            lappend gatewayArray($c,$l,$p) [eval $command cget -gatewayIpAddress]
+                        }
+                    }                   
+                }                   
+            }
+
+            while {![interfaceTable getNextInterface]} {
+                foreach typeId $typeList {
+                    if {![interfaceEntry getFirstItem $typeId]} {
+
+                        switch $typeId "
+                            $::addressTypeIpV4 {
+                                set command interfaceIpV4
+                            }
+                            $::addressTypeIpV6 {
+                                set command interfaceIpV6
+                            }
+                        "
+                        lappend gatewayArray($c,$l,$p) [eval $command cget -gatewayIpAddress]
+                        while {![interfaceEntry getNextItem $typeId]} {
+                            lappend gatewayArray($c,$l,$p) [eval $command cget -gatewayIpAddress]
+                        }
+                    }                   
+                }
+            }                 
+        }
+    }
+
+}
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/ipV6Utils.tcl b/dep/tclclient/ixTcl1.0/Generic/ipV6Utils.tcl
new file mode 100644
index 00000000..50e1d0d4
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/ipV6Utils.tcl
@@ -0,0 +1,1479 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: ipV6Utils.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#   Description:    This file contains utilities for manipulating IPv6 addresses.
+#
+#	Revision Log:
+#	Date		Author				Comments
+#	-----------	-------------------	--------------------------------------------
+#	2002/05/16  D. Heins-Gelder     Initial release 
+#
+##################################################################################
+
+#   Procedure List
+#
+#    convertAddress
+#    convertIpToIpV6
+#    convertIpV6ToIp
+#    convertIpV6ToMac
+#    convertMacToIpV6
+#    convertNoop
+#    expandAddress
+#    getAddressFieldOffset
+#    getAddressFields
+#    getFieldListByPrefix
+#    getFieldMask 
+#    getFieldNamesByPrefix 
+#    getFormatPrefix 
+#    getHeaderLength 
+#    getInterfaceId 
+#    getLoopbackAddress
+#    getMinimumValidFramesize
+#    getNextLevelAggregateId
+#    getSiteLevelAggregateId
+#    getSubnetId
+#    getTopLevelAggregateId
+#    host2addr
+#    incrIpField
+#    isMixedVersionAddress
+#    isReservedMCAddress
+#    isValidAddress
+#    validateAddress
+
+namespace eval ipv6 {
+
+    variable ipV6AddressSize            128
+    variable ipV4AddressSize            32
+    variable macAddressSize             48
+
+    # IPv6 Addresses can be mixed with Ipv4 address as: 66:66:66:66:66:66:444.444.444.444
+    #   In this case the first 6 segements are the hex V6 address, the lower 4 segment are
+    #   decimal V4 address (traditional format).  For example: 
+    #
+    #       fffe:0000:0a3d:0001:0dce:1234:192.168.10.1
+
+    # Known IPv6 addresses.
+    variable addressUnspecified         ::0
+    variable addressLoopback            ::1
+    variable addressTest                03ff:e0::00
+    variable addressUnicastLinkLocal    fe80::00
+    variable addressUnicastSiteLocal    fec0::00
+    variable addressIsatap              00005efe
+
+    #
+    # Multicast addresses
+    #
+    variable addressMulticast           ff::00
+    variable addressMulticastAllNodes   [list     \
+                                        ff:01::01 \
+                                        ff:02::01 ]
+
+    variable addressMulticastAllRouters [list   ff:01::02 \
+                                                ff:02::02 \
+                                                ff:05::02]
+    # Well known multicast addresses
+	variable reservedMCAddressList
+    set reservedMCAddressList			[list \
+                                        ff01:0000:0000:0000:0000:0000:0000:0001 \
+                                        ff01:0000:0000:0000:0000:0000:0000:0002 \
+                                        ff02:0000:0000:0000:0000:0000:0000:0001 \
+                                        ff02:0000:0000:0000:0000:0000:0000:0002 \
+                                        ff02:0000:0000:0000:0000:0000:0000:0003 \
+										ff02:0000:0000:0000:0000:0000:0000:0004	\
+                                        ff02:0000:0000:0000:0000:0000:0000:0005 \
+                                        ff02:0000:0000:0000:0000:0000:0000:0006 \
+                                        ff02:0000:0000:0000:0000:0000:0000:0007 \
+                                        ff02:0000:0000:0000:0000:0000:0000:0008 \
+                                        ff02:0000:0000:0000:0000:0000:0000:0009 \
+                                        ff02:0000:0000:0000:0000:0000:0000:000a \
+                                        ff02:0000:0000:0000:0000:0000:0000:000b \
+                                        ff02:0000:0000:0000:0000:0000:0000:000c \
+                                        ff02:0000:0000:0000:0000:0000:0000:000d \
+                                        ff02:0000:0000:0000:0000:0000:0000:000e \
+										ff02:0000:0000:0000:0000:0000:0001:0001	\
+										ff02:0000:0000:0000:0000:0000:0001:0002	\
+										ff05:0000:0000:0000:0000:0000:0000:0002	\
+										ff05:0000:0000:0000:0000:0000:0001:0003	\
+										ff05:0000:0000:0000:0000:0000:0001:0004	]
+	# The reservedMCAddressList also contains addresses in the following range
+	# ff02:0000:0000:0000:0000:0001:FFXX:XXXX  where X is a place holder for a variable scope value
+	# ff05:0000:0000:0000:0000:0000:0001:1000 to ff05:0000:0000:0000:0000:0000:0001:13FF
+
+    variable fieldNames                 {topLevelAggregationId nextLevelAggregationId siteLevelAggregationId subnetId interfaceId}
+
+    variable fieldListByPrefix
+    eval array set fieldListByPrefix    \{ \
+		$::ipV6Reserved                 \{interfaceId\} \
+		$::ipV6NSAPAllocation           \{interfaceId\} \
+		$::ipV6IPXAllocation            \{interfaceId\} \
+        $::ipV6GlobalUnicast            \{topLevelAggregationId reserved nextLevelAggregationId siteLevelAggregationId interfaceId\} \
+        $::ipV6LinkLocalUnicast         \{interfaceId\} \
+        $::ipV6SiteLocalUnicast         \{subnetId interfaceId \} \
+        $::ipV6UserDefined              \{interfaceId topLevelAggregationId nextLevelAggregationId siteLevelAggregationId subnetId\} \
+    \}
+
+    variable fieldNamesByPrefix
+    eval array set fieldNamesByPrefix   \{ \
+		$::ipV6Reserved                 \{\"Interface Id\"\} \
+		$::ipV6NSAPAllocation           \{\"Interface Id\"\} \
+		$::ipV6IPXAllocation            \{\"Interface Id\"\} \
+        $::ipV6GlobalUnicast            \{\"Interface Id\" \"Top-Level Aggregation Id\" \"Next-Level Aggregation Id\" \"Site-Level Aggregation Id\"\} \
+        $::ipV6SiteLocalUnicast         \{\"Interface Id\" \"Subnet Id\"\} \
+        $::ipV6LinkLocalUnicast         \{\"Interface Id\"\} \
+        $::ipV6UserDefined              \{\"Interface Id\" \"Top-Level Aggregation Id\" \"Next-Level Aggregation Id\" \"Site-Level Aggregation Id\" \"Subnet Id\"\} \
+    \}
+
+
+
+    variable  fieldPositions
+    array set fieldPositions {
+        prefix                          4
+        topLevelAggregationId           16
+        nextLevelAggregationId          48
+        siteLevelAggregationId          64
+        subnetId                        64
+        interfaceId                     128
+		groupId							128							
+    }
+
+    variable  fieldOffsets
+    array set fieldOffsets {
+        prefix                          0
+        topLevelAggregationId           0
+        nextLevelAggregationId          3
+        siteLevelAggregationId          6
+        subnetId                        6
+        interfaceId                     8
+    }
+
+    variable  fieldMasks
+    array set fieldMasks {
+        prefix                  0xE0000000000000000000000000000000
+        topLevelAggregationId   0x1FFF0000000000000000000000000000
+        nextLevelAggregationId  0x000000FFFFFF00000000000000000000
+        siteLevelAggregationId  0x000000000000FFFF0000000000000000
+        subnetId                0x000000000000FFFF0000000000000000
+        interfaceId             0x0000000000000000FFFFFFFFFFFFFFFF
+		groupId					0xFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+    }
+
+}   
+
+########################################################################################
+#
+#   Conversion Utilities
+#   
+########################################################################################
+
+########################################################################################
+#
+# Procedure:        ipv6::host2addr
+#
+# Description:      Given an IPv6 address, expand it, then return a string of hex
+#                   characters (similar function to host2addr for IPv4 in utils.tcl)
+#
+# Argument(s):      address:    Ipv6 address (any acceptable IPv6 format)
+#               
+# Returns:          hex byte string, for example:
+#                       ffe1::1 becomes
+#                       ff e1 00 00 00 00 00 00 00 00 00 00 00 00 00 01
+#
+#                       ffe1:ffff:eeee:dddd:cccc:bbbb:aaaa:0001 becomes
+#                       ff e1 ff ff ee ee dd dd cc cc bb bb aa aa 00 01
+#
+########################################################################################
+proc ipv6::host2addr {address} \
+{
+    variable ipV6AddressSize
+    set bytes {}
+
+    if {[isValidAddress $address]        || \
+        [isMixedVersionAddress $address]  } {
+
+        set address [expandAddress $address]
+        
+        set length [expr $ipV6AddressSize / 8]
+        regsub -all ":" $address {} address
+        for {set i 0} {$i < $length} {incr i} {
+            lappend bytes [string range   $address 0 1]
+            set address   [string replace $address 0 1]
+        }
+    }
+
+    return $bytes
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::expandAddress
+#
+# Description:      Expand and IPv6 address from it's compressed form (RFC 2373, section
+#                   2.1 & 2.2) to a full 16 byte address delimited by colons:
+#
+#                   Handles the following:
+#                       
+#                   1. Zeros compression operator ::
+#                           ::1 becomes
+#                           0000:0000:0000:0000:0000:0000:0000:0001 
+#
+#                           fffe::1 becomes
+#                           fffe:0000:0000:0000:0000:0000:0000:0001
+#
+#                   2. Mixed IPv4 and IPv6 Address:
+#                           0:0:0:0:0:0:192.168.10.1 becomes
+#                           0000:0000:0000:0000:0000:0000:C0a8:0a01
+#
+# Argument(s):      address:    compressed ipv6 address
+#               
+# Returns:          expanded address
+#
+########################################################################################
+proc ipv6::expandAddress {address} \
+{
+    variable ipV6AddressSize
+    variable ipV4AddressSize
+
+    set retValue    {}
+    set segments    8
+
+    if {[isValidAddress $address]} {
+
+        # Convert IPv4 address to Hex.
+        if {[isMixedVersionAddress $address]} {
+            set end [expr [llength [split $address :]] - 1]
+            set ipv4Address [lindex [split $address :] $end]
+            regsub "$ipv4Address" $address {} address
+            regsub -all {(.*)\.(.*)\.(.*)\.(.*)} $ipv4Address \
+                {[format "%02x%02x:%02x%02x" \1 \2 \3 \4]} ipv4Address
+            set ipv4Address [subst $ipv4Address]
+            append address $ipv4Address
+        }
+
+        # Check for Zero Compression operator, if found split into before and after.
+        set segmentsBefore {}
+        set segmentsAfter  $address
+        
+        regexp {(.*)::(.*)} $address result segmentsBefore segmentsAfter
+        
+        #
+        # Fill in the zeroes needed to expand.
+        set segmentsBefore [split $segmentsBefore :]
+        set segmentsAfter  [split $segmentsAfter  :]
+        set segmentsNeeded [expr  $segments - ([llength $segmentsBefore] + [llength $segmentsAfter])]
+        set segmentList "$segmentsBefore [string repeat " 0" $segmentsNeeded] $segmentsAfter"
+        
+        # Build it back into a list as the expanded address in 8 segments (2 bytes each).
+        set expandedAddress [list]
+        foreach segment $segmentList {
+            lappend expandedAddress [format "%04x" 0x$segment]
+        }
+        set retValue [join $expandedAddress :]
+    }
+                    
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::compressAddress
+#
+# Description:  
+#
+# Argument(s):
+#               
+# Returns:
+#
+########################################################################################
+proc ipv6::compressAddress { address } \
+{
+    regsub -all {(:0{1,3})+} $address ":" stripZeros
+    regsub {(:0)+} $stripZeros ":" dc
+    if {[string index $dc end] == ":"} {
+        set num_colons [regsub -all {:} $dc " " dc_ignore]
+        if {$num_colons < 7} {
+            append dc :0
+        } else  {
+            append dc 0
+        }
+    }
+    regsub {^(0{1,3})(.*):(.*)} $dc {\2:\3} dc
+    return $dc
+}
+
+
+########################################################################################
+#
+# Procedure:        ipv6::convertAddress
+#
+# Description:      Converts from one type of address to another:
+#                       mac     -> ipv4 invalid
+#                       mac     -> ipv6
+#                       ipv4    -> ipv6
+#                       ipv4    -> mac  invalid
+#                       ipv6    -> mac  (returns lower 6 bytes)
+#                       ipv6    -> ipv4 (returns lower 4 bytes)
+#
+# Argument(s):      address:        mac or ip address (version 4 or 6)
+#                                       mac format: 00:00:00:00:00:00 (hex)
+#                                       ip format:  000.000.000.000 (decimal)        
+#                                       ipv6 format:  0000:0000:0000:0000:0000:0000:0000:0000
+#
+#                   sourceType:     ip, ipV6, mac
+#                   destType:       ip, ipV6, mac
+#                   args:           prefix if destType = ipv6 (must be fully expanded prefix)
+#
+# Returns:          converted address
+#
+########################################################################################
+proc ipv6::convertAddress {address sourceType destType {args ""}} \
+{
+    set retValue {}
+
+    array set conversion {
+        mac,ip              ipv6::convertNoop
+        mac,ipV6            ipv6::convertMacToIpV6      
+        ip,mac              ipv6::convertNoop
+        ip,ipV6             ipv6::convertIpToIpV6
+        ip,isatap           ipv6::convertIpToIsatap
+        ip,ipV4Compatible   ipv6::convertIptoIpV4Compatible
+        ip,6to4             ipv6::convertIpTo6to4
+        isatap,ip           ipv6::convertIpV6ToIp
+        ipV4Compatible,ip   ipv6::convertIpV6ToIp
+        6to4,ip             ipv6::convertIpV6ToIp
+        ipV6,mac            ipv6::convertIpV6ToMac   
+        ipV6,ip             ipv6::convertIpV6ToIp    
+    }
+
+    if {[info exists conversion($sourceType,$destType)]} {
+        set command $conversion($sourceType,$destType)
+        if {$command != {}} {
+            set retValue [eval $command $address $args]
+        }
+    }
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::convertMacToIpV6
+#
+# Description:      Converts a MAC address to an IPv6 address.
+#
+# Argument(s):      address:    mac address
+#                   prefix:     defaults to 0
+#               
+# Returns:          converted address
+#
+########################################################################################
+proc ipv6::convertMacToIpV6 {address {prefix 0}} \
+{
+    variable ipV6AddressSize
+    variable macAddressSize
+
+    set retValue {}
+    if {[isMacAddressValid $address] == $::TCL_OK} {
+
+        # Convert the address and prefix to a string of bytes.
+        regsub -all ":" $prefix { } prefixList
+        set prefix {}
+        foreach segment $prefixList {
+            lappend prefix [format "%04X" 0x$segment]
+        }
+        regsub -all " " $prefix "" prefix
+        regsub -all ":" $address {} address
+
+        # Expand if necessary.
+        set prefixLength [expr [string length $prefix]/2]
+        set expand [expr $ipV6AddressSize/8 - $macAddressSize/8 - $prefixLength]
+        for {set i $expand} {$i} {incr i -1} {
+            append prefix "00"
+        }
+        append prefix $address
+
+        # Build prefix-address string into IPv6 style address
+        set address {}
+        while {[string length $prefix] > 0} {
+            append address "[string range $prefix 0 3]:"
+            set prefix [string replace $prefix 0 3]
+        }
+        regexp {(.*):$} $address match address  
+        set retValue $address
+    }            
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::convertIpToIpV6
+#
+# Description:      Converts an IP address to an IPv6 address.
+#
+# Argument(s):      address:    version 4 style IP address
+#                   prefix:     defaults to 0
+#               
+# Returns:          converted address
+#
+########################################################################################
+proc ipv6::convertIpToIpV6 {address {prefix 0} {option addressAtTheEnd}} \
+{
+    variable ipV4AddressSize
+    variable ipV6AddressSize
+
+    set retValue {}
+
+    if {[isIpAddressValid $address]} {
+
+        # Convert prefix to string.
+        regsub -all ":" $prefix { } prefixList
+        set prefix {}
+        foreach segment $prefixList {
+            lappend prefix [format "%04X" "0x$segment"]
+        }
+        regsub -all " " $prefix "" prefix
+        
+        
+        # Convert ip address to string.
+        regsub -all {(.*)\.(.*)\.(.*)\.(.*)} $address \
+            {[format "%02x%02x%02x%02x" \1 \2 \3 \4]} address
+        set address [subst $address]
+        
+        
+        # Expand if necessary.
+        set prefixLength [expr [string length $prefix]/2]
+        set expand [expr $ipV6AddressSize/8 - $ipV4AddressSize/8 - $prefixLength]
+        if {$option == "addressFollowPrefix"} {
+            append prefix $address
+            ### append the rest with 00...01
+            ### because host address cannot be all 0's
+            incr expand -1
+            for {set i $expand} {$i} {incr i -1} {
+                append prefix "00"
+            } 
+            append prefix "01" 
+        } else {
+           for {set i $expand} {$i} {incr i -1} {
+                append prefix "00"
+           }
+           append prefix $address          
+        }
+        
+        # Break it up into IPv6 address seperated by colons.
+        set address {}
+        while {[string length $prefix] > 0} {
+            append address "[string range $prefix 0 3]:"
+            set prefix [string replace $prefix 0 3]
+        }
+        regexp {(.*):$} $address match address            
+        set retValue $address
+    }
+
+    return $retValue
+}
+
+
+########################################################################################
+#
+# Procedure:        ipv6::convertIpToIsatap
+#
+# Description:      Converts an IP address to an IPv6 Isatap address.
+#
+# Argument(s):      address:    version 4 style IP address
+#                   prefix:     defaults to 0
+#               
+# Returns:          converted address
+#
+########################################################################################
+proc ipv6::convertIpToIsatap {address {prefix 0}} \
+{
+    variable ipV4AddressSize
+    variable ipV6AddressSize
+    variable addressIsatap
+
+    set retValue {}
+
+    if {[isIpAddressValid $address]} {
+
+        # Convert prefix to string.
+        regsub -all ":" $prefix { } prefixList
+        set prefix {}
+        foreach segment $prefixList {
+
+            lappend prefix [format "%04X" "0x$segment"]
+        }
+        regsub -all " " $prefix "" prefix
+        
+        # Convert ip address to string.
+        regsub -all {(.*)\.(.*)\.(.*)\.(.*)} $address \
+            {[format "%02x%02x%02x%02x" \1 \2 \3 \4]} address 
+        set address [subst $address]
+        set address [format "%08x%08x" 0x$addressIsatap 0x$address]
+
+        set isatapSize [expr [string length $addressIsatap]/2]
+
+        
+        # Expand if necessary.
+        set prefixLength [expr [string length $prefix]/2]
+        set expand [expr $ipV6AddressSize/8 - $ipV4AddressSize/8 - $prefixLength - $isatapSize]
+        for {set i $expand} {$i} {incr i -1} {
+            append prefix "00"
+        }
+        append prefix $address
+        
+        # Break it up into IPv6 address seperated by colons.
+        set address {}
+        while {[string length $prefix] > 0} {
+            append address "[string range $prefix 0 3]:"
+            set prefix [string replace $prefix 0 3]
+        }
+        regexp {(.*):$} $address match address            
+        set retValue $address
+    }
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::convertIpToIpV4Compatible
+#
+# Description:      Converts an IP address to an IPv6 IPv4 Compatible address.
+#
+# Argument(s):      address:    version 4 style IP address
+#                   prefix:     defaults to 0
+#               
+# Returns:          converted address
+#
+########################################################################################
+proc ipv6::convertIptoIpV4Compatible {address {prefix 0}} \
+{
+    set retValue [convertIpToIpV6 $address $prefix]
+    return $retValue
+}
+
+
+########################################################################################
+#
+# Procedure:        ipv6::convertIpTo6To4
+#
+# Description:      Converts an IP address to an IPv6 6to4 address.
+#
+# Argument(s):      address:    version 4 style IP address
+#                   prefix:     defaults to 2002
+#               
+# Returns:          converted address
+#
+########################################################################################
+proc ipv6::convertIpTo6to4 {address {prefix 2002}} \
+{
+    set retValue [convertIpToIpV6 $address $prefix addressFollowPrefix]
+    return $retValue
+}
+
+
+########################################################################################
+#
+# Procedure:        ipv6::convertIpV6ToMac
+#
+# Description:      Converts an IPv6 address to a MAC.
+#
+# Argument(s):      address:    IpV6 address
+#               
+# Returns:          converted address
+#
+########################################################################################
+proc ipv6::convertIpV6ToMac {address {args ""}} \
+{
+    variable macAddressSize
+    variable ipV6AddressSize
+
+    set retValue {}
+
+    if {[isValidAddress $address]} {
+        set address [expandAddress $address]
+        regsub -all ":" $address {} address
+        
+        set start [expr ($ipV6AddressSize/4) - ($macAddressSize/4)]
+        set end   [expr ($ipV6AddressSize/4) - 1]
+        set byteString [string range $address $start $end]
+        
+        set address {}
+        while {[string length $byteString] > 0} {
+            append address "[string range $byteString 0 1]:"
+            set byteString [string replace $byteString 0 1]
+        }
+        regexp {(.*):$} $address match address            
+        set retValue $address
+    }
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::convertIpV6ToIp
+#
+# Description:      Converts an IPv6 address to an IP address, aka IPv4-Compatible Address.
+#
+# Argument(s):      address:    IPv4 style address (192.168.1.10)
+#               
+# Returns:          converted address
+#
+########################################################################################
+proc ipv6::convertIpV6ToIp {address {args ""}} \
+{
+    variable ipV4AddressSize
+    variable ipV6AddressSize
+
+    set retValue {}
+
+    if {[isValidAddress $address]} {
+        set address [expandAddress $address]
+        regsub -all ":" $address {} address
+        
+        set start [expr ($ipV6AddressSize/4) - ($ipV4AddressSize/4)]
+        set end   [expr ($ipV6AddressSize/4) - 1]
+        set byteString [string range $address $start $end]
+        
+        set address {}
+        while {[string length $byteString] > 0} {
+            lappend address "[string range $byteString 0 1]"
+            set byteString [string replace $byteString 0 1]
+        }
+        regsub -all {(.*) (.*) (.*) (.*)} $address \
+            {[format "%d.%d.%d.%d" 0x\1 0x\2 0x\3 0x\4]} address
+        set address [subst $address]
+        set retValue $address
+    }
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::convertNoop
+#
+# Description:      Place holder, doesn't do any thing
+#
+# Argument(s):      None
+#               
+# Returns:          None
+#
+########################################################################################
+proc ipv6::convertNoop {address {args ""}} \
+{
+}
+
+########################################################################################
+#
+#   Field 'get' Utilities
+#   
+########################################################################################
+
+proc ipv6::getAddressFields {} \
+{
+    variable fieldNames
+    return  $fieldNames
+}
+
+########################################################################
+# Procedure:    getFieldListByPrefix
+#
+# Description:  Given an address, return a list of the valid fields
+#                   for that address type.
+#
+# Argument(s):  ipAddress:  IP address
+#
+# Returns:      field list (enums are interfaceId, subnetID, siteLevelAggregationId,
+#                    nextLevelAggregationId, topLevelAggregationId).
+#
+########################################################################
+proc ipv6::getFieldListByPrefix {address} \
+{
+    variable fieldListByPrefix
+
+    set retValue {}
+
+    if {![ipV6Address decode $address]} {
+        set prefixType [ipV6Address cget -prefixType]
+        if {[info exists fieldListByPrefix($prefixType)]} {
+            set retValue $fieldListByPrefix($prefixType)
+        }
+    }
+    
+    return $retValue    
+}
+
+########################################################################
+# Procedure:    getFieldNamesByPrefix
+#
+# Description:  Given an address, return a list of the field names
+#                   for that address type.
+#
+# Argument(s):  ipAddress:  IP address
+#
+# Returns:      list of field names
+#
+########################################################################
+proc ipv6::getFieldNamesByPrefix {address} \
+{
+    variable fieldNamesByPrefix
+
+    set retValue {}
+
+    if {![ipV6Address decode $address]} {
+        set prefixType [ipV6Address cget -prefixType]
+        if {[info exists fieldNamesByPrefix($prefixType)]} {
+            set retValue $fieldNamesByPrefix($prefixType)
+        }
+    }
+
+    return $retValue    
+}
+
+
+
+
+########################################################################################
+#
+# Procedure:        ipv6::getFormatPrefix
+#
+# Description:      Returns the format prefix of an IPv6 address.
+#
+# Argument(s):      address
+#               
+# Returns:          format prefix (enums: ipV6NSAPAllocation, ipV6GlobalUnicast, 
+#                                         ipV6LinkLocalUnicast, ipV6SiteLocalUnicast,
+#                                         ipV6IPXAllocation, ipV6Multicast)
+#
+########################################################################################
+proc ipv6::getFormatPrefix {address} \
+{
+    set retValue {}
+
+    if {![ipV6Address decode $address]} {
+        set retValue [list [ipV6Address cget -prefixValue]]
+    }        
+
+    return $retValue
+}
+
+
+########################################################################################
+#
+# Procedure:        ipv6::getTopLevelAggregationId
+#
+# Description:      Returns the top level aggregation id of the global aggregate address.
+#
+# Argument(s):      address
+#               
+# Returns:          top level aggregation id
+#
+########################################################################################
+proc ipv6::getTopLevelAggregateId {address} \
+{
+    set retValue {}
+
+    if {![ipV6Address decode $address]} {
+        if {[ipV6Address cget -prefixType] == $::ipV6GlobalUnicast} {
+            set retValue [ipV6Address cget -topLevelAggregationId]
+        }        
+    }        
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::getNextLevelAggregationId
+#
+# Description:      Returns the Next Level Aggregation Id of the Global Aggregate address.
+#
+# Argument(s):      address
+#               
+# Returns:          next level aggregation id
+#
+########################################################################################
+proc ipv6::getNextLevelAggregateId {address} \
+{
+    set retValue {}
+
+    if {![ipV6Address decode $address]} {
+        if {[ipV6Address cget -prefixType] == $::ipV6GlobalUnicast} {
+            set retValue [ipV6Address cget -nextLevelAggregationId]
+        }        
+    }        
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::getSiteLevelAggregationId
+#
+# Description:      Returns the Site Level Aggregation Id of the Global Aggregate address.
+#
+# Argument(s):      address
+#               
+# Returns:          site level aggregation id
+#
+########################################################################################
+proc ipv6::getSiteLevelAggregateId {address} \
+{
+    set retValue {}
+
+    if {![ipV6Address decode $address]} {
+        if {[ipV6Address cget -prefixType] == $::ipV6GlobalUnicast} {
+            set retValue [ipV6Address cget -siteLevelAggregationId]
+        }        
+    }        
+
+    return $retValue
+}
+
+
+########################################################################################
+#
+# Procedure:        ipv6::getSubnetId
+#
+# Description:      Returns the Subnet Id of the Site Local address.
+#
+# Argument(s):      address
+#               
+# Returns:          subnet id
+#
+########################################################################################
+proc ipv6::getSubnetId {address} \
+{
+    set retValue {}
+
+    if {![ipV6Address decode $address]} {
+        if {[ipV6Address cget -prefixType] == $::ipV6SiteLocalUnicast} {
+            set retValue [ipV6Address cget -subnetId]
+        }        
+    }        
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::getInterfaceId
+#
+# Description:      Returns the Interface Id Global Aggregate, Site Local, or Link
+#                       local address.
+#
+# Argument(s):      address
+#               
+# Returns:          interface id
+#
+########################################################################################
+proc ipv6::getInterfaceId {address} \
+{
+    set retValue {}
+
+    if {![ipV6Address decode $address]} {
+        switch [ipV6Address cget -prefixType] "
+            $::ipV6GlobalUnicast -
+            $::ipV6SiteLocalUnicast -
+            $::ipV6LinkLocalUnicast {
+                set retValue [list [ipV6Address cget -interfaceId]]
+            }        
+        "        
+    }        
+
+    return $retValue
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::getLoopbackAddress
+#
+# Description:      Returns the loopback address.
+#
+# Argument(s):      None
+# Argument(s):      None
+#               
+# Returns:          loopback address
+#
+########################################################################################
+proc ipv6::getLoopbackAddress {} \
+{
+    variable addressLoopback
+    return $addressLoopback
+}    
+
+
+########################################################################################
+#
+#   Validation Utilities
+#   
+########################################################################################
+
+########################################################################################
+#
+# Procedure:        ipv6::isValidAddress
+#
+# Description:      TRUE/FALSE: Is the given ipv6 address valid?
+#
+# Argument(s):      address
+#                   type:       unicast (default), anycast, multicast
+#               
+# Returns:          ::true or ::false
+#
+########################################################################################
+proc ipv6::isValidAddress {address {type unicast}} \
+{
+    variable ipV4AddressSize 
+
+    set retCode $::false
+
+    set segments        8
+    set nibbleSize      4
+    
+    set segmentsBefore  {}
+    set segmentsAfter   $address
+    set ipv4Address     {}
+    
+    set count [regsub -all ":" $address ":" address]
+    if {$count > 0 && $count <= [expr $segments-1]} {
+    
+        if {[isMixedVersionAddress $address]} {
+            set end [expr [llength [split $address :]] - 1]
+            set ipv4Address [lindex [split $address :] $end]
+            regsub "$ipv4Address" $address {} address
+            regsub -all {(.*)\.(.*)\.(.*)\.(.*)} $ipv4Address \
+                {[format "%02x%02x:%02x%02x" \1 \2 \3 \4]} ipv4Address
+            set ipv4Address [subst $ipv4Address]
+            append address $ipv4Address
+        }
+        
+        #
+        # Fill in the zeroes needed to expand.
+        set segmentsBefore {}
+        set segmentsAfter  $address
+        
+        if {[regexp {(.*)::(.*)} $address match segmentsBefore segmentsAfter]} {
+            set segmentsBefore [split $segmentsBefore :]
+            set segmentsAfter  [split $segmentsAfter  :]
+            set segmentsNeeded [expr  $segments - ([llength $segmentsBefore] + [llength $segmentsAfter])]
+            set segmentList "$segmentsBefore [string repeat " 0" $segmentsNeeded] $segmentsAfter"
+        } else {
+            set segmentList [split $address :]
+        }
+        
+        if {[llength [join $segmentList]] == 8} {
+            set retCode $::true
+            foreach segment $segmentList {
+                if {[regexp {[^0-9a-fA-f]} $segment match] > 0} {
+                    set retCode $::false
+                    break
+                }
+                if {[mpexpr 0x$segment > 0xffff]} {
+                    set retCode $::false
+                    break
+                }
+            }
+        }
+    }
+    
+
+    return $retCode
+}
+
+########################################################################################
+#
+# Procedure:    ipv6::validAddress
+#
+# Description:  Given and address, determine it's validitiy
+#
+# Argument(s):  address:    ipv6 address
+#               type:       unicast, multicast, anycast
+#               
+# Returns:      ::true or ::false
+#
+########################################################################################
+proc ipv6::validateAddress {address {type unicast}} \
+{
+    set retCode $::true
+
+	set retCode [isValidAddress $address]
+
+	if { $retCode } {
+
+		switch $type {
+			unicast -
+			anycast {
+				
+			}
+			multicast {
+				set retCode [isValidMCAddress $address]
+			}
+			default {
+				set retCode $::false
+			}
+		}
+	}
+
+    return $retCode
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::isReservedMCAddress
+#
+# Description:      TRUE/FALSE: Is this a reserved multicast address?
+#
+# Argument(s):      address:    Ipv6 address
+#               
+# Returns:          ::true or ::false
+#
+########################################################################################
+proc ipv6::isReservedMCAddress {address} \
+{
+    variable reservedMCAddressList
+	set retCode $::false
+
+	set expand_address [ipv6::expandAddress $address]
+	if { [llength expand_address] } {
+
+		# Check in the list for predefined multicast addresses
+		if { [lsearch $reservedMCAddressList $expand_address] < 0 } {
+
+			# Check for Solicited-node addresses
+			if {[string first "ff02:0000:0000:0000:0000:0001:ff" $expand_address] < 0 } {
+			
+				# Check for Service location addresses
+				if { [string first "ff05:0000:0000:0000:0000:0000:0001" $expand_address] == 0} {
+					set splittedAddr [split $expand_address ":"]
+					set comparedPart [format "0x%s" [lindex $splittedAddr 7]]	
+					if { $comparedPart >= 0x1000 &&  $comparedPart <= 0x13ff } {	
+						set retCode $::true
+					}
+				} 
+			} else {
+				set retCode $::true
+			}	
+		} else {
+			set retCode $::true
+		}
+	}
+
+    return $retCode
+}
+
+
+########################################################################################
+#
+# Procedure:        ipv6::isValidMCAddress
+#
+# Description:      TRUE/FALSE: Is this a reserved multicast address?
+#
+# Argument(s):      address:    Ipv6 address
+#               
+# Returns:          ::true or ::false
+#
+########################################################################################
+proc ipv6::isValidMCAddress {address} \
+{
+    set retCode $::false
+
+	set expand_address [ipv6::expandAddress $address]
+	if { [llength expand_address] } {
+
+		set splittedAddr [split $expand_address ":"]
+		set mcastPart [format "0x%s" [lindex $splittedAddr 0]]
+		if { $mcastPart >= 0xff00 &&  $mcastPart <= 0xff1f } {	
+			set retCode $::true
+		}
+	}
+			
+    return $retCode
+}
+
+########################################################################################
+#
+# Procedure:        ipv6::isMixedVersionAddress
+#
+# Description:      Given an IPv6 address, determine if it is compiled of both
+#                   IPv4 and IPv6 components, ie:
+#
+#                           0:0:0:0:0:0:192.168.10.1 
+#
+# Argument(s):      address:    Ipv6 address (any acceptable IPv6 format)
+#               
+# Returns:          ::true or ::false
+#
+########################################################################################
+proc ipv6::isMixedVersionAddress {address} \
+{
+    set retCode $::false
+    set address [lindex [split $address :] end]
+    if {[llength [split $address .]] == 4} {
+        set retCode $::true
+    }
+        
+    return $retCode
+}
+
+########################################################################
+# Procedure:    incrIpV6Field
+#
+# Description:  Increments the specified field of a 128 bit IPv6 address
+#
+# Argument(s):  ipAddress:  IP address whose field to be incremented
+#               field:      IPv6 - field to be incremented, default is interfaceId
+#                                  refer to TCLIpV6Address field enumerations, or 
+#								   any prefix, overflow is not supported yet
+#               increment:  increment the field by this number, default is 1
+#
+# Returns:      Modified IP address
+#
+########################################################################
+proc ipv6::incrIpField {address {prefix 128} {increment 1} } \
+{
+    variable  fieldPositions
+
+    set newAddress {}
+	set errorFlag  0
+
+    if {[info exists fieldPositions($prefix)]} {
+        set prefix $fieldPositions($prefix)	
+    } else {
+		if {[isValidInteger $prefix] } {
+			if { $prefix  > 128 || $prefix  < 0 } { 
+				errorMsg "Error: Invalid prefix value, must be between 0 - 128, inclusive"
+				set errorFlag 1
+			} 
+		} else {
+			set errorFlag 1
+			errorMsg "Error: Invalid predefined field enumeration"
+		}
+
+	}	
+	if { !$errorFlag } {  	
+		ipV6Address setDefault
+		if  {![ipV6Address decode $address]} {
+
+			set prefixType [ipV6Address cget -prefixType]  
+			set newAddress [incIpv6AddressByPrefix $address $prefix  $increment]
+			 
+			# Invalid if increment overflows into the format prefix.
+			if  {![ipV6Address decode $newAddress]} {
+				set newAddress [ipV6Address encode]
+				if {[ipV6Address cget -prefixType] != $prefixType} {
+					set newAddress {}
+				}
+			}
+		} else {
+			errorMsg "Error: Invalid ipV6 address:$address"
+		}
+	}
+
+    return $newAddress
+}
+
+
+
+# This is NOT COMPLETE
+# The idea was to get the previous field to the "prefix" from the fieldListByPrefix	then 
+# make sure it didn't change after increment, and only supports the predefined prefixes
+# in order to finish this method, we need to create one more method, and test it
+# proc getOverflowField { prefix prefixType } this will return the field that is overflown
+
+#proc ipv6::incrIpField_withOverflow {address {prefix 0} {increment 1} {wrapOverflow no} } \
+#{
+#    variable  fieldPositions
+#
+#    set newAddress {}
+#	set predefinedField		0
+#	set fieldMaxValue		255
+#
+#    if {[info exists fieldPositions($prefix)]} {
+#        set prefix $fieldPositions($prefix)
+#		set predefinedField 1
+#    } else {
+#		set wrapOverflow no
+#	}
+#     puts "prefix:$prefix"
+#
+#    ipV6Address setDefault
+#    if  {![ipV6Address decode $address]} {
+#
+#        set prefixType [ipV6Address cget -prefixType]  
+#        set newAddress [incIpv6AddressByPrefix $address $prefix  $increment]
+#		if { $predefinedField } {
+#			set overflowField	[getOverflowField $prefix $prefixType]
+#		}
+#		 
+#        # Invalid if increment overflows into the format prefix.
+#        if  {![ipV6Address decode $newAddress]} {	
+#
+#            set newAddress [ipV6Address encode]
+#			if {$wrapOverflow == "yes" } {
+#				set newOverflowField  [hexlist2Value [ipV6Address cget -overflowField]]
+#				ipV6Address decode $address
+#				set oldOverflowFieldValue [hexlist2Value [ipV6Address cget -overflowField]]
+#				if { $newOverflowField >  $oldOverflowFieldValue } {
+#					ipV6Address config -$prefix [value2Hexlist $increment]
+#				}
+#			}
+#			set newAddress [ipV6Address encode] 
+#		}
+#    } else {
+#		errorMsg "Invalid ipV6 address:$address"
+#	}
+#
+#    return $newAddress
+#} 
+
+########################################################################
+# Procedure:    convertIpv6AddrToBytes
+#
+# Description:  Converts the IPv6 into bytes 
+#
+# Argument(s):  address:      IPv6 address
+#
+# Returns:      
+#
+########################################################################
+proc ipv6::convertIpv6AddrToBytes { address } \
+{
+    set expand_address [expandAddress $address]
+    regsub -all ":" $expand_address " " expand_address
+    regsub -all {([0-9a-fA-F]{2})([0-9a-fA-F]{2})} $expand_address {\1 \2} addrList
+    return $addrList
+}
+
+########################################################################
+# Procedure:    convertBytesToIpv6Address
+#
+# Description:  Converts the bytes into IPv6 address 
+#
+# Argument(s):  address:      IPv6 address
+#
+# Returns:      
+#
+########################################################################
+proc ipv6::convertBytesToIpv6Address { bytes } \
+{
+   set str {}
+   foreach {b1 b2} $bytes {
+      lappend str "$b1$b2"
+   }
+   set str [join $str ":"]
+   return [compressAddress [join $str ""]]
+}
+
+
+########################################################################
+# Procedure:    incIpv6AddressByPrefix
+#
+# Description:  Increments the specified field of a 128 bit IPv6 address
+#
+# Argument(s):  ipAddress:  IP address whose field to be incremented
+#               prefix:     IPv6 - field to be incremented, default is 32
+#               inc:		increment the prefix by this number, default is 1
+#
+# Returns:      Modified IP address
+#
+########################################################################
+proc ipv6::incIpv6AddressByPrefix {ipAddress {prefix 32} {inc 1}} \
+{
+    variable ipV6AddressSize 
+
+	set retAddress {}
+
+	if {[isValidInteger $prefix] } {
+		if { $prefix  > 128 || $prefix  < 0 } { 
+			errorMsg "Error: Invalid prefix value, must be between 0 - 128, inclusive"
+			set errorFlag 1
+		} else {
+		 	set ipAddress	[expandAddress $ipAddress]
+			set host		[mpexpr [hexlist2Value [convertIpv6AddrToBytes $ipAddress]] & (int(pow(2,($ipV6AddressSize - $prefix)) - 1))]
+			set network		[mpexpr [hexlist2Value [convertIpv6AddrToBytes $ipAddress]] >> ($ipV6AddressSize - $prefix)]
+			mpincr	network $inc
+
+			set retAddress	[convertBytesToIpv6Address [value2Hexlist [mpexpr ($network << ($ipV6AddressSize - $prefix)) | $host] 16]]
+		}
+	} else {
+		errorMsg "Error: Expecting integer prefix value between 0 - 128, inclusive."
+	}
+	return $retAddress
+}
+
+########################################################################
+# Procedure:    getFieldMask
+#
+# Description:  Return the IPv6 Field Mask (used with stream increment).
+#
+# Argument(s):  field:      IPv6 - field to be incremented, default is interfaceId
+#                                  refer to TCLIpV6Address field enumerations
+#
+# Returns:      mask
+#
+########################################################################
+proc ipv6::getFieldMask {{field interfaceId}} \
+{
+    variable fieldPositions
+
+    set mask 64
+
+    switch $field {
+        interfaceId {
+            set mask 64
+        }
+        subnetId -
+        siteLevelAggregationId -
+        nextLevelAggregationId -
+        topLevelAggregationId {
+            if {[info exists fieldPositions($field)]} {
+                set mask $fieldPositions($field)
+            }
+        }
+    }
+
+    return $mask
+}
+
+########################################################################
+# Procedure:    getMinimumValidFramesize
+#
+# Description:  Returns the minimum valid header length for and IPv6
+#               packet.
+
+#               IPv6 header length can vary depending on the options
+#               selected.  The base header is 40 bytes long.
+#
+# Argument(s):  useUdf
+#               useFir
+#
+# Returns:      minimum acceptable frame size
+#
+########################################################################
+proc ipv6::getMinimumValidFramesize {{useUdf true} {useFir true}} \
+{
+    global kFirSize	kCrcSize kUdfSize kHeaderLength
+
+    if {$useFir == "true"} {
+        set firSize $kFirSize
+    } else {
+        set firSize 0
+    }
+
+    if {$useUdf == "true"} {
+        set udfSize $kUdfSize
+    } else {
+        set udfSize 0
+    }
+
+    set minimum [expr [getHeaderLength] + \
+                      $firSize + \
+                      $udfSize + \
+                      $kCrcSize]
+
+    set minimum [expr $minimum & 0xfffffffe]
+
+}
+
+########################################################################
+# Procedure:    getHeaderLength
+#
+# Description:  Return the length of the IPv6 Header including the
+#               MAC and UDP headers (in other words, everything up to
+#               the payload).
+#
+#               NOTE:   THis is incomplete since it handles only
+#                       the simplest case... needs work.
+#
+# Arguments(s): None
+#
+# Returns:      length of IPv6 header
+#
+########################################################################
+proc ipv6::getHeaderLength {} \
+{
+    global kHeaderLength
+
+    set headerLength 0
+
+    if {[protocol cget -name] == $::ipV6} {
+        set headerLength   $::DaSaLength
+        switch [protocol cget -ethernetType] "
+            $::ethernetII -
+            $::ieee8023 -
+            $::ieee8022 {
+                incr headerLength   2
+            }
+            $::ieee8023snap {
+                incr headerLength   10
+            }
+        "
+        incr headerLength [expr $::kHeaderLength(ipV6) + $::udpHeaderLength]
+    }
+
+    return $headerLength
+}
+
+########################################################################
+# Procedure:    getAddressFieldOffset
+#
+# Description:  Return the offset to the given address field from the
+#               start of the IPv6 address field (not from the start of
+#               the header).
+#
+# Arguments(s): field:      prefix, topLevelAggregationId, nextLevelAggregationId,
+#                           siteLevelAggregationId, subnetId, interfaceId
+#
+# Returns:      Offset
+#
+########################################################################
+proc ipv6::getAddressFieldOffset {field} \
+{
+    variable  fieldOffsets
+
+    set retValue 0
+
+    if {[info exists fieldOffsets($field)]} {
+        set retValue $fieldOffsets($field)
+    }
+
+    return $retValue
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/ixFileUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/ixFileUtils.tcl
new file mode 100644
index 00000000..b54a753a
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/ixFileUtils.tcl
@@ -0,0 +1,158 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: ixFileUtils.tcl
+#    Copyright ©  IXIA
+#    All Rights Reserved.
+#
+#    Revision Log:
+#    09-05-2002    MG    Genesis
+#
+# Description: Contains miscellaneous file commands.
+#
+##################################################################################
+
+
+namespace eval ixFileUtils {
+    variable filesToClose ""
+}
+
+
+########################################################################
+# Procedure:   ixFileUtils::closeOpenFiles
+#
+# Description: Either close all open file handles or close all file handles opened by Ixia routines
+#              The advanced test parameter closeAllFilesInCleanUp controls which one is done
+#
+# Arguments:   None
+#
+# Returns:     Nothing
+########################################################################
+proc ixFileUtils::closeAll {} \
+{
+    variable filesToClose
+
+    if {[info tclversion] >= 8.3} {
+        set closeAllFiles [advancedTestParameter cget -closeAllFilesInCleanUp]
+        set listOfFiles ""
+        if {$closeAllFiles} {
+            set listOfFiles $filesToClose
+        } else {
+            foreach fileId [file channels file*] {
+                set index [lsearch -exact $filesToClose $fileId]
+                if {$index >= 0} {
+                    lappend listOfFiles $fileId
+                }
+            }
+        }
+        foreach fileId $listOfFiles {
+            close $fileId
+        }        
+    }
+}
+
+
+########################################################################
+# Procedure:   ixFileUtils::addFileToList
+#
+# Description: Add a file handle to the list of handles to be closed during the cleanUp procedure
+#
+# Arguments:   fileId - the file handle to add
+#
+# Returns:     Nothing
+########################################################################
+proc ixFileUtils::addFileToList { fileId } \
+{
+    variable filesToClose
+
+    lappend filesToClose $fileId
+}
+
+
+########################################################################
+# Procedure:   ixFileUtils::removeFileFromList
+#
+# Description: Remove a file handle from the list of handles to be closed during the cleanUp procedure
+#
+# Arguments:   fileId - the file handle to remove
+#
+# Returns:     Nothing
+########################################################################
+proc ixFileUtils::removeFileFromList { fileId } \
+{
+    variable filesToClose
+
+    set index [lsearch -exact $filesToClose $fileId]
+    if {$index >= 0} {
+        set filesToClose [lreplace $filesToClose $index $index]
+    }
+}
+
+
+########################################################################
+# Procedure:   ixFileUtils::open
+#
+# Description: This command opens a file
+#
+# Arguments:   filename - full path to filename
+#              access - file access parameter to use
+#              permission - file permission parameter to use
+#
+# Returns:     fileID if successful, or "" if unsuccessful
+########################################################################
+proc ixFileUtils::open {filename {access ""} {permission ""}} \
+{
+    if {[catch {eval ::open [list $filename] $access $permission} fileID]} {
+        set fileID ""
+    } else {
+        ixFileUtils::addFileToList $fileID
+    }
+    return $fileID
+}
+
+
+########################################################################
+# Procedure:   ixFileUtils::close
+#
+# Description: This command closes a file
+#
+# Arguments:   fileId - channel id of the file to be closed
+#
+# Returns:     Nothing
+########################################################################
+proc ixFileUtils::close {fileId} \
+{
+    catch {::close $fileId}
+    ixFileUtils::removeFileFromList $fileId
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/ixGraph.tcl b/dep/tclclient/ixTcl1.0/Generic/ixGraph.tcl
new file mode 100644
index 00000000..1a526ded
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/ixGraph.tcl
@@ -0,0 +1,982 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: ixGraph.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#    Revision Log:
+#    Date        Author                Comments
+#    -----------    -------------------    --------------------------------------------
+#    2001/06/11  D. Heins-Gelder     Initial release
+#
+# Description:  This file contains API commands for generating a graph
+#               and displaying data on the graph.
+#
+##################################################################################
+
+package ifneeded BLT 2.4
+
+namespace eval ixGraph {
+#
+#   Public Procedures:  
+#       ixGraph::create:            Create graph with given attributes
+#       ixGraph::destroy            Destroy graph.
+#       ixGraph::reset                Reset all data.
+#       ixGraph::addLine            Add a line to given graph
+#       ixGraph::deleteLine            Delete a line from given graph
+#       ixGraph::resetLine            Clear a given line of it's data
+#       ixGraph::updateLine              Add new x,y coordinates(s) to graph
+#       ixGraph::updateCoordinates    Append new coordinate to either x or y axis.
+#       ixGraph::getLines            Show a list of line names
+#       ixGraph::getDataVector      Obtain data vector handle from graph
+#       ixGraph::setDataVector      Set data vector handle in graph
+#       ixGraph::updateDataVector   Append data to the end of the data vector  
+#       ixGraph::resetDataVector    Clear data from the data vector   
+#
+
+#   Private Procedures: 
+#       None
+#
+#   Private Variables:                                                           
+#       None
+#
+#
+#   SAMPLE USAGE:
+#   -------------
+#
+#    SAMPLE 1
+#
+#set xyList \
+#    [list 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 9.5 11 9 12 8 13 7 14 6 15 5 16 4 17 3 18 2 19 1.5 20 2 21 3 22 4 23 5 24 6 25 7 26 8 27 9 28 8.5 29 9 30 8]
+#
+#set g [ixGraph::create .g    -title          "MY GRAPH"      \
+#                             -background     black           \
+#                             -foreground     white           \
+#                             -plotColor      grey            \
+#                             -legendColor    grey            \
+#                             -xColor         red             \
+#                             -yColor         red             \
+#                             -font           {Arial-Bold 14} \
+#                             -xTitle         "X-AXIS TITLE"  \
+#                             -yTitle         "Y-AXIS TITLE"  \
+#                             -xRange         [list 0 10 2]   \
+#                             -yRange         [list 0 10 2]   \
+#                             -logoFile       ixiaLogo.gif    \
+#                             -crossHairs     on              \
+#                             -grid           on              ]
+#pack $g
+#
+#ixGraph::addLine $g rate     -color          white   \
+#                             -lineWidth      2       
+#
+## Update line with a list of coordinates.
+#ixGraph::updateLine $g rate $xyList
+#foreach {x y} $xyList {
+## Update line with a single set of coordinates.
+#    ixGraph::updateLine $g rate  [list $x $y]
+#
+##     or
+#
+## Update x / y coordinates individually.
+#    ixGraph::updateCoordinate $g rate x [list $x] 
+#    ixGraph::updateCoordinate $g rate y [list $y] 
+#
+#    after 250
+#}
+#
+#ixGraph::destroy $g
+#
+#   END SAMPLE OF SAMPLE 1
+
+#
+#    SAMPLE 2
+#
+#ixGraph::destroy $g
+#stat setDefault
+#set g [ixGraph::create .g    -title          "MY GRAPH"      \
+#                             -background     black           \
+#                             -foreground     white           \
+#                             -plotColor      grey            \
+#                             -legendColor    grey            \
+#                             -xColor         red             \
+#                             -yColor         red             \
+#                             -font           {Arial-Bold 14} \
+#                             -xTitle         "X-AXIS TITLE"  \
+#                             -yTitle         "Y-AXIS TITLE"  \
+#                             -xRange         [list 0 20 1]   \
+#                             -yRange         [list 0 200000 10000] \
+#                             -crossHairs     on              \
+#                             -grid           on              ]
+#pack $g
+#
+#ixGraph::addLine $g rate     -color          white   \
+#                             -lineWidth      2       
+#
+#set i 0
+#while {$i < 50} {
+#    after 1000
+#    incr i 1
+#    stat get -bytesReceived 1 1 1
+#    set value [stat cget -bytesReceived]
+#    set value [expr $value / 1000]
+#   ixGraph::updateLine $g rate [list $i $value]
+#}
+#   END SAMPLE OF SAMPLE 2
+
+}
+## End of ixGraph namespace
+
+########################################################################################
+# Procedure:    create
+#
+# Description:  Create a graph as a free-floating element and return it's handle  
+#                   
+# Input:        graphName:      window path name, ie: .myGraph or .window.myGraph      
+#               args:           configuration parameters for the graph, the following
+#                               are currently valid:
+#                                   -title          value   - Graph Title
+#                                   -foreground     value   - Graph foreground color (default grey)
+#                                   -background     value   - Graph background color (default black)
+#                                   -plotColor        value   - Color of plot area (default white)
+#                                   -font           value   - Graph text font
+#                                   -logoFile       value   - path and file of logo
+#                                   -xTickFont      value   - font of the numbers on the graph
+#                                   -yTickFont      value   - font of the numbers on the graph
+#                                   -xTitle         value   - X Axis Title
+#                                   -yTitle         value   - Y Axis Title
+#                                   -xTitleFont     value   - font of the axis titles
+#                                   -yTitleFont     value   - font of the axis titles
+#                                   -xRange         value   - [list $minimum $maximum $step]
+#                                   -yRange         value   - [list $minimum $maximum $step]
+#                                   -xColor         value   - color of x axis titles
+#                                   -yColor         value   - color of y axis titles
+#                                   -grid           value   - on or off
+#                                   -crossHairs     value   - on or off
+#                                   -legendColor    value   - color of legend (default grey)
+#
+# Output:       
+#
+########################################################################################
+proc ixGraph::create {graphName args} \
+{
+    set parameters [list title          ""          \
+                         foreground     "black"     \
+                         background     "grey"      \
+                         plotColor      "white"     \
+                         legendColor    "grey"      \
+                         logoFile       ""          \
+                         font           {Arial 10}  \
+                         xTitle         ""          \
+                         xTitleFont     {Arial 10}  \
+                         xTickFont      {Arial 8}   \
+                         xMinimum       ""          \
+                         xMaximum       ""          \
+                         xStep          0.0         \
+                         xColor         "black"     \
+                         yTitle         ""          \
+                         yTitleFont     {Arial 10}  \
+                         yTickFont      {Arial 8}   \
+                         yMinimum       ""          \
+                         yMaximum       ""          \
+                         yStep          0.0         \
+                         yColor         "black"     \
+                         grid           "off"       \
+                         crossHairs     "off"       ]
+
+    set retValue ""
+
+    # Initialize graph parameters
+    foreach {parameter value} $parameters {
+        set $parameter $value
+    }
+    
+    foreach {parameter value} $args {
+        switch -- $parameter {
+            -title {
+                set title $value
+            }
+            -foreground {
+                set foreground $value
+            }
+            -background {
+                set background $value
+            }
+            -plotColor {
+                set plotColor $value
+            }
+            -legendColor {
+                set legendColor $value
+            }
+            -font {
+                set font $value
+            }
+            -xTitle {
+                set xTitle $value
+            }
+            -yTitle {
+                set yTitle $value
+            }
+            -xColor {
+                set xColor $value
+            }
+            -yColor {
+                set yColor $value
+            }
+            -xTickFont {
+                set xTickFont $value
+            }
+            -yTickFont {
+                set yTickFont $value
+            }
+            -xTitleFont {
+                set xTitleFont $value
+            }
+            -yTitleFont {
+                set yTitleFont $value
+            }
+            -xRange {
+                foreach {xMinimum xMaximum xStep} $value {}
+                if {$xMaximum != ""} {
+                    if {$xMinimum > $xMaximum} {
+                        return $::TCL_ERROR
+                    }
+                }
+            }
+            -yRange {
+                foreach {yMinimum yMaximum yStep} $value {}
+                if {$yMaximum != ""} {
+                    if {$yMinimum > $yMaximum} {
+                        return $::TCL_ERROR
+                    }
+                }
+                if {$yStep == ""} {set yStep 0}
+            }
+            -grid {
+                switch $value {
+                    on -
+                    true -
+                    yes {
+                        set grid "on"
+                    }
+                }
+            }
+            -crossHairs {
+                switch $value {
+                    on -
+                    true -
+                    yes {
+                        set crossHairs "on"
+                    }
+                }
+            }
+            -logoFile {
+                if {[file exists $value]} {
+                    set logoFile $value
+                } else {
+                    return $::TCL_ERROR
+                }
+            }
+            default {
+                return $retValue
+            }
+        }
+    }
+
+    # Create graph and configure as requested.
+    if {![catch {blt::graph $graphName} graph]} {
+
+        $graph configure -title $title
+        $graph configure -bufferelements $::false
+        $graph axis configure x -title $xTitle -min $xMinimum \
+            -max $xMaximum -stepsize $xStep
+        $graph axis configure y -title $yTitle -min $yMinimum \
+            -max $yMaximum -stepsize $yStep -command "stringFormatNumber value"
+
+        $graph grid $grid
+
+        if {$crossHairs == "on"} {
+            Blt_Crosshairs $graph
+            $graph crosshairs configure -color grey
+        }
+
+        $graph configure -foreground $foreground
+        $graph configure -background $background
+        $graph configure -plotbackground $plotColor
+        $graph configure -font $font
+
+        $graph legend configure -background $legendColor
+
+        $graph axis configure x -tickfont $xTickFont
+        $graph axis configure y -tickfont $yTickFont
+        $graph axis configure x -titlefont $xTitleFont
+        $graph axis configure y -titlefont $yTitleFont
+        $graph axis configure x -color $xColor
+        $graph axis configure y -color $yColor
+        $graph axis configure x -titlecolor $foreground
+        $graph axis configure y -titlecolor $foreground
+
+        if {$logoFile == "on"} {
+            set marker [$graph marker create image \
+                -image [image create photo -file ixiaLogo.gif]]
+            $graph marker configure $marker -coords {1 1} -under 1
+        }
+
+        set retValue $graph
+    }
+
+    return $retValue
+}
+
+########################################################################################
+# Procedure:    reset
+#
+# Description:  Set/Reset the graph and all associated data vectors to initial values.
+#                   
+# Input:        graph:      handle
+#
+# Output:       TCL_OK or TCL_ERROR
+#
+########################################################################################
+proc ixGraph::reset {graph} \
+{
+    set retCode $::TCL_OK
+
+    if ![winfo exists $graph] {
+        return $::TCL_ERROR
+    }
+
+    foreach item [$graph element names] {
+        resetLine $graph $item
+    }
+
+    # Axis maximum set dynamically, reset to auto scale.
+    $graph yaxis configure -max ""
+
+    update idletasks
+    return $retCode    
+
+}
+
+########################################################################################
+# Procedure:    destroy
+#
+# Description:  Deletes all data associated with the graph.
+#                   
+# Input:        graph:      handle
+#
+# Output:       TCL_OK or TCL_ERROR
+#
+########################################################################################
+proc ixGraph::destroy {graph} \
+{
+    set retCode $::TCL_OK
+
+    if {![winfo exists $graph]} {
+        return $::TCL_ERROR
+    }
+
+    foreach item [$graph element names] {
+        blt::vector destroy [$graph element cget $item -xdata]
+        blt::vector destroy [$graph element cget $item -ydata]
+
+        $graph element delete $item
+    }
+    ::destroy $graph
+
+    return $retCode    
+
+}
+
+########################################################################################
+# Procedure:    addLine
+#
+# Description:  Add a data line to the given graph.
+#                   
+# Input:        graph:      handle
+#               args:       configuration parameters for the graph, the following
+#                           are currently valid:
+#
+#                           -color      value   - line color name (ie red) or
+#                                                  hex value (ie #000000)
+#                           -lineWidth  value   - line size (default 1)
+#                           -dashes     value   - # from 1-255, "" is solid line
+#                           -legendFont value   - Font of legend text
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::addLine {graph name args} \
+{
+    set parameters [list    color       black     \
+                            symbol      none      \
+                            smooth      linear    \
+                            lineWidth   1         \
+                            dashes      ""        \
+                            legendFont  {Arial 7} \
+                                                  ]
+
+    set retValue ""
+
+    # Initialize graph parameters
+    foreach {parameter value} $parameters {
+        set $parameter $value
+    }
+
+    if {![winfo exists $graph]} {
+        return $retValue
+    }
+
+    foreach {parameter value} $args {
+        switch -- $parameter {
+            -color {
+                set color $value
+            }
+            -xSize {
+                set xSize $value
+            }
+            -ySize {
+                set ySize $value
+            }
+            -symbol {
+                set symbol $value
+            }
+            -lineWidth {
+                set lineWidth $value
+            }
+            -dashes {
+                set dashes $value
+            }
+            -legendFont {
+                set legendFont $value
+            }
+            default {
+                return $retValue
+            }
+        }
+    }               
+
+    if {![catch {$graph element create $name}]} {
+        set xVector [blt::vector create #auto(1)]
+        set yVector [blt::vector create #auto(1)]
+
+
+        $graph element configure $name -xdata       $xVector
+        $graph element configure $name -ydata       $yVector
+        $graph element configure $name -color       $color
+        $graph element configure $name -symbol      $symbol
+        $graph element configure $name -smooth      $smooth
+        $graph element configure $name -linewidth   $lineWidth
+        $graph element configure $name -dashes      $dashes
+        $graph legend  configure -font $legendFont
+
+        set retValue [list $xVector $yVector]
+    }
+
+    return $retValue
+}
+
+########################################################################################
+# Procedure:    getLines
+#
+# Description:  Get a list of lines attached to a graph.
+#                   
+# Input:        graph:      handle
+#                           
+# Output:       List of lines attached to graph
+#
+########################################################################################
+proc ixGraph::getLines {graph} \
+{
+
+    set retCode $::TCL_OK
+
+    if ![winfo exists $graph] {
+        return $::TCL_ERROR
+    }
+
+    return [lsort [$graph element names]]
+}
+
+
+########################################################################################
+# Procedure:    deleteLine
+#
+# Description:  Delete a line from the given graph.
+#                   
+# Input:        graph:      handle
+#               line:       name of graph line
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::deleteLine {graph name} \
+{
+    set retCode $::TCL_OK
+
+    if ![winfo exists $graph] {
+        return $::TCL_ERROR
+    }
+
+    if {[lsearch [$graph element names] $name] < 0} {
+        return $::TCL_ERROR
+    }
+
+    set xVector [$graph element cget $name -xdata]
+    if {$xVector != ""} {
+        blt::vector destroy $xVector
+    }
+    set yVector [$graph element cget $name -ydata]
+    if {$yVector != ""} {
+        blt::vector destroy $yVector
+    }
+
+    if {[catch {$graph element delete $name}]} {
+        set retCode $::TCL_ERROR
+    }
+     
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:    resetLine
+#
+# Description:  Resets a graph line to no data.
+#                   
+# Input:        graph:      handle
+#               line:       name of graph line
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::resetLine {graph line} \
+{
+    set retCode $::TCL_OK
+
+    # Valid graph handle?
+    if ![winfo exists $graph] {
+        return $::TCL_ERROR
+    }
+
+    # Is the given line a member of this graph?
+    if {[lsearch [$graph element names] $line] < 0} {
+        return $::TCL_ERROR
+    }
+
+    # Clear the x & y vectors.
+    if {[set xVector [$graph element cget $line -xdata]] != ""} {
+        resetDataVector $graph $xVector
+    }
+    if {[set yVector [$graph element cget $line -ydata]] != ""} {
+        resetDataVector $graph $yVector
+    }
+
+    $graph axis view x moveto 0.0
+}
+
+########################################################################################
+# Procedure:    updateLine
+#
+# Description:  Inserts new data into a given line.
+#                   
+# Input:        graph:          handle
+#               line:           name of graph line
+#               xyCoordinate:   [list x y x1 y1 x2 x2 .... xn yn]
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::updateLine {graph line xyCoordinate} \
+{
+    set retCode $::TCL_OK
+
+    if ![winfo exists $graph] {
+        return $::TCL_ERROR
+    }
+
+    if {[lsearch [$graph element names] $line] < 0} {
+        return $::TCL_ERROR
+    }
+
+    # Don't allow graph to grow beyond size setting.
+    set xVector [$graph element cget $line -xdata]
+    set yVector [$graph element cget $line -ydata]
+
+    foreach {x y} $xyCoordinate {
+        updateDataVector $graph $xVector $yVector [list $x $y]
+
+        set xMaximum [$graph xaxis cget -max]
+        if {$x > $xMaximum} {
+            $graph axis view x moveto 1.0
+        }
+    }  
+    update idletasks
+          
+    return $retCode
+}
+
+########################################################################################
+# Procedure:    getDataVector
+#
+# Description:  Given a graph and line, return the data vector 
+#                   associated with the given axis.
+#                   
+# Input:        graph:      handle
+#               line:       desired line (name of)
+#               axis:       x or y
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::getDataVector {graph line axis} \
+{
+    set retValue ""
+
+    # Valid graph?
+    if {[winfo exists $graph]} {
+
+        # Valid line?
+        if {[lsearch [getLines $graph] $line] >= 0} {
+            switch $axis {
+                x {
+                    set retValue [$graph element cget $line -xdata]
+                }
+                y {
+                    set retValue [$graph element cget $line -ydata]
+                }
+                default {
+                    set retValue ""
+                }
+            }
+        }
+    }
+    return $retValue
+}
+
+########################################################################################
+# Procedure:    setDataVector
+#
+# Description:  Associate the given data vector with the given graph-line-axis 
+#                   combination.
+#                   
+# Input:        graph:      graph handle
+#               line:       line handle
+#               axis:       x or y
+#               vector:     vector handle
+#                           
+# Output:       TCL_OK or TCL_ERROR
+#
+########################################################################################
+proc ixGraph::setDataVector {graph line axis vector} \
+{
+    set retCode $::TCL_ERROR
+
+    if {[winfo exists $graph]} {
+
+        if {[lsearch [getLines $graph] $line] >= 0} {
+            switch $axis {
+                x {
+                    $graph element config $line -xdata $vector
+                    set retCode $::TCL_OK
+                }
+                y {
+                    $graph element config $line -ydata $vector
+                    set retCode $::TCL_OK
+                }
+                default {
+                    set retCode $::TCL_ERROR
+                }
+            }
+        }
+    }
+    return $retCode
+}
+
+########################################################################################
+# Procedure:    resetDataVector
+#
+# Description:  Resets a data vector to no data.
+#                   
+# Input:        graph:      graph handle
+#               vector:     vector handle
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::resetDataVector {graph vector} \
+{
+    set retCode $::TCL_OK
+
+    # Valid graph handle?
+    if ![winfo exists $graph] {
+        return $::TCL_ERROR
+    }
+
+    # Valid vector handle?
+    if {![info exists $vector]} {
+        return $::TCL_ERROR
+    }
+
+    if {[$vector length] > 0} {
+        $vector delete 0:end
+    }
+}
+
+
+########################################################################################
+# Procedure:    updateDataVectorPair
+#
+# Description:  Inserts new data into a given vector x,y pair.
+#                   
+# Input:        graph:          handle
+#               vector:         vector handle
+#               xyCoordinate:   [list x y x1 y1 x2 x2 .... xn yn]
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::updateDataVectorPair {graph xVector yVector xyCoordinate} \
+{
+    set retCode $::TCL_OK
+
+    if {![winfo exists $graph]} {
+        return $::TCL_ERROR
+    }
+
+    foreach {x y} $xyCoordinate {
+
+        updateDataVector $graph $xVector $yVector x $x
+        updateDataVector $graph $xVector $yVector y $y
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:    updateDataVector
+#
+# Description:  Inserts new data into a given vector
+#                   
+# Input:        graph:          handle
+#               vector:         vector handle
+#               Coordinate:     [list x x1 x2 ... xn] OR [list y y1 y2 ... yn]
+#               increment:      graph update increment (ie, how often is the graph updated)
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::updateDataVector {graph xVector yVector axis coordinates {increment 1}} \
+{
+    set retCode $::TCL_OK
+
+    if {![winfo exists $graph]} {
+        return $::TCL_ERROR
+    }
+
+    switch $axis {
+        x {
+            set vector $xVector
+        }
+        y {
+            set vector $yVector
+        }
+        default {
+            return $::TCL_ERROR
+        }
+    }
+
+    set xMaximum [$graph xaxis cget -max]
+    set xMinimum [$graph xaxis cget -min]
+    set windowLength [expr $xMaximum-$xMinimum]
+
+    foreach coordinate $coordinates {
+
+        # BLT is limited to an signed long - temporary fix.
+        if {$coordinate < 0} {
+            set coordinate 0x07fffffff
+            errorMsg "Negative number encountered"
+        }
+        if {[catch {set ${vector}(++end) $coordinate} errorMsg]} {
+            errorMsg "$errorMsg"
+            set ${vector}(++end) 0x07fffffff
+        }
+
+        # Dynamically set maximum for Y axis.
+        set yMaximum [$graph yaxis cget -max]
+        if {$yMaximum == "" } {
+            $graph yaxis config -max 100
+        }
+        if {[$graph yaxis cget -max] < $coordinate} {
+            if {[catch {$graph yaxis config -max [expr {round($coordinate*1.05)}]}]} {
+                $graph yaxis config -max [expr {round($coordinate)}]
+            }
+        }
+
+        if {[$vector length] > [expr {$windowLength/$increment}]} {
+            $xVector delete 0:0
+            $yVector delete 0:0
+        }
+        advanceBuffer $graph $xVector $windowLength $increment
+    }        
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:    updateCoordinates
+#
+# Description:  Append new data into the given axis on the given line in the given
+#                    graph.
+#                   
+# Input:        graph:          handle
+#               line:           name of graph line
+#               axis:            x or y
+#               coordinates:    [list value1 value2 value 3... valuen]
+#               increment:      graph update increment (ie, how often is the graph updated)
+#                           
+# Output:       vector handle
+#
+########################################################################################
+proc ixGraph::updateCoordinates {graph line axis coordinates {increment 1}} \
+{
+    set retCode $::TCL_OK
+
+    if ![winfo exists $graph] {
+        return $::TCL_ERROR
+    }
+
+    if {[lsearch [$graph element names] $line] < 0} {
+        return $::TCL_ERROR
+    }
+
+    set xVector [$graph element cget $line -xdata]
+    set yVector [$graph element cget $line -ydata]
+
+    switch $axis {
+        x {
+            set vector $xVector
+        }
+        y {
+            set vector $yVector
+        }
+        default {
+            return $::TCL_ERROR
+        }
+    }
+
+    set xMaximum [expr {round([$graph xaxis cget -max])}]
+    set xMinimum [expr {round([$graph xaxis cget -min])}]
+    set windowLength [expr $xMaximum-$xMinimum]
+
+    foreach coordinate $coordinates {
+
+        # BLT is limited to an signed long - temporary fix.
+        if {$coordinate < 0} {
+            set coordinate 0x07fffffff
+            errorMsg "Negative number encountered, statistic: $line."
+        }
+        if {[catch {set ${vector}(++end) $coordinate} errorMsg]} {
+            errorMsg "$errorMsg"
+            set ${vector}(++end) 0x07fffffff
+        }
+
+        # Dynamically set maximum for Y axis.
+        set yMaximum [$graph yaxis cget -max]
+        if {$yMaximum == "" } {
+            $graph yaxis config -max 100
+        } 
+        if {[$graph yaxis cget -max] < $coordinate} {
+            if {[catch {$graph yaxis config -max [expr {round($coordinate*1.05)}]}]} {
+                $graph yaxis config -max [expr {round($coordinate)}]
+            }
+        }
+
+        if {[$vector length] > [expr {$windowLength/$increment}]} {
+            $yVector delete 0:0
+            $xVector delete 0:0
+
+            $graph axis view x moveto [mpexpr 1.0/[$xVector length]]
+        }
+        advanceBuffer $graph $xVector $windowLength $increment
+    }        
+
+    return $retCode
+}
+
+########################################################################################
+# Procedure:    advanceBuffer
+#
+# Description:  The x axis contains time data which can be determined at the start of
+#                   the test, therefore to optimize graphing the x axis is updated
+#                   in multiples of the window length.  This procedure performs the
+#                   incrementation of the x axis vector.
+#                   
+# Input:        graph:          handle
+#               vector:         vector handle
+#               range:          increment size  (window)
+#               increment:      graph update increment
+#                           
+# Output:       $::TCL_ERROR or $::TCL_OK
+#
+########################################################################################
+proc ixGraph::advanceBuffer {graph vector range {increment 1}} \
+{
+    set retCode $::TCL_OK
+   
+    if ![winfo exists $graph] {
+        return $::TCL_ERROR
+    }
+
+    if {[$vector length] > [expr {$range/$increment}]} {
+        return $::TCL_OK
+    }
+
+    set nextVectorSegment [blt::vector create #auto(1)]
+    #set range [expr round($range - 1)]
+    $nextVectorSegment set [$vector range 0 [mpexpr $range/$increment-1]]
+ 
+    $nextVectorSegment expr {$nextVectorSegment + $range}
+    $vector append $nextVectorSegment
+
+    blt::vector destroy $nextVectorSegment
+
+    return $retCode
+}
+
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/log.tcl b/dep/tclclient/ixTcl1.0/Generic/log.tcl
new file mode 100644
index 00000000..ae5d2e9b
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/log.tcl
@@ -0,0 +1,177 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: log.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	10-22-1999	HS	Genesis
+#
+# Description: Command to set log parameters.
+#
+##################################################################################
+
+
+
+#######################################################################################
+# Procedure: logger::on
+#
+# Description: This command is used to turn on logging. Usage is as follows:
+#				log on
+#
+#######################################################################################
+proc logger::on {args} \
+{
+	global loggerParms
+
+    # if there are any current log files open, close them first
+    if [info exists loggerParms(enabled)] {
+        logOff
+    }
+
+    set loggerParms(enabled) 1
+    if {[string length [logger cget -logFileName]] == 0} {
+        logger config -logFileName     defaultFile.log
+        logger config -fileBackup      false
+    }
+
+    set loggerParms(fileID)  [openMyFile [logger cget -logFileName]]
+
+    set startTime [clock seconds]
+    catch {results config -startTime $startTime}
+
+    puts [logger cget -fileID] ">>>>>>> Start Time: [clock format [clock seconds] -format "%A, %b %d, %Y    %I:%M:%S %p"]\n"
+    logger config -startTime $startTime
+
+    if {[info script] != ""} {
+        puts [logger cget -fileID] "\nFile being sourced : [info script]\n"
+    }
+}
+
+
+#######################################################################################
+# Procedure: logger::off
+#
+# Description: This command is used to turn off logging. Usage is as follows:
+#				log off
+#
+#######################################################################################
+proc logger::off {args} \
+{
+    global loggerParms
+
+    if [info exists loggerParms(enabled)] {
+        logger config -endTime [clock seconds]
+        if {[info exists loggerParms(fileID)]} {
+		    puts [logger cget -fileID] "\n>>>>>>> End Time: [clock format [clock seconds] -format "%A, %b %d, %Y    %I:%M:%S %p"]"
+		    puts [logger cget -fileID] "Actual Duration of Test: [formatDurationTime [expr $loggerParms(endTime) - $loggerParms(startTime)]] seconds"
+	        flush [logger cget -fileID]
+		    if {[logger cget -fileID] != "stdout"} {
+			    closeMyFile [logger cget -fileID]
+		    }
+            set loggerParms(fileID) stdout
+        }
+        unset loggerParms(enabled)
+    }
+}
+
+
+###############################################################################
+# Procedure: logger::message
+#
+# Description: This command is used to write messages to the log.
+#              Usage is as follows:
+#                  log message <-priority 1> "This is my message"
+#
+###############################################################################
+proc logger::message {args} \
+{
+    global loggerParms loggerMethods tcl_platform
+
+    set argLen [llength $args]
+    set type   logger
+
+    if {[lindex $args 0] == "-priority"} {
+        set args  [lreplace $args 0 0]
+        set value [lindex $args 0]
+        if [catch {format %d $value} err] {
+            set errMsg "Usage: $type message "
+            foreach op $loggerMethods(message) {
+                set errMsg [format "%s\n       -$op <value> <message>" $errMsg]
+            }
+            error $errMsg
+            return
+        }
+        set args [lreplace $args 0 0]
+        # set the priority here when we decide to use it...
+    }
+
+    if {[lindex $args 0] == "-nonewline"} {
+        set args [lreplace $args 0 0]
+
+        catch {puts -nonewline [logger cget -ioHandle] [join $args " "]}
+
+        if [info exists loggerParms(enabled)] {
+            puts -nonewline [logger cget -fileID] [join $args " "]
+        }
+    } else {
+        catch {puts [logger cget -ioHandle] [join $args " "]}
+
+        if [info exists loggerParms(enabled)] {
+            puts [logger cget -fileID] [join $args " "]
+        }
+    }
+
+    flush [logger cget -ioHandle]
+
+    # required not only for flushing the stdout, but also to flush anything from the
+    # open socket connections  (should probably revisit the socket code later)
+    update
+}
+
+
+#######################################################################################
+# Procedure: logger::show
+#
+# Description: This command is used to show log parameters. Usage is as follows:
+#				logger show
+#
+#######################################################################################
+proc logger::show {args} \
+{
+    ixPuts "	logger parameters"
+    ixPuts "	=================================="
+    showCmd logger
+}
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/logCollector.tcl b/dep/tclclient/ixTcl1.0/Generic/logCollector.tcl
new file mode 100644
index 00000000..35935976
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/logCollector.tcl
@@ -0,0 +1,162 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: logCollector.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	05-29-2007	DS
+#
+# Description: This file contains procs used to collect & send logs to support
+#
+##################################################################################
+
+
+########################################################################
+# Procedure: ixCollectAndSendLogs
+#
+# This command wraps the exe used to collect logs, zip them & send them to support
+#	NOTE:  This command does NOT require a package req IxTclHal to run
+#
+# Arguments(s):
+#	argList - options include:
+#		-chassis <hostname><.card><.port>
+#		-userEmail <my email, used to cc on support email>
+#		-supportEmail <my favourite support person's email>
+#		-stepsToReproduce <text describing how to reproduce the issue>
+#		-zipFileName <myZipFile.zip>
+#
+########################################################################
+proc ixCollectAndSendLogs {args} \
+{
+    set level	  [expr [info level]]
+    set procName  "[lindex [info level $level] 0]"
+
+	set optList {-chassis -userEmail -supportEmail -stepsToReproduce -zipFileName}
+
+	if {[llength $args] == 0} {
+		puts "Usage: $procName "
+		foreach op $optList {
+			puts "       $op  <[string trimleft $op "-"]>"
+		}
+		flush stdout
+		return 1
+	}
+
+	# this has to change, but leaving it here for the moment...
+	set exeString [list exec "../diagnostic/logcollectorclient.exe"]
+
+	foreach {option parameter} $args {
+		switch -glob -- $option {
+			-chassis {
+				set parameter [split $parameter .]
+				set result [scan $parameter "%s %d %d" chassis card port]
+				switch -- $result {
+					1 {
+						set exeString [concat $exeString "--chassis $chassis"]
+					}
+					2 {
+						set exeString [concat $exeString "--chassis $chassis,$card"]
+					}
+					3 {
+						set exeString [concat $exeString "--chassis $chassis,$card,$port"]
+					}
+					default {
+						puts "$procName:  No chassis/hostname specified"
+						return 1
+					}
+				}								
+			}
+			-userEmail {
+				# just do some quickie checking looking for @ & .   The exe should do the rest.
+				if {[llength $parameter] > 0} {
+					if {[regexp -all {[@.]} $parameter] >= 2} {
+						lappend exeString "--useremail=$parameter"
+					} else {
+						puts "$procName:  Invalid userEmail: $parameter"
+						return 1
+					}
+				} else {
+					puts "$procName:  No userEmail specified"
+					return 1
+				}
+			}
+			-supportEmail {
+				# just do some quickie checking looking for @ & .   The exe should do the rest.
+				if {[llength $parameter] > 0} {
+					if {[regexp -all {[@.]} $parameter] >= 2} {
+						lappend exeString "--supportemail=$parameter"
+					} else {
+						puts "$procName:  Invalid supportEmail: $parameter"
+						return 1
+					}
+				} else {
+					puts "$procName:  No supportEmail specified"
+					return 1
+				}
+			}
+			-stepsToReproduce {
+				if {[llength $parameter] > 0} {
+					set exeString [concat $exeString "--usertext $parameter"]
+				} else {
+					puts "Warning:  No steps to reproduce included with collection of log files"
+				}
+			}
+			-zipFileName {
+				if {[llength $parameter] > 0} {
+					set exeString [concat $exeString "--zip $parameter"]
+				}
+			}
+			default {
+				puts "Usage: $procName "
+				foreach op $optList {
+					puts "       -$op  <value>"
+				}
+				flush stdout
+				return
+			}
+		}
+		catch {unset option}
+		catch {unset parameter}
+	}
+
+	puts $exeString
+	
+	if [catch {eval $exeString} retCode] {
+		puts "$procName: $exeString failed: $retCode"
+		return 1
+	}
+
+	return 0
+}
diff --git a/dep/tclclient/ixTcl1.0/Generic/map.tcl b/dep/tclclient/ixTcl1.0/Generic/map.tcl
new file mode 100644
index 00000000..11c2163a
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/map.tcl
@@ -0,0 +1,383 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: map.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	02-05-1998	DS	Genesis
+#
+# Description: This file contains all the commands to configure the mapping
+# of traffic which could be from ports of one card of one chassis to any port
+# on same card on same chassis, different card on same chassis or different
+# cards on different chassis. Any combination can be specified.
+#
+##################################################################################
+
+
+
+########################################################################################
+# Procedure: map::new
+#
+# Description: This command deletes the existing type & creates a new map.
+#
+########################################################################################
+proc map::new {args} \
+{
+	global mapMethods mapParms
+
+	set type "map"
+
+	if {[llength $args] == 0} {
+		logMsg "Usage: $type new "
+		foreach op $mapMethods(new) {
+			logMsg "       -$op  <value>"
+		}
+		return
+	}
+
+	if {[string index [lindex $args 0] 0] != "-"} {
+		logMsg "Usage: $type new "
+		foreach op $mapMethods(new) {
+			logMsg "       -$op  <value>"
+		}
+		return
+	}
+	set opt [string trimleft [lindex $args 0] "-"]
+	if {[lsearch $mapMethods(new) $opt] == -1} {
+		logMsg "Usage: $type new "
+		foreach op $mapMethods(new) {
+			logMsg "       -$op  <value>"
+		}
+		return
+	}
+
+    set mapType [lindex $args 1]
+
+    if {![validateMapType $mapType]} {
+        set mapArray    [format "%sArray" $mapType]
+        global $mapArray
+
+        if [info exists $mapArray] {
+            unset $mapArray
+        }
+    }
+}
+
+
+#######################################################################################
+# Procedure: map::add
+#
+# Description: This command adds a chassis, card and port number for tx and rx.
+#
+########################################################################################
+proc map::add {args} \
+{
+	global mapMethods mapParms mapConfigVals 
+	global one2oneArray one2manyArray many2oneArray many2manyArray
+
+	# if no option name was passed then display all options available for tx
+	if {[llength $args] == 0} {
+		return -code error "Usage: map add $mapMethods(add)"
+	}
+
+	if {[llength $args] != [llength $mapMethods(add)]} {
+		return -code error "Usage: map add $mapMethods(add)"
+	}
+
+	if {![info exists mapParms(type)]} {
+		return -code error "map type not configured yet."
+	}
+
+	set tx_c [lindex $args 0]
+	set tx_l [lindex $args 1]
+	set tx_p [lindex $args 2]
+	set rx_c [lindex $args 3]
+	set rx_l [lindex $args 4]
+	set rx_p [lindex $args 5]
+
+	# first of all, don't let tx=rx!! 
+    #if {($tx_c == $rx_c) && ($tx_l == $rx_l) && ($tx_p == $rx_p)} {
+    #    return -code error "Invalid map: Tx == Rx"
+    #}
+
+	switch $mapParms(type) {
+		"one2one" {
+			# check if tx is already configured as tx
+			if {[info exists one2oneArray($tx_c,$tx_l,$tx_p)]} {
+				return -code error "map Tx:[getPortId $tx_c $tx_l $tx_p] exists.\
+					                Delete it and add again to change the Rx"
+			}
+
+			# check if rx is already configured as rx
+			foreach r [array names one2oneArray] {
+				if {[string compare $one2oneArray($r) "{$rx_c $rx_l $rx_p}"] == 0} {
+					return -code error "map Rx:[getPortId $rx_c $rx_l $rx_p] is already configured for Rx."
+				}
+			}
+
+			set one2oneArray($tx_c,$tx_l,$tx_p) [list [list $rx_c $rx_l $rx_p]]
+		}
+
+		"one2many" {
+			# check if rx is already configured as rx on this tx port
+			foreach txPort [array names one2manyArray] {
+    			if {[lsearch $one2manyArray($txPort) [list $rx_c $rx_l $rx_p]] >= 0} {
+                    if {"$tx_c,$tx_l,$tx_p" == $txPort} {
+    				    return -code error "map Tx:[getPortId $tx_c $tx_l $tx_p] to Rx:[getPortId $rx_c $rx_l $rx_p] already exists."
+                    } else {
+    				    return -code error "map Rx:[getPortId $rx_c $rx_l $rx_p] is already configured for Rx."
+                    }
+    			}
+            }
+
+			set one2manyArray($tx_c,$tx_l,$tx_p) [lappend one2manyArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+		}
+
+		"many2one" {
+			# check if tx is already configured as tx
+			if {[info exists many2oneArray($tx_c,$tx_l,$tx_p)]} {
+    			if {$many2oneArray($tx_c,$tx_l,$tx_p) == "{$rx_c $rx_l $rx_p}"} {
+    			    return -code error "map Tx:[getPortId $tx_c $tx_l $tx_p] to Rx:[getPortId $rx_c $rx_l $rx_p] already exists."
+                } else {
+    			    return -code error "map Tx:[getPortId $tx_c $tx_l $tx_p] is already configured for Tx."
+                }
+			}
+
+			set many2oneArray($tx_c,$tx_l,$tx_p) [list [list $rx_c $rx_l $rx_p]]
+		}
+
+		"many2many" {
+            if {([lsearch [array names many2manyArray] "$tx_c,$tx_l,$tx_p"] != -1)} {
+                if {[lsearch $many2manyArray($tx_c,$tx_l,$tx_p) "$rx_c $rx_l $rx_p"] == -1} {
+		            set many2manyArray($tx_c,$tx_l,$tx_p) [lappend many2manyArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+                }
+            } else {
+		        set many2manyArray($tx_c,$tx_l,$tx_p) [lappend many2manyArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+            }
+		}
+
+	}
+
+	return -code ok
+}
+
+########################################################################################
+# Procedure: map::del
+#
+# Description: This command deletes a chassis, card and port number for tx and rx.
+#
+########################################################################################
+
+proc map::del {args} \
+{
+	global mapMethods mapParms mapConfigVals
+
+    set retCode $::TCL_ERROR
+
+	# if no option name was passed then display all options available for tx
+	if {[llength $args] == 0} {
+		logMsg "Usage: map del $mapMethods(del)"
+		return $::TCL_ERROR
+	}
+
+	if {[llength $args] != [llength $mapMethods(add)]} {
+		logMsg "Usage: map del $mapMethods(del)"
+		return $::TCL_ERROR
+	}
+
+	if {![info exists mapParms(type)]} {
+		logMsg "map type not configured yet."
+		return $::TCL_ERROR
+	}
+
+	set tx_c [lindex $args 0]
+	set tx_l [lindex $args 1]
+	set tx_p [lindex $args 2]
+	set rx_c [lindex $args 3]
+	set rx_l [lindex $args 4]
+	set rx_p [lindex $args 5]
+
+	switch $mapParms(type) {
+		"one2one" {
+            global one2oneArray
+			foreach tx [array names one2oneArray] {
+				if {$tx == "$tx_c,$tx_l,$tx_p" && [join $one2oneArray($tx)] == [list $rx_c $rx_l $rx_p]} {
+					unset one2oneArray($tx)
+                    set retCode $::TCL_OK
+                    break
+				}
+			}
+		}
+
+		"one2many" {
+            global one2manyArray
+
+            if [info exists one2manyArray($tx_c,$tx_l,$tx_p)] {				
+			    set indx [lsearch $one2manyArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+			    if {$indx >= 0} {
+			        if {[llength $one2manyArray($tx_c,$tx_l,$tx_p)] == 1} {
+				        unset one2manyArray($tx_c,$tx_l,$tx_p)
+			        } else {
+				        set one2manyArray($tx_c,$tx_l,$tx_p) [lreplace $one2manyArray($tx_c,$tx_l,$tx_p) $indx $indx]
+			        }
+                    set retCode $::TCL_OK
+                }
+            }
+		}
+
+		"many2one" {
+            global many2oneArray
+			foreach tx [array names many2oneArray] {
+				if {$tx == "$tx_c,$tx_l,$tx_p" && [join $many2oneArray($tx)] == [list $rx_c $rx_l $rx_p]} {
+					unset many2oneArray($tx)
+                    set retCode $::TCL_OK
+                    break
+				}
+			}
+		}
+
+		"many2many" {
+            global many2manyArray
+            if [info exists many2manyArray($tx_c,$tx_l,$tx_p)] {				
+			    set indx [lsearch $many2manyArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+			    if {$indx >= 0} {
+			        if {[llength $many2manyArray($tx_c,$tx_l,$tx_p)] == 1} {
+				        unset many2manyArray($tx_c,$tx_l,$tx_p)
+			        } else {
+				        set many2manyArray($tx_c,$tx_l,$tx_p) [lreplace $many2manyArray($tx_c,$tx_l,$tx_p) $indx $indx]
+			        }
+                    set retCode $::TCL_OK
+                }
+            }
+		}
+
+	}
+
+	return $retCode
+}
+
+
+########################################################################################
+# Procedure: map::show
+#
+# Description: This command is used to show the current port map.
+#
+# Arguments:
+#   mapType     - valid options are: one2one, one2many, many2one or many2many
+#                 Default is current configured mapType
+#
+########################################################################################
+proc map::show {{mapType ""}} \
+{
+    global  mapConfigVals
+
+    if {$mapType == ""} {
+        set mapType [map cget -type]
+    }
+
+    if [validateMapType $mapType] {
+        return
+    }
+
+    set mapArray    [format "%sArray" $mapType]
+    global $mapArray
+
+    logMsg "\nMap type: $mapType"
+
+    if {[llength [array names $mapArray]] < 1} {
+        logMsg "--->No ports in map.\n"
+        set retCode 1
+    } else {
+        foreach txMap [lnumsort [array names $mapArray]] {
+            scan [join $txMap] "%d,%d,%d" tx_c tx_l tx_p
+
+            foreach rxMap [set ${mapArray}($tx_c,$tx_l,$tx_p)] {
+                scan [join $rxMap] "%d %d %d" rx_c rx_l rx_p
+
+                logMsg "\tTx:[getPortId $tx_c $tx_l $tx_p]   Rx: [getPortId $rx_c $rx_l $rx_p]"
+            }
+        }
+        logMsg "\n"
+    }
+}
+
+
+########################################################################################
+# Procedure: map::validateMapType
+#
+# Description: This command is used to find out if the given map type is valid.
+#
+# Arguments:
+#   mapType     - valid options are: one2one, one2many, many2one or many2many
+#
+########################################################################################
+proc map::validateMapType {mapType {verbose verbose}} \
+{
+    global  mapConfigVals
+
+    set notValidMap    1
+
+    foreach thing [map getValidValues -type] {
+        if {$mapType == $thing} {
+            set notValidMap    0
+            break
+        }
+    }
+    if {$notValidMap && $verbose == "verbose"} {
+        errorMsg "Error - invalid map type: $mapType"
+    }
+
+    return $notValidMap
+}
+
+
+########################################################################################
+# Procedure: showmaps
+#
+# Description: This command is used to show all port maps.
+#
+#
+########################################################################################
+proc showmaps {} \
+{
+    global  mapConfigVals
+
+    foreach thing [split $mapConfigVals(type) |] {
+        map show $thing
+    }
+}
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/miiUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/miiUtils.tcl
new file mode 100644
index 00000000..e379b6d7
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/miiUtils.tcl
@@ -0,0 +1,619 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: miiUtils.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	05-05-03	DS
+#
+# Description: This file contains common procs used to configure features
+#              via the MII ixTclHal api
+#
+##################################################################################
+
+
+proc ixMiiConfigPreEmphasis           {chassis card port peSetting} {return [miiConfig::preEmphasis $chassis $card $port $peSetting]}
+proc ixMiiConfigLossOfSignalThreshold {chassis card port threshold} {return [miiConfig::lossOfSignalThreshold $chassis $card $port $threshold]}
+proc ixMiiConfigXgxsLinkMonitoring    {chassis card port enable}    {return [miiConfig::xgxsLinkMonitoring $chassis $card $port $enable]}
+proc ixMiiConfigAlignRxDataClock      {chassis card port clock}     {return [miiConfig::alignRxDataClock $chassis $card $port $clock]}
+proc ixMiiConfigReceiveEqualization   {chassis card port value}     {return [miiConfig::receiveEqualization $chassis $card $port $value]}
+proc ixMiiConfigXauiOutput            {chassis card port enable}    {return [miiConfig::xauiOutput $chassis $card $port $enable]}
+proc ixMiiConfigXauiSerialLoopback    {chassis card port enable}    {return [miiConfig::xauiSerialLoopback $chassis $card $port $enable]}
+proc ixMiiConfigXgmiiParallelLoopback {chassis card port enable}    {return [miiConfig::xgmiiParallelLoopback $chassis $card $port $enable]}
+
+
+namespace eval miiConfig {
+}
+
+namespace eval miiaeConfig {
+}
+
+
+########################################################################
+# Procedure: preEmphasis
+#
+# This command configs the pre-emphasis bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   peSetting  <miiPreemphasis_none|miiPreemphasis_18|miiPreemphasis_38|miiPreemphasis_75>
+#
+########################################################################
+proc miiConfig::preEmphasis {chassis card port peSetting} \
+{
+    switch $peSetting {
+        75 {
+            set peSetting $::miiPreemphasis_75
+        }
+        38 {
+            set peSetting $::miiPreemphasis_38
+        }
+        18 {
+            set peSetting $::miiPreemphasis_18
+        }
+    }            
+
+    if {$peSetting > 3 || $peSetting < 0} {
+        errorMsg "$peSetting not supported for preEmphasis"
+        set retCode $::TCL_ERROR
+        return $retCode
+    }
+
+    set peSetting [expr $peSetting << 14]
+
+    return [setRegister $chassis $card $port $::miiRegister28 0xc000 $peSetting]
+}
+
+
+########################################################################
+# Procedure: lossOfSignalThreshold
+#
+# This command configs the lossOfSignalThreshold bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   threshold  <miiPreemphasis_none|miiPreemphasis_18|miiPreemphasis_38|miiPreemphasis_75>
+#
+########################################################################
+proc miiConfig::lossOfSignalThreshold {chassis card port threshold} \
+{
+    switch $threshold {
+        160 {
+            set threshold $::miiLossOfSignal160mv
+        }
+        240 {
+            set threshold $::miiLossOfSignal240mv
+        }
+        200 {
+            set threshold $::miiLossOfSignal200mv
+        }
+        120 {
+            set threshold $::miiLossOfSignal120mv
+        }
+        80 {
+            set threshold $::miiLossOfSignal80mv
+        }
+    }            
+
+    if {$threshold > 4 || $threshold < 0} {
+        errorMsg "$threshold not supported for lossOfSignalThreshold"
+        set retCode $::TCL_ERROR
+        return $retCode
+    }
+
+    set threshold [expr $threshold << 4]
+
+    return [setRegister $chassis $card $port $::miiRegister29 0x0070 $threshold]
+}
+
+
+########################################################################
+# Procedure: xgxsLinkMonitoring
+#
+# This command configs the xgxsLinkMonitoring bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   enable <$::TRUE|$::FALSE>
+#
+########################################################################
+proc miiConfig::xgxsLinkMonitoring {chassis card port enable} \
+{
+    switch $enable {
+        enable -
+        ENABLE -
+        true -
+        TRUE {
+            set enable $::TRUE
+        }
+        enable -
+        ENABLE -
+        false -
+        FALSE {
+            set enable $::FALSE
+        }
+        1 -
+        0 {
+        }
+        default {
+            errorMsg "XgxsLinkMonitoring enable must be bool <1|0>"
+            set retCode $::TCL_ERROR
+            return $retCode
+        }
+    }
+
+    return [setRegister $chassis $card $port $::miiRegister29 0x0040 $enable]
+}
+
+
+########################################################################
+# Procedure: alignRxDataClock
+#
+# This command configs the alignRxDataClock bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   clock
+#
+########################################################################
+proc miiConfig::alignRxDataClock {chassis card port clock} \
+{
+    set retCode $::TCL_OK
+
+    switch $clock "
+        miiRecoveredClock -
+        $::miiRecoveredClock {
+            set clock $::miiRecoveredClock
+        }
+        miiLocalRefClock -
+        $::miiLocalRefClock {
+            set clock $::miiLocalRefClock
+        }
+        default {
+            errorMsg [list Invalid clock $clock selected.]
+            set retCode $::TCL_ERROR
+            return $retCode
+        }
+    "
+    return [setRegister $chassis $card $port $::miiRegister24 0x0001 $clock]
+}
+
+
+########################################################################
+# Procedure: receiveEqualization
+#
+# This command configs the receiveEqualization bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   value
+#
+########################################################################
+proc miiConfig::receiveEqualization {chassis card port value} \
+{
+    if {$value > 15 || $value < 0} {
+        errorMsg "$value not supported for receiveEqualization"
+        set retCode $::TCL_ERROR
+        return $retCode
+    }
+
+    return [setRegister $chassis $card $port $::miiRegister28 0x000F $value]
+}
+
+
+########################################################################
+# Procedure: xauiOutput
+#
+# This command configs the xauiOutput bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   enable <$::TRUE|$::FALSE>
+#
+########################################################################
+proc miiConfig::xauiOutput {chassis card port enable} \
+{
+    switch $enable {
+        1 -
+        enable -
+        ENABLE -
+        true -
+        TRUE {
+            set enable 0xAAAA
+        }
+        0 -
+        enable -
+        ENABLE -
+        false -
+        FALSE {
+            set enable 0
+        }
+        default {
+            errorMsg "XAUI Output enable must be bool <1|0>"
+            set retCode $::TCL_ERROR
+            return $retCode
+        }
+    }
+
+    return [setRegister $chassis $card $port $::miiRegister30 0xAAAA $enable]
+}
+
+
+########################################################################
+# Procedure: xauiSerialLoopback
+#
+# This command enable/disables the xauiSerialLoopback bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   enable
+#
+########################################################################
+proc miiConfig::xauiSerialLoopback {chassis card port enable} \
+{
+    set retCode $::TCL_ERROR
+
+    switch $enable {
+        enable -
+        ENABLE -
+        true -
+        TRUE {
+            set enable $::TRUE
+        }
+        enable -
+        ENABLE -
+        false -
+        FALSE {
+            set enable $::FALSE
+        }
+        1 -
+        0 {
+        }
+        default {
+            errorMsg "XAUISerialLoopback enable must be bool <1|0>"
+            set retCode $::TCL_ERROR
+            return $retCode
+        }
+    }
+
+    # If Serial loopback selected:
+    #       - set bit 14 of register 0. If it's not selected, clear that bit
+    #       - clear bits 0-3 and set bits 8-11 for register 23.
+    if {$enable} {
+        set reg23   0x0F00
+    } else {
+        set reg23   0x0000
+    }
+
+    if {[setRegister $chassis $card $port $::miiRegister23 0x0F0F $reg23] == $::TCL_OK} {        
+        set bits [expr $enable << 14]
+        if {[setRegister $chassis $card $port $::miiControl 0x4000 $bits noGet] == $::TCL_OK} {
+            set retCode $::TCL_OK
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: xgmiiParallelLoopback
+#
+# This command enable/disables the xgmiiParallelLoopback bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   loopback
+#
+########################################################################
+proc miiConfig::xgmiiParallelLoopback {chassis card port enable} \
+{
+    switch $enable {
+        enable -
+        ENABLE -
+        true -
+        TRUE {
+            set enable $::TRUE
+        }
+        enable -
+        ENABLE -
+        false -
+        FALSE {
+            set enable $::FALSE
+        }
+        1 -
+        0 {
+        }
+        default {
+            errorMsg "XGMIIParallelLoopback enable must be bool <1|0>"
+            set retCode $::TCL_ERROR
+            return $retCode
+        }
+    }
+
+    if {$enable} {
+        set reg23   0x000F
+    } else {
+        set reg23   0x0000
+    }
+
+    if {[setRegister $chassis $card $port $::miiControl 0x4000 0x0000] == $::TCL_OK} {
+        if {[setRegister $chassis $card $port $::miiRegister23 0x0F0F $reg23 noGet] == $::TCL_OK} {        
+            set retCode $::TCL_OK
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: isXauiSerialLoopback
+#
+# This command checks the xauiSerialLoopback bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#
+# Return code:
+#   true if enabled
+#
+########################################################################
+proc miiConfig::isXauiSerialLoopback {chassis card port} \
+{
+    return [expr [getRegister $chassis $card $port $::miiControl] & 0x4000 && \
+                 [getRegister $chassis $card $port $::miiRegister23 noGet] & 0x0f00]
+
+}
+
+
+########################################################################
+# Procedure: isXgmiiParallelLoopback
+#
+# This command checks the isXgmiiParallelLoopback bits for 10ge
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#
+# Return code:
+#   true if enabled
+#
+########################################################################
+proc miiConfig::isXgmiiParallelLoopback {chassis card port} \
+{
+    if {[expr [getRegister $chassis $card $port $::miiRegister23] & 0x000F] == 0x000f} {
+        set retCode $::true
+    } else {
+        set retCode $::false
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: setRegister
+#
+# This command sets the register for 10ge - PRIVATE
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   register    <ie., $::register28>
+#   bitMask     <ie., 0xc000>
+#   get         default: true; sometimes you don't want to 'get' first...
+#
+########################################################################
+proc miiConfig::setRegister {chassis card port register bitMask value {get true}} \
+{
+    set retCode $::TCL_OK
+
+    if {$get == "true"} {
+        if [mii get $chassis $card $port] {
+            errorMsg "Error getting mii for port [getPortId $chassis $card $port]"
+            set retCode $::TCL_ERROR
+        }
+    }
+
+    if [mii selectRegister $register] {
+        errorMsg "Error selecting register $register"
+        set retCode $::TCL_ERROR
+    }
+
+    set registerValue [format "0x%s" [mii cget -registerValue]]
+    mii config -registerValue [format %04x [expr {$value & $bitMask} | {$registerValue & ~$bitMask}]]
+    
+    if [mii set $chassis $card $port] {
+        errorMsg "Error setting mii for port [getPortId $chassis $card $port]"
+        set retCode $::TCL_ERROR
+    }
+   
+    return $retCode
+}
+
+
+
+########################################################################
+# Procedure: getRegister
+#
+# This command gets the register for 10ge - PRIVATE
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   register    <ie., $::register28>
+#   get         default: true; sometimes you don't want to 'get' first...
+#
+# Returns:
+#   value of register as hex number
+#
+########################################################################
+proc miiConfig::getRegister {chassis card port register {get true}} \
+{
+    set value 0x0000
+
+    if {$get == "true"} {
+        if [mii get $chassis $card $port] {
+            errorMsg "Error getting mii for port [getPortId $chassis $card $port]"
+            set retCode $::TCL_ERROR
+        }
+    }
+
+    if [mii selectRegister $register] {
+        errorMsg "Error selecting register $register"
+        return $value
+    }
+
+    return [format "0x%s" [mii cget -registerValue]]
+} 
+
+########################################################################
+# Procedure: setRegister
+#
+# This command sets the register for 10ge - PRIVATE
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   register    <ie., $::register28>
+#   bitMask     <ie., 0xc000>
+#   get         default: true; sometimes you don't want to 'get' first...
+#
+########################################################################
+proc miiaeConfig::setRegister { chassis card port mdioIndex deviceAddress register bitMask value } \
+{
+    set retCode $::TCL_OK
+
+
+	set registerAddress [miiaeConfig::getRegister $chassis $card $port $mdioIndex $deviceAddress $register ]
+	set registerValue	[format "0x%s" [mmdRegister cget -registerValue]]
+
+	
+    # Since we don't have setRegister command, therefore we have to remove and the same register again
+	if [mmd delRegister $register] {
+        errorMsg "Error deleting mmd register $register"
+		set retCode $::TCL_ERROR
+    }  
+
+    if {[miiae delDevice $deviceAddress]} {
+        errorMsg "Error setting miiae for port [getPortId $chassis $card $port]"
+        set retCode $::TCL_ERROR
+    }	 
+
+    mmdRegister config -registerValue [format %04x [expr {$value & $bitMask} | {$registerValue & ~$bitMask}]]
+
+    if {[mmd addRegister ]} {
+        errorMsg "Error adding mmd register $register"
+		set retCode $::TCL_ERROR
+    }
+
+	mmd config -address $registerAddress
+
+    if {[miiae addDevice]} {
+        errorMsg "Error adding miiae device for port [getPortId $chassis $card $port]"
+        set retCode $::TCL_ERROR
+    }
+
+    if {[miiae set $chassis $card $port $mdioIndex]} {
+        errorMsg "Error setting miiae for port [getPortId $chassis $card $port]"
+        set retCode $::TCL_ERROR
+    }
+   
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getRegister
+#
+# This command gets the register for 10ge - PRIVATE
+#
+# Arguments(s):
+#   chassis
+#   card
+#   port
+#   register    <ie., $::register28>
+#   get         default: true; sometimes you don't want to 'get' first...
+#
+# Returns:
+#   value of register as hex number
+#
+########################################################################
+proc miiaeConfig::getRegister {chassis card port mdioIndex deviceAddress register} \
+{
+    set value 0x0000
+
+    if [miiae get $chassis $card $port $mdioIndex] {
+        errorMsg "Error getting miiae PHY $mdioIndex for port [getPortId $chassis $card $port]"
+        set retCode $::TCL_ERROR
+    }
+
+    if [miiae getDevice $deviceAddress] {
+        errorMsg "Error getting miiae device  $deviceAddress"
+        set retCode $::TCL_ERROR
+    }
+
+    if [mmd getRegister $register] {
+        errorMsg "Error getting mmd register $register"
+        set retCode $::TCL_ERROR
+	} else {
+		set value [format "0x%s" [mmd cget -address]]
+	}
+
+    return $value
+}
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/miscCmds.tcl b/dep/tclclient/ixTcl1.0/Generic/miscCmds.tcl
new file mode 100644
index 00000000..3ccb3f9e
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/miscCmds.tcl
@@ -0,0 +1,992 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: miscCmds.tcl
+#    Copyright ©  IXIA
+#    All Rights Reserved.
+#
+#    Revision Log:
+#    02-05-1998    DS    Genesis
+#
+# Description: Contains miscellaneous log file commands.
+#
+##################################################################################
+
+########################################################################
+# Procedure: logOn
+#
+# This command wraps the logger command logger on & sets the parameter
+#              -logFileName to the defaulted file.
+#
+# Arguments:
+#   filename    - filename, w/out directory, to open
+#                 directory *must* be specified via cget -directory
+#
+########################################################################
+proc logOn {{file {}}} \
+{
+    logger config -logFileName $file
+    logger on
+}
+
+
+########################################################################
+# Procedure: logOff
+#
+# This command wraps the logger command logger off
+#
+########################################################################
+proc logOff {} \
+{
+    logger off
+}
+
+
+########################################################################
+# Procedure: logMsg
+#
+# Description: This command wraps the logger command logger message
+#
+# Arguments: args - a list of valid arguments
+#
+# Results: Returns 0 for ok and 1 for error.  WARNING: Cannot use TCL_OK
+#          and TCL_ERROR at this point.  It was failing on certain unix
+#          and linux combinations
+########################################################################
+proc logMsg {args} \
+{
+    set retCode 0
+    if {[lindex $args 0] == "-nonewline"} {
+        set args [lreplace $args 0 0]
+        if {[catch {eval logger::message -nonewline $args} err]} {
+            set retCode 1
+        }
+    } else {
+        if {[catch {eval logger::message $args} err]} {
+            set retCode 1
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: errorMsg
+#
+# This command prints the name of the current proc + a message - intended
+# for output of error messages.
+#
+########################################################################
+proc errorMsg {args} \
+{
+    set level [expr [info level] - 1]
+    if {$level > 0} {
+        set levelStr    "[lindex [info level $level] 0]: "
+    } else {
+        set levelStr    "Error: "
+    }
+
+    set verbose     1
+    set nonewline   0
+
+    while {[string index [lindex $args 0] 0] == "-"} {    
+        switch [string range [lindex $args 0] 1 end] {
+            "verbose" {
+                set verbose 1
+                set args [lreplace $args 0 0]
+            }
+            "noVerbose" {
+                set verbose 0
+                set args [lreplace $args 0 0]
+            }
+            "nonewline" {
+                set nonewline 1
+                set args [lreplace $args 0 0]
+            }
+            default {
+                break
+            }
+        }
+    }
+
+    if {$verbose} {
+        if {$nonewline} {
+            logger message -priority 1 -nonewline $levelStr[join $args " "]
+        } else {
+            logger message -priority 1 "$levelStr[join $args " "]"
+        }
+    }
+}
+
+
+########################################################################
+# Procedure: debugOn
+#
+# This command enables debug messages & sends them to a file.
+#
+########################################################################
+proc debugOn {{file {}}} \
+{
+    global debug
+
+    set debug(enabled) 1
+    if {[string length $file] == 0} {
+        set debug(file) [file join [logger cget -directory] debugfile.log]
+    } else {
+        set debug(file) [file join [logger cget -directory] $file]
+    }
+
+    if [catch {open $debug(file) w} fileID] {
+        puts stdout "Cannot open $debug(file): $fileID"
+        set debug(file) stdout
+    } else {
+        set debug(file) $fileID
+    }
+
+    proc debugMsg {args} \
+    {
+        global debug
+
+        set levelStr    ""
+        set level       [expr [info level] - 1]
+        if {$level > 0} {
+            set levelStr    "[lindex [info level $level] 0]: "
+        }
+
+        puts $debug(file) $levelStr[join $args " "]
+    }
+}
+
+
+########################################################################
+# Procedure: debugOff
+#
+# This command disables debug messages & sets the proc debugMsg to empty
+#
+########################################################################
+proc debugOff {} \
+{
+    global debug
+    if [info exists debug(enabled)] {
+        unset debug(enabled)
+        flush $debug(file)
+        if {$debug(file) != "stdout"} {
+            close $debug(file)
+        }
+    }
+    proc debugMsg {args} \
+    {
+    }
+}
+
+
+
+########################################################################
+# Procedure: debugMsg
+#
+# If debugging is enabled, prints a message to the debug file.
+#
+########################################################################
+proc debugMsg {args} \
+{
+}
+
+
+##################################################################################
+# Procedure: showCmd
+#
+# This command lists all available cget options & their current values
+#
+# Argument(s):
+#   cmd     name of command to show
+#
+##################################################################################
+proc showCmd {cmd {method cget}} \
+{
+    catch {$cmd $method} paramList
+    foreach param [lsort [join $paramList]] {
+        if {$param == "-this"} {
+            continue
+        }
+        if {[string index $param 0] == "-"} {
+            logMsg "$cmd $method $param: [$cmd cget $param]"
+        }
+    }
+}
+
+
+########################################################################
+# Procedure:   openMyFile
+#
+# Description: This command opens a file set by a command, w/backup if required.
+#
+# The global array openedFileName contains the full name of opened files indexed
+# by their channels. This information will be used to set the permission of the file
+# back to both readable and writable when its channel is closed by closeMyFile. 
+#
+# Arguments:   filename - filename, w/out directory, to open directory *must* be specified via cget -directory
+#              testCmd  - test command name, ie., logger or results
+#
+# Returns:     fileID if successful, or "" if unsuccessful
+########################################################################
+proc openMyFile {filename {fileAccess w} {command logger}} \
+{
+    global openedFileName
+
+    set fileID  stdout
+    set fullFileName [file join [$command cget -directory] $filename]
+
+    if {[$command cget -fileBackup] == "true" && $fileAccess == "w"} {
+        # if the log file by this name exists, then copy it into a different name
+        # with a magic number that increments every time the test is run
+        if {[file exists $fullFileName]} {
+            set filePrefix      [file rootname [file tail $fullFileName]]
+            set magicNum        [clock format [file mtime $fullFileName] -format "%H%M%S"]
+
+            # put the full path for new file name
+            set newFileName         [format "%s%s%s" $filePrefix $magicNum [file extension $filename]]
+            set newFullFileName     [file join [$command cget -directory] $newFileName]
+            if [catch {file rename -force $fullFileName $newFullFileName} res] {
+                errorMsg "$res"
+            }
+        }
+    }
+
+    set fileID [ixFileUtils::open $fullFileName $fileAccess]
+    if {$fileID == ""} {
+        set fileID  stdout
+    } else {
+        set openedFileName($fileID) $fullFileName
+    }
+
+    return $fileID
+}
+
+
+########################################################################
+# Procedure:   closeMyFile
+#
+# Description: This command closes a file that is opened by the command openMyFile.
+#
+# Arguments:   fileId - channel id of the file to be closed
+#
+# Returns:     None
+########################################################################
+proc closeMyFile {fileId} \
+{
+    global openedFileName
+
+    if {$fileId == "stdout"} {
+        return
+    }
+
+    ixFileUtils::close $fileId
+
+    if { [info exists openedFileName($fileId)] } {
+        catch {unset openedFileName($fileId)}
+    }
+}
+
+
+########################################################################
+# Procedure: callTraceMsg
+#
+# This command prints a trace of the procs
+#
+########################################################################
+proc callTraceMsg {{arg ""}} \
+{
+    errorMsg $arg
+    for {set x [expr [info level]-1]} {$x > 0} {incr x -1} {
+        ixPuts "$x: [info level $x]"
+    }
+}
+
+
+########################################################################
+# Procedure: traceVariableMsg
+#
+# This command traces 
+#
+########################################################################
+proc traceVariableMsg {name1 name2 op} \
+{
+    upvar $name1 Name1
+    errorMsg [format "variable = %s, value = %s" $name1 $Name1]
+}
+
+
+##################################################################################
+# Procedure: isDigit
+#
+# This command checks to see if it is digit.
+#
+# Argument(s):
+#
+##################################################################################
+proc isDigit {arg} \
+{
+    set retCode 1
+
+    if [catch {format %d $arg}] {
+        set retCode 0
+    } 
+    return $retCode
+} 
+
+
+##################################################################################
+# Procedure: isNegative
+#
+# This command checks to see if it is negative - (needed for >32 bit numbers)
+#
+# Argument(s):
+#
+##################################################################################
+proc isNegative {arg} \
+{
+    set retCode 0
+
+    if { [regexp {^-[0-9]+$} $arg] } {
+        set retCode 1
+    }
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure:   isValidExponentialFloat
+#
+# Description: Tells if a value is a legal exponential float.
+#
+# Argument(s): valueToCheck - the value to check.
+#
+# Returns:     true if valid, false otherwise
+##################################################################################
+proc isValidExponentialFloat { valueToCheck } \
+{
+    if {($valueToCheck == "+") || ($valueToCheck == "-")} {
+        # Do not allow just these symbols.  Regexp will not catch them.
+        set retCode $::false
+    } else {
+        # First check for the one digit - a lot clearer than putting alternates in one big pattern
+        # Whole digit
+        set wholeDigit {^[+-]?[0-9]+}
+        # No whole digit but fraction digit
+        set fraction {^[+-]?([\.][0-9]+)+}
+        if {!([regexp $wholeDigit $valueToCheck] || [regexp $fraction $valueToCheck])} {
+            set retCode $::false
+        } else {
+            # The expression for a legal exponential float means:  An optional +/-
+            # followed by zero or more digits followed (the fractional part is 
+            # optional) by decimal followed by one or more digits followed by
+            # optional exponential expression which consists of e/E followed by
+            # optional +/- followed by an integer.
+            set validFloat {^[+-]?[0-9]*([\.][0-9]+)?([eE][+-]?[0-9]+)?$}
+            if {[regexp $validFloat $valueToCheck]} {
+                set retCode $::true
+            } else {
+                set retCode $::false
+            }
+        }
+    }
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure:   isValidPositiveExponentialFloat
+#
+# Description: Tells if a given value is a legal positive exponential float
+#
+# Argument(s): valueToCheck - the input value to check
+#
+# Returns:     true if valid, false otherwise
+##################################################################################
+proc isValidPositiveExponentialFloat { valueToCheck } \
+{
+    if {[isValidExponentialFloat $valueToCheck] && [expr $valueToCheck > 0]} {
+        set retCode $::true
+    } else {
+        set retCode $::false
+    }
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure:   isValidPartialFloat
+#
+# Description: Tells if a given value is a legal partial float.
+#
+# Argument(s): valueToCheck - the input value to check
+#
+# Returns:     true if valid, false otherwise
+##################################################################################
+proc isValidPartialFloat { valueToCheck } \
+{
+    # The expression for a legal partial float means:
+    # An optional +/- followed by digits.  Followed by optional decimal and
+    # more digits.  Followed by pieces of the optional exponential expression
+    # The key difference between partial and full is that partial uses *
+    # after 0-9 to show it can have 0 or more values.  The values number
+    # must have 1 or more that is why it uses the +.
+    set validPartialFloat {^[+-]?[0-9]*([\.][0-9]*)?([eE][+-]?[0-9]*)?$}
+    if {[regexp $validPartialFloat $valueToCheck]} {
+        set retCode $::true
+    } else {
+        set retCode $::false
+    }
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure:   isValidPositivePartialFloat
+#
+# Description: Tells if a given value is a legal positive partial float.
+#
+# Argument(s): valueToCheck - the input value to check
+#
+# Returns:     true if valid, false otherwise
+##################################################################################
+proc isValidPositivePartialFloat { valueToCheck } \
+{
+    set validPositivePartialFloat {^[+]?[0-9]*([\.][0-9]*)?([eE][+-]?[0-9]*)?$}
+    if {[regexp $validPositivePartialFloat $valueToCheck]} {
+        set retCode $::true
+    } else {
+        set retCode $::false
+    }
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure:   isValidPositiveFloat
+#
+# Description: Tells if a given number is a legal positive float.
+#
+# Argument(s): valueToCheck - the input value to check
+#
+# Returns:     true if valid, false otherwise
+##################################################################################
+proc isValidPositiveFloat { valueToCheck } \
+{
+    # Special case to handle the singular plus and period
+    if {($valueToCheck == "+") || ($valueToCheck == ".")} {
+        set retCode $::false
+    } else {
+        # The expression for a legal float is an optional + followed by either
+        # (zero or more digits followed by decimal followed by one or more digits)
+        # or one or more digits.
+        set validPositiveFloat {^[+]?[0-9]+([\.]?[0-9]+)?$}
+        if {[regexp $validPositiveFloat $valueToCheck]} {
+            set retCode $::true
+        } else {
+            set retCode $::false
+        }
+    }
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure:   isValidInteger
+#
+# Description: Tell if a given number is a legal integer
+#
+# Argument(s): valueToCheck - the input value to check
+#
+# Returns:     true if valid, false otherwise
+##################################################################################
+proc isValidInteger { valueToCheck } \
+{
+    # The expression for a legal integer is an optional +/- followed by one or more digits.
+    set validInteger {^[+-]?[0-9]+$}
+    if {[regexp $validInteger $valueToCheck]} {
+        set retCode $::true
+    } else {
+        set retCode $::false
+    }
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure:   isValidPositiveInteger
+#
+# Description: Tell if a given number is a legal non-zero positive integer
+#
+# Argument(s): valueToCheck - the input value to check
+#
+# Returns:     true if valid, false otherwise
+##################################################################################
+proc isValidPositiveInteger { valueToCheck } \
+{
+    set validPositiveInteger {^[+]?[0-9]+([eE][+-]?[0-9]+)?$}
+    # If valueToCheck is zero, special case failure
+    if {$int == "0"} {
+        set retCode $::false
+    } else {
+        if {[regexp $validPositiveInteger $valueToCheck]} {
+            set retCode $::true
+        } else {
+            set retCode $::false
+        }
+    }
+    return $retCode
+}
+
+
+
+##################################################################################
+# Procedure: getProcList
+#
+# This command opens a Tcl file & prints all procs that live in that file.
+#
+# Argument(s):
+#   fileName        file name
+#   sortOn          sort either by proc name or line number (default is proc name)
+#
+##################################################################################
+proc getProcList {fileName {sortOn procName} {ProcList ""} {verbose verbose}} \
+{
+    set retCode 0
+
+    upvar $ProcList procList
+
+    set cmd      "proc "
+    if [catch {open $fileName r} fid] {
+        errorMsg "Cannot open file $fileName"
+        set retCode 1
+    } else {
+
+        if {$verbose == "verbose"} {
+            ixPuts "FILE:  $fileName"
+            ixPuts "============================================================================"
+        }
+
+        if [info exists procList] {
+            unset procList
+        }
+
+        set linenum 1
+        while {![eof $fid]} {
+            gets $fid originalLine
+
+            if {[string first $cmd $originalLine] == 0} {
+                lappend procList   [list $linenum [string range [string trim $originalLine \\] 5 end]]
+            }
+            incr linenum
+        }        
+        close $fid
+
+        if {$sortOn == "procName"} {
+            set procList    [lsort -index 1 $procList]
+        } else {
+            set procList    [lsort -index 0 -integer $procList]
+        }
+
+        if {$verbose == "verbose"} {
+            foreach item $procList {
+                scan $item "%s %s" linenum name
+                ixPuts [format "Line: %4d ::::\t%s" $linenum [join [lrange $item 1 end]]]
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure: getTxBasedOnRx
+#
+# This command returns the tx port based on rx port from TxRxArray
+#
+# Argument(s):
+#   TxRxArray       - map, ie. one2oneArray
+#
+##################################################################################
+proc getTxBasedOnRx {TxRxArray c l p } \
+{
+    upvar $TxRxArray txRxArray
+    
+    set breakFlag   0
+
+    foreach txMap [lnumsort [array names txRxArray]] {
+        scan $txMap    "%d,%d,%d" tx_c tx_l tx_p
+
+        foreach rxMap $txRxArray($tx_c,$tx_l,$tx_p) {
+            scan $rxMap "%d %d %d" rx_c rx_l rx_p
+
+            if { [list $rx_c $rx_l $rx_p] == [list $c $l $p]} {
+                set txPort  [list $tx_c $tx_l $tx_p]
+                set breakFlag   1
+                break
+            }
+        }
+        if {$breakFlag ==1} {
+            break
+        }
+    }
+    return $txPort
+}
+
+##################################################################################
+# Procedure: convertFromSeconds
+#
+# This command formats the duration in hour:minute:seconds format.
+#
+# Argument(s):
+#   duration        duration of the test
+#
+##################################################################################
+proc convertFromSeconds {time Hours Minutes Seconds} \
+{
+    set retCode $::TCL_OK
+
+    upvar $Hours   hours
+    upvar $Minutes minutes
+    upvar $Seconds seconds
+
+    set hours       [expr {$time / 3600}]
+
+    set minuteTemp  [expr {$time - $hours * 3600}]
+    set minutes     [expr {$minuteTemp / 60}]
+
+    set seconds     [expr {$minuteTemp - $minutes * 60}]
+
+    return $retCode
+}
+
+
+###############################################################################
+# Procedure: convertToSeconds
+#
+# Description: Convert hours:min:seconds to seconds
+#
+# Arguments: hours
+#            minutes
+#            seconds
+#
+# Returns:   time, in seconds
+#
+###############################################################################
+proc convertToSeconds {hours minutes seconds} \
+{
+    if {[scan $hours "%d" x] <= 0} {
+        set hours 0
+    }
+    if {[scan $minutes "%d" x] <= 0} {
+        set minutes 0
+    }
+    if {[scan $seconds "%d" x] <= 0} {
+        set seconds 0
+    }
+
+    return [expr ((($hours*60) + $minutes) * 60) + $seconds]
+}
+
+
+
+##################################################################################
+# Procedure: formatDurationTime
+#
+# This command formats the duration in hour:minute:seconds format.
+#
+# Argument(s):
+#   duration        duration of the test
+#
+##################################################################################
+proc formatDurationTime {duration} \
+{
+    convertFromSeconds $duration hour minute seconds   
+    return  [format "%.2d:%.2d:%.2d" $hour $minute $seconds]   
+}
+
+
+##################################################################################
+# Procedure: formatNumber
+#
+# This command formats the number based on the format given
+#
+# Argument(s):
+#   number        number to be formated
+#
+##################################################################################
+proc formatNumber {number formatTemplete} \
+{
+ 	scan $formatTemplete "%d.%d" intDigits decDigits
+	set base [expr pow(10,$decDigits)]
+
+    if {$number > 0.00 && $number < [expr 1/$base]} {
+        set number [expr ceil($number * $base)/$base]
+    } else {
+		set newFormat [format "%d.%df" $intDigits $decDigits]
+        set number  [format "%$newFormat" $number]
+    }
+ 
+   return  $number
+   
+}
+
+##################################################################################
+# Procedure: unixCludgeGetExpr
+#
+# This command reroutes mpexpr command. (Note: for UNIX)
+#
+# Argument(s):
+#   duration        duration of the test
+#
+##################################################################################
+proc unixCludgeGetExpr {} \
+{
+    set expr    mpexpr
+
+    if {[lsearch [join [info loaded]] Mpexpr] < 0} {
+        set expr    expr
+    }
+
+    return $expr
+}
+
+
+##################################################################################
+# Procedure: useProfile
+#
+# This command get the profiles
+#
+# Argument(s):
+#   use         "true" for using profile and "false" for not using it. It is set to 
+#               "false" so whenever you want to use it set it to "true". 
+#
+##################################################################################
+proc useProfile {use} \
+{
+    if { $use == "true" } \
+    {
+        if {[info tclversion] > 8.0} {
+            proc ixInitProfiler {} \
+            {
+                global currTime
+                set currTime    [clock clicks -milliseconds]
+            }
+            proc profiler {args} \
+            {
+                global currTime
+
+                set now         [clock clicks -milliseconds]
+                set diff        [expr $now - $currTime]
+                set currTime    $now
+
+                return $diff
+            }
+                
+        } else {
+            global halCommands
+        
+            if {[lsearch $halCommands profiler] == -1} {
+                lappend halCommands profiler
+            }
+
+            proc ixInitProfiler {} \
+            {
+                if {[TCLProfile profiler] == ""} {
+                    puts "Error instantiating TCLProfile object!"
+                    return 1
+                }
+            }
+        }
+        catch {ixInitProfiler}
+        proc ixProfile {args} \
+        {   # take an optional comment string
+            set commentStr  ""
+            if {[llength $args] > 0} {
+                set commentStr "[lindex $args 0]"
+            }
+            set levelStr    ""
+            set level [expr [info level] - 1]
+            if {$level > 0} {
+                set levelStr    "[lindex [info level $level] 0]: "
+            }
+            logMsg "$levelStr: [profiler getDiffTime] $commentStr"
+        }
+    } else {
+        proc ixInitProfiler {} {}
+        proc ixProfile {args} {}
+        proc profiler {{arg ""}} {}
+    }
+}        
+
+########################################################################################
+# Procedure:    CountGlobalMemory
+#
+# Description:  Counts the memory usage of a global variable or array, or all global
+#					variables and arrays.
+#
+#					Tcl arrays are stored as hash tables, the indices are stored
+#						as strings.  The overhead in the hash tables is not easily
+#						accounted for, thus it is not accounted for in this procedure.
+#
+#					The following is a quote from www.scriptic.com/bboard
+#
+#					"...Each array entry will have an overhead of 16 bytes (on a 32-bit
+#					machine) over the size of the data due to the code that manages the
+#					hashtable on which the array is based, another 32 bytes due to the 
+#					fact that it is a Tcl array entry and is not just a simple mapping 
+#					between strings, and another 24 bytes for each unique value in the 
+#					array. (There is also a small overhead due to the overall array and 
+#					hashtable management themselves, but this probably doesn't matter 
+#					since it is roughly invariant with the size of the table; the only
+#					non-constant part is the size of the C array holding the addresses
+#					of the bucket chains, but that's generally going to average at less
+#					than a byte per entry.) This gives you an overhead of 72 bytes per 
+#					entry assuming a worst case of all values being different, which is
+#					likely to be the case with your code since Tcl doesn't work incredibly
+#					hard at merging values which look the same (if it did, the cost of doing
+#					this would be prohibitive.)"
+#
+# Input:        memory:		array name, wildcard characters are usuable (gxi*)
+#								default is all globals.
+#
+# Output:       byte count
+#
+#
+########################################################################################
+proc CountGlobalMemory {{memory ""}} \
+{
+
+	# Hash table overhead is 16 bytes per entry
+	set hashTableOverhead 16
+
+	# Tcl Array mapping overhead is 32 bytes per entry
+	set arrayMappingOverhead 32
+
+	# Unique value overhead is 24 bytes per entry
+	set uniqueValueOverhead 24
+
+	# Overall Overhead per Entry
+	set TclOverhead \
+		[expr $hashTableOverhead + $arrayMappingOverhead + $uniqueValueOverhead]
+
+	set arrayCounter 0
+	set arraySizeCounter 0
+	set arrayIndexSizeCounter 0
+
+	if {[string length $memory] == 0} {
+		set command [list info globals]
+	} else {
+		set command [list info globals $memory]
+	}
+
+	foreach i [lsort [eval $command]] {
+		global $i
+		if [array exists $i] {
+			incr arrayCounter [array size $i]
+			foreach j [array names $i] {
+				incr arraySizeCounter [string length ${i}($j)]
+				incr arrayIndexSizeCounter [string length $j]
+			}
+	
+		} else {
+			incr arraySizeCounter [string length ${i}]
+		}
+	}
+
+	set totalOverhead [expr $TclOverhead * $arrayCounter]
+
+#	errorMsg "Array Elements: $arrayCounter, \
+#			  Array Element Overhead: $totalOverhead \
+#			  Array Size: $arraySizeCounter, \
+#			  Array Index Overhead: $arrayIndexSizeCounter"
+
+
+	return [expr $arraySizeCounter + $arrayIndexSizeCounter + $totalOverhead]											
+
+}
+
+
+########################################################################################
+# Procedure:    createNamedFont
+#
+# Description:  Create a font with the given name, font family, and size.
+#               If a font exists with the same name, set it to the given font family
+#               and size.
+#
+# Input:        name:   font name
+#               family: name of the font family
+#               size:   size of the font
+#
+# Output:       nothing
+#
+########################################################################################
+proc createNamedFont { name family size } \
+{
+    if {[lsearch [font names] $name] == -1} { 
+        font create $name -family $family -size $size
+    } else {
+        font config $name -family $family -size $size
+    }
+}
+
+
+########################################################################################
+# Procedure:    buildFileName
+#
+# Description:  Builds a new file name by appending the type to the main fileName. This 
+#               is used mostly for the tests that either generate mutiple results files
+#               
+#
+# Input:        fileName: filename without the ".results"
+#               type :    type, ie. runtype, errorType etc..
+#
+# Output:       The new filename
+#
+########################################################################################
+proc buildFileName { fileName  type} \
+{
+    if { [regexp {\.} $fileName] == 1} {
+
+        set firstPart   [string range $fileName 0 [expr [string last . $fileName] -1] ]
+        set lastPart    [string range $fileName [string last . $fileName] end ] 
+        unset fileName
+        append fileName $firstPart _$type $lastPart 
+    } else {
+        append fileName _$type
+    }
+
+    return $fileName
+}
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/multiUser.tcl b/dep/tclclient/ixTcl1.0/Generic/multiUser.tcl
new file mode 100644
index 00000000..d7335a00
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/multiUser.tcl
@@ -0,0 +1,402 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: multiUser.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#    Revision Log:
+#    03-01-1998    HS    Genesis
+#
+# Description: This file contains commands related to multi-user scripts
+# to run.
+#
+########################################################################
+
+##################################################################################
+# Procedure: ixSource
+#
+# This command sources a list of files passed an an argument or the files under
+# the directory names passed as an argument. If a list of files is passed, then the
+# full path of the file must be specified.
+#
+# Argument(s):
+#   dirFileName        directory name or list of files to be sourced
+#
+##################################################################################
+proc ixSource {dirFileName} \
+{
+    if [file isdirectory $dirFileName] {
+        #  if there are .tcl files here, source them first
+        if {![catch {glob -nocomplain -- [file join $dirFileName *.tcl]}] != -1} {
+            foreach filename [glob -nocomplain [file join $dirFileName *.tcl]] {
+                if [catch {source $filename} srcError] {
+                    ixPuts "*** $filename: $srcError"
+                }
+            }
+        }
+        sourceRecursively $dirFileName
+    } else {
+        # else dirFileName is a list of files, so source them
+        foreach filename $dirFileName {
+            if [catch {source $filename} srcError] {
+                ixPuts "*** $filename: $srcError"
+            }
+        }
+    }
+}
+
+##################################################################################
+# Procedure: sourceRecursively
+#
+# This command sources all .tcl files in directories recursively.
+#
+# Argument(s):
+#   dirName        directory name under which files to be sourced
+#
+##################################################################################
+proc sourceRecursively {dirName} \
+{
+    foreach currDir [glob -nocomplain [file join $dirName *]] {
+        if [file isdirectory $currDir] {
+            foreach filename [glob -nocomplain [file join $currDir *.tcl]] {
+                if [catch {source $filename} srcError] {
+                    ixPuts "*** $filename: $srcError"
+                }
+            }
+            sourceRecursively [file join $dirName $currDir]
+        }
+    } 
+}
+
+
+########################################################################
+# Procedure: ixLogin
+#
+# This command logs in a user.
+#
+# Argument(s):
+#   userName    - name of the user to login
+#
+########################################################################
+proc ixLogin {userName} \
+{
+    session login $userName
+}
+
+########################################################################
+# Procedure: ixLogout
+#
+# This command logs out the current user.
+#
+# Argument(s):
+#   None
+#
+########################################################################
+proc ixLogout {} \
+{
+    session logout
+}
+
+########################################################################
+# Procedure: ixTakeOwnership
+#
+# This command attempts to take ownership of all the ports in the list
+#
+# Argument(s):
+#   txRxList    - list of ports to take ownership
+#   takeType    - if "force" take regardless of whether
+#                 the port is previously owned by someone else
+#
+########################################################################
+proc ixTakeOwnership {txRxList {takeType ""}} \
+{
+    set retCode 0
+  
+	set portList $txRxList
+    set removedPorts {}
+
+    foreach port $txRxList {
+
+		scan $port "%d %d %d" c l p
+
+
+		if {[lsearch -exact $port "*"] != -1}  {
+			set portList [ixCreatePortListWildCard $txRxList]
+			break
+		} else {
+			# in case we pass the name of the txRxList, which causes ixTakeOwnership 
+			# misbehaves after error condition, so we check if the parm passed is 
+			# really the value of the port list
+			if [catch {format "%d %d %d" $c $l $p} port] {
+				errorMsg  "Error creating port list"
+				return 1
+			}
+		}
+	}
+
+    if {[info exists takeType] && $takeType == "force"} {
+        if [issuePortGroupCommand takeOwnershipForced portList] {
+            errorMsg "Error forcing ownership on requested ports"
+            set retCode 1
+        }
+    } else {
+        foreach portItem $portList {
+		    scan $portItem "%d %d %d" c l p
+
+            if [canUse $c $l $p] {
+                set index    [lsearch $portList [list $c $l $p]]
+                if {$index >= 0} {
+                    logMsg "Port [getPortId $c $l $p] is not available, removing port from the list."
+                    lappend removedPorts    [list $c $l $p] 
+                    set portList [lreplace $portList $index $index]
+                } 
+                continue
+            }
+        }
+        if [llength $portList] {
+            if [issuePortGroupCommand takeOwnership portList] {
+                errorMsg "Error taking ownership on requested ports"
+                set retCode 1
+            }
+        } else {
+            logMsg "No available ports to take ownership."
+            set retCode 1
+        }
+    }
+
+    if {$retCode == 0} {
+        logMsg "Took ownership of following ports:"
+        logMsg "$portList"
+    }
+
+    if [llength $removedPorts] {
+        errorMsg "Error taking ownership of ports:"
+        logMsg $removedPorts
+    } 
+
+    return $retCode
+}
+
+########################################################################
+# Procedure: ixPortTakeOwnership
+#
+# This command attempts to take ownership of this port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#   takeType    - if "force" take regardless of whether
+#                 the port is previously owned by someone else
+#
+########################################################################
+proc ixPortTakeOwnership {chassis lm port {takeType ""}} \
+{
+    set portList    [list [list $chassis $lm $port]]
+    return          [ixTakeOwnership $portList $takeType]
+}
+
+
+########################################################################
+# Procedure: ixClearOwnership
+#
+# This command clears ownership of all the ports in the list
+#
+# Argument(s):
+#   txRxList    - list of ports to take ownership
+#   takeType    - if "force" take regardless of whether
+#                 the port is previously owned by someone else
+#
+########################################################################
+proc ixClearOwnership {{txRxList "" } {takeType ""}} \
+{
+    set retCode 0
+
+    if {$txRxList == ""} {
+        set retCode [clearAllMyOwnership]
+    } else {
+        set portList [ixCreatePortListWildCard $txRxList]
+        if {[info exists takeType] && $takeType == "force"} {
+            if [issuePortGroupCommand clearOwnershipForced portList] {
+                errorMsg "Error forcing clear ownership on requested ports"
+                set retCode 1
+            }
+        } else {
+			set otherPortList {}
+			if {[llength $portList] == 0} {
+				errorMsg "Error clear ownership on requested ports"
+				set retCode 1
+			}
+			foreach port $portList {
+				scan $port "%d %d %d" c l p
+				if {![isMine $c $l $p]} {
+					lappend otherPortList $port
+					set index [lsearch $portList $port]
+					set portList [lreplace $portList $index $index]
+				}
+			}
+			if {[llength $portList] > 0} {
+				if [issuePortGroupCommand clearOwnership portList] {
+					errorMsg "Error clearing ownership on requested ports"
+					set retCode 1
+				}
+			}
+			if {[llength $otherPortList] > 0} {
+				errorMsg "Error clearing ownership of ports owned by other user(s):"
+				logMsg $otherPortList
+				set retCode 1
+			}
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: ixPortClearOwnership
+#
+# This command clears ownership of this port
+#
+# Arguments(s):
+#    chassis
+#    lm
+#    port
+#   takeType    - if "force" take regardless of whether
+#                 the port is previously owned by someone else
+#
+########################################################################
+proc ixPortClearOwnership {chassis lm port {takeType ""}} \
+{
+    set portList    [list [list $chassis $lm $port]]
+    return          [ixClearOwnership $portList $takeType]
+}
+
+
+########################################################################
+# Procedure: ixCheckOwnership
+#
+# This command checks ownership of all the ports in the list
+#
+# Argument(s):
+#   TxRxList    - list of ports to take ownership
+#
+########################################################################
+proc ixCheckOwnership {txRxList} \
+{
+    set retCode 0
+
+    set portList [ixCreatePortListWildCard $txRxList]
+
+    foreach myport $portList {
+        scan $myport "%d %d %d" c l p
+       
+        set retCode [canUse $c $l $p] 
+        if {$retCode != 0} {
+            return $retCode
+        }
+    }           
+    
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: canUse
+#
+# This command checks to see if the port can be used (ie., if it's not
+# owned by someone else)
+#
+# Argument(s):
+#   c    - chassis
+#   l    - card
+#   p    - port
+#
+# NOTE:  logMsg is used here rather than ixPuts so that if logs are 
+#        turned on, the canUse message *will* be saved into the test log.
+#
+########################################################################
+proc canUse {c l p} \
+{
+    set retCode $::TCL_OK
+
+    if {![port canUse $c $l $p]} {
+        set retCode $::ixTcl_notAvailable
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: isMine
+#
+# This command checks to see if the currently logged in user owns this
+# port.
+#
+# Argument(s):
+#   c   - chassis
+#   l   - card
+#   p   - port
+#
+# Returns :
+#	0	-	the port is owned by other user
+#	1	-	the ixLogin user name matches the ownership owner
+#	2	-	the port does not belong to any user
+#
+########################################################################
+proc isMine {chassis card port} \
+{
+    set isMine 0
+
+    global ixTcl_notAvailable
+
+    if [port get $chassis $card $port] {
+        errorMsg "Error getting port $chassis $card $port"
+        set retCode 1
+    } else {
+        set owner   [port cget -owner]
+        if {[string tolower $owner] == [string tolower [session cget -userName]]} {
+            set isMine  1   ;# this is my port
+        } elseif {[string tolower $owner] == ""} {
+			set isMine	2	;# this is unowned port
+		} else {
+			set isMine	0	;# this is owned by other			
+		}
+    }
+
+    return $isMine
+}
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/packetBuilder.tcl b/dep/tclclient/ixTcl1.0/Generic/packetBuilder.tcl
new file mode 100644
index 00000000..9679b4ea
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/packetBuilder.tcl
@@ -0,0 +1,922 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: packetBuilder.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	02-19-1998	DS	Genesis
+#
+# Description: This file contains common utility functions used to 
+#			   build the data packets for various protocols.
+#
+########################################################################
+
+
+
+####################################################################
+#				Utility procs used in building packets
+####################################################################
+
+
+
+########################################################################
+# Procedure: calculateChecksum
+#
+# This command calculates a checksum for the data argument
+#
+# Argument(s):
+#	data		data to calculate checksum for	
+#
+#########################################################################
+proc calculateChecksum {data} \
+{
+	set checksum	0
+
+	foreach {hi low} $data \
+	{
+		set word [format 0x%02s%02s $hi $low]
+		set compliment $word
+		set checksum [expr $checksum + $compliment]
+	}
+	
+	set checksum [expr (($checksum >> 16) + ($checksum & 0xffff))]
+	set checksum [expr ~($checksum + ($checksum >> 16))]
+
+	return [long2octet $checksum]
+}
+
+
+########################################################################
+# Procedure: oid2octet
+#
+# This command converts an oid into an octet list for use in an SNMP
+# packet.
+#
+# Argument(s):
+#		oid		oid to convert
+#
+#########################################################################
+proc oid2octet {oid} \
+{
+	set myOid	[oid2dot $oid]	;# just in case, doesn't hurt
+	while {([string length $myOid] > 0)} \
+	{
+		set dot	[string first "." $myOid]
+		if {($dot < 0)} \
+		{
+			lappend octet [format %02x $myOid]
+			break;
+		} \
+		else \
+		{
+			lappend octet [format %02x [string range $myOid 0 [expr $dot-1]]]
+			set myOid	[string range $myOid [expr $dot+1] end]
+		}
+	}
+	set octet [join [lreplace $octet 0 1 2b]]
+	return $octet
+}
+
+
+########################################################################
+# Procedure: buildLLCHeader
+#
+# This command builds the LLC header for an 802.2 Ethernet frame.
+#
+# Argument(s):
+#
+#########################################################################
+proc buildLLCHeader {} \
+{
+	set DSAP		e0
+	set SSAP		e0
+	set control		03
+
+	set llcHeader	[concat $DSAP $SSAP $control]
+
+	return $llcHeader
+}
+
+
+########################################################################
+# Procedure: buildIpHeader
+#
+# This command builds the IP header for an IP frame including 
+# checksum calculation.
+#
+# Argument(s):
+#		sourceIP		IP address of source, in octet format
+#		destinationIP	IP address of destination, in octet format
+#		dataLength		Length of the data only if UDP; else length of 
+#						all data except IP header.
+#		TTL				time to live
+#		protocol		Protocol for IP header, ie, 1 = ICMP, 11 - UDP, etc
+#		flags			Flags for IP header
+#		options			32-bit options + padding, not required
+#
+#########################################################################
+proc buildIpHeader {sourceIP  destinationIP  \
+					dataLength TOS TTL protocol flags options} \
+{
+	set ipType			{08 00}
+	set	ipVersion		45
+	set	id				{00 00}
+	set headerChecksum	{00 00}
+	set	TTL				[format %02x $TTL]
+	set TOS				[format %02x $TOS]
+
+	if {($protocol == 11)}	\
+	{
+		set	totalLength	[expr $dataLength + $::kHeaderLength(udp) + $::kHeaderLength(ip)]
+	} \
+	else \
+	{
+		set totalLength $dataLength
+	}
+
+	if {[llength $options] != 0} {
+		for {set i [llength $options]} {$i < 4} {incr i} {
+			set options	[concat $options 00]
+		}
+		set ipVersion	46
+	}
+
+	set totalLength [expr $totalLength + [llength $options]]
+
+	set ipHeader [concat $ipVersion $TOS [long2octet $totalLength] $id \
+						 $flags $TTL $protocol $headerChecksum \
+						 $sourceIP $destinationIP]
+
+	if {[llength $options] > 0} {
+		set ipHeader [concat $ipHeader $options]
+	}
+
+	set headerChecksum [calculateChecksum $ipHeader]
+	set ipHeader [concat $ipType [join [lreplace $ipHeader 10 11 $headerChecksum]]]
+
+	return $ipHeader
+}
+
+########################################################################
+# Procedure: buildRipBlock
+#
+# This command builds one block for a RIP packet
+#
+# Argument(s):
+#	ipAddress		IP address to use in RIP packet
+#	Metric			metric value to use in RIP packet	
+#
+# Note:
+# ipAddress should be passed in as a string of the format:
+#	"192.42.172.0" (class C) or "192.42.0.0" (class B) etc.
+# Metric should be passed in as an integer, 1-15 or 16 for unreachable.
+#  (ref. rfc1058)
+#########################################################################
+proc buildRipBlock {ipAddress Metric {familyId "00 02"}} \
+{
+	if {($Metric > 16)} \
+	{
+		puts "Invalid metric value. Must be between 1-16."
+		return
+	}
+
+	set Metric			[format %02x $Metric]
+	
+	return	[concat $familyId {00 00} \
+					[host2addr $ipAddress] \
+					{00 00 00 00 00 00 00 00} \
+					{00 00 00} $Metric]
+}
+
+########################################################################
+# Procedure: buildVidHeader
+#
+# This procedure builds the VID of a vlan-tagged frame. 
+#
+# Argument(s):
+#   userPriority    - user priority field of the TCI, eight priority levels, 0-7
+#   CFIformat       - Canonical Format Indicator - if set to true, all MAC
+#                     addresses in frame is in Canonical format
+#   VID             - twelve-bit VLAN identifier that uniquely identifies
+#                     the VLAN to which the frame belongs.
+#
+#########################################################################
+proc buildVidHeader {userPriority CFIformat VID} \
+{
+    set tpid    {81 00}
+
+    if {$userPriority > 7 || $userPriority < 0} {
+        logMsg "Invalid userPriority value.  Parameter set to 0."
+        set userPriority    0
+        set retCode         1
+    }
+
+   switch $CFIformat {
+        true {
+            set CFIformat   1
+        }
+        false {
+            set CFIformat   0
+        }
+	    default {
+            logMsg "Invalid CFIformat value.  Parameter set to false."
+            set CFIformat   0
+            set retCode     1
+        }
+    }
+
+    if {$VID > 0xfff || $VID < 0} {
+        logMsg "Invalid VID value.  Parameter set to 0x00."
+        set VID         0
+        set retCode     1
+    }
+
+    set tci     [long2octet [expr ((($userPriority << 1) + $CFIformat) << 12) + $VID]]
+    
+    return [concat $tpid $tci]
+}
+
+
+####################################################################
+#				Packet building procs
+####################################################################
+
+########################################################################
+# Procedure: buildIPXPacket
+#
+# This procedure builds the header and data portion of an IPX packet
+#
+# Argument(s):
+#	packetType		type of packet (1 byte)
+#						0x00	- unknown packet type
+#						0x01	- routing information packet (RIP)
+#						0x04	- service advertising packet (SAP)
+#						0x05	- sequenced packet
+#						0x11	- netware core protocol packet
+#						0x14	- propagated packet
+#	destNetwork		destination network (4 bytes)
+#	destNode		destination node (6 bytes)
+#	destSocket		destination socket (2 bytes)
+#						0x451	- NetWare core protocol
+#						0x452	- Service advertising packet
+#						0x453	- Routing information packet
+#						0x455	- NetBIOS packet
+#						0x456	- Diagnostic packet
+#						0x457	- Serialization packet
+#						0x4000 - 0x7fff		- dynamic sockets
+#						0x8000 - 0xffff		- well-known sockets; assigned by Novell
+#	sourceNetwork	source network (4 bytes)
+#	sourceNode		source node (6 bytes)		
+#	sourceSocket	source socket (2 bytes, see destSocket for description)
+#	dataLength		length of the data
+#	data			data to follow IPX header (length = dataLength bytes)
+#
+#########################################################################
+proc buildIPXPacket {packetType destNetwork destNode destSocket \
+				sourceNetwork sourceNode sourceSocket dataLength data} \
+{
+    set IPXtype             {81 37}
+	set checksum			{ff ff}
+	set	transportControl	00
+
+	if {[llength $destSocket] == 1} {
+		set	destSocket	  [concat [format %02x [expr (($destSocket >> 8) & 0xff)]] \
+				  				  [format %02x [expr $destSocket & 0xff]]]
+	}
+
+	if {[llength $sourceSocket] == 1} {
+		set	sourceSocket  [concat [format %02x [expr (($sourceSocket >> 8) & 0xff)]] \
+				  				  [format %02x [expr $sourceSocket & 0xff]]]
+	}
+
+	set packetType		[format %02x $packetType]
+
+	set packetLength	[expr $::kIPXHeaderLength + $dataLength]
+
+	set	length			[concat [format %02x [expr (($packetLength >> 8) & 0xff)]] \
+							    [format %02x [expr $packetLength & 0xff]]]
+
+	set IPXheader [concat $checksum $length $transportControl $packetType \
+						  $destNetwork $destNode $destSocket \
+						  $sourceNetwork $sourceNode $sourceSocket]
+	set IPXpacket [concat $IPXheader $data]
+
+    if {[protocol cget -ethernetType] == 1} {
+        set ipxFrame    [concat $IPXtype $IPXpacket]
+    } else {
+    	set enLength  [llength $IPXpacket]
+	    set	length	  [concat [format %02x [expr (($enLength >> 8) & 0xff)]] \
+		    		  	      [format %02x [expr $enLength & 0xff]]]
+    	set ipxFrame 	[concat $length $IPXpacket]
+    }
+
+	return $ipxFrame
+}
+
+########################################################################
+# Procedure: buildIPXData
+#
+# This procedure builds the data portion of an IPX packet
+########################################################################
+proc buildIPXData {frameSize} \
+{
+	set ipxdataList {}
+	set currLen 0
+	set typeLen			2
+	set dasaLen			12
+	set crcLen			4
+
+	while {$currLen < [expr $frameSize - $::kIPXHeaderLength - $typeLen - $dasaLen - $crcLen]} {
+		set ipxdataList [lappend ipxdataList "B8"]
+		incr currLen
+	}
+	return $ipxdataList
+}
+
+########################################################################
+# Procedure: buildServerEntry
+#
+# This procedure builds one server entry (64 bytes) for a SAP packet,
+# For a SAP request, only the service type field will be used to build
+# the entry.
+#
+# Argument(s):
+#	serverType		- type of server (2 bytes)
+#	serverName		- server name (SAP response only, 48 bytes)
+#	netAddress		- network address on which server resides (4 bytes)
+#	nodeAddress		- address of the node on which server resides (2 bytes)
+#	socketNum		- socket number server will receive service requests (2 bytes)
+#	hops			- number of hops to reach server (2 bytes)
+#
+#########################################################################
+proc buildServerEntry {operation serviceType serverName netAddress nodeAddress socketNum hops} \
+{
+	set entry $serviceType
+
+	if {($operation == $::kSapOperation(response)) || ($operation == $::kSapOperation(getNearestServerResponse))} {
+		set entry [concat $entry $serverName $netAddress $nodeAddress $socketNum $hops]
+	} else {
+		set emptyList {}
+#		for {set i 0} {$i < 62} {incr i} {
+#			set emptyList [lappend emptyList "00"]
+#		}
+#		set entry [concat $entry $emptyList]
+	}
+	return $entry
+}
+
+########################################################################
+# Procedure: buildSapPacket
+#
+# This procedure builds a SAP packet.
+# For a SAP request, only the service type field will be used to build
+# the server entry.
+#
+# Argument(s):
+#	operation		- type of operation the SAP packet performs
+#						1 - request
+#						2 - response
+#						3 - get nearest server request
+#						4 - get nearest server response	
+#	serverEntry		- server information (64 bytes)
+#
+#########################################################################
+proc buildSapPacket {operation serviceType serverName netAddress nodeAddress socketNum hops} \
+{
+	
+	set oper	[format "00 %02x" $operation]
+
+	if {[llength $socketNum] == 1} {
+		set	socketNum	  [concat [format %02x [expr (($socketNum >> 8) & 0xff)]] \
+				  				  [format %02x [expr $socketNum & 0xff]]]
+	}
+
+	set serverEntry [buildServerEntry $operation $serviceType $serverName $netAddress $nodeAddress \
+					 $socketNum $hops]
+	set sapFrame [concat $oper $serverEntry]
+	return $sapFrame
+}
+
+########################################################################
+# Procedure: buildNetworkEntry
+#
+# This procedure builds one network entry (8 bytes) for a RIPX packet.
+#
+# Argument(s):
+#	networkNumber	- network number. Set to all F's for requests (4 bytes)
+#	hops			- number of routers to pass through to reach the network
+#					  number (2 bytes)
+#	ticks			- how much time it takes to reach the network number
+#					  (2 bytes)
+#
+#########################################################################
+proc buildNetworkEntry {networkNumber hops ticks} \
+{
+	return [concat $networkNumber [format "00 %02x" $hops] [format "00 %02x" $ticks]]
+}
+
+########################################################################
+# Procedure: buildRipxPacket
+#
+# This procedure builds a RIP packet used in IPX.
+#
+# Argument(s):
+#	operation		- type of operation the SAP packet performs (2 bytes)
+#						1 - request
+#						2 - response
+#	networkEntry	- network information (8 bytes)
+#
+#########################################################################
+proc buildRipxPacket {operation networkNumber hops ticks} \
+{
+	set oper [format "00 %02x" $operation]
+	set nwEntry [buildNetworkEntry $networkNumber $hops $ticks]
+	return [concat $oper $nwEntry]
+}
+
+########################################################################
+# Procedure: buildArpPacket
+#
+# This procedure builds the data portion of an ARP packet
+#
+# Argument(s):
+#	sourceMAC		source MAC address, list format
+#	sourceIP		IP address of the source, in text format
+#	dutIP			IP address of the DUT, in text format
+#
+#########################################################################
+# ARP request on ethernet
+proc buildArpPacket {sourceMAC sourceIP dutIP} \
+{
+	set ethernetType	{08 06}
+	set destMAC			{00 00 00 00 00 00}
+	set hwType			{00 01}
+	set protocolType	{08 00}
+	set hwAddressLen	06		;# length of MAC address
+	set	prAddressLen	04		;# length of IP address
+	set opcode			{00 01}
+
+	return	[concat $ethernetType $hwType $protocolType $hwAddressLen $prAddressLen \
+					$opcode $sourceMAC [host2addr $sourceIP] $destMAC [host2addr $dutIP]]
+}
+
+
+########################################################################
+# Procedure: buildRipPacket
+#
+# This procedure builds the data portion of a routing update frame. Note-
+# up to 25 IP addresses may be specified in one datagram.
+#
+# Argument(s):
+#		sourceMAC		source MAC address, list format
+#		sourceIP		IP address of source, in text format
+#		destinationIP	IP address of destination, in text format
+#		RipCommand		Command for RIP frame:  01 - request
+#												02 - response
+#		IpList			List of RIP blocks to build RIP packet from -
+#						use buildRipBlocks
+#
+#########################################################################
+proc buildRipPacket {sourceMAC sourceIP destinationIP RipCommand IpList {ttl 0x40} {ripVersion 02}} \
+{
+	# Determine number of items in IpList first...
+	set	IpListLength	[llength $IpList]
+	if {($IpListLength > 25)} \
+	{
+		puts "Too many IP addresses specified for RIP"
+		return
+	}
+
+	# Determine data length for IP header & UDP header
+	set	RipLength		20
+	set dataLength		[expr ($IpListLength * $RipLength) + $::kHeaderLength(rip)]
+
+	# Build IP header for RIP packet
+	set TOS				00		;# includes precedence bits
+	set protocol		11
+	set	flags			{00 00}
+	set options			{}
+
+	# make the destination IP address into a broadcast type...
+	set destinationIP	[host2addr $destinationIP]
+	if {( [llength $destinationIP] == 0 )} \
+	{
+		puts "Invalid destination IP address."
+		return
+	}
+	set ipHeader		[buildIpHeader [host2addr $sourceIP] $destinationIP \
+										$dataLength $TOS $ttl $protocol $flags $options]
+
+	# build UDP part
+	set sourcePort		{02 08}		;# source port 208 = RIP
+	set destPort		{02 08}
+	set udpLength		[expr $dataLength + $::kHeaderLength(udp)]
+	set	udpLength		[concat [format %02x [expr (($udpLength >> 8) & 0xff)]] \
+							    [format %02x [expr $udpLength & 0xff]]]
+	set udpChecksum		{00 00}
+
+	# build data part of UDP
+	set RipCommand		[format %02x $RipCommand]	;# just to clean it up
+	set data			[concat $RipCommand [format %02x $ripVersion] {00 00}]
+
+	foreach {ipItem} $IpList \
+	{
+		set data		[concat $data $ipItem]
+	}
+
+	set	udpData			[concat $sourcePort $destPort $udpLength $udpChecksum $data]
+	set	pseudoIpHdr		[concat [host2addr $sourceIP] $destinationIP 00 $protocol $udpLength]
+	set	udpChecksum		[calculateChecksum $pseudoIpHdr]
+
+	# replace udpChecksum in udpData
+	return	[concat $ipHeader [join [lreplace $udpData 6 7 $udpChecksum]]]
+}
+
+
+########################################################################
+# Procedure: buildUdpEchoPacket
+#
+# This procedure builds the data portion of a test packet for use 
+# w/Bradner's test suite
+#
+# Argument(s):
+#	sourceIP		IP address of source, in text format
+#	destIP			IP address of destination, in text format
+#	frameLength		total length of frame, including IP & UDP headers	
+#
+#########################################################################
+proc buildUdpEchoPacket {sourceIP destIP frameLength} \
+{
+	# a couple of constants...
+	set	addressLength	6
+	set	crcLength		4
+	set	typeLength		2
+
+	set dataLength		[expr $frameLength - $addressLength*2 - $typeLength - \
+							  $::kHeaderLength(ip) - $::kHeaderLength(udp) - $crcLength]
+
+	set TOS				00		;# includes precedence bits
+ 	set TTL				0x0a
+ 	set protocol		11			;# UDP
+ 	set flags			{00 00}
+	set options			{}
+	set ipHeader		[buildIpHeader [host2addr $sourceIP] [host2addr $destIP] \
+										$dataLength $TOS $TTL $protocol $flags $options]
+
+	# build UDP part
+ 	set sourcePort		{C0 20}
+ 	set destPort		{00 07}		;# ethernet Echo
+	set udpLength		[concat {00} [format %02x [expr $dataLength + $::kHeaderLength(udp)]]]
+	set udpChecksum		{00 00}
+
+ 	set data {}
+    for {set x 0} {$x < $dataLength} {incr x} {
+ 		lappend data [format %02x [expr $x & 0xff]]
+ 	}
+
+ 	set udpHeader		[concat $sourcePort $destPort $udpLength $udpChecksum]
+	set pseudoIpHeader	[concat [host2addr $sourceIP] [host2addr $destIP] 00 $protocol $udpLength]
+	set udpChecksum		[calculateChecksum [concat $pseudoIpHeader $udpHeader $data]]
+	set udpHeader		[join [lreplace $udpHeader 6 end $udpChecksum]]
+
+ 	return [concat $ipHeader $udpHeader $data]
+}
+
+
+########################################################################
+# Procedure: buildIgmpPacket
+#
+# This procedure builds the data portion of an IP-multicast (IGMP)
+# packet.
+#
+# Argument(s):
+#	sourceIP		IP address of source, in text format
+#	destIP			IP address of destination, in text format
+#	version			v1 or v2 IGMP
+#	type			IGMP message type:
+#						0x11	- Membership query
+#						0x16	- Version 2 membership report
+#						0x17	- Leave group
+#						0x12	- Version 1 membership report (provided
+#								  for backwards capability only)
+#	respTime		Maximum allowed time before sending a responding
+#					report, in units of 1/10 second.  Valid only for
+#					type = 0x11 (membership query)
+#	groupAddr		IP multicast group address, set to zero for sending
+#					a general membership query.
+#
+#########################################################################
+
+proc buildIgmpPacket {sourceIP destIP version type respTime groupAddr} \
+{
+	set TOS				0xc0			;# includes precedence bits
+ 	set TTL				0x01
+ 	set protocol		02			;# IGMP
+	set IgmpHdrLength	[expr 8 + $::kHeaderLength(ip)]
+ 	set flags			{00 00}
+
+	switch $version {
+		default -
+		v1	{
+			set options			{}
+		}
+		v2	{
+			set options			{94 04}
+		}
+	}
+	set ipHeader		[buildIpHeader [host2addr $sourceIP] [host2addr $destIP] \
+										$IgmpHdrLength $TOS $TTL $protocol $flags $options]
+
+	# build IGMP part
+	set type			[format %02x $type]
+	set respTime		[format %02x $respTime]
+	set igmpChecksum	{00 00}
+	if {$groupAddr == 0} {
+		set groupAddr	0.0.0.0
+	}
+
+	set igmpHeader		[concat $type $respTime $igmpChecksum [host2addr $groupAddr]]
+
+	set igmpChecksum	[calculateChecksum $igmpHeader]
+	set igmpHeader		[join [lreplace $igmpHeader 2 3 $igmpChecksum]]
+
+ 	return [concat $ipHeader $igmpHeader]
+}
+
+
+########################################################################
+# Procedure: buildIpPriorityPacket
+#
+# This procedure builds the data portion of a test UDP packet for Priority
+# Queue test.
+#
+# Argument(s):
+#	sourceIP		IP address of source, in text format
+#	destIP			IP address of destination, in text format
+#	frameLength		total length of frame, including IP & UDP headers
+#	precedence	
+#
+#########################################################################
+
+proc buildIpPriorityPacket {sourceIP destIP frameLength TOS} \
+{
+	# a couple of constants...
+	set	addressLength	6
+	set	crcLength		4
+	set	typeLength		2
+
+	set dataLength		[expr $frameLength - $addressLength*2 - $typeLength - \
+							  $::kHeaderLength(ip) - $::kHeaderLength(udp) - $crcLength]
+
+	set TOS				[format %02x $TOS]		;# includes precedence bits
+ 	set TTL				0x0a
+ 	set protocol		11			;# UDP
+ 	set flags			{00 00}
+	set options			{}
+	set ipHeader		[buildIpHeader [host2addr $sourceIP] [host2addr $destIP] \
+										$dataLength $TOS $TTL $protocol $flags $options]
+
+	# build UDP part
+ 	set sourcePort		{C0 20}
+ 	set destPort		{00 07}		;# ethernet Echo
+	set udpLength		[concat {00} [format %02x [expr $dataLength + $::kHeaderLength(udp)]]]
+	set udpChecksum		{00 00}
+
+ 	for {set x 0} {$x < $dataLength} {incr x} {
+ 		lappend data [format %02x [expr $x & 0xff]]
+ 	}
+
+ 	set udpHeader		[concat $sourcePort $destPort $udpLength $udpChecksum]
+	set pseudoIpHeader	[concat [host2addr $sourceIP] [host2addr $destIP] 00 $protocol $udpLength]
+	set udpChecksum		[calculateChecksum [concat $pseudoIpHeader $udpHeader $data]]
+	set udpHeader		[join [lreplace $udpHeader 6 end $udpChecksum]]
+
+ 	return [concat $ipHeader $udpHeader $data]
+}
+
+
+
+########################################################################
+# Procedure: buildVlanTagPacket
+#
+# This procedure builds the data portion of a vlan tag packet. 
+#
+# Argument(s):
+#   userPriority    - user priority field of the TCI, eight priority levels, 0-7
+#   CFIformat       - Canonical Format Indicator - if set to true, all MAC
+#                     addresses in frame is in Canonical format
+#   VID             - twelve-bit VLAN identifier that uniquely identifies
+#                     the VLAN to which the frame belongs.
+#   data            - remaining data for packet
+#
+#########################################################################
+proc buildVlanTagPacket {userPriority CFIformat VID data} \
+{
+    return [concat [buildVidHeader $userPriority $CFIformat $VID] $data]
+}
+
+
+########################################################################
+# Procedure: buildSnmpPacket
+#
+# This procedure builds the data portion of an SNMP management frame. 
+# Only 'get' requests are supported.
+#
+# Argument(s):
+#	sourceIP		IP address of source, in text format
+#	destIP			IP address of destination, in text format
+#	sourcePort		Source port to aim SNMP packet at
+#	communityName	community name, in text format (usually 'public')
+#	oid				oid to get	
+#
+#########################################################################
+proc buildSnmpPacket {sourceIP destIP sourcePort communityName oid } \
+{
+	# build SNMPv1 part first...
+	set	asn1Header		30
+	set snmpVersion		{02 01 00}
+	set community		04
+	set	NullValue		{05 00}					;# cause we only do gets...
+
+	set	snmpGet			a0
+	set snmpRequestID	{02 02 00 00}
+	set	snmpErrorIndex	{02 01 00 02 01 00}
+
+	# begin building varbind list
+	set	oid				[oid2octet $oid]		;# turn oid into an octet list
+	set oidLength		[llength $oid]
+	
+	set	VarBind			[concat [list 06 [format %02x $oidLength]] $oid]
+	
+	set VarBindLength	[list 30 [format %02x [expr $oidLength + 4]]]
+	set	VarBind			[concat	$VarBindLength $VarBind]
+
+	set	VarBindList		[list 30 [format %02x [expr [llength $VarBind] + 2]]]
+
+	set	VarBind			[concat $snmpRequestID $snmpErrorIndex $VarBindList $VarBind]
+	set	VarBind			[concat $snmpGet [format %02x [expr [llength $VarBind] + 2]] $VarBind]
+
+	# Finish by building pdu
+	set	communityName	[string tolower $communityName]
+	set	pdu				[concat $snmpVersion $community [format %02x [llength $communityName]] \
+								$communityName $VarBind]
+	
+	set pdu				[concat $asn1Header [format %02x [expr [llength $pdu] + 2]] $pdu $NullValue]
+
+	
+	# build UDP part next
+	set destPort		{00 a1}		;# SNMP port 161
+	set	udpLength		[concat {00} [format %02x [expr [llength $pdu] + $::kHeaderLength(udp)]]]
+	set	udpChecksum		{00 00}
+	set sourcePort		[list [format %02x [expr $sourcePort >> 8]] \
+							  [format %02x [expr $sourcePort & 0xff]]]
+	set	udp				[concat $sourcePort $destPort $udpLength $udpChecksum $pdu]
+	set	udpChecksum		[calculateChecksum $udp]
+	set udp				[join [lreplace $udp 6 7 $udpChecksum]]
+
+	set TOS				00		;# includes precedence bits
+	set TTL				80
+	set protocol		11			;# UDP
+	set flags			{00 00}
+	set options			{}
+	set	ipHeader		[buildIpHeader [host2addr $sourceIP] [host2addr $destIP] \
+									    [llength $pdu] $TOS $TTL $protocol $flags $options]
+
+ 	return [concat $ipHeader $udp]
+}
+
+########################################################################
+# Procedure: buildIcmpPacket
+#
+# This procedure builds the data portion of an icmp/ping packet.
+#
+# Argument(s):
+#	sourceIP		IP address of source, in text format
+#	destIP			IP address of destination, in text format
+#	dataLength		length of ping
+#	icmpEcho		== 1 if this is this an Echo frame, 0 if response
+#	icmpSequence	sequence number for this ping, 0 is valid.
+#
+#########################################################################
+proc buildIcmpPacket {sourceIP destIP dataLength icmpEcho icmpSequence} \
+{
+	set	start				97
+	set	max					[expr $start + 22]
+
+ 	if {($icmpEcho == 1)} \
+	{
+		set icmpEcho	08
+	} \
+	else \
+	{
+		set icmpEcho	00
+	}
+	
+	set	icmpCode		00
+	set	icmpChecksum	{00 00}
+	set	icmpId			{01 00}
+
+	set	icmpSequence	[long2octet $icmpSequence]
+
+ 	for {set x 0} {$x < $dataLength} {incr x } {
+		if {($start > $max)} {set start 97}
+ 		lappend data [format %02x $start]
+		incr start
+ 	}
+
+	set	icmp			[concat $icmpEcho $icmpCode $icmpChecksum \
+								$icmpId $icmpSequence $data]
+	set icmpChecksum	[calculateChecksum $icmp]
+	set icmp			[join [lreplace $icmp 2 3 $icmpChecksum]]
+
+	set TOS				00		;# includes precedence bits
+	set TTL				0x0a
+	set protocol		01			;# ICMP
+	set flags			{00 00}
+	set options			{}
+	set	ipHeader		[buildIpHeader [host2addr $sourceIP] [host2addr $destIP] \
+									   [expr [llength $icmp] + $::kHeaderLength(ip)] \
+									    $TOS $TTL $protocol $flags $options]
+
+	return	[concat $ipHeader $icmp]
+}
+
+
+########################################################################
+# Procedure: buildBpduPacket
+#
+# This procedure builds the data portion of a 802.1d BPDU packet.
+#
+# Argument(s):
+#   rootID      root id in IEEE 802.1d BPDU packet
+#   bridgeID    bridge id in IEEE 802.1d BPDU packet
+#	
+#########################################################################
+proc buildBpduPacket { {rootID {00 10 FF E4 1C 0D}} {bridgeID {00 10 FF E4 1C 0D}} {protocolID 0} {versionID 0} {bpduType 0} {bitField 0} \
+                  {rootPriority 0} {rootPathCost 0} {bridgePriority 32768} {portID 128} \
+                  {messageAge 17920} {maxAge 20} {helloTime 2} {forwardDelay 15} } \
+{
+    set bpduData {}
+
+    set llcHeader       {42 42 03}                              
+    set protocolID      [long2octet $protocolID]              ;# 2 byte
+    set versionID       [long2octet $versionID 1]             ;# 1 byte
+    set bpduType        [long2octet $bpduType  1]             ;# 1 byte
+    set bitField        [long2octet $bitField  1]             ;# 1 byte
+    set rootPriority    [long2octet $rootPriority]            ;# 2 byte
+    set rootPathCost    [long2octet $rootPathCost 4]          ;# 4 byte
+    set bridgePriority  [long2octet $bridgePriority]          ;# 2 byte
+    set portID          [long2octet $portID 1]                ;# 1 byte
+    set messageAge      [long2octet $messageAge]              ;# 2 byte
+    set maxAge          [long2octet $maxAge]                  ;# 2 byte
+    set helloTime       [long2octet $helloTime]               ;# 2 byte
+    set forwardDelay    [long2octet $forwardDelay]            ;# 2 byte
+   
+    set otherData       {00 10 54 65 73 74 5f 52 6f}
+    set bpduData        [concat $llcHeader $protocolID $versionID $bpduType $bitField $rootPriority \
+                                $rootID $rootPathCost $bridgePriority $bridgeID $portID $messageAge \
+                                $maxAge $helloTime $forwardDelay $otherData] 
+    
+    
+    set length          [long2octet [llength $bpduData]]
+
+    return              [concat  $length $bpduData ] 
+}
+
+
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/parseArgs.tcl b/dep/tclclient/ixTcl1.0/Generic/parseArgs.tcl
new file mode 100644
index 00000000..c4bb6288
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/parseArgs.tcl
@@ -0,0 +1,87 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: parseArgs.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	10-11-2004	Hasmik
+#
+# Description: This file contains common procs used for parsing
+#              
+#
+##################################################################################
+
+
+
+########################################################################
+# Procedure:   ixGetArgument
+#
+# Description: This command will return a value from an argument list
+#              for a given named argument
+#
+# Arguments:
+#    argList   - A list of arguments.
+#    argToFind - The name of the option to find in the argList
+#
+########################################################################
+proc ixGetArgument { argList argToFind } \
+{
+	
+	set retValue ""
+
+	if {[llength $argList] == 0 } {
+		errorMsg "Error - empty argument list"
+		return $retValue
+	}
+
+    # Put on the dash if it is missing.
+    if {[string index $argToFind 0] != "-"} {
+        set argToFind [format "-%s" $argToFind]
+    } 
+
+    set index [lsearch -exact $argList $argToFind]
+
+    if {$index != -1} {
+        # Just in case they passed a list with the argument, then nothing
+        # after it, this will return null in that case.
+        if {[catch {lindex $argList [expr $index + 1]} retValue]} {
+            set retValue ""
+        }
+    }
+
+	return $retValue
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/platform.tcl b/dep/tclclient/ixTcl1.0/Generic/platform.tcl
new file mode 100644
index 00000000..7aba7d2d
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/platform.tcl
@@ -0,0 +1,88 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: platform.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#       Revision Log:
+#       09-29-2000       DS
+#
+# Description: This file contains platform-independent stuff
+#
+##################################################################################
+
+
+############################################################
+# Procedure  : isUNIX
+# 
+# Description: This proc tells if current OS is Windows.
+# Output     : 1 if it is UNIX, 0 otherwise.
+#
+############################################################
+proc isUNIX {} \
+{
+    global tcl_platform
+
+    set retCode 0
+
+    if {$tcl_platform(platform) == "unix"} {
+        set retCode 1
+    }
+
+    return $retCode
+}
+
+
+############################################################
+# Procedure  : isWindows
+# 
+# Description: This proc tells if current OS is Windows.
+# Output     : 1 if it is UNIX, 0 otherwise.
+#
+############################################################
+
+proc isWindows {} \
+{
+    global tcl_platform
+
+    set retCode 0
+
+    if {$tcl_platform(platform) == "windows"} {
+        set retCode 1
+    }
+
+    return $retCode
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/random.tcl b/dep/tclclient/ixTcl1.0/Generic/random.tcl
new file mode 100644
index 00000000..e6e68739
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/random.tcl
@@ -0,0 +1,109 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: random.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	02-03-2000	HSH
+#
+# Description: This file contains common procs used for generating random
+#              numbers
+#
+##################################################################################
+
+
+########################################################################
+# Set the default randomSeed
+# Now use a random number to be the randomSeed
+########################################################################
+
+global randomSeed
+
+set randomSeed [expr int( [expr rand()] * 100 ) ]
+
+
+########################################################################
+# Procedure: RandomRange
+# Should let range equal to "the total number of data" ( do not subtract 1 )!!
+#
+# range -  the range of random numbers 
+#
+########################################################################
+proc RandomRange { range } \
+{
+ 	
+    return [ expr int( [ Random ] * $range ) ]
+}
+
+########################################################################
+# Procedure: Random
+# This gives a random decimal num.
+# 
+########################################################################
+
+proc Random {} \
+{
+ 	global randomSeed
+ 	set randomSeed [ expr ( $randomSeed * 9301 + 49297 ) %233280 ]
+	return [ expr $randomSeed / double( 233280 ) ]
+}
+
+########################################################################
+# Procedure: RandomInit
+# 
+# 
+########################################################################
+proc RandomInit {} \
+{
+    global randomSeed
+    set randomSeed  [clock seconds]
+}
+
+
+########################################################################
+# Procedure: RandomFromTo
+# This gives a random num within the given range of numbers.
+# 
+########################################################################
+proc RandomFromTo {from to} \
+{
+    global randomSeed
+
+    set randomSeed [expr ($randomSeed*9301 + 49297) % 233280]
+    set random     [expr $randomSeed/double(233280)]
+
+    return [expr int($random * ($to - $from + 1)) + $from]
+}
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/scriptmateBackCompat.tcl b/dep/tclclient/ixTcl1.0/Generic/scriptmateBackCompat.tcl
new file mode 100644
index 00000000..8c99c3f1
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/scriptmateBackCompat.tcl
@@ -0,0 +1,65 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: scriptmateBackCompat.tcl
+#
+#   This file is used to create backwards compatibility for sample scripts created prior to
+#   IxOS 3.70.  Post of this version, a package require Scriptmate is needed.  This will handle
+#   attempting to define the commands that used to be defined by IxTclHal and now are defined 
+#   Scriptmate
+#  
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#############################################################################################
+
+namespace eval scriptmateBackwardsCompatibility {}
+
+
+proc scriptmateBackwardsCompatibility::createAllCommands { } {
+
+    foreach cmd {addr back2back bcast cableModem congest dataVerify dtm errframe floss flow gapcheck imix \
+            ipmulticast latency tunnel mesh qost randomFS tput tputerror tputjitter tputnat tputl2l3 tputlat \
+            tputmfs tputvlan ttl wip results internalModem user bgpSuite dslats ospfSuite rsvpSuite ldpSuite \
+            l2VpnSuite l3VpnSuite} {
+
+        proc $cmd { args } {
+            if {[catch {package require Scriptmate}]} {
+                return "Command is not supported by IxTclHal, it is part of Scriptmate"
+            } else {
+                return [eval $cmd $args]
+            }
+        }
+    }
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/socket.tcl b/dep/tclclient/ixTcl1.0/Generic/socket.tcl
new file mode 100644
index 00000000..50d60a2c
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/socket.tcl
@@ -0,0 +1,718 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: socket.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+# Revision Log:
+#
+# Description: 
+#
+###############################################################################
+
+###############################################################################
+# Procedure: serverSocketAccept
+#
+# Description: This function accepts a connection request from client and 
+#              spawns a new socket that will be used to communicate with client
+#
+# Arguments:
+#    socket - the name of the socket to configure
+#    addr - the ip address or hostname of client
+#    port - the port number of the server socket
+###############################################################################
+proc serverSocketAccept {socket addr port} \
+{ 
+    debugMsg "enter serverSocketAccept $socket from $addr port $port"
+
+    fconfigure $socket -buffering none
+    fconfigure $socket -blocking 0
+    fileevent  $socket readable [list readsocket $socket]
+
+    debugMsg "exit  serverSocketAccept"
+}
+
+
+###############################################################################
+# Procedure: readSocket
+#
+# Description: This function reads a line from client. It is invoked 
+#              everytime a message arrived from client.
+#
+# Arguments:
+#    socket - the socket that is communicating with the client.
+###############################################################################
+proc readsocket {socket} \
+{
+    global socketArray
+
+    debugMsg "enter readSocket $socket"
+
+    if {[eof $socket] || [catch {gets $socket line}]} {
+
+        closeSocket $socket
+        debugMsg "Close $socket"
+
+     } else {
+        
+        debugMsg "line=$line"
+
+        if {[string compare $line "quit"] == 0} {
+            close $socketArray(serverSocket)
+            catch {unset socketArray(serverSocket)}
+        }
+
+        if [isLogSocket $socket] {
+
+            if { ![regexp {client response:|runningStatus:|this is log socket} $line] } {
+
+                if [fblocked $socket] {
+                    set line [read -nonewline $socket]
+                    updateLog $line 0
+                } else {
+                    updateLog $line
+                }
+
+            } else {
+
+                handleEvent $socket $line
+            }
+
+        } elseif {[isCommandSocket $socket]} {
+            fileTransferServer::handleCommand $line
+
+        } elseif {[isDataSocket $socket]} {
+
+            fileTransferServer::handleData $line
+
+        } else {
+
+            handleEvent $socket $line
+        }
+    }
+
+    update idletask
+    debugMsg "exit  readSocket"
+}
+
+
+###############################################################################
+# Procedure: handleEvent
+#
+# Description: This function invokes the appropriate action according to the
+#              contents of the input from client.
+#
+# Arguments:
+#    socket - the socket that received the line.
+#    line - the character string received from the client
+###############################################################################
+proc handleEvent {socket line} \
+{
+    global currContext
+    global socketArray
+
+    debugMsg "enter handleEvent socket=$socket line=$line"
+    
+    set commandPattern ""
+    catch { regexp {(.*): (.*)} $line match commandPattern portMapList }
+
+
+    if {[regexp {client response} $line]} {
+
+        # Nothing to do
+
+    } elseif {$line == "closeSocket"} {
+
+        closeSocket $socket
+
+    } elseif {$line == "runningStatus:currentTestFinished"} {
+
+        updateLog "\n****** Current test(s) finished ******"
+
+        runStop
+        forceToStop
+
+       	setSF08StartButtonState normal
+
+        displayResults
+
+    } elseif {$line == "runningStatus:currentTestFailed"} {
+
+        updateLog "\n****** Current test(s) failed ******"
+
+        runStop
+        forceToStop
+
+    } elseif {$line == "runningStatus:currentTestStopped"} {
+
+        updateLog "\n****** Current test(s) stopped ******"
+
+        runStop
+        forceToStop
+
+        setSF08StartButtonState normal
+
+    } elseif {$line == "runningStatus:currentTestStoppedByUser"} {
+
+        updateLog "\n****** Current test(s) stopped by user ******"
+
+        forceToStop
+       
+        setSF08StartButtonState normal
+
+    } elseif {[regexp {removefile} $line]} {
+
+        set file [lindex [split $line "?"] 1]
+        debugMsg "file to be removed is $file"
+
+        if [file exists $file] {
+            catch {file delete $file}
+        }
+
+    } elseif {$line == "progress dialog is ready"} {
+
+        progressDialogReady
+
+    } elseif {$line == "this is test command socket"} {
+
+        set currContext(commandSocketReady) 1
+        set socketArray(testCommandSocket)  $socket
+
+    } elseif {$line == "Background wish is ready"} {
+
+        backgroundWishReady
+        
+    } elseif {$line == "this is log socket"} {
+
+        set socketArray(logSocket) $socket
+
+    } elseif {$line == "this is command socket"} {
+
+        set socketArray(commandSocket) $socket
+
+    } elseif {$line == "this is data socket"} {
+
+        set socketArray(dataSocket) $socket
+    } elseif { $commandPattern == "portlist" } {
+
+        debugMsg "[pid]>>>>>>>>> portMapList:$portMapList"
+        testConfig::setCurrentTestMap $portMapList 
+    }
+
+    debugMsg "exit  handleEvent"
+}
+
+
+###############################################################################
+# Procedure: generatePort
+#
+# Description: This function generates a port for then server side socket.
+#              It is based on the current pid.
+#
+# Returns the generated port number.
+###############################################################################
+proc generatePort {} \
+{
+    debugMsg "enter generatePort"
+
+    set port [pid]
+    set len  [string length $port]
+    debugMsg "pid=$port"
+
+    if {$len > 4} {
+        set port [string range $port [expr $len - 4] [expr $len - 1]]
+    }
+
+    if {[string compare $port 0] != 0} {
+        set port [string trimleft $port 0] 
+    }
+
+    if {$port < 4000} {
+        incr port 4000
+    }
+
+    debugMsg "exit  generatePort port=$port"
+    return $port
+}
+
+
+###############################################################################
+# Procedure: putsClient
+#
+# Description: This function sends a line to client.
+#
+# Arguments:
+#    line - The string of characters that is to be sent to the client side.
+###############################################################################
+proc putsClient {line} \
+{
+    global socketArray
+
+    debugMsg "enter putsClient line=$line"
+
+    if {([info exists socketArray(testCommandSocket)] == 0) || \
+            ($socketArray(testCommandSocket) == -1)} {
+        debugMsg "exit putsClient on testCommandSocket does not exist"
+
+    } else {
+        catch {puts  $socketArray(testCommandSocket) $line}
+        catch {flush $socketArray(testCommandSocket)}
+        debugMsg "exit  putsClient"
+    }
+}
+
+
+###############################################################################
+# Procedure: createServerSocket
+#
+# Description: This function creates a server side socket on the specified
+#              port. If port is not specified, the port number will be 
+#              generated using pid and set to SCRIPTMATE_PORT as an environment
+#              variable.  The spawned child process will retrieve the port
+#              number from the environment and create a client side socket.
+#
+# Arguments:
+#    port  - Optional.  The port number to use.  Defaults to -1 if not given.
+#    retry - Optional.  Increase the port number by 1 until a port is available
+#                       and server socket is created when this argument is true.
+#                       Otherwise give up if the port is not available.
+# Returns:
+#    port  - The port number of server socket.
+#
+###############################################################################
+proc createServerSocket {{port -1} {retry true}} \
+{
+    global env socketArray
+
+    debugMsg "enter createServerSocket"
+
+    if {$port == -1} {
+        set port [generatePort]
+    }
+
+    while {[catch {socket -server serverSocketAccept $port} socketArray(serverSocket)] == 1} {
+        if {$retry == "true"} {
+            incr port
+            debugMsg "port=$port"
+        } else {
+            set port -1
+            break
+        }
+    }
+
+    debugMsg "exit  createServerSocket $port"
+    return $port
+}
+
+
+###############################################################################
+# Procedure: closeSocket
+#
+# Description: Close either the given socket, or if none given, close the 
+#              global new socket
+#
+# Arguments:
+#    socket - Optional.  The socket to close
+###############################################################################
+proc closeSocket {socket} \
+{
+    global socketArray
+
+    debugMsg "enter closeSocket $socket"
+
+    if {$socket != -1} {
+        # Close the given socket
+        catch {close $socket}
+
+        foreach name [array name socketArray] {
+            if {$socketArray($name) == $socket} {
+                catch {unset socketArray($name)}
+                break
+            }
+        }
+    }
+
+    debugMsg "exit  closeSocket"
+}
+
+
+###############################################################################
+# Procedure: closeServerSocket
+#
+# Description: Close the global main socket
+###############################################################################
+proc closeServerSocket {} \
+{
+    global socketArray
+
+    debugMsg "enter closeServerSocket"
+
+    if {[info exists socketArray(serverSocket)]} {
+        catch {close $socketArray(serverSocket)}
+        catch {unset socketArray(serverSocket)}
+    }
+
+    debugMsg "exit  closeServerSocket"
+}
+
+###############################################################################
+# Procedure: isTestCommandSocket
+#
+# Description: Determine if the given socket is the same as the test command socket
+#
+# Arguments:
+#    socket - the socket to check
+#
+# Returns 1 when it is the same socket, and 0 when it is not the same.
+###############################################################################
+proc isTestCommandSocket {socket} \
+{
+    global socketArray
+
+    debugMsg "enter isTestCommandSocket $socket"
+
+    set retCode 0
+
+    if [info exists socketArray(testCommandSocket)] {
+        if {$socket == $socketArray(testCommandSocket)} {
+            set retCode 1
+        }
+    }
+
+    debugMsg "exit  isTestCommandSocket $retCode"
+    return $retCode
+}
+
+###############################################################################
+# Procedure: isLogSocket
+#
+# Description: Determine if the given socket is the same as the log socket
+#
+# Arguments:
+#    socket - the socket to check
+#
+# Returns 1 when it is the same socket, and 0 when it is not the same.
+###############################################################################
+proc isLogSocket {socket} \
+{
+    global socketArray
+
+    debugMsg "enter isLogSocket $socket"
+
+    set retCode 0
+
+    if [info exists socketArray(logSocket)] {
+        if {$socket == $socketArray(logSocket)} {
+            set retCode 1
+        }
+    }
+
+    debugMsg "exit  isLogSocket $retCode"
+    return $retCode
+}
+
+###############################################################################
+# Procedure: isCommandSocket
+#
+# Description: Determine if the given socket is the same as the command socket
+#
+# Arguments:
+#    socket - the socket to check
+#
+# Returns 1 when it is the same socket, and 0 when it is not the same.
+###############################################################################
+proc isCommandSocket {socket} \
+{
+    global socketArray
+
+    debugMsg "enter isCommandSocket $socket"
+
+    set retCode 0
+
+    if [info exists socketArray(commandSocket)] {
+        if {$socket == $socketArray(commandSocket)} {
+            set retCode 1
+        }
+    }
+
+    debugMsg "exit  isCommandSocket $retCode"
+    return $retCode
+}
+
+###############################################################################
+# Procedure: isDataSocket
+#
+# Description: Determine if the given socket is the same as the data socket
+#
+# Arguments:
+#    socket - the socket to check
+#
+# Returns 1 when it is the same socket, and 0 when it is not the same.
+###############################################################################
+proc isDataSocket {socket} \
+{
+    global socketArray
+
+    debugMsg "enter isDataSocket $socket"
+
+    set retCode 0
+
+    if [info exists socketArray(dataSocket)] {
+        if {$socket == $socketArray(dataSocket)} {
+            set retCode 1
+        }
+    }
+
+    debugMsg "exit  isDataSocket $retCode"
+    return $retCode
+}
+
+###############################################################################
+# Procedure: createClientSocket
+#
+# Description: Create a client socket for the given port name.
+#
+# Arguments:
+#    port - Optional.  The port number to use for the socket being created.
+#
+# Returns the name of the socket created
+###############################################################################
+proc createClientSocket {{port -1}} \
+{
+    global ixgClientSocket
+
+    debugMsg "enter createClientSocket"
+
+    set socket [createClientSocketCreate localhost $port]
+
+    if {$socket != -1} {
+        fconfigure $socket -buffering line
+        fileevent $socket readable [list readClientSocket $socket]
+        #puts $socket "this is test command socket"
+    }
+
+    set ixgClientSocket $socket
+
+    update idletask
+
+    debugMsg "exit  createClientSocket $socket"
+    return $socket
+}
+
+
+###############################################################################
+# Procedure: closeClientSocket
+#
+# Description: Close the given socket.  If no socket given, close the global
+#              ixgClientSocket
+#
+# Arguments:
+#    socket - the name of the socket to close
+###############################################################################
+proc closeClientSocket {{socket -1}} \
+{
+    global ixgClientSocket
+
+    if {$socket != -1} {
+        catch {close $socket}
+    } else {
+        catch {close $ixgClientSocket}
+    }
+}
+
+
+###############################################################################
+# Procedure: closeAllSockets
+#
+# Description: Close the two global sockets
+###############################################################################
+proc closeAllSockets {} \
+{
+    global socketArray
+
+    foreach name [array name socketArray] {
+        closeSocket $socketArray($name)
+    }
+}
+
+
+###############################################################################
+# Procedure: readClientSocket
+#
+# Description: Read the data from the given socket
+#
+# Arguments:
+#    socket - the socket to get the data from
+###############################################################################
+proc readClientSocket {socket} \
+{
+    if {[eof $socket] || [catch {gets $socket line}]} {
+        debugMsg "readClientSocket: child eof line"
+        close $socket
+    } else {
+        debugMsg "readClientSocket: $line"
+        handleCommand $line
+    }
+}
+
+
+###############################################################################
+# Procedure: createClientSocketCreate
+#
+# Description: Create a client socket given a hostname and port id.
+#
+# Arguments:
+#    host - the hostname to use
+#    port - the port number to use
+#
+# Returns the name of the socket created
+###############################################################################
+proc createClientSocketCreate {host port} \
+{
+    global env
+
+    if {$port == -1} {
+        if {[info exists env(SCRIPTMATE_PORT)]} {
+            set port $env(SCRIPTMATE_PORT)
+        } else {
+            debugMsg "Could not find env(SCRIPTMATE_PORT), failed creating socket."
+            return -1
+        }
+    }
+
+    set socketName [socket $host $port]
+    fconfigure $socketName -blocking  0
+    fconfigure $socketName -buffering line
+    return $socketName
+}
+
+
+###############################################################################
+# Procedure: putsServer
+#
+# Description:
+#
+# Arguments:
+#    line - the character stream that is being sent to the server side.
+#
+# Returns 0 on success and 1 on failure
+###############################################################################
+proc putsServer {line} \
+{
+    global ixgClientSocket
+
+    set retCode 0
+
+    if {([info exists ixgClientSocket] == 0) || ($ixgClientSocket == -1)} {
+        set retCode 1
+        debugMsg "in putsServer, ixgClientSocket is bad"
+
+    } else {
+        debugMsg "in putsServer before line=$line is sent to server"
+        if {[catch {puts $ixgClientSocket $line} retCode]} {
+
+            # Stop the shell if the child socket is closed
+            exit
+        }
+        catch {flush $ixgClientSocket}
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+# Procedure: handleCommand
+#
+# Description: Handle the command sent to the client
+#
+# Arguments:
+#    line - the character stream to handle
+###############################################################################
+proc handleCommand {line} \
+{
+    putsServer "client response: $line newline"
+
+    if {$line == "stopTest"} {
+        stopTest
+
+    } elseif { $line == "closeSession" || $line == "stopTestNow" } {
+        # kill current tcl shell
+        closeAllSockets
+        exit
+
+    } elseif {[regexp {progressDialog} $line] == 1} {
+
+        set msg [lindex [split $line :] 1]
+        setMsgWinMessage $msg
+
+    } elseif {$line == "createInterpreter"} {
+
+        # Do nothing
+
+    } elseif {[regexp {source\ ?} $line]} {
+
+        regsub {source\ ?} $line "" filename
+
+        if { [catch { eval "source \"$filename\"" } retCode] } {
+
+            logMsg $retCode
+
+        } else {
+
+            if { $retCode == 0 } {
+                logMsg "runningStatus:currentTestFinished"
+            } else {
+                logMsg "runningStatus:currentTestFailed"
+            }
+        }
+
+        logOff
+
+    } elseif {$line == "stopSF08Test"} {
+
+        setStopTestFlag 1
+        logOff
+
+    } elseif { [regexp {connectToTclServer} $line] } {
+        set serverName [lindex $line 1]
+        tclServer::connectToTclServer $serverName errMsg
+
+    } 
+
+    debugMsg "handleCommand:Exit"
+
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/statistics.tcl b/dep/tclclient/ixTcl1.0/Generic/statistics.tcl
new file mode 100644
index 00000000..c10a23d6
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/statistics.tcl
@@ -0,0 +1,1222 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: statistics.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	12-30-1998	DS
+#
+# Description: 
+#	This file contains common procs used to access/calculate statistics
+#
+########################################################################
+
+
+########################################################################
+# Procedure: checkTransmitDone
+#
+# This command polls the TX rate counters & returns the number of frames
+# transmitted
+#
+# Argument(s):
+#	chassis		chassis ID
+#	lm			Load Module number
+#	port		port number
+#
+########################################################################
+proc checkTransmitDone {chassis lm port} \
+{
+    set retCode     $::TCL_OK
+	set numTxFrames	0
+
+    while {[stat getTransmitState $chassis $lm $port] && ($::ixStopTest != 1)} {
+        after 250
+    }
+ 
+    # just a wait to make sure stats are all updated...
+    after 400
+	
+	set txList [list [list $chassis $lm $port]]
+	requestStats txList
+
+	if [statList get $chassis $lm $port] {
+		errorMsg "Error getting statList for [getPortId $chassis $lm $port]."
+		set retCode $::TCL_ERROR
+	}
+
+    if { !$retCode } {
+		# we only need this cause this proc returns num frames sent...
+		if [catch {statList cget -scheduledFramesSent} numTxFrames ] {
+			if [catch {statList cget -framesSent} numTxFrames ] {
+				set numTxFrames 0
+			} else {
+				set numTxFrames [mpexpr $numTxFrames - [statList cget -protocolServerTx]]
+				if {[isNegative $numTxFrames]} {
+					 set numTxFrames 0
+				}
+			}
+		}
+	}
+    
+    return $numTxFrames    
+}
+
+
+########################################################################
+# Procedure: checkAllTransmitDone
+#
+# This command polls the TX rate counters for all ports in the list/map
+#
+# Argument(s):
+#   TxRxArray          - list or map array containing ports
+#
+########################################################################
+proc checkAllTransmitDone {TxRxArray {duration 0}} \
+{
+    upvar $TxRxArray    txRxArray
+
+    set retCode $::TCL_OK
+
+	set timeout		[expr $duration + 1]
+    set currentTime [mpexpr [clock clicks]/1000.]
+
+    set txPorts     [getTxPorts txRxArray]
+
+	foreach port $txPorts {
+		scan $port "%d %d %d" c l p
+
+	    while {[stat getTransmitState $c $l $p] == $::statActive && ($::ixStopTest != 1)} {
+            after 250
+            if {$duration > 0} {
+                if {[mpexpr [clock clicks]/1000. - $currentTime] > $timeout} {
+					set retCode $::TCL_ERROR 
+					break                  
+                }
+            }
+	    }
+		if { $retCode } {
+			break
+		}
+    }
+    
+    return $retCode   
+}
+
+
+
+########################################################################
+# Procedure: requestStats
+#
+# This command request stats from a group of ports 
+#
+# Argument(s):
+#   TxRxArray          - list or map array containing ports
+#
+########################################################################
+proc requestStats {TxRxArray} \
+{
+    upvar $TxRxArray    txRxArray
+
+    set retCode $::TCL_OK
+
+    statGroup setDefault
+	foreach port [getAllPorts txRxArray] {
+		scan $port "%d %d %d" c l p
+        
+        if [statGroup add $c $l $p] {
+            errorMsg "Error adding port [getPortId $c $l $p] to statGroup"
+            set retCode $::TCL_ERROR
+            continue
+        }
+	}
+
+    if [statGroup get] {
+        errorMsg "Error getting stats for ports in statGroup"
+        set retCode $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: collectTxStats
+#
+# This command polls the TX counters 
+#
+# Argument(s):
+#   txList          - list of transmit ports
+#   TxNumFrames     - array containing the number of frames that should have been transmitted
+#   TxActualFrames  - array containing the actual transmitted stats (returned val)
+#
+########################################################################
+proc collectTxStats {txList TxNumFrames TxActualFrames {TotalTxFrames ""} {verbose true} } \
+{
+    upvar $TxNumFrames    txNumFrames
+    upvar $TxActualFrames txActualFrames
+
+    if {[info exists TotalTxFrames]} {
+        upvar $TotalTxFrames	totalTxFrames
+    }
+
+    set retCode		        0
+    set totalTxFrames		0
+
+    if {$verbose == "true"} {
+        logMsg "Collecting transmit statistics ..."
+    }
+
+    checkAllTransmitDone txList
+    requestStats txList
+
+    # Loop through all receive ports and find the longest name.  Then the log messages can be formatted well.
+    # Keep the names in a temporary array for use in the next loop.  This is so unix will not be calling twice
+    # for the name.
+    set nameLen 0
+    foreach txMap $txList {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+        set tempTxArray($tx_c,$tx_l,$tx_p) [getPortId $tx_c $tx_l $tx_p]
+        set newLen [string length $tempTxArray($tx_c,$tx_l,$tx_p)]
+        if {$newLen > $nameLen} {
+            set nameLen $newLen
+        }
+    }
+
+    foreach txMap $txList {
+        scan $txMap	"%d %d %d" tx_c tx_l tx_p
+
+        if [statList get $tx_c $tx_l $tx_p] {
+            errorMsg "Error getting stats for [getPortId $tx_c $tx_l $tx_p]."
+            set txActualFrames($tx_c,$tx_l,$tx_p)   0
+            continue
+        }
+
+        # there's a new stat for the txs-family so that we don't have to subtract out the protocol stats, yea!!
+        if [catch {statList cget -scheduledFramesSent} numTxFrames] {
+            # if this port doesn't support nifty new stat, then just use config'd value
+            set numTxFrames $txNumFrames($tx_c,$tx_l,$tx_p)
+
+            # only make use of the protocolServerTx stats if the user aborted the test whilst transmitting
+            if {$::ixStopTest} {
+                if [catch {statList cget -framesSent} numTxFrames ] {
+                    set numTxFrames  0
+                }
+                if [catch {statList cget -protocolServerTx} numProtocolServerFrames ] {
+                    set numProtocolServerFrames  0
+                }
+                set numTxFrames [mpexpr ($numTxFrames - $numProtocolServerFrames ) ]
+                # Since 32 bit counter (mpexpr) is used here, if we get a 32 bit long number (in binary) whose most significiant
+                # bit is 1, it will be recognized as a negtive number. 
+                # So we use regexp to determine wheather numTxFrames is a negative number instead of using "$numTxFrames < 0"
+                if { [regexp {^-[0-9]+$} $numTxFrames] } {
+                    set numTxFrames 0
+                }
+            }
+        }
+        set txActualFrames($tx_c,$tx_l,$tx_p) $numTxFrames
+
+        if {$txActualFrames($tx_c,$tx_l,$tx_p) < $txNumFrames($tx_c,$tx_l,$tx_p)} {
+            if {$verbose == "true"} {
+                logMsg "All $txNumFrames($tx_c,$tx_l,$tx_p) frames not transmitted on [getPortId $tx_c $tx_l $tx_p] - check the device"
+            }
+            set retCode $::TCL_ERROR
+        } elseif {$txActualFrames($tx_c,$tx_l,$tx_p) > $txNumFrames($tx_c,$tx_l,$tx_p)} {
+            if {$verbose == "true"} {
+                logMsg "Transmitted more frames than expected on [getPortId $tx_c $tx_l $tx_p]"
+            }
+        }
+
+        if {$verbose == "true"} {
+            logMsg [format "%-${nameLen}s:  Total frames transmitted: $txActualFrames($tx_c,$tx_l,$tx_p)" $tempTxArray($tx_c,$tx_l,$tx_p)]
+        }
+
+        mpincr totalTxFrames $txActualFrames($tx_c,$tx_l,$tx_p)
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: collectRxStats
+#
+# This command polls the RX counters 
+#
+# Argument(s):
+#   rxList          - list of receive ports
+#   RxNumFrames     - array containing the returned rx stats
+#   TotalRxFrames   - total received frames
+#   printError      - if no frames received, print error message
+#
+########################################################################
+proc collectRxStats {rxList RxNumFrames {TotalRxFrames ""} {printError yes} {receiveCounter userDefinedStat2}} \
+{
+    upvar $RxNumFrames		rxNumFrames
+    if {[info exists TotalRxFrames]} {
+        upvar $TotalRxFrames	totalRxFrames
+    }
+
+    set retCode				0
+    set totalRxFrames		0
+
+    logMsg "Collecting receive statistics ..."
+
+    set retCode [requestStats rxList]
+
+    # Loop through all receive ports and find the longest name.  Then the log messages can be formatted well.
+    set nameLen 0
+    foreach rxMap [lnumsort $rxList] {
+        scan $rxMap "%d %d %d" rx_c rx_l rx_p
+        set tempRxArray($rx_c,$rx_l,$rx_p) [getPortId $rx_c $rx_l $rx_p]
+        set newLen [string length $tempRxArray($rx_c,$rx_l,$rx_p)]
+        if {$newLen > $nameLen} {
+            set nameLen $newLen
+        }
+    }
+
+    foreach rxMap [lnumsort $rxList] {
+        scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+
+        # count the Rx Frames
+        if [statList get $rx_c $rx_l $rx_p] {
+            errorMsg "Error getting Rx statistics for [getPortId $rx_c $rx_l $rx_p]"
+        }
+
+        if [catch {statList cget -$receiveCounter} rxNumFrames($rx_c,$rx_l,$rx_p)] {
+            errorMsg "$receiveCounter is not a valid counter for port [getPortId $rx_c $rx_l $rx_p]"
+            set rxNumFrames($rx_c,$rx_l,$rx_p)  0
+        }
+
+        # if no frames received, there must be a connection error... dump out
+        if {$rxNumFrames($rx_c,$rx_l,$rx_p) == 0} {
+            if {$printError == "yes"} {
+                logMsg "\n\n\tError !!"
+                logMsg "\tZero packets received on port [getPortId $rx_c $rx_l $rx_p]"    
+                logMsg "\tCheck the connections." 
+            }
+            set retCode 1
+        }
+
+        logMsg [format "%-${nameLen}s:  Total frames received   : $rxNumFrames($rx_c,$rx_l,$rx_p)" \
+                $tempRxArray($rx_c,$rx_l,$rx_p)]
+
+        mpincr totalRxFrames $rxNumFrames($rx_c,$rx_l,$rx_p)
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: collectVlanStats
+#
+# This command polls the Vlan counters 
+#
+# Argument(s):
+#   vlanList          - list of receive ports
+#   VlanNumFrames     - array containing the returned Vlan stats
+#   TotalVlanFrames   - total received frames
+#
+########################################################################
+proc collectVlanStats {vlanList VlanNumFrames {TotalVlanFrames ""}} \
+{
+    upvar $VlanNumFrames		vlanNumFrames
+	if {[info exists TotalVlanFrames]} {
+		upvar $TotalVlanFrames	totalVlanFrames
+	}
+
+	set retCode				0
+	set totalVlanFrames		0
+
+	debugMsg "Collecting vlan tagged frame statistics ..."
+
+    set retCode [requestStats vlanList]
+
+	foreach rxMap [lnumsort $vlanList] {
+		scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+
+	    # count the vlan tagged frames
+        if [statList get $rx_c $rx_l $rx_p] {
+	        errorMsg "Error getting vlan tagged frame statistics for [getPortId $rx_c $rx_l $rx_p]"
+        } else {
+            if [catch {statList cget -vlanTaggedFramesRx} vlanNumFrames($rx_c,$rx_l,$rx_p)] {
+                errorMsg "***** WARNING:Invalid statistic (vlanTaggedFramesRx) for the port:[getPortString $rx_c $rx_l $rx_p]\n"
+                set vlanNumFrames($rx_c,$rx_l,$rx_p) 0
+                set retCode 1
+            }
+
+            mpincr totalVlanFrames $vlanNumFrames($rx_c,$rx_l,$rx_p)       
+        }
+    }
+    return $retCode
+}
+
+########################################################################
+# Procedure: collectDataIntegrityStats
+#
+# This command polls the Data Integrity counters 
+#
+# Argument(s):
+#   rxPortList      - list of receive ports
+#   Errors          - array containing the error stats
+#   RxFrames        - received data integrity frames per rx port
+#   TotalRxFrames   - total received data integrity frames
+#
+########################################################################
+proc collectDataIntegrityStats {rxPortList Errors RxFrames {TotalRxFrames ""} {TotalErrorFrames ""}} \
+{
+    upvar $Errors	errors
+	upvar $RxFrames	rxFrames
+
+	if {[string length $TotalRxFrames] != 0 } {
+		upvar $TotalRxFrames	totalRxFrames
+	}
+
+	if {[string length $TotalErrorFrames] != 0 } {
+		upvar $TotalErrorFrames	totalErrorFrames
+	}
+
+	set retCode				$::TCL_OK
+	set totalRxFrames		0
+    set totalErrorFrames    0
+
+	logMsg "Collecting data integrity statistics ..."
+    
+    set retCode [requestStats rxPortList]
+
+	foreach rxMap $rxPortList {
+		scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+
+	    # count the data integrity frames
+        if [statList get $rx_c $rx_l $rx_p] {
+	        errorMsg "Error getting data integrity frame statistics for [getPortId $rx_c $rx_l $rx_p]"
+        } else {
+
+            if {[catch {statList cget -dataIntegrityFrames} rxFrames($rx_c,$rx_l,$rx_p)]} {
+                errorMsg "***** WARNING:Invalid statistic (dataIntegrityFrames) for the port:[getPortString $rx_c $rx_l $rx_p]\n"
+                set rxFrames($rx_c,$rx_l,$rx_p) 0
+                set retCode $::TCL_ERROR
+            }
+            mpincr totalRxFrames $rxFrames($rx_c,$rx_l,$rx_p)       
+
+            if {[catch {statList cget -dataIntegrityErrors} errors($rx_c,$rx_l,$rx_p)]} {
+                errorMsg "***** WARNING:Invalid statistic (dataIntegrityErrors) for the port:[getPortString $rx_c $rx_l $rx_p]\n"
+                set errors($rx_c,$rx_l,$rx_p) 0
+                set retCode $::TCL_ERROR
+            }
+            mpincr totalErrorFrames $errors($rx_c,$rx_l,$rx_p)            
+        }
+    }
+    return $retCode
+}
+
+########################################################################
+# Procedure: collectSequenceStats
+#
+# This command polls the Sequence counters 
+#
+# Argument(s):
+#   rxPortList      - list of receive ports
+#   Errors          - array containing the error stats
+#   RxFrames        - received sequence frames per rx port
+#   TotalRxFrames   - total received sequence frames
+#
+########################################################################
+proc collectSequenceStats {rxPortList Errors RxFrames {TotalRxFrames ""} {TotalErrorFrames ""}} \
+{
+    upvar $Errors	errors
+	upvar $RxFrames	rxFrames
+
+	if {[info exists TotalRxFrames]} {
+		upvar $TotalRxFrames	totalRxFrames
+	}
+
+	if {[info exists TotalErrorFrames]} {
+		upvar $TotalErrorFrames	totalErrorFrames
+	}
+
+	set retCode				$::TCL_OK
+	set totalRxFrames		0
+    set totalErrorFrames    0
+
+	logMsg "Collecting sequence statistics ..."
+    
+    set retCode [requestStats rxPortList]
+
+	foreach rxMap $rxPortList {
+		scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+
+	    # count the data integrity frames
+        if [statList get $rx_c $rx_l $rx_p] {
+	        errorMsg "Error getting data integrity frame statistics for [getPortId $rx_c $rx_l $rx_p]"
+        } else {
+
+            if {[catch {statList cget -sequenceFrames} rxFrames($rx_c,$rx_l,$rx_p)]} {
+                errorMsg "***** WARNING:Invalid statistic (dataIntegrityFrames) for the port:[getPortString $rx_c $rx_l $rx_p]\n"
+                set rxFrames($rx_c,$rx_l,$rx_p) 0
+                set retCode $::TCL_ERROR
+            }
+            mpincr totalRxFrames $rxFrames($rx_c,$rx_l,$rx_p)       
+
+            if {[catch {statList cget -sequenceErrors} errors($rx_c,$rx_l,$rx_p)]} {
+                errorMsg "***** WARNING:Invalid statistic (dataIntegrityErrors) for the port:[getPortString $rx_c $rx_l $rx_p]\n"
+                set errors($rx_c,$rx_l,$rx_p) 0
+                set retCode $::TCL_ERROR
+            }
+            mpincr totalErrorFrames $errors($rx_c,$rx_l,$rx_p)       
+        }
+    }
+    return $retCode
+}
+
+########################################################################
+# Procedure: collectErroredFramesStats
+#
+# This command collects the counters for the errored frames received 
+# 
+# Argument(s):
+# rxPortList            - receive port list
+# ErrorredFrames        - array containing the number of errored frames per rx port
+# errorList		        - list that contains errors, example {oversize undersize}
+#
+# NOTE: This proc is used by custom code, don't remove it
+#
+########################################################################
+proc collectErroredFramesStats {rxPortList ErrorredFrames errorList} \
+{
+    upvar $ErrorredFrames	errorredFrames
+
+    set retCode     0   
+    set retCode     [requestStats rxPortList]
+            
+	foreach rxMap $rxPortList {
+		scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+
+        if [statList get $rx_c $rx_l $rx_p] {
+	        errorMsg "Error getting statList for [getPortId $rx_c $rx_l $rx_p]"
+        } else {
+            foreach errType $errorList {
+                if [catch {statList cget -$errType} statValue] {
+                    logMsg "\n\n***** WARNING: Invalid statistic ($errType) for the port:[getPortString $rx_c $rx_l $rx_p] \n"
+                    set errorredFrames($errType,$rx_c,$rx_l,$rx_p)    "N/A"
+                } else {       
+                    set errorredFrames($errType,$rx_c,$rx_l,$rx_p)    [statList cget -$errType]
+                }
+            }
+        }
+    }
+
+    return $retCode
+}
+
+########################################################################
+# Procedure: collectQosStats
+#
+# This command polls the QoS counters 
+#
+# Argument(s):
+#   rxList          - list of receive ports
+#   RxQosNumFrames  - array containing the returned rx stats per priority
+#   TotalQosFrames  - array containing the total Qos frames, per priority
+#   TotalRxFrames   - total received frames
+#   printError      - if no frames received, print error message
+#
+########################################################################
+proc collectQosStats {rxList RxQosNumFrames {TotalQosFrames ""} {TotalRxFrames ""} {printError yes}} \
+{
+    upvar $RxQosNumFrames		rxQosNumFrames
+
+    if [info exists TotalQosFrames] {
+        upvar $TotalQosFrames   totalQosFrames
+    }
+
+	if [info exists TotalRxFrames] {
+		upvar $TotalRxFrames	totalRxFrames
+	}
+
+	set retCode 0
+
+    set numPriorities 8
+
+    # init the totals first
+    for {set i 0} {$i < $numPriorities} {incr i} {
+        set totalQosFrames($i)  0
+    }
+
+    set retCode [requestStats rxList]
+
+	set totalRxFrames    0
+
+    # look at each qost stat
+	foreach rxMap $rxList {
+		scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+
+        if [statList get $rx_c $rx_l $rx_p] {
+			errorMsg "Error getting Rx statistics for [getPortId $rx_c $rx_l $rx_p]"
+			set retCode 1
+		}
+
+        set totalRx($rx_c,$rx_l,$rx_p)  0
+
+        for {set priority 0} {$priority < $numPriorities} {incr priority} {
+		    if [catch {statList cget -qualityOfService$priority} rxQosNumFrames($priority,$rx_c,$rx_l,$rx_p)] {
+                errorMsg "***** WARNING:Invalid statistic (qualityOfService$priority) for the port:[getPortString $rx_c $rx_l $rx_p]\n"
+                set rxQosNumFrames($priority,$rx_c,$rx_l,$rx_p) 0
+                set retCode 1
+            }
+            mpincr totalQosFrames($priority)  $rxQosNumFrames($priority,$rx_c,$rx_l,$rx_p)
+            mpincr totalRxFrames              $rxQosNumFrames($priority,$rx_c,$rx_l,$rx_p)
+            mpincr totalRx($rx_c,$rx_l,$rx_p) $rxQosNumFrames($priority,$rx_c,$rx_l,$rx_p)
+ 
+        }
+
+		if {$totalRx($rx_c,$rx_l,$rx_p) == 0 && $printError == "yes"} {
+			logMsg "\n\n\tError !!"
+			logMsg "\tZero packets received on port [getPortId $rx_c $rx_l $rx_p]"    
+			logMsg "\tCheck the connections." 
+		}
+
+	    logMsg "[getPortId $rx_c $rx_l $rx_p]:	Total frames received: $totalRx($rx_c,$rx_l,$rx_p)"
+	}
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: collectStats
+#
+# This command polls the RX counters for the specified stat
+#
+# Argument(s):
+#   rxList          - list of receive ports
+#   statNameList    - list name of stats to poll, return total (need cget name)
+#   RxNumFrames     - array containing the returned rx stats
+#   TotalRxFrames   - total received frames
+#
+########################################################################
+proc collectStats {rxList statNameList RxNumFrames {TotalRxFrames ""} {verbose verbose} } \
+{
+    upvar $RxNumFrames		rxNumFrames
+	if {[info exists TotalRxFrames]} {
+		upvar $TotalRxFrames	totalRxFrames
+	}
+
+	set retCode				0
+	set totalRxFrames		0
+
+    logMsg "Collecting [join $statNameList] statistics ..."
+    set retCode [requestStats rxList]
+
+	foreach rxMap [lnumsort $rxList] {
+		scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+
+		# count the Rx Frames
+		if [statList get $rx_c $rx_l $rx_p] {
+			errorMsg "Error getting Rx statistics for [getPortId $rx_c $rx_l $rx_p]"
+            set retCode 1
+		} else {
+            set rxNumFrames($rx_c,$rx_l,$rx_p)  0
+            foreach statName $statNameList {
+	            # make sure we're using the proper stat name!!
+                if {[string first stat $statName] == 0} {
+                    set statName     [string trimleft $statName stat]
+                    set firstChar    [string tolower [string index $statName 0]]
+                    append firstChar [string range $statName 1 end]
+                    set statName     $firstChar
+                }
+
+ 		        if [catch {statList cget -$statName} value] {
+                    if {$verbose == "verbose"} {
+                        errorMsg "***** WARNING:Invalid statistic ($statName) for the port:[getPortString $rx_c $rx_l $rx_p]\n"
+                    }
+		            set value   0
+                    set retCode 1
+                }
+                 
+                mpincr rxNumFrames($rx_c,$rx_l,$rx_p) $value
+            }
+		    mpincr totalRxFrames $rxNumFrames($rx_c,$rx_l,$rx_p)
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getNumErroredFrames
+#
+# This command gets the counter that contains the number of errored frames 
+# received
+#
+# Argument(s):
+#	chassis		chassis ID
+#	lm			Load Module number
+#	port		port number
+#	error		allErrors OR {oversize|undersize|alignment|dribble|badCRC}
+#
+########################################################################
+proc getNumErroredFrames {chassis lm port {error allErrors}} \
+{ 
+    set numRxFrames     0
+
+    set errList         {fragments undersize oversize fcsErrors symbolErrors \
+                         alignmentErrors dribbleErrors collisions lateCollisions \
+                         collisionFrames excessiveCollisionFrames oversizeAndCrcErrors \
+                         symbolErrorFrames synchErrorFrames} 
+ 
+    if [stat get statAllStats $chassis $lm $port] {
+        errorMsg "Error getting statistics for $chassis,$lm,$port"
+    } else {
+        if {$error != "allErrors"} {
+            set errList $error
+        }
+        foreach error $errList {
+            if [catch {stat cget -$error} msg]  {
+               errorMsg $msg
+            } else {
+                catch {mpincr numRxFrames [stat cget -$error]}
+            }
+        }
+    }
+ 
+    return $numRxFrames
+}
+
+
+########################################################################
+# Procedure: checkLinkState
+#
+# This command checks the link state of all ports in parallel and labels
+# the ones that are down. Then it polls the links that are down for two
+# seconds and returns 1 if any port is still down and a 0 if all ports are
+# up.
+#
+# Arguments(s):
+#	PortArray		array or list of ports, ie, ixgSortMap
+#   PortsToRemove	list containing the ports to be removed
+#
+########################################################################
+proc checkLinkState {PortArray {PortsToRemove ""} {message messageOn}} \
+{
+	upvar $PortArray portArray
+    upvar $PortsToRemove portsToRemove
+
+    set retCode $::TCL_OK
+
+	if {$message == "messageOn"} {
+        set logger  "logMsg"
+    } else {
+        set logger  "debugMsg"
+    }
+
+    eval $logger "Checking link states on ports ..."
+   
+    after 1000  ;# give the port some time to begin it's in autonegotiate mode or PPP
+    
+    set portList    [getAllPorts portArray]
+	set validLinkUpStates [list $::linkUp $::pppUp $::linkLoopback $::forcedLinkUp]
+    
+	# go through all the ports and label the ones whose links are down
+	foreach portMap $portList {
+		scan $portMap "%d %d %d" tx_c tx_l tx_p
+        debugMsg "checking link state on [getPortId $tx_c $tx_l $tx_p]"
+
+		if {[lsearch $validLinkUpStates [stat getLinkState $tx_c $tx_l $tx_p]] < 0} {
+			set linkState($tx_c,$tx_l,$tx_p)	1
+			debugMsg "Link on Tx port [getPortId $tx_c $tx_l $tx_p] is down."
+		}
+	}
+
+	# the linkState array are all the ports whose links are down. Now poll
+	# them a few times until they are all up or return.
+    set loopCount   [expr [advancedTestParameter cget -linkStateTimeout] * 2] 
+	for {set ctr 0} {$ctr < $loopCount} {incr ctr} {
+		foreach downlink [array names linkState] {
+			scan $downlink "%d,%d,%d" c l p
+
+			if {[lsearch $validLinkUpStates [stat getLinkState $c $l $p]] >= 0} {
+				debugMsg "Link on port [getPortId $c $l $p] is now up."
+				unset linkState($c,$l,$p)
+			}
+		}
+		if {[llength [array names linkState]] == 0} {
+			break
+		} else {
+			after 500
+		}
+	}
+
+	set portsToRemove [getTxPorts linkState]
+
+	if {[llength [array names linkState]] == 0} {
+		eval $logger "Links on all ports are up."
+	} else {
+		logMsg "Link on these ports are down:"
+		foreach downlink [array names linkState] {
+			scan $downlink "%d,%d,%d" c l p
+			logMsg [getPortId $c $l $p]
+		}
+        set retCode $::TCL_ERROR      
+	}
+
+    after [advancedTestParameter cget -dutDelay]
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: checkPPPState
+#
+# This command checks the PPP state of all PoS ports in parallel and labels
+# the ones that are down. Then it polls the links that are down for two
+# seconds and returns 1 if any port is still down and a 0 if all ports are
+# up.
+#
+# Arguments(s):
+#	PortArray	array or list of ports, ie, ixgSortMap
+#
+########################################################################
+proc checkPPPState {PortArray {message messageOn}} \
+{
+	upvar $PortArray portArray
+
+    set retCode $::TCL_OK
+
+	if {$message == "messageOn"} {
+        set logger  "logMsg"
+    } else {
+        set logger  "debugMsg"
+    }
+
+    eval $logger "Checking PPP states on ports ..."
+ 
+    after 1000  ;# give the port some time to begin it's in autonegotiate mode or PPP
+
+    set portList    [getAllPorts portArray]
+	set validLinkUpStates [list $::pppUp ]
+    
+	# go through all the ports and label the ones whose links are down
+	foreach portMap $portList {
+		scan $portMap "%d %d %d" c l p
+
+        if [IsPOSPort $c $l $p] {
+            debugMsg "checking link state on [getPortId $c $l $p]"
+
+			if {[lsearch $validLinkUpStates [stat getLinkState $c $l $p]] < 0} {
+				set linkState($c,$l,$p)	[stat getLinkState $c $l $p]
+				debugMsg "Link on Tx port [getPortId $c $l $p] is down"
+			}
+        }
+	}
+
+	# the linkState array are all the ports whose links are down. Now poll
+	# them a few times until they are all up or return.
+    set loopCount   [expr [advancedTestParameter cget -linkStateTimeout] * 4] 
+	for {set ctr 0} {$ctr < $loopCount} {incr ctr} {
+		foreach downlink [array names linkState] {
+			scan $downlink "%d,%d,%d" c l p
+            set state   [stat getLinkState $c $l $p]
+
+            # if the state has transitioned to something else, print it & check it...
+            if {$state != $linkState($c,$l,$p)} {
+		        if {$state == $::pppUp} {
+				    debugMsg "Link on port [getPortId $c $l $p] is now up."
+				    unset linkState($c,$l,$p)
+			    } else {
+                    set linkState($c,$l,$p)    $state
+                }
+            }
+		}
+		if {[llength [array names linkState]] == 0} {
+			break
+		} else {
+			after 250
+		}
+	}
+
+	if {[llength [array names linkState]] == 0} {
+	    if {$message == "messageOn"} {
+		    logMsg "Links on all ports are up."
+        } else {
+		    debugMsg "Links on all ports are up."
+        }
+	} else {
+		logMsg "Link on these ports are down:"
+		foreach portItem [array names linkState] {
+			logMsg $portItem
+		}
+		set retCode $::TCL_ERROR
+	}
+
+	return $retCode
+}
+
+
+########################################################################
+# Procedure: getRunningRate
+#
+# Description: Gets the running rates of a list of ports
+#
+# Argument(s):
+#   portList    - list of ports or array contains tx and rx ports
+#   RunningRate - array w/rate values
+#   sampleNum   - for keeping track of different sample times
+#
+########################################################################
+proc getRunningRate {portList RunningRate args {sampleNum 1}} \
+{
+	upvar $RunningRate  runningRate
+
+    set retCode $::TCL_OK
+
+	requestStats portList
+
+    # even if we got an error, go ahead & fill array so we don't crash anyone...
+	foreach portMap $portList {
+		scan $portMap "%d %d %d" c l p
+
+	    if [statList getRate $c $l $p] {
+		    errorMsg "Error getting rates on port $c,$l,$p"
+            set retCode $::TCL_ERROR
+	    }
+
+        foreach counter [join $args] {
+			set failCount 0
+			set tempCounter $counter
+			
+		    if [catch {statList cget -$counter} currRate($counter)] {
+
+				switch $counter {
+
+					"framesReceived" {			
+						set tempCounter atmAal5FramesReceived
+						if [catch {statList cget -atmAal5FramesReceived} currRate($counter)] {
+							incr failCount
+						}
+					}
+					"scheduledFramesSent" { 
+						set tempCounter framesSent
+						if [catch {statList cget -framesSent} currRate($counter)] {
+							incr failCount
+						}
+					}
+				}
+
+				if { $counter == $tempCounter } {
+					incr failCount
+				}
+			}
+
+			if { $failCount } {				
+				errorMsg "$tempCounter is not a valid rate counter"
+				set currRate($counter)  0
+		    }
+        }
+  
+		if {[llength $args] == 1} {
+    		set runningRate($c,$l,$p,$sampleNum) $currRate($args)
+			debugMsg "TX: runningRate($c,$l,$p,$sampleNum) = $runningRate($c,$l,$p,$sampleNum)"
+		} else {
+			foreach counter $args {
+    			set runningRate($c,$l,$p,$counter,$sampleNum) $currRate($counter)
+				debugMsg "TX: runningRate($c,$l,$p,$counter,$sampleNum) = $runningRate($c,$l,$p,$counter,$sampleNum)"
+			}
+		}
+    }
+
+    return $retCode
+}
+
+
+
+##################################################################################
+# Procedure: getRunRatePerSecond
+#
+# Description: Collects the rate during transmission at every second.
+#
+# Argument(s):
+#   TxRxArray       - array of ports to transmit, ie. one2oneArray
+#   TxRateArray     - array containing the running rate for tx ports
+#   RxRateArray     - array containing the receive rate for rx ports
+#   duration        - duration of tx
+#
+# Note: We need to get rid of this method when we get rid of cable modem suite
+#
+##################################################################################
+proc getRunRatePerSecond {TxRxArray TxRateArray RxRateArray duration} \
+{
+    upvar $TxRxArray    txRxArray
+    upvar $TxRateArray  txRateArray
+    upvar $RxRateArray  rxRateArray
+
+    set retCode 0
+    set count   0
+
+    set txPortList  [getTxPorts txRxArray]
+    set rxPortList  [getRxPorts txRxArray]
+ 
+    if [createDialog "Transmit Status"] {
+        set cmd logMsg
+    } else {
+        set cmd writeDialog
+    }
+
+    set currentTime [clock seconds]
+
+    for {set timeCtr 1} {$timeCtr <= $duration} {incr timeCtr} {
+        $cmd  "Transmitted $timeCtr of $duration seconds"
+        mpincr count				
+
+        if [getRunningRate $txPortList txRateArray scheduledFramesSent $count] {
+            set retCode 1
+        }
+        if {$retCode == 0 && [getRunningRate $rxPortList rxRateArray framesReceived $count]} {
+            set retCode 1
+        }
+
+        while {[expr {[clock seconds] - $currentTime}] < 1} {
+            update idletasks
+            after 20
+        }
+        set currentTime   [clock seconds]
+    }
+    debugMsg "txRateArray: [array get txRateArray] "
+    debugMsg "rxRateArray: [array get rxRateArray]"
+
+    incr timeCtr -1
+    if {$duration != $timeCtr} {
+        logMsg "******* Test terminated by user after $timeCtr seconds"
+    }
+
+    logMsg "Done transmitting for $duration seconds...\n"
+
+    # destroy the dialog box if it is created
+    if {$cmd == "writeDialog"} {
+        destroyDialog
+    }
+
+    return $retCode
+}
+
+
+
+##################################################################################
+# Procedure: collectRates
+#
+# Description: Collects the rate during transmission at the following points:
+# 1. Half way during tx
+# 2. 15% of half duration before the half way point
+# 3. 15% of half duration after the half way point
+#
+# Then get the average of these rates for the QoS counters!!.
+#
+# Argument(s):
+#   AvgRateArray    - array containing the average running rate for tx/rx ports
+#	statNameList	- name of the stats that rates will be collected
+#   RxRateArray		- array containing the average rx running rate for the corresponding
+#					  rateType: rxRate (regular) or qosRate (qos counters)
+#   duration        - duration of tx
+#	rateType		- the type of the rate will be collected
+#
+##################################################################################
+proc collectRates { TxRxArray AvgRateArray duration {rateType rxRate} { RxRateArray ""} } \
+{
+	upvar $TxRxArray		txRxArray
+	upvar $AvgRateArray     avgRateArray
+    upvar $RxRateArray		rxRateArray
+
+	set retCode     $::TCL_OK
+    set sampleCount 0
+	set numSamples	3
+	set count       1
+    set txStartTime [clock seconds]
+    set runTime		0
+    set sampleIndex 0
+    set txPortList  [getTxPorts txRxArray]
+    set rxPortList  [getRxPorts txRxArray]
+
+	if {$rateType == "qosRate" } {
+		set statNameList	[list qualityOfService0 qualityOfService1 qualityOfService2 qualityOfService3	\
+							  qualityOfService4 qualityOfService5 qualityOfService6 qualityOfService7]
+	} else {
+		set statNameList	[list userDefinedStat2] 
+
+	}
+
+    # it may take very long time to get all Qos stats, so we want to start earlier...
+	set sampleDuration2 [ixMath::max [mpexpr $duration/2]  5]
+    set sampleDuration1 [mpexpr $sampleDuration2 - round((.15 * $sampleDuration2))]
+    set sampleDuration3 [mpexpr $sampleDuration2 + round(ceil((.15 * $sampleDuration2)))]
+	debugMsg "***** sampleDuration2 = $sampleDuration2, sampleDuration1 = $sampleDuration1, sampleDuration3 = $sampleDuration3"
+    set sampleTimes [list $sampleDuration1 $sampleDuration2 $sampleDuration3 -1] 
+
+	if [createDialog "Transmit Status"] {
+		set cmd logMsg
+	} else {
+		set cmd writeDialog
+	}
+
+    set nextSample	[lindex $sampleTimes $sampleIndex]
+
+	set percentToDuration	0
+	set sampleCount			0
+    while {$runTime <= $duration} {
+        set currentTime [clock seconds]
+		set percentToDuration	[mpexpr int(ceil(double($runTime)/$duration*100))]
+
+		$cmd  "Transmitted $percentToDuration% of $duration seconds"
+      
+        if { ($nextSample > 0) && ($runTime >= $nextSample) } {
+
+			set startSample $runTime
+
+			if {[getRunningRate $txPortList txRunningRate scheduledFramesSent $count]} {
+                set retCode $::TCL_ERROR
+		    }
+			
+			if {[getRunningRate $rxPortList rxRunningRate $statNameList $count]} {
+				set retCode $::TCL_ERROR
+			}
+
+			set runTime [expr ([clock seconds] - $txStartTime)]
+
+            if {$runTime > $duration } {
+				logMsg "\nWARNING!!!: Sampled rate values maybe incorrect. Increase test duration."
+			}
+
+    		incr count				
+ 			incr sampleIndex
+            set nextSample [lindex $sampleTimes $sampleIndex]
+			incr sampleCount
+		}
+
+        while {[expr {[clock seconds] - $currentTime}] < 1} {
+            update idletasks
+            after 20
+        }
+        set runTime [expr ([clock seconds] - $txStartTime)]
+    }
+
+	if { $sampleCount < $numSamples } {
+		# We don't want to miss the last transmit status
+		$cmd  "Transmitted 100% of $duration seconds"
+	}
+
+	logMsg "Done transmitting for $duration seconds...\n"
+
+    if {$duration > $runTime} {
+        logMsg "******* Test terminated by user after $runTime seconds"
+    }
+
+
+	# destroy the dialog box if it is created
+	if {$cmd == "writeDialog"} {
+		destroyDialog
+	}
+
+	if {!$retCode } {
+
+		# get the average running rate for transmitted frame, received frame & qos rates
+		foreach txMap $txPortList {
+			scan $txMap	"%d %d %d" tx_c tx_l tx_p
+			set total 0
+			for {set i 1} {$i <= $sampleCount} {incr i} {
+				if {![info exists txRunningRate($tx_c,$tx_l,$tx_p,$i)]} {
+					logMsg "Running rate for [getPortId $tx_c $tx_l $tx_p] sample $i not calculated during transmission"
+					set retCode $::TCL_ERROR
+				} else {
+					mpincr total  $txRunningRate($tx_c,$tx_l,$tx_p,$i)
+				}    
+			}
+
+			if {$rateType == "qosRate" } {
+				if [catch {mpexpr $total/$sampleCount} avgRateArray($tx_c,$tx_l,$tx_p)] {
+					set avgRateArray($tx_c,$tx_l,$tx_p)   0
+				}
+			} else {
+
+				if [catch {mpexpr $total/$sampleCount} avgRateArray(TX,$tx_c,$tx_l,$tx_p)] {
+					set avgRateArray(TX,$tx_c,$tx_l,$tx_p)   0
+				}
+			}
+			debugMsg "avgRateArray:[array get avgRateArray]"
+		}
+
+		if {$rateType == "qosRate" } {
+			foreach rxMap $rxPortList {
+				scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+
+				for {set priority 0} {$priority < 8} {incr priority} {
+					set total 0
+    				for {set i 1} {$i <= $sampleCount} {incr i} {
+						set counter qualityOfService$priority
+						if {![info exists rxRunningRate($rx_c,$rx_l,$rx_p,$counter,$i)]} {
+							logMsg "QOS Running rate, priority $priority for [getPortId $rx_c $rx_l $rx_p] sample $i not calculated during transmission."
+							set retCode $::TCL_ERROR
+						} else {
+							mpincr total  $rxRunningRate($rx_c,$rx_l,$rx_p,$counter,$i)
+						}
+					}
+					if [catch {mpexpr round($total/$sampleCount)} rxRateArray($rx_c,$rx_l,$rx_p,$priority)] {
+						rxRateArray($rx_c,$rx_l,$rx_p,$priority)   0
+					}
+				}
+			}
+		} else {
+			foreach rxMap $rxPortList {
+				scan $rxMap	"%d %d %d" rx_c rx_l rx_p
+				set total 0
+				for {set i 1} {$i <= $sampleCount} {incr i} {
+					if {![info exists rxRunningRate($rx_c,$rx_l,$rx_p,$i)]} {
+						logMsg "Running rate for [getPortId $rx_c $rx_l $rx_p] sample $i not calculated during transmission."
+						set retCode $::TCL_ERROR
+					} else {
+						mpincr total  $rxRunningRate($rx_c,$rx_l,$rx_p,$i)
+					}    
+				}
+				if [catch {mpexpr $total/$sampleCount} avgRateArray(RX,$rx_c,$rx_l,$rx_p)] {
+					set avgRateArray(RX,$rx_c,$rx_l,$rx_p)   0
+				}
+			}
+		}
+	}
+
+    return $retCode
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/stringUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/stringUtils.tcl
new file mode 100644
index 00000000..6ac77997
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/stringUtils.tcl
@@ -0,0 +1,632 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: stringUtils.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	03-07-2001	DS	Genesis
+#
+# Description: This file contains string helpers, including wrappers
+#              for string commands not supported in 8.0
+#
+########################################################################
+
+
+##################################################################################
+# Procedure: capitalizeString
+#
+# This command returns the string w/the first char toupper
+#
+# Argument(s):
+#   str     string to capitalize
+#
+##################################################################################
+proc capitalizeString {str} \
+{
+    if {[info tclversion] > 8.0} {
+        set capString   [string totitle $str]
+    } else {
+        set capString [format "%s%s" [string toupper [string index $str 0]] [string range $str 1 end]]
+    }
+    return $capString
+}
+
+
+
+##################################################################################
+# Procedure: stringRepeat
+#
+# Helper proc to create a string consists of specialized charaters or strings.
+#
+# Argument(s):
+#   string		- the string to repeat, eg. "*", "," ...
+#   repeatCount - number of times to repeat the string
+#
+##################################################################################
+proc stringRepeat {string repeatCount} \
+{
+    if {$repeatCount <= 0} {
+        return ""
+    }
+
+	# string repeat is a new option added in Tcl8.1
+    if {[info tclversion] > 8.0} {
+		set outPutString [string repeat $string $repeatCount]
+
+    } else {
+        regsub -all {[ ]} [format "%$repeatCount\s" " "] $string outPutString
+	}
+
+	return $outPutString
+}
+
+
+##################################################################################
+# Procedure: stringIsInteger
+#
+# Helper proc to verify if a string is an integer value or not.
+#
+# Argument(s):
+#   string		- the string to check
+#
+# Return value:
+#   1 if true
+#   0 if false
+#
+##################################################################################
+proc stringIsInteger {string} \
+{
+	# string is integer is a new option added in Tcl8.1
+    if {[info tclversion] > 8.0} {
+		set retCode [string is integer $string]
+    } else {
+        set retCode 1
+        if [catch {format %d $string}] {
+            set retCode 0
+        }
+    }
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure: stringIsDouble
+#
+# Helper proc to verify if a string is an floating value or not.
+#
+# Argument(s):
+#   string		- the string to check
+#
+# Return value:
+#   1 if true
+#   0 if false
+#
+##################################################################################
+proc stringIsDouble {string} \
+{
+	# string is integer is a new option added in Tcl8.1
+    if {[info tclversion] > 8.0} {
+		set retCode [string is double $string]
+    } else {
+        set retCode 1
+        if [catch {format %f $string}] {
+            set retCode 0
+        }
+    }
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure: stringSubstitute
+#
+# Helper proc to replace a string w/in another string.
+#
+# Argument(s):
+#   string1     - string to look in
+#   old	        - the string to replace	
+#   new		    - replace w/this string
+#
+# Return value:
+#   new string
+#
+##################################################################################
+proc stringSubstitute {string1 old new} \
+{
+    set oldLength   [string length $old]
+    set index       [string first $old $string1]
+    if {$index < 0} {
+        set newString   $string1
+    } else {
+
+        # string is integer is a new option added in Tcl8.1
+        if {[info tclversion] > 8.0} {
+            set newString [string replace $string1 $index [expr $index + $oldLength - 1] $new]
+        } else {
+            set newString [format %s%s%s [string range $string1 0 [expr $index - 1]] $new \
+                    [string range $string1 [expr $oldLength + $index] end]]
+        }
+    }
+
+    return $newString
+}
+
+##################################################################################
+# Procedure:    stringUnderscore
+#
+# Description:  Given an alpha-numeric string, build the same string underscored.
+#                   Tabs are left in-tact by default, but may be ignored.
+#
+#                   Given the string:
+#                       "Now is the time for all good people to come to the aid of their universe"
+#
+#                   Returns:
+#                       "Now is the time for all good people to come to the aid of their universe"
+#                        ========================================================================
+#
+#                   OR...
+#
+#                   Given a string with tabs:
+#                       "This is a\ttab."
+#
+#                   Returns:
+#                       "This is a\ttab."
+#                        =========\t====
+#
+#                        Looks like:
+#
+#                       "This is a  tab."
+#                        =========  ====
+
+#
+# Input:        theString:  string to underscore
+#               underscore: default is "="
+#               tabs:       ignore OR observe (default)
+#
+# Output:       underscored string
+#
+##################################################################################
+proc stringUnderscore {theString {underscore "="} {tabs "observe"}} {
+
+    if [string length $theString] {
+        
+        # Strip out tabs if ignoring.
+        if {$tabs != "observe"} {
+            regsub -all \t $theString " " theString
+        }
+        if {[info tclversion] > 8.0} {
+            regsub -all {[[:alnum:][:punct:] ]} $theString $underscore underscores
+        } else {
+            regsub -all {[-a-zA-z0-9 ;:"/?.<>!@#$%&*()+']} $theString $underscore underscores
+        }
+        
+        return $theString\n$underscores\n
+    }
+
+}
+
+##################################################################################
+# Procedure:    stringTitle
+#
+# Description:  Convert a string to a title, ie all words capitalized.
+#
+#                   Given the string:
+#                       "Now is the time for all good people to come to the aid of their universe"
+#
+#                   Returns:
+#                       "Now is the Time For All Good People to Come to the Aid of Their Universe"
+#
+#
+# Input:        theString:  string to convert
+#               whichWords: significant (default) OR all
+#
+# Output:       new string
+#
+#
+# This capitalizes all words:
+#
+#
+##################################################################################
+proc stringTitle {theString {whichWords "significant"}} \
+{
+
+    if {$whichWords == "significant"} {
+        set title ""
+        foreach i $theString {
+            switch -- $i {
+                the -
+                is -
+                to -
+                of -
+                and {
+                    append title "$i "
+                }
+        
+                default {
+                    append title "[stringToUpper $i 0 0] "
+                }
+            }
+        }
+    set title [string range $title 0 [expr [string length $theString] -1]]
+    } else {
+        regsub -all {(.+?\M)} $theString {[stringToUpper \1 0 0] } title
+        set title [string trim [subst $title]]
+    }
+
+    return $title
+}
+
+
+
+
+##################################################################################
+# Procedure:    stringSplitToTitle
+#
+# Description:  Splits a string into a title, ie all words capitalized.
+#
+#                   Given the string:
+#                       "headerBytesReceived"
+#                   Returns:
+#                       "Header Bytes Received"
+#
+#
+# Input:        theString:  string to convert
+#
+# Output:       new string
+#
+#
+# This capitalizes all words:
+#
+#
+##################################################################################
+proc stringSplitToTitle {theString} \
+{
+    regsub -all {[A-Z]} $theString " &" newText
+    set theString [stringToUpper $newText 0 0]
+
+    return $theString
+}
+
+##################################################################################
+# Procedure:    stringJoinFromTitle
+#
+# Description:  Joins a title into a string, the first letter of each word (except
+#                   the first is kept/made uppercase, for example:
+#
+#                   Given the string:
+#                       "Site Level Aggregation Id"
+#                   Returns:
+#                       "siteLevelAggregationId"
+#
+#
+# Input:        theString:  string to convert
+#
+# Output:       new string
+#
+##################################################################################
+proc stringJoinFromTitle {theString} \
+{
+    set theString [string tolower [stringTitle $theString all] 0 0]
+    regsub -all { } $theString "" theString
+
+    return $theString
+}
+
+
+
+
+##################################################################################
+# Procedure:    stringToUpper
+#
+# Description:  Return string in upper case
+#
+#
+#
+# Input:        theString:  string to convert
+#               index1   : If it is specified, it refers to the first char index in the string to start modifying. 
+#               index2   : If it is specified, it refers to the char index in the string to stop at. 
+#
+# Output:       new string
+#
+#
+##################################################################################
+proc stringToUpper {theString {index1 -1} {index2  -1}} \
+{
+    if {[info tclversion] > 8.0} {
+        if { $index1 == -1 && $index2 == -1 } {
+            set newString [string toupper $theString]
+        } elseif { $index2 == -1 } {
+            set newString [string toupper $theString $index1]
+        } else {
+            set newString [string toupper $theString $index1 $index2]
+        }
+
+    } else {
+        if {$index1 == -1 && $index2 == -1 } {
+            set newString [string toupper $theString]
+        } elseif { $index2 < $index1 && $index2 != -1} {
+            set newString $theString
+        } else {
+            if {$index2 == -1} {
+                set index2 $index1
+            }
+            set part1 [string range $theString 0 [expr $index1 - 1]]
+            set part2 [string range $theString $index1 $index2]
+            set part3 [string range $theString [expr $index2 + 1] [string length $theString]]
+            set newString [append part1 [string toupper $part2] $part3]
+
+        }
+    }        
+    return $newString
+}
+
+########################################################################################
+# Procedure:    stringMap
+#
+# Description:  Given a translation map, perform character tranlation (same function
+#                   as [string map] available in 8.3.
+#
+# Arguments:    value:	string of characters
+#
+# Returns:      retValue:	string with characters mapped to the corresponding 
+#							characters in the map.  Note that characters not in the 
+#                           map are returned unaltered.
+#
+#
+########################################################################################
+proc stringMap {{map ""} value} \
+{
+    set retValue ""
+    
+    array set translation $map
+
+    set length [string length $value]
+    for {set i 0} {$i < $length} {incr i} {
+
+        set translatedValue [string index $value $i]
+        if {[info exists translation($translatedValue)]} {
+            set translatedValue $translation($translatedValue)
+        }
+        append retValue $translatedValue
+    }
+
+    return $retValue
+}
+
+
+########################################################################################
+# Procedure:    stringCompare
+#
+# Description:  Compare the given strings with option that are all specified by the
+#               argument "args".
+#
+# Arguments:    args - a list that contains options and strings to be compared
+#               
+#
+# Returns:      retValue - the result of the comparison.
+#
+#
+########################################################################################
+proc stringCompare {args} \
+{
+    set retValue 1
+
+    if { [info tclversion] > 8.0 } {
+
+        if [catch {eval "string compare $args"} result] {
+            errorMsg $result
+        } else {
+            set retValue $result
+        }
+
+    } else {
+        
+        set flagNocase  0
+        set flagLength  0
+
+        foreach arg $args {
+
+            switch -- $arg {
+                "-nocase" {
+                    set flagNocase 1
+                }
+                "-length" {
+                    set flagLength 1
+                    set state length
+                }
+                default {
+
+                    if { [info exists state] && ($state == "length") } {
+
+                        set length $arg
+                        catch {unset state}
+
+                        if { ![stringIsInteger $length] } {
+                            errorMsg "expected integer but got \"$length\""
+                            break
+                        }
+
+                    } elseif { [info exists string1] == 0 } {
+                        set string1 $arg
+                    } elseif { [info exists string2] == 0 } {
+                        set string2 $arg
+                    }
+                }
+            }
+        }
+
+        if { [info exists string1] && [info exists string2] } {
+
+            if { $flagLength == 1 } {
+        
+                if { $length > 0 } {
+                    set index [expr $length - 1]
+                    set string1 [string range $string1 0 $index]
+                    set string2 [string range $string2 0 $index]
+                } else {
+                    set string1 ""
+                    set string2 ""
+                }
+            }
+
+            if { $flagNocase == 1 } {
+                set string1 [string tolower $string1]
+                set string2 [string tolower $string2]
+            }
+
+            if [catch {eval "string compare \"$string1\" \"$string2\""} result] {
+                errorMsg $result
+            } else {
+                set retValue $result
+            }
+
+        } else {
+            errorMsg "wrong # args: should be \"stringCompare ?-nocase? ?-length int? string1 string2\""
+        }
+        
+        return $retValue
+    }
+}
+
+##################################################################################
+# Procedure:    stringFormatNumber
+#
+# Description:  Take a string on numbers (doesn't support special characters yet)
+#                   and insert commas appropriately. 
+#
+#                   Note: normally the value to be converted is in the parameter
+#                   string, when called by a GUI callback function, the value is
+#                   in args
+#                   
+#                   Handles:    -/+ in initial position
+#                               comma insertion
+#                               removal of non-numeric data
+#                               integer with decimal
+#
+# Arguments:    string
+#               args
+#
+# Returns:      formatted string
+#
+##################################################################################
+proc stringFormatNumber { value {args {}} } \
+{
+    set retValue 0
+
+    if {[llength $args] > 0} {
+        set value [lindex $args 1]
+    }
+
+    # Check if there is any numeric characters in the string
+    regsub -all {[^0-9]} $value "" temp
+
+    if { [string length $temp] > 0 } {
+        set retValue ""
+
+        # Remember sign.
+        if {[string compare [string index $value 0] "-"] == 0} {
+            set sign $::true
+        } else {
+            set sign $::false
+        }
+
+        # Remove non-numeric characters (except ".")
+        regsub -all {[^0-9\.]} $value "" value
+
+        set useDecimal [expr [scan [split $value .] "%s %s" integer decimal] > 1 ? $::true:$::false]
+    
+        # remove leading '0's before adding commas from INTEGER PORTION ONLY!!
+        set integer [string trimleft $integer '0']
+        if {[string length $integer] == 0} {
+            set integer 0
+        }
+
+        if {[string length $integer] > 0} {
+
+            set repetition [mpexpr int([string length $integer] / 3)]
+            incr repetition -[expr [expr [mpexpr [string length $integer] % 3]>0] ? 0:1]
+        
+            for {set i $repetition} {$i > 0} {incr i -1} {
+                set startIndex [expr [string length $integer] - 3]
+                set triplet [string range $integer $startIndex end]
+                set integer [stringReplace $integer $startIndex end]
+                set retValue ",$triplet$retValue"
+            }
+        }
+        
+        set retValue "$integer$retValue"
+        if {$useDecimal} {
+            set retValue [join [list $retValue $decimal] .]
+        }
+
+        if {$sign} {
+            set retValue [format "%s%s" "-" $retValue]
+        }
+    }
+
+    return $retValue
+}
+
+
+##################################################################################
+# Procedure:   stringReplace
+#
+# Description: Helper proc to replicate the string replace command which is not supported in tcl 8.0
+#
+# Argument(s): oldString - the original string value
+#              first - the index of the starting point for the replacement
+#              last - the index of the ending point for the replacement, we will accept end, but not end minus a value
+#              newString - (optional, defaults to null) the new string to use
+#
+# Returns:     Returns a new string created by replacing characters first through last with newString, or nothing.
+##################################################################################
+proc stringReplace {oldString first last {newString ""}} \
+{
+    # string replace is a new option added in Tcl8.1
+    if {[info tclversion] > 8.0} {
+        set newString [string replace $oldString $first $last $newString]
+    } else {
+        if {$last == "end"} {
+            set last [expr [string length $oldString] - 1]
+        }
+        set newString [format %s%s%s [string range $oldString 0 [expr $first - 1]] $newString \
+                [string range $oldString [expr $last + 1] end]]
+    }
+
+    return $newString
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/switchLearn.tcl b/dep/tclclient/ixTcl1.0/Generic/switchLearn.tcl
new file mode 100644
index 00000000..85222208
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/switchLearn.tcl
@@ -0,0 +1,2030 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: switchLearn.tcl
+#
+#   Copyright ©  IXIA
+#	All Rights Reserved.
+#
+#	Revision Log:
+#	08-13-1998    Hardev Soor
+#
+# Description: This file contains commands that send learn frames
+# for various protocols to the switch (DUT).
+#
+########################################################################################
+
+set ::udfList {1 2 3 4}
+
+########################################################################################
+#::::::::::::                    MAC Layer Learn frames                       :::::::::::::
+########################################################################################
+
+########################################################################################
+# Procedure: send_learn_frames
+#
+# Description: This command sends directed learn frames to allow the DUT to learn the
+#              mac addresses of the sending ports
+#
+# Argument(s):
+#    PortArray    array of ports, ie., one2oneArray for a one2one configuration
+#
+########################################################################################
+proc send_learn_frames {PortArray {RemovedPorts ""} {staggeredStart true}} \
+{
+    upvar $PortArray portArray
+    if {[string length $RemovedPorts] > 0} {
+        upvar $RemovedPorts removedPorts
+    }
+
+    set retCode       0
+    set removedPorts  0
+
+    set broadcastMac  $::kBroadcastMacAddress
+
+    set enable802dot1qTag [protocol cget -enable802dot1qTag]
+
+    # set the stream parameters.
+    set preambleSize  8
+
+    stream setDefault
+    stream config -rateMode  usePercentRate
+    stream config -name      "LearnStream"
+    stream config -framesize [learn cget -framesize]
+    stream config -dma       stopStream
+    stream config -gapUnit   gapNanoSeconds
+    stream config -enableIbg false
+    stream config -enableIsg false
+
+    # set frameType to "08 00" 
+	if {[protocol cget -ethernetType] == $::ethernetII} {
+		stream config -frameType [advancedTestParameter cget -streamFrameType]
+	}
+
+    set sentList ""
+    # note - send one port at portArray time to allow time for learning;
+    #         remember, learn frames are sent from Rx to Tx...
+    foreach txMap [lnumsort [array names portArray]] {
+        scan $txMap "%d,%d,%d" tx_c tx_l tx_p
+
+        if [IsPOSPort $tx_c $tx_l $tx_p] {
+            set txSA $broadcastMac
+        } else {
+            if [port get $tx_c $tx_l $tx_p] {
+                errorMsg "Port [getPortId $tx_c $tx_l $tx_p] has not been configured yet."
+                set retCode $::TCL_ERROR
+                continue
+            }
+            set txSA [port cget -MacAddress]
+        }
+
+        foreach rxMap $portArray($txMap) {
+            scan [join $rxMap] "%d %d %d" rx_c rx_l rx_p
+
+            if {![IsPOSPort $rx_c $rx_l $rx_p] && [lsearch $sentList [list $rx_c $rx_l $rx_p]] < 0} {
+                lappend sentList [list $rx_c $rx_l $rx_p]
+
+                if {[port get $rx_c $rx_l $rx_p] == 1} {
+                    errorMsg "Port [getPortId $rx_c $rx_l $rx_p] has not been configured yet."
+                    continue
+                }
+
+                set learnPercentRate [expr double([learn cget -rate])/[calculateMaxRate $rx_c $rx_l $rx_p [learn cget -framesize]]*100.]
+                stream config -percentPacketRate $learnPercentRate
+
+                stream config -da           $txSA
+
+                stream config -sa           [port cget -MacAddress]
+                stream config -numSA        [port cget -numAddresses]
+
+                if {[stream cget -numSA] > 1} {
+                    stream config -saRepeatCounter  increment
+                }
+
+                set numFrames($rx_c,$rx_l,$rx_p)    [expr [learn cget -numframes] * [port cget -numAddresses]]
+                stream config -numFrames            $numFrames($rx_c,$rx_l,$rx_p)
+
+				if [catch {expr int(ceil(double($numFrames($rx_c,$rx_l,$rx_p))/[learn cget -rate]))} duration] {
+					errorMsg "$duration"
+					set retCode $::TCL_ERROR
+					set duration 1
+				}
+
+                disableUdfs {1 2 3 4}
+                
+                if {![vlanUtils::isPortTagged $rx_c $rx_l $rx_p] && $enable802dot1qTag} {
+                    protocol config -enable802dot1qTag  false
+                }
+
+                if [stream set $rx_c $rx_l $rx_p 1] {
+                    errorMsg "Error setting stream for learning frames on [getPortId $rx_c $rx_l $rx_p] 1."
+                    set retCode $::TCL_ERROR
+                    continue
+                }
+            }
+        }
+    }
+
+    if {[llength $sentList] > 0} {        
+        logMsg "Configuring learn frames ..."
+
+        # zero stats everywhere to avoid confusion later...
+        zeroStats portArray
+
+        if {$retCode == 0} {
+            logMsg "Sending learning frames to all ports..."
+
+            writeConfigToHardware sentList
+	        if [startTx sentList $staggeredStart] {
+                set retCode $::TCL_ERROR
+            }
+        }
+
+        if {$duration < 1} {
+            set duration 1
+        }
+
+        after [learn cget -waitTime]
+        # Wait for all frames to be transmitted..
+        writeWaitMessage "Transmit Status" "Transmitting learn frames" $duration
+
+        statGroup setDefault
+        foreach rxMap $sentList {
+            scan $rxMap "%d %d %d" rx_c rx_l rx_p
+
+            if [statGroup add $rx_c $rx_l $rx_p] {
+                errorMsg "Error adding port [getPortId $rx_c $rx_l $rx_p] to statGroup"
+                set retCode $::TCL_ERROR
+                continue
+            }
+        }
+
+        # wait the min refresh for 10/100 cards to let the stats update...
+        after 800
+        set tempSentList   $sentList 
+        set retry           20
+
+        while {([llength $tempSentList] > 0) && ($retry > 0)} {
+            if [statGroup get] {
+                errorMsg "Error getting stats for statGroup"
+                set retCode $::TCL_ERROR
+            }
+
+            foreach rxMap $tempSentList {
+                scan $rxMap "%d %d %d" rx_c rx_l rx_p
+
+                if [statList get $rx_c $rx_l $rx_p] {
+                    errorMsg "Error getting Tx statistics for [getPortId $rx_c $rx_l $rx_p]"
+                    set retCode $::TCL_ERROR
+                    continue
+                }
+
+				if [catch {statList cget -scheduledFramesSent} txNumFrames ] {
+					if [catch {statList cget -framesSent} txNumFrames ] {
+						set txNumFrames 0
+					} else {
+						if [catch {statList cget -protocolServerTx} numProtocolServerFrames ] {
+							set numProtocolServerFrames  0
+						}
+						set txNumFrames [mpexpr $txNumFrames - $numProtocolServerFrames]
+						if {[isNegative $txNumFrames]} {
+							 set txNumFrames 0
+						}
+					}
+				}
+
+                if { $txNumFrames == $numFrames($rx_c,$rx_l,$rx_p) } {
+                    set portIndex [lsearch $tempSentList [list $rx_c $rx_l $rx_p]]
+			        if {$portIndex != -1} {
+				        set tempSentList [lreplace $tempSentList $portIndex $portIndex]
+			        }
+                }
+            }
+            if { [llength $tempSentList] == 0 } {
+                set retry  0
+            } else {
+                incr retry -1
+            }
+        }
+
+        if {[llength $tempSentList] > 0} { 
+            foreach rxMap $tempSentList {
+                scan $rxMap "%d %d %d" rx_c rx_l rx_p
+                logMsg "All Learn frames not sent on port [getPortId $rx_c $rx_l $rx_p]"
+                set retCode $::TCL_ERROR
+            }
+        }
+
+        logMsg "Learning frames sent..."
+    }
+
+    if {[fastpath cget -enable] == "true"} {
+        if [send_fastpath_frames portArray] {
+            errorMsg "Error sending fastpath frames"
+            set retCode $::TCL_ERROR
+        }
+    }
+
+    protocol config -enable802dot1qTag  $enable802dot1qTag   
+    stream setDefault
+
+    return $retCode
+}
+
+
+########################################################################################
+#::::::::::::                    IP Layer Learn frames                       :::::::::::::
+########################################################################################
+
+########################################################################################
+# Procedure: OLDsend_arp_frames
+#
+# Description: This command send the arp frames from rx to tx
+#
+# Argument(s):
+#    PortArray    array of ports, ie., one2oneArray for a one2one configuration
+#
+########################################################################################
+proc OLDsend_arp_frames {PortArray {RemovedPorts ""}} \
+{
+    upvar $PortArray portArray
+    if {[string length $RemovedPorts] > 0} {
+        upvar $RemovedPorts removedPorts
+    }
+
+    set retCode 0
+    
+    # This code has been added for "Send MAC Only" option
+    if {[learn cget -type] == "mac" } {
+		if [send_learn_frames portArray] {
+			return -code error -errorinfo "Error sending MAC learning frames"
+		}
+        return $retCode
+    }
+            
+    set removedPorts 0
+
+    disableUdfs $::udfList
+    filter setDefault
+    stream setDefault
+    udf setDefault
+
+    # set the stream parameters.
+    set preambleSize            8
+    set framesize               [learn cget -framesize]
+    set enable802dot1qTag       [protocol cget -enable802dot1qTag]
+    set duration                [expr [learn cget -numframes] / [learn cget -rate]]
+
+    stream config -rateMode     usePercentRate
+    stream config -name         "ArpStream"
+    stream config -framesize    $framesize
+    stream config -dma          stopStream
+    stream config -numFrames    [learn cget -numframes]
+    stream config -fcs          good
+    stream config -gapUnit      gapNanoSeconds
+
+    filter config -captureFilterPattern          any
+    filter config -captureFilterError            errGoodFrame
+    filter config -captureFilterFrameSizeEnable  false
+    filter config -captureFilterFrameSizeEnable  false
+    filter config -captureTriggerError           errGoodFrame
+
+    # zero stats everywhere to avoid confusion later...
+    zeroStats portArray
+
+    # note - send one port at portArray time to allow time for learning; arp frames should
+    #         be sent from tx->DUT & rx->DUT.
+
+    set rxList  [lnumsort [getAllPorts portArray]]
+
+    set tempAppName [protocol cget -appName]
+    protocol config -appName  Arp
+
+    foreach txMap $rxList {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+
+        if [IsPOSPort $tx_c $tx_l $tx_p] {
+            set index   [lsearch  $rxList $txMap]
+            set rxList  [lreplace $rxList $index $index]
+            continue
+        }
+
+        if {[port get $tx_c $tx_l $tx_p] == 1 || [ip get $tx_c $tx_l $tx_p] == 1} {
+            errorMsg "Port [getPortId $tx_c $tx_l $tx_p] has not been configured yet."
+            set retCode 1
+            continue
+        }
+
+        set txSA            [port cget -MacAddress]
+        set numTx           [port cget -numAddresses]
+
+        set txDA            $::kBroadcastMacAddress
+        set txIP            [ip cget -sourceIpAddr]
+        set txDutIP         [ip cget -destDutIpAddr]
+
+
+        arp config -operation           arpRequest
+        arp config -sourceProtocolAddr  $txIP
+        arp config -destProtocolAddr    $txDutIP
+        arp config -sourceHardwareAddr  $txSA
+        arp config -destHardwareAddr    $txDA
+                               
+        if {$numTx > 1} {
+            arp config -sourceHardwareAddrMode arpIncrement
+            arp config -sourceHardwareAddrRepeatCount $numTx
+            arp config -sourceProtocolAddrMode arpIncrement
+            arp config -sourceProtocolAddrRepeatCount $numTx
+            stream config -numFrames [expr $numTx * [learn cget -numframes]]
+            if {[expr [stream cget -numFrames]/[learn cget -rate]] > $duration} {
+                set duration    [expr [stream cget -numFrames]/[learn cget -rate]]
+            }
+        }
+
+        if [arp set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting Arp for port [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+
+        set learnPercentRate             [expr double([learn cget -rate])/[calculateMaxRate $tx_c $tx_l $tx_p $framesize]*100.]
+        stream config -percentPacketRate $learnPercentRate
+
+        stream config -da       $txDA
+        stream config -numDA    1
+
+        stream config -sa       $txSA
+        stream config -numSA    $numTx
+        if {$numTx > 1} {
+            stream config -saRepeatCounter increment
+        }
+
+        stream config -patternType    repeat
+        stream config -dataPattern    allZeroes
+
+        if {$enable802dot1qTag && ![vlanUtils::isPortTagged $tx_c $tx_l $tx_p]} {
+            protocol config -enable802dot1qTag  false
+        }
+
+        if [stream set $tx_c $tx_l $tx_p 1] {
+            errorMsg "Error setting stream 1 on [getPortId $tx_c $tx_l $tx_p] for ARP frames."
+            set retCode 1
+        }
+
+        protocol config -enable802dot1qTag  $enable802dot1qTag
+
+        # set up the pattern filter
+        filterPallette config -pattern1        [host2addr $txDutIP]
+        filterPallette config -patternOffset1    28
+        if [filterPallette set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting filter pallette for [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+        }
+
+        # set the filter parameters on the receive port
+        debugMsg "    configuring filters"
+        filter config -captureFilterEnable   true
+        filter config -captureTriggerEnable  true
+        if [filter set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting filters on [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+        }
+    }
+    protocol config -appName  $tempAppName
+
+    if {[llength $rxList] == 0} {
+        return $retCode
+    }
+
+    disableArpResponse    rxList
+
+    if [setCaptureMode rxList] {
+        set retCode 1
+    }
+
+    writeConfigToHardware rxList
+
+	if {[checkLinkState rxList ]} {
+        set retCode 1
+    }
+
+    if [startCapture rxList] {
+        errorMsg "Error starting capture."
+        set retCode 1
+    }
+
+    foreach txMap $rxList {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+
+        if [arp get $tx_c $tx_l $tx_p] {
+            errorMsg "Error getting Arp on [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+        }
+
+        logMsg "sending ARP frame from [getPortId $tx_c $tx_l $tx_p], SrcPort: [arp cget -sourceProtocolAddr] to DestPort: [arp cget -destProtocolAddr]"
+    }
+	set retCode [startStaggeredTx rxList]
+
+    # wait the min refresh for 10/100 cards to let the stats update...
+    after 800
+
+    after [learn cget -waitTime]
+    # Wait for all frames to be transmitted..
+    for {set timeCtr 1} {$timeCtr <= $duration} {incr timeCtr} {
+        logMsg  "Transmitted arp frames $timeCtr of $duration seconds"
+        after 1000
+    }
+
+    checkAllTransmitDone rxList
+
+    foreach txMap $rxList {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+
+        # look for ARP responses
+        set maxArp  100
+        if [captureBuffer get $tx_c $tx_l $tx_p 1 $maxArp] {
+            errorMsg "Error getting capture buffer for [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+        set found 0
+        set nFrame 1
+        while {[captureBuffer getframe $nFrame] != 1 && $nFrame <= $maxArp} {
+            debugMsg "Getting frame $nFrame from Buffer   ....."
+            set capframe    [captureBuffer cget -frame]
+            if {([arp decode $capframe] == 0) && ([arp cget -operation] == $::arpReply)} {
+                set found 1
+                break
+            }
+            incr nFrame
+        }
+
+        if {$found == 0} {
+            logMsg "No ARP response frames received on [getPortId $tx_c $tx_l $tx_p]"
+            if {[learn cget -removeOnError] == "true"} {
+                logMsg "Removing port $txMap from map..."
+                if [array exists portArray] {
+                    if [info exists portArray($c,$l,$p)] {
+                        unset portArray($c,$l,$p)
+                        set removedPorts    1
+                    }
+                    foreach txMap [array names portArray] {
+                        scan $txMap "%d,%d,%d" tx_c tx_l tx_p
+
+                        foreach rxMap $portArray($tx_c,$tx_l,$tx_p) {
+                            set index [lsearch $portArray($tx_c,$tx_l,$tx_p) "$c $l $p"]
+
+                            if {$index >= 0} {
+                                set portArray($tx_c,$tx_l,$tx_p) [lreplace $portArray($tx_c,$tx_l,$tx_p) $index $index]
+                                set removedPorts    1
+                            }
+                            if {[llength $portArray($tx_c,$tx_l,$tx_p)] <= 0} {
+                                unset portArray($tx_c,$tx_l,$tx_p)
+                            }
+                        }
+                    }                   
+                } else {
+                    set index [lsearch [getAllPorts portArray] "$c $l $p"]
+                    if {$index >= 0} {
+                        set portArray [lreplace [getAllPorts portArray $index $index]]
+                        set removedPorts    1
+                    }
+                }
+
+                # remember to set an error if we removed all ports!!
+                if {![info exists portArray]} {
+                    set retCode 1
+                } else {
+                    if {[llength [array get portArray]] <= 0} {
+                        set retCode 1
+                    }
+                }
+            } else {
+                set retCode 1
+            }
+            continue
+        }
+
+        if [port get $tx_c $tx_l $tx_p] {
+            errorMsg "Error getting port [getPortId $tx_c $tx_l $tx_p] for storing DestMacAddress."
+            set retCode 1
+            continue
+        }
+        port config -DestMacAddress    [arp cget -sourceHardwareAddr]
+        if [port set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting port [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+        }
+        logMsg "Got ARP RESPONSE on [getPortId $tx_c $tx_l $tx_p], DUT MAC address for [getPortId $tx_c $tx_l $tx_p]: [arp cget -sourceHardwareAddr]"
+    }
+
+    if {[learn cget -waitTime] > 1000} {
+        logMsg "Waiting for DUT to settle down after learning for [expr [learn cget -waitTime]/1000] second(s)..."
+    }
+
+    after [learn cget -waitTime]
+
+    if {$retCode == 0 && [ipfastpath cget -enable] == "true"} {
+        if [send_ipfastpath_frames portArray] {
+            errorMsg "Error sending IP fastpath frames"
+            set retCode 1
+        }
+    } elseif {$retCode == 0 && [fastpath cget -enable] == "true"} {
+        if [send_fastpath_frames portArray] {
+            errorMsg "Error sending IP fastpath frames"
+            set retCode 1
+        }
+    }
+
+    stream setDefault
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: send_arp_frames
+#
+# Description: This command uses the protocol server to configure arp, send out arp 
+#              requests & enable arp response
+#
+# Argument(s):
+#    PortArray    array of ports, ie., one2oneArray for a one2one configuration
+#
+########################################################################################
+proc send_arp_frames {PortArray {RemovedPorts ""} {resetInterfaces true}} \
+{
+    upvar $PortArray    portArray
+    if {[string length $RemovedPorts] > 0} {
+        upvar $RemovedPorts removedPorts
+    }
+
+    set retCode			0
+	set numInterfaces	1
+    set arpList         [getAllPorts portArray]
+
+    if [configureArp portArray arpList write $numInterfaces $resetInterfaces] {
+        errorMsg "Error configuring ARP"
+        set retCode 1
+    }   
+    if {[llength $arpList] != 0} {
+        
+        if {[sendArp portArray $arpList removedPorts] || $retCode } {
+            errorMsg "Error sending ARP"
+            set retCode 1
+        }
+
+        if {$retCode == 0 && [ipfastpath cget -enable] == "true"} {
+            if [send_ipfastpath_frames portArray] {
+                errorMsg "Error sending IP fastpath frames"
+                set retCode 1
+            }
+        } elseif {$retCode == 0 && [fastpath cget -enable] == "true"} {
+            if [send_fastpath_frames portArray] {
+                errorMsg "Error sending IP fastpath frames"
+                set retCode 1
+            }
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: configureArp
+#
+# Description: This command configures the protocol server for ARP 
+#
+# Argument(s):
+#    PortArray  - array of ports, ie., one2oneArray for a one2one configuration
+#                 NOTE:This array is passed for internal modem configuration purposes      
+#    ArpList
+#
+########################################################################################
+proc configureArp {PortArray ArpList {write write} {numInterfaces 1} {resetInterfaces true}} \
+{
+    upvar $PortArray    portArray
+    upvar $ArpList      arpList
+
+    set retCode 0
+
+    #set rxList  [getRxPorts  portArray]
+    set enable802dot1qTag   [protocol cget -enable802dot1qTag]
+
+    foreach txMap $arpList {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+        
+        if [IsPOSPort $tx_c $tx_l $tx_p] {
+            set index   [lsearch $arpList $txMap]
+            set arpList [lreplace $arpList $index $index]
+            continue
+        }
+
+        ipAddressTable      setDefault
+        ipAddressTableItem  setDefault
+        arpServer           setDefault
+        protocolServer      setDefault
+                         
+        if {![catch {hasInternalModem portArray $tx_c $tx_l $tx_p} internalModemFlag] && $internalModemFlag } {
+            configureArpInternalModem portArray $tx_c $tx_l $tx_p
+
+        } else {
+            if {[port get $tx_c $tx_l $tx_p] == 1 || [ip get $tx_c $tx_l $tx_p] == 1} {
+                errorMsg "Port [getPortId $tx_c $tx_l $tx_p] has not been configured yet."
+                set retCode 1
+                continue
+            }
+            set txSA                [port cget -MacAddress]
+            set numTx               [port cget -numAddresses]
+                              
+            ipAddressTable config -defaultGateway       [ip cget -destDutIpAddr]
+
+            ipAddressTableItem config -fromIpAddress    [ip cget -sourceIpAddr]
+            ipAddressTableItem config -fromMacAddress   $txSA
+            ipAddressTableItem config -numAddresses     $numTx
+
+            if {[vlanUtils::isPortTagged $tx_c $tx_l $tx_p] && $enable802dot1qTag} {
+                if [vlan get $tx_c $tx_l $tx_p] {
+                    errorMsg "Error getting vlan parameters for $tx_c $tx_l $tx_p"
+                    set retCode 1
+                }
+                ipAddressTableItem config -enableVlan   true
+                ipAddressTableItem config -vlanId   [vlan cget -vlanID]
+            }
+
+            if [ipAddressTableItem set] {
+                errorMsg "Error setting ipAddressTableItem"
+                set retCode 1
+                continue
+            }
+            if [ipAddressTable addItem] {
+                errorMsg "Error adding ipAddressTable item"
+                set retCode 1
+                continue
+            }
+        }
+        
+        if [ipAddressTable set $tx_c $tx_l $tx_p] {
+             errorMsg "Error setting ipAddressTable on port [getPortId $tx_c $tx_l $tx_p]"
+             set retCode 1
+             continue
+        }
+
+        # if this is a receive port, then make sure we learn as well as get the DUT mac addr...
+        #if {[lsearch $rxList [list $tx_c $tx_l $tx_p]] >= 0} {
+        #   arpServer config -mode   arpGatewayAndLearn
+        #} else {
+        #   # we only need the gateway address if we're not a receiver...
+        #   arpServer config -mode   arpGatewayOnly
+        #}
+    
+        # because we want to use requestRepeatCount, so need to ARP and Learn for all ports
+        arpServer config -mode          arpGatewayAndLearn
+        arpServer config -retries       [learn cget -retries]
+        arpServer config -rate          [learn cget -rate]
+        arpServer config -requestRepeatCount   [learn cget -numframes]
+
+        if [arpServer set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting arpServer on port [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+        protocolServer config -enableArpResponse    true
+        if [protocolServer set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting protocolServer on port [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+        }
+
+        if {[interfaceTable::configurePort $tx_c $tx_l $tx_p $::ipV4 $numInterfaces nowrite $resetInterfaces]} {
+            errorMsg "Error: Unable to set interface table on port [getPortId $tx_c $tx_l $tx_p]"
+            set retCode $::TCL_OK
+        }
+    }
+
+    if {[llength $arpList] > 0 && $retCode == 0 && $write == "write"} {
+        writeConfigToHardware arpList
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: sendArp
+#
+# Description: This command uses the protocol server to send out arp requests & enable
+#              arp response
+#
+# Argument(s):
+#    PortArray    array of ports, ie., one2oneArray for a one2one configuration
+#
+# Returns:        TCL_OK or TCL_ERROR
+#
+########################################################################################
+proc sendArp { PortArray arpList {RemovedPorts ""} } \
+{
+
+    upvar $PortArray    portArray
+    #upvar $ArpList      arpList
+    if {[string length $RemovedPorts] > 0} {
+        upvar $RemovedPorts removedPorts
+    }
+
+    set retCode $::TCL_OK
+
+    if {[info exists removedPorts]} {
+        unset removedPorts
+    }
+    set removedPorts    0
+
+    if {[clearArpTable arpList]} {
+        errorMsg "Error clearing arp table"
+        set retCode $::TCL_ERROR
+    }
+
+    set numAddress          [advancedTestParameter cget -numAddressesPerPort]
+    set duration            [expr ceil (double([learn cget -numframes]) / [learn cget -rate])]
+
+    if {[issuePortGroupCommand resetStatistics arpList]} {
+	    errorMsg "Error: Unable to issue port group commands: resetStatistics"
+	    set retCode $::TCL_ERROR
+    }
+    set numFrames  $numAddress
+
+    if {[advancedTestParameter cget -verifyAllArpReply] == "true"} {
+        set numFrames [expr $numAddress * [learn cget -numframes]]
+    }
+
+    if {[expr ceil (double($numFrames)/[learn cget -rate])] > $duration } {
+        set duration    [expr $numFrames/[learn cget -rate]]
+    }
+
+    if {[transmitArpRequest arpList]} {
+        errorMsg "Error transmitting arp request"
+        set retCode $::TCL_ERROR
+    }
+
+    if {$duration > 2 } {
+        logMsg "Transmiting ARP frames for $duration seconds..."
+        # Wait for at least 1 frame per address gets transmitted..
+        set retCode [writeWaitMessage "Transmit ARP Status" "Transmitting" $duration destroy]
+    }
+
+    if {[learn cget -waitTime] > 1000 } {
+        logMsg "Waiting for DUT to settle down after learning for [expr [learn cget -waitTime]/1000] second(s)..."
+    }
+
+    after [learn cget -waitTime]
+
+    if {$numAddress > 1 } {
+        if {[verifyAllArpFramesSent $arpList]} {
+            errorMsg "Error verifying all Arp frames sent."
+            return $::TCL_ERROR
+        }
+    } 
+       
+    if {[advancedTestParameter cget -verifyAllArpReply] == "true"} {
+        if {[verifyArpReply $arpList]} {
+            errorMsg "Error verifying all Arp replies"
+            return $::TCL_ERROR
+        }
+    }
+
+    set retries     [learn cget -retries]
+    while {[llength $arpList] > 0 && $retries > 0} {
+        incr retries -1
+
+        foreach txMap [lnumsort $arpList] {
+            scan $txMap "%d %d %d" tx_c tx_l tx_p
+
+            if {[ipAddressTable get $tx_c $tx_l $tx_p]} {
+                errorMsg "Error getting ipAddressTable on [getPortId $tx_c $tx_l $tx_p]"
+                set retCode $::TCL_ERROR
+                continue
+            }
+            # look for ARP responses
+            if {[arpServer get $tx_c $tx_l $tx_p]} {
+                errorMsg "Error getting arpServer from [getPortId $tx_c $tx_l $tx_p]"
+                set retCode $::TCL_ERROR
+                continue
+            }
+
+            if {![catch {hasInternalModem portArray $tx_c $tx_l $tx_p} internalModemFlag] && $internalModemFlag} {
+                if {[internalModemCheckArpResponse portArray $tx_c $tx_l $tx_p]} {
+                    set retCode $::TCL_ERROR
+                } else {
+                    set mapIndex    [lsearch  $arpList $txMap]
+                    set arpList     [lreplace $arpList $mapIndex $mapIndex]
+                    set retCode $::TCL_OK
+                }
+            } else {
+                set gateway [ipAddressTable cget -defaultGateway]
+
+
+                if {[arpServer getEntry $gateway]} {
+                    logMsg "Waiting for ARP response from $gateway on [getPortId $tx_c $tx_l $tx_p] ..."
+                    after [learn cget -waitTime]
+                    continue
+                }
+                if {[arpAddressTableEntry get]} {
+                    errorMsg "Error getting arpAddressTableEntry"
+                    set retCode $::TCL_ERROR
+                    continue
+                }
+                set dutMacAddress   [arpAddressTableEntry cget -macAddress]
+
+                if {[port get $tx_c $tx_l $tx_p]} {
+                    errorMsg "Error getting port [getPortId $tx_c $tx_l $tx_p] for storing DestMacAddress."
+                    set retCode $::TCL_ERROR
+                    continue
+                }
+                port config -DestMacAddress    $dutMacAddress
+                if {[port set $tx_c $tx_l $tx_p]} {
+                    errorMsg "Error setting port [getPortId $tx_c $tx_l $tx_p]"
+                    set retCode $::TCL_ERROR
+                }
+                logMsg "Got ARP RESPONSE on [getPortId $tx_c $tx_l $tx_p], Gateway: $gateway, DUT MAC address for [getPortId $tx_c $tx_l $tx_p]: $dutMacAddress"
+                set mapIndex    [lsearch  $arpList $txMap]
+                set arpList     [lreplace $arpList $mapIndex $mapIndex]
+            } 
+        }
+    }
+    
+    foreach txMap [lnumsort $arpList] {
+        scan $txMap "%d %d %d" c l p
+        if {![catch {hasInternalModem portArray $c $l $p} internalModemFlag] && $internalModemFlag} {
+            getInternalModemNoArpResponse portArray $c $l $p
+        } else {
+            if {[ipAddressTable get $c $l $p]} {
+                errorMsg "Error getting ipAddressTable on [getPortId $c $l $p]"
+                set retCode $::TCL_ERROR
+                continue
+            }
+            set gateway [ipAddressTable cget -defaultGateway]
+            logMsg "No ARP response received from $gateway on $txMap"
+        }
+
+    }
+    
+    if {[llength $arpList] > 0 && $retCode == 0} {
+        if {[learn cget -removeOnError] == "true"} {
+            removePorts portArray $arpList
+            set removedPorts      1
+        } else {
+            set retCode     $::TCL_ERROR
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: verifyAllArpFramesSent
+#
+# Description: This command verifies all the ARP frames sent for all the addresses
+#
+# Argument(s):
+#    portList   - list of ports
+#
+########################################################################################
+proc verifyAllArpFramesSent { portList } \
+{
+
+    set retCode $::TCL_OK
+
+    set numAddress  [advancedTestParameter cget -numAddressesPerPort]
+    if {[advancedTestParameter cget -verifyAllArpReply] == "true"} {
+        set numFrames   [expr $numAddress * [learn cget -numframes]]
+    } else {
+        set numFrames $numAddress
+    }
+
+    set retries     [learn cget -retries]
+    while {[llength $portList] > 0 && $retries > 0} {
+        
+        set retCode [requestStats portList]
+        
+        foreach portMap $portList {
+            scan $portMap	"%d %d %d" c l p
+
+            if {[statList get $c $l $p]} {
+                errorMsg "Error getting stats for [getPortId $c $l $p]."
+                set retCode     $::TCL_ERROR
+                continue
+            }
+
+			if [catch {statList cget -framesSent} framesSent ] {
+				if [catch {statList cget -atmAal5FramesSent} framesSent ] {
+					set framesSent 0
+				}
+			}
+
+            # Since 32 bit counter (mpexpr) is used here, if we get a 32 bit long number (in binary) whose most significiant
+            # bit is 1, it will be recognized as a negtive number. 
+            # So we use regexp to determine wheather numTxFrames is a negative number instead of using "$numTxFrames < 0"
+            if { [regexp {^-[0-9]+$} $framesSent] } {
+                set framesSent 0
+            }
+            if { $framesSent >= $numFrames } {
+                set mapIndex    [lsearch  $portList $portMap]
+                set portList    [lreplace $portList $mapIndex $mapIndex] 
+            }   
+            after 1000
+        }
+        incr retries -1
+    }
+
+    foreach txMap [lnumsort $portList] {
+        scan $txMap "%d %d %d" c l p
+   
+        logMsg "Not all ARP frames sent for all $numAddress addresses on $txMap"
+        set retCode     $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+########################################################################################
+# Procedure: verifyArpReply
+#
+# Description: This command verifies all the ARP replies - number of ARP replies from all
+#              the addresses
+#
+# Argument(s):
+#    portList   - list of ports
+#
+########################################################################################
+proc verifyArpReply { portList } \
+{
+
+    set retCode $::TCL_OK
+
+    set numAddress  [advancedTestParameter cget -numAddressesPerPort]
+
+    set retries     [learn cget -retries]
+    while {[llength $portList] > 0 && $retries > 0} {
+        
+        set retCode [requestStats portList]
+        
+        foreach portMap $portList {
+            scan $portMap	"%d %d %d" c l p
+
+            if {[statList get $c $l $p]} {
+                errorMsg "Error getting stats for [getPortId $c $l $p]."
+                set retCode     $::TCL_ERROR
+                continue
+            }
+
+            set numRxArpReply [statList cget -rxArpReply]
+
+            # Since 32 bit counter (mpexpr) is used here, if we get a 32 bit long number (in binary) whose most significiant
+            # bit is 1, it will be recognized as a negtive number. 
+            # So we use regexp to determine wheather numTxFrames is a negative number instead of using "$numTxFrames < 0"
+            if { [regexp {^-[0-9]+$} $numRxArpReply] } {
+                set numRxArpReply 0
+            }
+            if { $numRxArpReply >= $numAddress } {
+                set mapIndex    [lsearch  $portList $portMap]
+                set portList    [lreplace $portList $mapIndex $mapIndex] 
+            }   
+            after 1000
+        }
+        incr retries -1
+    }
+
+    foreach txMap [lnumsort $portList] {
+        scan $txMap "%d %d %d" c l p
+   
+        if {[ipAddressTable get $c $l $p]} {
+            errorMsg "Error getting ipAddressTable on [getPortId $c $l $p]"
+            set retCode $::TCL_ERROR
+            continue
+        }
+        set gateway [ipAddressTable cget -defaultGateway]
+        logMsg "Not all ARP responses received for all $numAddress addresses from $gateway on $txMap"
+        set retCode     $::TCL_ERROR
+    }
+
+    return $retCode
+}
+
+########################################################################################
+#::::::::::::                    IPV6 Layer Learn frames                   :::::::::::::
+########################################################################################
+########################################################################################
+# Procedure:    send_neighborDiscovery_frames
+#
+# Description:  Solicit and save the link-layer addresses for the ports of the 
+#                   given portArray
+#
+# Argument(s):  PortArray:      ports array, ie: one2oneArray, many2oneArray...
+#               RemovedPorts:   return removed ports here
+#
+# Returns:      ::TCL_OK or ::TCL_ERROR
+#
+########################################################################################
+proc send_neighborDiscovery_frames {PortArray {RemovedPorts ""} {resetInterfaces true}} \
+{
+    upvar $PortArray portArray
+    if {[string length $RemovedPorts] > 0} {
+        upvar $RemovedPorts removedPorts
+    }
+
+    set retCode $::TCL_OK
+
+    if {![catch {namespace parent userCode}]} {
+        set retCode [userCode::performNeighborDiscovery portArray]
+        
+    } else {
+        set retCode [performNeighborDiscovery portArray removedPorts $resetInterfaces]
+    }
+    return $retCode
+}
+
+########################################################################################
+# Procedure:    performNeighborDiscovery
+#
+# Description:  Solicit and save the link-layer addresses for the ports of the 
+#                   given portArray
+#
+#                   In this implementation, the neighbor discovery table is populated
+#                   after a set of router solicitation/advertisement commands are 
+#                   sent and recieved.  The 'source link-layer option' of the router
+#                   advertisement is used to extract the DUT's link layer address.
+#
+# Argument(s):  PortArray:      ports array, ie: one2oneArray, many2oneArray...
+#               RemovedPorts:   return removed ports here
+#
+# Returns:      ::TCL_OK or ::TCL_ERROR
+#
+########################################################################################
+proc performNeighborDiscovery {PortArray {RemovedPorts ""} {resetInterfaces true}} \
+{
+    upvar $PortArray    portArray
+    if {[string length $RemovedPorts] > 0} {
+        upvar $RemovedPorts removedPorts
+    }
+
+    set retCode $::TCL_OK
+
+    set retries     [learn cget -retries]
+    set waitTime    [learn cget -waitTime]
+    set portList    [getAllPorts portArray]
+
+    if {[llength $portList] > 0} {
+
+        discoveredNeighbor  setDefault
+        if {![interfaceTable::configure portList $::ipV6 1 nowrite $resetInterfaces]} {
+
+            set discoveryList $portList
+
+			foreach portItem $portList {
+				scan $portItem "%d %d %d" tx_c tx_l tx_p
+
+				if [IsPOSPort $tx_c $tx_l $tx_p] {
+					set index   [lsearch $discoveryList $portItem]
+					set discoveryList [lreplace $discoveryList $index $index]
+					continue
+				}
+			}
+			if {[llength $discoveryList] } {
+				if {![set retCode [sendRouterSolicitation discoveryList]]} {
+					while {$retries >= 0} {
+                
+						set retCode $::TCL_OK
+						if {![getNeighborDiscovery discoveryList]} {
+							break
+						} else {
+							set retCode $::TCL_ERROR
+							incr retries -1
+						}
+						after $waitTime
+
+						sendRouterSolicitation discoveryList
+					}
+
+					# Handle ports that didn't respond with Neighbor Advertisement.
+					if {[llength $discoveryList] > 0} {
+                
+						if {[learn cget -removeOnError] == "true"} {
+							removePorts portArray $discoveryList
+							set removedPorts $::true
+						} else {
+							errorMsg "Error: Unable to discover neighbors on ports: $discoveryList"
+							set retCode $::TCL_ERROR
+						}
+					}
+				}
+			}
+
+        } else {
+            errorMsg "Error configuring Interface Table"
+            set retCode $::TCL_ERROR
+        }
+    }
+
+    return $retCode
+}
+
+########################################################################################
+# Procedure:    SendRouterSolicitation
+#
+# Description:  Send router solicitation to each port in the portList.
+#
+#               This command causes the router to respond with a router advertisement 
+#               where the source link-layer option is used to extract the link layer 
+#               address of the DUT.
+#
+# Argument(s):  PortArray:      ports array, ie: one2oneArray, many2oneArray...
+#
+# Returns:      ::TCL_OK or ::TCL_ERROR
+#
+########################################################################################
+proc sendRouterSolicitation {PortList} \
+{
+    upvar $PortList portList
+
+    set retCode $::TCL_OK
+
+    foreach portMap $portList {
+        scan $portMap "%d %d %d" c l p
+
+        if {![interfaceTable select $c $l $p]} {
+
+            if {[interfaceTable sendRouterSolicitation]} {
+                errorMsg "Error: Unable to send router solicitation on $c $l $p"
+                set retCode $::TCL_ERROR
+                break
+            } 
+
+        } else {
+            errorMsg "Error: Unable to selected interface on $c $l $p"
+            set retCode $::TCL_ERROR
+            break
+        }
+    }
+    after [learn cget -waitTime]
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure:    getNeighborDiscovery
+#
+# Description:  Store the link-layer addresses solicited.
+#
+# Argument(s):  PortList:  port list
+#
+# Returns:      ::TCL_OK or ::TCL_ERROR
+#
+########################################################################################
+proc getNeighborDiscovery {PortList {MacAddrArray ""} {verbose false} } \
+{
+    upvar $PortList         portList
+    upvar $MacAddrArray     macAddrArray
+
+    set retCode $::TCL_OK
+
+    set waitTime     [learn cget -waitTime]
+
+    if { [llength $portList] > 1 } {
+        logMsg "\nPerforming Neighbor Discovery on ports: $portList."
+    }
+
+    # Read neighbors from neighbor discovery table.
+    foreach portMap $portList {
+        scan $portMap "%d %d %d" chassId cardId portId
+
+        # Error message for select is taken care off on the second select below
+        if {![interfaceTable select $chassId $cardId $portId]} {
+            interfaceTable requestDiscoveredTable
+        } 
+    }
+
+    # We only wait here instead of inside the loop for each port,
+    # make sure we wait long enough for all the ports in the list
+    after [learn cget -waitTime]
+
+    foreach portMap $portList {
+
+        scan $portMap "%d %d %d" chassId cardId portId
+
+        set macAddrArray($chassId,$cardId,$portId) 0
+        set message ""
+
+        if {![interfaceTable select $chassId $cardId $portId]} {
+        
+            set description [interfaceTable::formatEntryDescription $chassId $cardId $portId]
+            if {![interfaceTable getDiscoveredList $description]} {
+            
+                            
+                if {![discoveredList getFirstNeighbor]} {
+                    set macAddrArray($chassId,$cardId,$portId) [discoveredNeighbor cget -macAddress]
+                } else {
+                    set message "Error: Unable to get neighbor in discovery list for [getPortId $chassId $cardId $portId]"
+                }
+        
+            } else {
+                set message "Error: Unable to get neighbor discovery list for [getPortId $chassId $cardId $portId]"
+            }
+
+            if {[isMacAddressValid $macAddrArray($chassId,$cardId,$portId)] == $::TCL_OK} {
+
+                logMsg "Neighbor Discovery Complete for [getPortId $chassId $cardId $portId]: $macAddrArray($chassId,$cardId,$portId)"
+                if {![port get $chassId $cardId $portId]} {
+                    port config -DestMacAddress $macAddrArray($chassId,$cardId,$portId)
+                }
+                if {[port set $chassId $cardId $portId]} {
+                    errorMsg "Error: Unable configure [getPortId $chassId $cardId $portId] with link-layer address"
+                    set retCode $::TCL_ERROR
+                }
+
+                set index       [lsearch  $portList $portMap]
+                set portList [lreplace $portList $index $index]
+
+            } else {
+                set retCode $::TCL_ERROR
+            }            
+
+        } else {
+            set message "Error: Unable to select interface table for [getPortId $chassId $cardId $portId]"
+        }
+
+        if {$verbose == "true"} {
+            if {[string length $message] > 0} {
+                errorMsg $message
+            }
+        }
+    }
+
+    return $retCode
+}
+
+########################################################################################
+# Procedure:    getNeighborDiscoveryPort
+#
+# Description:  Return link-layer address of DUT.
+#
+# Argument(s):  chassId
+#               cardId
+#               portId
+#
+# Returns:      ::TCL_OK or ::TCL_ERROR
+#
+########################################################################################
+proc getNeighborDiscoveryPort {chassId cardId portId {verbose false} } \
+{
+    set macAddrArray($chassId,$cardId,$portId) 0
+
+    set portList [list [list $chassId $cardId $portId]]
+
+    if {[getNeighborDiscovery portList macAddrArray $verbose]} {
+        errorMsg "Error getting Neighbor Discovery for one or more ports."
+    }
+
+    return $macAddrArray($chassId,$cardId,$portId)
+}
+
+
+
+########################################################################################
+#::::::::::::                    IPX Layer Learn frames                       :::::::::::::
+########################################################################################
+
+########################################################################################
+# Procedure: sapStr2Asc
+#
+# Description: Converts a string into hex and pads to make it into 48 bytes. SAP frame
+# has 48 bytes reserved for server name.
+#
+# Argument(s):
+#    string to convert
+#
+########################################################################################
+
+proc sapStr2Asc {strName} \
+{
+    set nameList {}
+    for {set i 0} {$i < [string length $strName]} {incr i} {
+        binary scan [string index $strName $i] tx_c val
+        set hexVal [format %02x [set val]]
+        set nameList [lappend nameList $hexVal]
+    }
+
+    set currLen [string length $strName]
+    while {$currLen < 48} {
+        set nameList [lappend nameList "00"]
+        incr currLen
+    }
+    return $nameList
+}
+
+########################################################################################
+# Procedure: send_ripx_frames
+#
+# Description: This command sends ripx frames all ports in order to advertise the
+#               sourceNode for IPX routing
+# The algorithm of establishing an IPX connection is as follows:
+#    - send RIPX broadcast (requests) to the destination node's (router's) network number
+#        from all ports in the port map
+#    - the router responds to this request giving its network and node (MAC) adddress in
+#        the IPX header
+#    - to send traffic now, the sending node
+#        * places the destination node's (router's) network, node addresses and socket number
+#            in the destination address fields of the IPX header
+#        * places its own network, node addresses and socket number in the source address
+#            fields of the IPX header
+#        * places the node (MAC) address of the router (port) in the destination address
+#            address field of MAC header
+#        * places its own node address in the source address field of the MAC header
+#
+# Argument(s):
+#    PortArray    array of ports, ie., one2oneArray for a one2one configuration
+#
+########################################################################################
+proc send_ripx_frames {PortArray {RemovedPorts ""}} \
+{
+    global udfList
+
+    upvar $PortArray portArray
+    if {[string length $RemovedPorts] > 0} {
+        upvar $RemovedPorts removedPorts
+    }
+
+    set retCode         0
+    set removedPorts    0
+
+    # set the stream parameters.
+    set preambleSize    8
+    set framesize       [learn cget -framesize]
+
+    set duration    [expr [learn cget -numframes] / [learn cget -rate]]
+
+    stream setDefault
+    stream config -rateMode         usePercentRate
+    stream config -dma              stopStream
+    stream config -fcs              good
+    stream config -enableTimestamp  false
+    stream config -gapUnit          gapNanoSeconds
+
+    # need to turn off signature...!!
+    packetGroup setDefault
+
+    udf setDefault
+    if [disableUdfs $udfList] {
+        errorMsg "Error disabling udfs in switchLearn for RIPx frames"
+        set retCode 1
+    }
+
+    filterPallette setDefault
+
+    filter setDefault
+    filter config -captureFilterError   errGoodFrame
+    filter config -captureTriggerError  errGoodFrame
+
+    # zero stats everywhere to avoid confusion later...
+    zeroStats portArray
+
+    # note - send one port at portArray time to allow time for learning
+
+    debugMsg "Configuring RIPX frames..."
+
+    # send RIPX on all ports involved in this map, but just send once...
+    set ripxMap     [getAllPorts portArray]
+
+    # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+    # >>>>>>>>>>>>>>>>>>>>>>>>>>  Send RIPX Frames <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+    # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+    # first send the RIPX broadcast request to the router asking for its addresses
+    foreach txMap $ripxMap {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+
+        if {[port get $tx_c $tx_l $tx_p] == 1} {
+            errorMsg "port [getPortId $tx_c $tx_l $tx_p] has not been configured yet."
+            continue
+        }
+
+        set learnPercentRate             [expr double([learn cget -rate])/[calculateMaxRate $tx_c $tx_l $tx_p $framesize]*100.]
+        stream config -percentPacketRate $learnPercentRate
+
+        stream config -name         "RIPXStream"
+
+        stream config -da       $::kBroadcastMacAddress
+        stream config -numDA    1
+
+        set numAddresses        [port cget -numAddresses]
+          stream config -sa     [port cget -MacAddress]
+        stream config -numSA    $numAddresses
+
+        stream config -patternType    nonRepeat
+        stream config -dataPattern    userpattern
+        stream config -numFrames      [expr [learn cget -numframes] * $numAddresses]
+        if {[expr [stream cget -numFrames]/[learn cget -rate]] > $duration} {
+            set duration    [expr [stream cget -numFrames]/[learn cget -rate]]
+        }
+
+        if [ipx get $tx_c $tx_l $tx_p] {
+            errorMsg "Error getting IPx on [getPortId $tx_c $tx_l $tx_p] for RIPX frames."
+            set retCode 1
+            continue
+        }
+
+        # save the original setup and restore it at the end
+        set origSrcSocket($tx_c,$tx_l,$tx_p)    [ipx cget -sourceSocket]
+
+        # build the RIPX packet which is the data portion of the IPX packet
+        ipx config -packetType        1        ;# RIP type packet
+
+        set RIPXNetworkNumber   {ff ff ff ff}
+        set numHops             1
+        set numTicks            2
+
+        ipx config -destNetwork     {00 00 00 00}
+        ipx config -destNode        $::kBroadcastMacAddress
+        ipx config -destSocket      [format %d $::kRipSocket]
+
+        ipx config -sourceNetwork   {00 00 00 00}
+        ipx config -sourceNode      [port cget -MacAddress]
+        if {$numAddresses > 1} {
+            ipx config -sourceNodeRepeatCounter $numAddresses
+            ipx config -sourceNodeCounterMode   ipxIncrement
+        } else {
+            ipx config -sourceNodeCounterMode   ipxIdle
+        }
+        ipx config -destNetworkCounterMode  ipxIdle
+        ipx config -destNodeCounterMode     ipxIdle
+        ipx config -destSocketCounterMode   ipxIdle
+
+        ipx config -sourceSocket        [format %d $::kRipSocket]
+        ipx config -lengthOverride      true
+        ipx config -length              40
+
+        if [ipx set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting IPX parameters on [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+
+       
+        # now build the IPX packet with the RIPX in it
+        set streamPattern    [buildRipxPacket $::kRIPXOperation(request) $RIPXNetworkNumber $numHops $numTicks]    
+
+        stream config -pattern $streamPattern
+        stream config -framesize [learn cget -framesize]
+        if [stream set $tx_c $tx_l $tx_p 1] {
+            errorMsg "Error setting stream 1 on [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+
+        # need to turn off signature for ripx frames...!!
+        if [packetGroup setTx $tx_c $tx_l $tx_p 1] {
+            errorMsg "Error disabling packetGroup signatures on stream 1, [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+
+        # set up the pattern filter
+        filterPallette config -DA1 [port cget -MacAddress]
+        if [filterPallette set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting filter pallette for [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+
+        # set the filter parameters on the receive port
+        debugMsg "    configuring filters"
+        filter config -captureFilterEnable  true
+        filter config -captureTriggerEnable true
+        if [filter set $tx_c $tx_l $tx_p] {
+            errorMsg "Error setting filters on [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+
+        if [filterPallette write $tx_c $tx_l $tx_p] {
+            errorMsg "Error writing filterPallette to hardware for RIPX frames"
+            set retCode 1
+            continue
+        }
+
+    }
+
+    writeConfigToHardware portArray
+    if [startCapture ripxMap] {
+        errorMsg "Error starting capture."
+        set retCode 1
+    }
+
+    foreach txMap [lnumsort $ripxMap] {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+
+        logMsg "sending RIPX broadcast frame from [getPortId $tx_c $tx_l $tx_p]"
+    }
+	set retCode [startStaggeredTx ripxMap]
+
+    # wait the min refresh for 10/100 cards to let the stats update...
+    after 800
+
+    after [learn cget -waitTime]
+    # Wait for all frames to be transmitted..
+    for {set timeCtr 1} {$timeCtr <= $duration} {incr timeCtr} {
+        logMsg  "Transmitted $timeCtr of $duration seconds"
+        after 1000
+    }
+
+    checkAllTransmitDone ripxMap
+
+    foreach txMap [lnumsort $ripxMap] {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+
+        # decode the RIPX response and get the router's node address
+        set maxRip  100
+
+        if [port get $tx_c $tx_l $tx_p] {
+            errorMsg "port [getPortId $tx_c $tx_l $tx_p] has not been configured yet."
+            continue
+        }
+
+        if [captureBuffer get $tx_c $tx_l $tx_p 1 $maxRip] {
+            errorMsg "Error getting capture buffer from frame(s) 1 to 1 for [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+
+        set found 0
+        set nFrame 1
+        while {[captureBuffer getframe $nFrame] != 1 && $nFrame <= $maxRip} {
+            debugMsg "Getting frame $nFrame from Buffer   ....."
+            set capframe    [captureBuffer cget -frame]
+
+            if {[ipx decode $capframe] == 0 && ([ipx cget -destSocket] == 1107) && ([ipx cget -destNode] == [string toupper [port cget -MacAddress]])} {
+                logMsg "Got RIPX RESPONSE on [getPortId $tx_c $tx_l $tx_p]"
+                set found 1
+
+                ipx config -sourceSocket    $origSrcSocket($tx_c,$tx_l,$tx_p)
+                ipx config -destNetwork     [ipx cget -sourceNetwork]
+                ipx config -sourceNetwork   [ipx cget -destNetwork]
+
+                set sourceNode              [ipx cget -destNode]
+                set destNode                [ipx cget -sourceNode]
+                ipx config -sourceNode      $sourceNode
+                ipx config -destNode        $destNode
+
+                if [ipx set $tx_c $tx_l $tx_p] {
+                    errorMsg "Error setting IPX parameters for [getPortId $tx_c $tx_l $tx_p]"
+                    set retCode 1
+                    continue
+                }
+
+                if [port get $tx_c $tx_l $tx_p] {
+                    errorMsg "Error getting port [getPortId $tx_c $tx_l $tx_p]"
+                    set retCode 1
+                    continue
+                }
+                port config -DestMacAddress    [ipx cget -destNode]
+                if [port set $tx_c $tx_l $tx_p] {
+                    errorMsg "Error setting port [getPortId $tx_c $tx_l $tx_p]"
+                    set retCode 1
+                    continue
+                }
+                break
+            }
+            incr nFrame
+        }
+
+        if {$found == 0} {
+            errorMsg "No RIPX response frames received on [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+return -code error
+            continue
+        }
+    }
+
+    if {$retCode == 0 && [fastpath cget -enable] == "true"} {
+        if [send_fastpath_frames portArray] {
+            errorMsg "Error sending fastpath frames"
+            set retCode 1
+        }
+    }
+
+    stream setDefault
+
+    logMsg "RIPX frames sent ..."
+    return $retCode
+}
+
+########################################################################################
+# Procedure: send_sap_server_frames
+#
+# Description: This command sends IPX SAP broadcast frames in order to advertise the
+#               port as portArray server node for IPX routing.
+#
+# Argument(s):
+#    PortArray    array of ports, ie., one2oneArray for portArray one2one configuration
+#
+########################################################################################
+proc send_sap_server_frames {PortArray} \
+{
+    global udfList
+
+    upvar $PortArray portArray
+    set retCode 0
+
+    # set the stream parameters.
+    set preambleSize                8
+    set framesize                   [learn cget -framesize]
+
+    stream config -rateMode         usePercentRate
+    stream config -dma              stopStream
+    stream config -fcs              good
+    stream config -enableTimestamp  false
+    stream config -numFrames        [learn cget -numframes]
+    stream config -gapUnit          gapNanoSeconds
+
+    udf setDefault
+    disableUdfs $udfList
+
+    filterPallette setDefault
+
+    filter setDefault
+    filter config -captureTriggerDA     addr1
+    filter config -captureFilterError   errGoodFrame
+    filter config -captureTriggerError  errGoodFrame
+
+    # zero stats everywhere to avoid confusion later...
+    zeroStats portArray
+
+    # note - send one port at portArray time to allow time for learning
+
+    debugMsg "Configuring SAP frames..."
+
+    # send sap on all ports involved in this map, but just send once...
+    foreach txMap [array names portArray] {
+        if {![info exists sapMap($txMap]} {
+            set sapMap($txMap)    1
+        }
+
+        foreach rxMap $portArray($txMap) {
+            scan $rxMap "%d %d %d" tx_c tx_l tx_p
+            if {![info exists sapMap($tx_c,$tx_l,$tx_p)]} {
+                set sapMap($tx_c,$tx_l,$tx_p)    1
+            }
+        }
+    }
+
+    # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+    # >>>>>>>>>>>>>>>>>>>  SAP Broadcast - Advertise Servers <<<<<<<<<<<<<<<<<<<
+    # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+    foreach txMap [lnumsort [array names sapMap]] {
+        scan $txMap "%d,%d,%d" tx_c tx_l tx_p
+        if {[port get $tx_c $tx_l $tx_p] == 1} {
+            logMsg "port [getPortId $tx_c $tx_l $tx_p] has not been configured yet."
+            continue
+        }
+
+        if [ipx get $tx_c $tx_l $tx_p] {
+            errorMsg "Error getting IPx on [getPortId $tx_c $tx_l $tx_p] for SAP frames."
+            set retCode 1
+            continue
+        }
+        # if this port is set up as SERVER, then send SAP broadcast announcing iteslf
+        if {[ipx cget -svrClientType] == 1} {
+            set txSA  [port cget -MacAddress]
+
+            set learnPercentRate [expr double([learn cget -rate])/[calculateMaxRate $tx_c $tx_l $tx_p $framesize]*100.]
+            stream config -percentPacketRate $learnPercentRate
+
+            stream config -name    "SapBroadcastStream"
+
+            stream config -da      $::kBroadcastMacAddress
+            stream config -numDA   1
+
+            stream config -sa      $txSA
+            stream config -numSA   1
+
+            stream config -patternType    nonRepeat
+            stream config -dataPattern    userpattern
+
+            set netAddress  [ipx cget -sourceNetwork]
+            set nodeAddress [port cget -MacAddress]
+
+            set hops {00 01}
+            ipx config -packetType     4
+
+            ipx config -destSocket     $::kSapSocket
+            ipx config -sourceNode     $txSA
+            ipx config -sourceNetwork  {00 00 00 00}
+            ipx config -destNetwork    {00 00 00 00}
+
+            set serverName [sapStr2Asc "ixiaServer$tx_c$tx_l$tx_p"]
+
+            if [ipx set $tx_c $tx_l $tx_p] {
+                errorMsg "Error setting IPX packet on [getPortId $tx_c $tx_l $tx_p]"
+                set retCode 1
+            }
+
+            # build the SAP broadcast packet (which is service type General Service Response)
+            set streamPattern [buildSapPacket $::kSapOperation(response) $::kSapServiceType(fileServer) \
+                                         $serverName $netAddress $nodeAddress $::kSapSocket $hops]
+                                                         
+            stream config -pattern $streamPattern
+
+            set IPXheaderLen    30
+            set DASATypeLen     14
+            set CRCLen          4
+            stream config -framesize [expr [llength [ipx cget -data]] + $IPXheaderLen + $DASATypeLen + $CRCLen]
+
+            if [stream set $tx_c $tx_l $tx_p 1] {
+                errorMsg "Error setting stream 1 on [getPortId $tx_c $tx_l $tx_p] for SAP frames."
+                set retCode 1
+            }
+
+            if [stream write $tx_c $tx_l $tx_p 1] {
+                errorMsg "Error writing stream to hardware for SAP frames"
+                set retCode 1
+                continue
+            }
+
+            logMsg "sending SAP broadcast frame from [getPortId $tx_c $tx_l $tx_p] server, Network address: [ipx cget -sourceNetwork]"
+            if [startPortTx $tx_c $tx_l $tx_p] {
+                errorMsg "Error starting Tx on port [getPortId $tx_c $tx_l $tx_p]"
+                set retCode 1
+            }
+
+            # wait for portArray second portArray look for nearest SAP response on each port
+            after 1000
+
+            # make sure something got transmitted
+            set txNumFrames    [stat cget -counterVal]
+            if {$txNumFrames == 0} {
+                errorMsg "Error transmitting SAP broadcast frames for SERVER on [getPortId $tx_c $tx_l $tx_p]"
+                set retCode 1
+                continue
+            }
+        }
+    }
+
+    logMsg "SAP broadcast frames sent..."
+    return $retCode
+}
+
+########################################################################################
+# Procedure: send_sapgns_frames
+#
+# Description: This command sends SAP GNS frames on all ports for IPX routing
+#
+# Argument(s):
+#    PortArray    array of ports, ie., one2oneArray for portArray one2one configuration
+#
+########################################################################################
+proc send_sapgns_frames {PortArray} \
+{
+    global udfList
+
+    upvar $PortArray portArray
+    set retCode 0
+
+    # set the stream parameters.
+    set preambleSize        8
+    set framesize           [learn cget -framesize]
+
+    stream config -rateMode         usePercentRate
+    stream config -dma              stopStream
+    stream config -fcs              good
+    stream config -enableTimestamp  false
+    stream config -numFrames        [learn cget -numframes]
+    stream config -gapUnit          gapNanoSeconds
+
+    udf setDefault
+    disableUdfs $udfList
+
+    filterPallette setDefault
+
+    filter setDefault
+    filter config -captureTriggerDA     addr1
+    filter config -captureFilterError   errGoodFrame
+    filter config -captureTriggerError  errGoodFrame
+
+    # zero stats everywhere to avoid confusion later...
+    zeroStats portArray
+
+    # note - send one port at portArray time to allow time for learning
+
+    debugMsg "Configuring SAP frames..."
+
+    # send sap on all ports involved in this map, but just send once...
+    foreach txMap [array names portArray] {
+        if {![info exists sapMap($txMap]} {
+            set sapMap($txMap)    1
+        }
+
+        foreach rxMap $portArray($txMap) {
+            scan $rxMap "%d %d %d" tx_c tx_l tx_p
+            if {![info exists sapMap($tx_c,$tx_l,$tx_p)]} {
+                set sapMap($tx_c,$tx_l,$tx_p)    1
+            }
+        }
+    }
+
+    # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+    # >>>>>>>>>>>>>>>>>>>>  SAP Get Nearest Server Request <<<<<<<<<<<<<<<<<<<<<
+    # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+    foreach txMap [lnumsort [array names sapMap]] {
+        scan $txMap "%d,%d,%d" tx_c tx_l tx_p
+        if {[port get $tx_c $tx_l $tx_p] == 1} {
+            logMsg "port [getPortId $tx_c $tx_l $tx_p] has not been configured yet."
+            continue
+        }
+
+        set txSA [port cget -MacAddress]
+
+        if [ipx get $tx_c $tx_l $tx_p] {
+            errorMsg "Error getting IPx on [getPortId $tx_c $tx_l $tx_p] for SAP frames."
+            set retCode 1
+            continue
+        }
+        # if this port is set up as CLIENT, then send SAP Get Nearest server request
+        if {[ipx cget -svrClientType] == 2} {
+            filter config -captureFilterPattern         any
+            filter config -captureFilterError           errGoodFrame
+            filter config -captureFilterFrameSizeEnable false
+            filter config -captureFilterFrameSizeEnable false
+            filter config -captureTriggerError          errGoodFrame
+
+            if [startPortCapture $tx_c $tx_l $tx_p] {
+                errorMsg "Error starting Capture on port [getPortId $tx_c $tx_l $tx_p]"
+                set retCode 1
+            }
+
+            set learnPercentRate             [expr double([learn cget -rate])/[calculateMaxRate $tx_c $tx_l $tx_p $framesize]*100.]
+            stream config -percentPacketRate $learnPercentRate
+
+            stream config -name     "SapGNSStream"
+
+            stream config -da       [port cget -DestMacAddress]
+            stream config -numDA    1
+
+              stream config -sa     $txSA
+            stream config -numSA    1
+
+            stream config -patternType    nonRepeat
+            stream config -dataPattern    userpattern
+
+            set netAddress    [ipx cget -sourceNetwork]
+            set nodeAddress   [port cget -MacAddress]
+            set hops {00 01}
+
+            ipx config -packetType      4
+
+            ipx config -destNode        $::kBroadcastMacAddress
+            ipx config -destSocket      $::kSapSocket
+
+            ipx config -sourceNode      $txSA
+            ipx config -sourceSocket    $::kSapSocket
+
+            set serverName [sapStr2Asc "ixiaServer$tx_c$tx_l$tx_p"]        ;# this is ignored by the router
+
+            if [ipx set $tx_c $tx_l $tx_p] {
+                errorMsg "Error setting IPX packet on [getPortId $tx_c $tx_l $tx_p]"
+                set retCode 1
+            }
+
+            set streamPattern [buildSapPacket $::kSapOperation(getNearestServerRequest) $::kSapServiceType(fileServer) \
+                                           $serverName $netAddress $nodeAddress $::kSapSocket $hops]    
+    
+            stream config -pattern $streamPattern
+            stream config -framesize 64
+
+            if [stream set $tx_c $tx_l $tx_p 1] {
+                errorMsg "Error setting stream 1 on [getPortId $tx_c $tx_l $tx_p] for SAP GNS frames."
+                set retCode 1
+            }
+
+
+            if [stream write $tx_c $tx_l $tx_p 1] {
+                errorMsg "Error writing stream to hardware for SAP GNS frames"
+                set retCode 1
+                continue
+            }
+
+            logMsg "sending SAP GNS request frame from [getPortId $tx_c $tx_l $tx_p] client, Network address: [ipx cget -sourceNetwork]"
+            if [startPortTx $tx_c $tx_l $tx_p] {
+                errorMsg "Error starting Tx on port [getPortId $tx_c $tx_l $tx_p]"
+                set retCode 1
+            }
+
+            # wait for portArray second portArray look for nearest SAP response on each port
+            after 1000
+
+            # make sure something got transmitted
+            set txNumFrames    [stat cget -counterVal]
+            if {$txNumFrames == 0} {
+                errorMsg "Error transmitting SAP GNS frames for CLIENT on [getPortId $tx_c $tx_l $tx_p]"
+                set retCode 1
+                continue
+            }
+
+            # decode the SAP GNS response and get the server's net address
+            if [capture get $tx_c $tx_l $tx_p] {
+                errorMsg "Error getting capture data on [getPortId $tx_c $tx_l $tx_p]"
+                set retCode 1
+                continue
+            }
+    
+            set numCapturedFrames [capture cget -nPackets]
+            debugMsg "numCapturedFrames = $numCapturedFrames"
+
+            if {$numCapturedFrames < 1} {
+                logMsg "No SAP GNS response frames received on [getPortId $tx_c $tx_l $tx_p]"
+            } else {
+                # look for SAP GNS responses
+                if [captureBuffer get $tx_c $tx_l $tx_p 1 $numCapturedFrames] {
+                    errorMsg "Error getting capture buffer from frame(s) 1 to 1 for [getPortId $tx_c $tx_l $tx_p]"
+                    set retCode 1
+                    continue
+                }
+                set found 0
+                for {set nFrame 1} {$nFrame <= $numCapturedFrames} {incr nFrame} {
+                    debugMsg "Getting frame $nFrame from Buffer   ....."
+                    if [captureBuffer getframe $nFrame] {
+                        errorMsg "Error getting frame $nFrame from capture buffer for [getPortId $tx_c $tx_l $tx_p]"
+                        set retCode 1
+                        continue
+                    }
+                    set capframe    [captureBuffer cget -frame]
+                    debugMsg $capframe
+
+                    if [ipx get $tx_c $tx_l $tx_p] {
+                        errorMsg "Error getting IPx on [getPortId $tx_c $tx_l $tx_p] for SAP frames."
+                        set retCode 1
+                        continue
+                    }
+
+                    set ipxPacketType   [lindex $capframe 19]
+                    set sapOperType     [lrange $capframe 44 45]
+                    set destSocket      [lrange $capframe 106 107]
+                    set serverType      [lrange $capframe 46 47]
+                    set serverNetAddr   [lrange $capframe 96 99]
+
+                    if {($sapOperType == "00 04") && ($destSocket == "04 52") && ($serverType == $::kSapServiceType(fileServer))} {
+                        logMsg "Got SAP GNS RESPONSE on [getPortId $tx_c $tx_l $tx_p]"
+                        set found 1
+                        break
+                    }
+                }
+
+                if {$found == 0} {
+                    logMsg "No SAP GNS response frames received on [getPortId $tx_c $tx_l $tx_p]"
+                    continue
+                }
+
+                ipx config -destNetwork $serverNetAddr
+                if [ipx set $tx_c $tx_l $tx_p] {
+                    errorMsg "Error setting IPX parameters for [getPortId $tx_c,$tx_c,$tx_p]"
+                }
+            }
+        }
+    }
+
+    logMsg "SAP GNS frames sent..."
+    return $retCode
+}
+
+
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/tclServer.tcl b/dep/tclclient/ixTcl1.0/Generic/tclServer.tcl
new file mode 100644
index 00000000..55091d75
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/tclServer.tcl
@@ -0,0 +1,458 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: tclServer.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+# Revision Log:
+# 3-1-2001 Michael Githens
+#
+# Description: This file contains procedures that handle any connections with
+#              the Tcl Server.
+#
+# NOTE: All routines in this file must be able to stand on their own.  There
+#       can be no dependence on ScriptMate
+#
+###############################################################################
+
+namespace eval tclServer \
+{
+    variable tclServerName      ""
+    variable tclServerConnected 0
+}
+# End of tclServer namespace
+
+# The following are the procedures that are meant to be called from outside
+# of the namespace.  The rest are just helper routines for use within the
+# namespace.
+#
+#  tclServer::getTclServerName
+#  tclServer::setTclServerName
+#  tclServer::disconnectTclServer
+#  tclServer::connectToTclServer serverName errMsg clientPort
+#  tclServer::isTclServerConnected
+#
+
+
+###############################################################################
+# Procedure:   tclServer::getTclServerName
+#
+# Description: Retrieve the hostname of tcl server.
+#
+# Arguments:   None
+#
+# Returns:     Hostname of the tcl server.
+###############################################################################
+proc tclServer::getTclServerName {} \
+{
+    variable tclServerName
+
+    return  $tclServerName
+}
+
+
+###############################################################################
+# Procedure:   tclServer::setTclServerName
+#
+# Description: Sets the hostname of tcl server.
+#
+# Arguments:   hostname - the new hostname
+#
+# Returns:     None
+###############################################################################
+proc tclServer::setTclServerName { hostname } \
+{
+    variable tclServerName
+
+    set tclServerName $hostname
+
+    return
+}
+
+
+###############################################################################
+# Procedure: tclServer::disconnectTclServer
+#
+# Description: Disconnects from the TclServer socket
+#
+# Results: Returns the code from the clientClose call.
+###############################################################################
+proc tclServer::disconnectTclServer {} \
+{
+    global   ixTclSvrHandle ixErrorInfo
+
+    variable tclServerName
+    variable tclServerConnected
+
+    set retCode 0
+
+    if {[isUNIX]} {
+        # We only want to see this message on unix machines.  We do not want 
+        # to see it on windows, because it is meaningless.
+        logMsg "Disconnecting from Tcl Server ..."
+    }
+    if {[info exists ixTclSvrHandle]} {
+        set retCode [clientClose $ixTclSvrHandle]
+        catch {unset ixTclSvrHandle}
+    }
+    set tclServerConnected 0
+    set tclServerName      ""
+    set ixErrorInfo        ""
+
+    return $retCode
+}
+
+
+###############################################################################
+# Procedure: tclServer::read
+#
+# Description: Reads the buffer from the TclServer socket
+#
+# Results: 
+###############################################################################
+proc tclServer::read {socket} \
+{
+    variable buffer
+
+    set buffer ""
+    set length -1
+
+	if {[eof $socket] || [catch {gets $socket buffer}]} {
+		# end-of-file or abnormal connection drop
+        catch {close $socket}
+        debugMsg "Close $socket"
+        return -code error -errorinfo "Socket closed prematurely.."
+    } else {
+        debugMsg "buffer=$buffer"
+    }
+}
+
+
+###############################################################################
+# Procedure: tclServer::connectToTclServer
+#
+# Description: This procedure connects the remote tcl session to a
+#              TclServer/proxy.
+#
+# Side Effects: If the connection is successful, then define the remote 
+#               commands and functions that can now be accessed.
+#
+# Arguments:
+#    serverName: Hostname or IP address of the machine to connect with.
+#    ErrMsg: Pass by reference.  If there is an error connecting, this will contain the error message.
+#    clientPort: Optional.  The port number to use.
+#
+# Results: Returns 0 on success and 1 on failure
+###############################################################################
+proc tclServer::connectToTclServer { serverName ErrMsg {clientPort 4555} } \
+{
+    global halCommands halFuncs ixTclSvrHandle ixErrorInfo halRedefineCommands
+    variable tclServerConnected
+    variable tclServerName
+
+    upvar $ErrMsg errMsg
+    set errMsg ""
+
+    set retCode 0
+
+    set ixErrorInfo ""
+
+    logMsg "Connecting to Tcl Server $serverName ..."
+    if {[info exists ixTclSvrHandle]} {
+        catch { clientClose $ixTclSvrHandle }
+        catch { unset ixTclSvrHandle }
+    }
+
+    set clientSocket [clientOpen $serverName $clientPort]
+    set ixTclSvrHandle $clientSocket
+
+    if {$clientSocket == {}} {
+        set tclServerConnected 0
+        set errMsg "Error opening client socket."
+        set retCode 1
+    } else {
+        set tclServerConnected 1
+        set tclServerName      $serverName
+
+	    fconfigure $clientSocket -buffering line -translation crlf
+        fileevent  $clientSocket readable [list tclServer::read $clientSocket]
+
+        if [catch {clientSend $ixTclSvrHandle "package req IxTclHal"} result] {
+            errorMsg $result
+        }
+
+        remoteDefine $halCommands
+        remoteDefine $halFuncs
+
+        getConstantsValue $clientSocket
+
+        if { [isUNIX] } {
+            foreach {command} $halRedefineCommands {
+                redefineCommand $command
+            }
+        }
+    }
+
+    # Warn user if using different Ixia versions on client & server.
+    if {[isUNIX]} {
+        if {[isTclServerConnected]} {
+            set clientVersion $::env(IXIA_VERSION)
+            set clientVers [scan $clientVersion "%d.%d" clientMajor clientMinor]
+
+            set serverVers [scan [version cget -ixTclHALVersion] "%d.%d" serverMajor serverMinor]
+            set serverVersion [format "%d.%d" $serverMajor $serverMinor]
+
+            if {$clientVers != 2 || $serverMajor != $clientMajor || $serverMinor < $clientMinor} {
+                set retCode 1
+                set errMsg "WARNING: Tcl Server and Client are running incompatible Ixia Software Versions"
+                append errMsg "\n\tTcl Server: $serverVersion"
+                append errMsg "\n\tTcl Client: $clientVersion\n\n"
+                logMsg "$errMsg"
+                set ixErrorInfo $errMsg
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+# Procedure: tclServer::isTclServerConnected
+#
+# Description: Tells if the there is a connection to a tcl server
+#
+# Results: Returns the value of the tclServerConnected variable
+###############################################################################
+proc tclServer::isTclServerConnected {} \
+{
+    variable tclServerConnected
+    return $tclServerConnected
+}
+
+
+###############################################################################
+# Procedure: tclServer::setTclServer
+#
+# Description: Create a window that will ask for the location of the tcl
+#              server.  Only used on Unix and Linux platforms.
+#
+# Arguments:
+#    warningMsg - the text to place next to the warning sign
+###############################################################################
+proc tclServer::setTclServer {warningMsg} \
+{
+    variable tclServerName
+    variable tclServerConnected
+
+    # Return if not on unix or linux
+    if {[isUNIX] == 0} {
+        # Always let windows think it is connected
+        set tclServerConnected 1
+        return
+    }
+
+    set tclServerDlg .tclServer
+
+    # If it already exists, destroy it.
+    if {[winfo exists $tclServerDlg]} {
+        catch {destroy $tclServerDlg}
+    }
+
+    # Create the new top level window and make it transient to the top
+    toplevel $tclServerDlg -class Dialog
+    wm withdraw $tclServerDlg
+    wm title $tclServerDlg "Tcl Server"
+
+    # Create a frame and the entry for the tcl server value
+    set serverFrame [frame $tclServerDlg.frame]
+    set serverLabel [label $serverFrame.label -text "Hostname: " -width 10]
+    set serverEntry [entry $serverFrame.entry -width 20]
+
+    # Bind the enter key to the window. It will be the same as clicking connect
+    bind $tclServerDlg <Key-Return> "[namespace current]::connectButton \
+            $tclServerDlg $serverEntry \"$warningMsg\""
+
+    # Create a warning note about the consequences of not being connected
+    set serverWarning [label $serverFrame.warning -text "WARNING: " \
+            -fg red]
+    set serverMessage [label $serverFrame.message -text $warningMsg]
+
+    # Create the connect and cancel buttons
+    set connectButton [button $tclServerDlg.connect -text "Connect" -width 6 \
+            -command "[namespace current]::connectButton $tclServerDlg \
+            $serverEntry \"$warningMsg\""]
+    set cancelButton [button $tclServerDlg.cancel -text "Cancel" -width 6 \
+            -command "[namespace current]::cancelButton $tclServerDlg \
+            $serverEntry"]
+
+    # Grid the entry and warning into the frame
+    grid $serverLabel   -row 0 -column 0 -padx 5  -pady 5 -sticky wens
+    grid $serverEntry   -row 0 -column 1 -padx 10 -pady 5 -sticky wens
+    grid $serverWarning -row 1 -column 0 -pady 10 -sticky ens
+    grid $serverMessage -row 1 -column 1 -pady 10 -sticky wns
+
+    # Grid the frame and the buttons into the dialog
+    grid $serverFrame   -row 0 -column 0 -padx 5 -pady 5 -sticky wens \
+            -columnspan 2
+    grid $connectButton -row 1 -column 0 -padx 5 -pady 5 -sticky ens
+    grid $cancelButton  -row 1 -column 1 -padx 5 -pady 5 -sticky wns
+
+    # Make the first row and the second column expandable
+    grid rowconfigure $tclServerDlg 0 -weight 1
+
+    # Set the entry with the currently saved value
+    if {[string compare $tclServerName ""] != 0} {
+        $serverEntry insert 0 $tclServerName
+    } else {
+        $serverEntry insert 0 [testConfig::getTestConfItem serverName]
+    }
+
+    # Bring up the dialog and set its size
+    wm deiconify $tclServerDlg
+    wm minsize $tclServerDlg 325 150
+    wm resizable $tclServerDlg 0 0
+
+    # Make the user do something in this window before continuing
+    focus $tclServerDlg
+    grab $tclServerDlg
+    tkwait window $tclServerDlg
+
+    return
+}
+
+
+###############################################################################
+# Procedure: tclServer:connectButton
+#
+# Description: Called when the connect button on the set tcl server window is
+#              pressed.  This will 
+#              1. If already connected, save any values that need to carry
+#                 across to the new connection and then disconnect.
+#              2. Connect to the newly chosen tcl server.
+#              3. Restore any saved settings from step 1.
+#
+# Arguments:
+#    tclServerDlg - The widget name for the set tcl server dialog
+#    serverEntry - The entry widget that contains the tcl server data
+#    warningMsg - If failure to connect, the message to pass to the dialog
+###############################################################################
+proc tclServer::connectButton { tclServerDlg serverEntry warningMsg } \
+{
+    variable tclServerName
+    variable tclServerConnected
+
+    # If connected, we first need to disconnect
+    set continueFlag 1
+
+    if {$tclServerConnected} {
+        if { [llength [smChassisUtils::getHostName]] > 0 } {
+            set    message "Reconnecting to Tcl Server will cause reconnecting"
+            append message "\nto all configured chassis.\n\nDo you want to continue?"
+            set answer [tk_messageBox -parent $tclServerDlg -title "Warning" -type yesno \
+                    -icon warning -message $message]
+
+            if { $answer == "no" } {
+                catch {destroy $tclServerDlg}
+                set continueFlag 0
+            }
+        }
+
+        if { $continueFlag == 1 } {
+            tclServer::disconnectTclServer
+        }
+    }
+
+    if { $continueFlag == 1 } {
+
+        set tclServerName [$serverEntry get]
+
+        testConfig::setTestConfItem serverName $tclServerName
+
+        # Connect to this server
+        $tclServerDlg configure -cursor watch
+        set retcode [tclServer::connectToTclServer $tclServerName errMsg]
+
+        if {$retcode == 0} {
+            setConnectChassisFlag "continue" 
+            smGlobalChassis::reconnect
+    	    $tclServerDlg configure -cursor arrow
+            catch {destroy $tclServerDlg}
+        } else {
+            $tclServerDlg configure -cursor arrow
+            # Could not connect to tcl server, ask them again
+            set msg "Could not connect to Tcl Server on $tclServerName.\n"
+            append msg $errMsg
+            tk_messageBox -parent $tclServerDlg -title "Tcl Server" -type ok \
+                    -icon error -message $msg
+            tclServer::setTclServer $warningMsg
+
+            set tclServerName ""
+        }
+    }
+
+    return
+}
+
+
+###############################################################################
+# Procedure: tclServer:cancelButton
+#
+# Description: Called when the cancel button on the set tcl server window is
+#              pressed.  This will 
+#
+# Arguments:
+#    tclServerDlg - The widget name for the set tcl server dialog
+#    serverEntry - The entry widget that contains the tcl server data
+###############################################################################
+proc tclServer::cancelButton { tclServerDlg serverEntry } \
+{
+    variable tclServerConnected
+
+    set tclServerName [$serverEntry get]
+
+    # Set the server name
+    testConfig::setTestConfItem serverName $tclServerName
+
+    if {[info exists tclServerConnected] == 0} {
+        set tclServerConnected 0
+    }
+
+    # Destroy the dialog
+    catch {destroy $tclServerDlg}
+
+    return
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/testCmdControl.tcl b/dep/tclclient/ixTcl1.0/Generic/testCmdControl.tcl
new file mode 100644
index 00000000..74ea02b8
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/testCmdControl.tcl
@@ -0,0 +1,538 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: testCmdControl.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	01-06-1999	HS	Genesis
+#
+# Description: This file contains the commands for all the tests. When a new test
+# is added, create a new proc for that test here.
+#
+##################################################################################
+
+
+########################################################################################
+# Procedure: parseCmd
+#
+# Description: This command parses the test parameters and calls the appropriate functions.
+#
+########################################################################################
+proc parseCmd {testName {method_name ""} {Args {}}} \
+{
+    upvar $Args args
+
+    set retCode 0
+
+    switch $method_name {
+        "config" -
+        "configure" {
+            configureOptions $testName args
+        }
+        "cget" {
+            set retCode [cgetOptions $testName args]
+        }
+        "exists" {
+            set retCode [existsOptions $testName args]
+        }
+        "start" {
+            set retCode [startOptions $testName args]
+        }
+        "registerResultVars" {
+            set retCode [registerResultVarsOptions $testName args]
+        }
+        "getType" {
+            set retCode [getParmProperty $testName type $args]
+        }
+        "getValidRange" {
+            set retCode [getParmProperty $testName validRange $args]
+        }
+        "getValidValues" {
+            set retCode [getParmProperty $testName validValues $args]
+        }
+        "getValidateProc" {
+            set retCode [getParmProperty $testName validateProc $args]
+        }
+        "getHelp" {
+            set retCode [getParmProperty $testName help $args]
+        }
+        "get" -
+        "set" {
+	        set mname [format "%s::_%s" $testName $method_name]
+	        set retCode [uplevel $mname $args]
+        }
+        default {
+	        set mname [format "%s::%s" $testName $method_name]
+
+            if [catch {uplevel $mname $args} retCode] {
+                set testMethods [format "%s%s" $testName Methods]
+                global $testMethods
+
+                set methods [array names ${testMethods}]
+                set methods [lsort [lappend methods exists]]
+
+                error "$testName methods : { $methods }"
+                return
+            }
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: configureOptions
+#
+# Description: This command is used to configure the parameters.
+#
+########################################################################################
+proc configureOptions {testName arguments} \
+{
+    upvar $arguments args
+
+    set testMethods [format "%s%s" $testName Methods]
+    set testParms   [format "%s%s" $testName Parms]
+    set testConfigVals   [format "%s%s" $testName ConfigVals]
+
+	global $testMethods $testParms $testConfigVals
+
+	set argLen [llength $args]
+	set type $testName
+
+	# if no option name was passed then display all options available for config
+	if {$argLen == 0} {
+		set errMsg "Usage: $type config "
+		foreach op [set ${testMethods}(config)] {
+			set errMsg  [format "%s\n       -$op  <value>" $errMsg]
+		}
+        error $errMsg
+		return
+	}
+
+	if {[string index [lindex $args 0] 0] != "-"} {
+		set errMsg "Usage: $type config "
+		foreach op [set ${testMethods}(config)] {
+			set errMsg  [format "%s\n       -$op  <value>" $errMsg]
+		}
+        error $errMsg
+		return
+	}
+	set opt [lindex [string trimleft [lindex $args 0] "-"] 0]
+
+	# if a wrong option is passed then display all options available for config
+	if {[lsearch [set ${testMethods}(config)] $opt] == -1} {
+		set errMsg "Usage: $type config "
+		foreach op [set [set testMethods](config)] {
+			set errMsg  [format "%s\n       -$op  <value>" $errMsg]
+		}
+        error $errMsg
+		return
+	}
+
+    if {[info exists ${testConfigVals}]} {
+	    # if an option is passed but no value then display the values expected for this parm
+	    if {$argLen == 1} {
+		    set errMsg "Usage: $type config -$opt "
+		    set valList [array names ${testConfigVals}]
+		    if {[lsearch $valList $opt] != -1} {
+			    foreach val [set ${testConfigVals}($opt)] {
+				    set errMsg  [format "%s<$val> " $errMsg]
+		        }
+		    }
+            set errMsg [format "%s\n" $errMsg]
+            error $errMsg 
+	    }
+
+	    # at this point, it is confirmed that a valid option name with a value has
+	    # been passed. Validate the value passed now. Do this only for parms who are
+	    # expecting only one value, not multiple. Also, check only if this parm is
+	    # expecting a certain type or range of values.
+	    if {$argLen == 2} {
+		    set valList [array names ${testConfigVals}]
+		    if {[lsearch $valList $opt] != -1} {
+
+			    # if the values are required options then it is a list of more
+			    # than one element. If values are "one of" type, like a|b|c,
+			    # then this is a list of 1 element. First search for the
+			    # expected value in the list
+			    if {[lsearch [set ${testConfigVals}($opt)] [lindex $args 1]] == -1} {
+				    # now it may be an a|b|c type value
+				    if {[regexp [set ${testConfigVals}($opt)] [lindex $args 1]] == 0} {
+					    set errMsg "Invalid value. Usage: $type config -$opt "
+					    foreach val [set ${testConfigVals}($opt)] {
+						    set errMsg [format "%s<$val> " $errMsg]
+					    }
+                        set errMsg [format "%s\n" $errMsg]
+					    error $errMsg
+				    }
+			    }
+		    }
+	    }
+    }
+
+	# if more than one parm is passed then convert it to a list because it is
+	# one of the parms that is expecting multiple values. But first check if the
+	# right number of values are passed.
+	if {$argLen > 2} {
+        if {[info exists ${testConfigVals}]} {
+		    if {[expr $argLen - 1] != [llength [set [set testConfigVals]($opt)]]} {
+			    set errMsg "Invalid number of arguments. Usage: $type config -$opt "
+                foreach val [set ${testConfigVals}($opt)] {
+				    set errMsg [format "%s<$val> " $errMsg]
+                }
+                set errMsg [format "%s\n" $errMsg]
+			    error $errMsg
+		    }
+        }
+		set argList {}
+		for {set i 1} {$i < $argLen} {incr i} {
+			set argList [lappend argList [lindex $args $i]]
+		}
+		set ${testParms}($opt) $argList
+	} else {
+		set ${testParms}($opt) [lindex $args 1]
+	}
+
+	return 0
+}
+
+########################################################################################
+# Procedure: cgetOptions
+#
+# Description: This command is used to get the configured parameters.
+#
+########################################################################################
+proc cgetOptions {testName arguments} \
+{
+    upvar $arguments args
+
+    set testMethods [format "%s%s" $testName "Methods"]
+    set testParms   [format "%s%s" $testName "Parms"]
+
+	global $testMethods $testParms
+
+	set type $testName
+	if {[llength $args] == 0} {
+		set errMsg "Usage: $type cget "
+		foreach op [set ${testMethods}(cget)] {
+			set errMsg  [format "%s\n       -$op" $errMsg]
+		}
+        error $errMsg
+		return
+	}
+
+	if {[string index [lindex $args 0] 0] != "-"} {
+		set errMsg  "Usage: $type cget "
+		foreach op [set ${testMethods}(cget)] {
+			set errMsg  [format "%s\n       -$op" $errMsg]
+		}
+        error $errMsg
+		return
+	}
+	set opt [lindex [string trimleft [lindex $args 0] "-"] 0]
+
+	if {[lsearch [set ${testMethods}(cget)] $opt] == -1} {
+		set errMsg   "Usage: $type cget "
+		foreach op [set ${testMethods}(cget)] {
+			set errMsg  [format "%s\n       -$op" $errMsg]
+		}
+        error $errMsg
+		return
+	}
+
+	return [set ${testParms}($opt)]
+}
+
+########################################################################################
+# Procedure: getParmProperty
+#
+# Description: This command is used to get the configured parameters.
+#
+########################################################################################
+proc getParmProperty {testName property parmName} \
+{
+    set retCode 0
+
+    switch $property {
+        type         {set propertyArray [format %sType         $testName]}
+        validRange   {set propertyArray [format %sValidRange   $testName]}
+        validValues  {set propertyArray [format %sConfigVals   $testName]}
+        validateProc {set propertyArray [format %sValidateProc $testName]}
+        help         {set propertyArray [format %sHelp         $testName]}
+        default {
+            error "Parameter property \'$property\' does not exist."
+            set retCode 1
+        }
+    }
+
+    global $propertyArray
+    regsub {^-} $parmName "" parmName
+
+    if {($retCode == 0) && [info exists ${propertyArray}($parmName)]} {
+        set retCode [set ${propertyArray}($parmName)]
+    } else {
+        set retCode ""
+    }
+
+    return $retCode
+}
+
+########################################################################################
+# Procedure: startOptions
+#
+# Description: This command starts the specified test. The frames on desired ports should
+# have been configured using the "port" and "streams" commands.  For this test,
+# there is only one stream per port with a specific frame size and rate.
+#
+########################################################################################
+proc startOptions {testName arguments} \
+{
+    upvar $arguments args
+
+    set testMethods [format "%s%s" $testName "Methods"]
+
+	global $testMethods
+
+	set type    $testName
+	set methods [lsort [eval set ${testMethods}(start)]]
+
+    # this is some special stuff to preserve backwards compatibility...
+	switch $testName {
+        tput {
+            if {[llength $args] == 0} {
+		        lappend args -rfc2544
+	        }
+            # Protect the depricated test command
+            if { $args == "-Rfc2544" } {
+                set args    "-rfc2544"
+            }
+        }
+        bcast {
+            if {[llength $args] == 0} {
+		        lappend args -rate
+	        }
+        }
+        tputjitter {
+            if {[llength $args] == 0} {
+		        lappend args -linearIteration
+	        }
+        }
+        imix {
+            if {[llength $args] == 0} {
+		        lappend args -linearIteration
+	        }
+        }
+        tputvlan {
+            if {[llength $args] == 0} {
+		        lappend args -one2many
+	        }
+        }
+        cableModem {
+            # since the percentMaxRate vars have been obseleted, do this for backwards compatiblity
+            # w/the new vars
+            if {[cableModem cget -clientPercentMaxRate] > 0} {
+                cableModem config -rateSelect   percentMaxRate
+                cableModem config -clientRate   [cableModem cget -clientPercentMaxRate]
+            }  
+
+            if {[cableModem cget -serverPercentMaxRate] > 0} {
+                cableModem config -rateSelect   percentMaxRate
+                cableModem config -serverRate   [cableModem cget -serverPercentMaxRate]
+            }
+            
+            # Protect the depricated test
+            if { $args == "-LLCFiltering" } {
+                set args    "-usb02LLCFiltering"
+            }
+            
+            if { $args == "-LLCTransfer" } {
+                set args    "-usb02LLCTransfer"
+            }
+            if { $args == "-multiAddrIPFiltering" } {
+                set args    "-usb02MultiAddrIPFiltering"
+            }
+            if { $args == "-multiAddrIPTransfer" } {
+                set args    "-usb02MultiAddrIPTransfer"
+            }
+            if { $args == "-usb02MultiAddrIPFiltering" } {
+                set args    "-usb02MultiAddrFiltering"
+            }
+            if { $args == "-usb02MultiAddrIPTransfer" } {
+                set args    "-usb02MultiAddrTransfer"
+            }                 
+        }
+    }
+
+    switch [llength $args] {
+        0 {
+            if {[llength $methods] > 0} {
+		        puts "Usage: $type start "
+		        foreach op $methods {
+			        puts "       -$op"
+		        }
+		        return $::TCL_ERROR
+            }
+            set opt "start"
+        }
+        1 {
+	        if {[string index [lindex $args 0] 0] != "-"} {
+		        puts "Usage: $type start "
+		        foreach op $methods {
+			        puts "       -$op"
+		        }
+		        return $::TCL_ERROR
+	        }
+	        set opt [string trimleft [lindex $args 0] "-"]
+
+	        if {[lsearch $methods $opt] == -1} {
+		        puts "Invalid ${testName} command: $methods"
+		        return $::TCL_ERROR
+	        }
+        }
+        default {
+		    puts "Usage: $type start "
+		    foreach op ${testName} {
+			    puts "       -$op  <value>"
+		    }
+		    return $::TCL_ERROR
+        }
+    }
+
+    set mname [format "%s::%s" $testName $opt]
+	set retCode [uplevel $mname]
+	
+	return $retCode
+}
+
+
+########################################################################################
+# Procedure: registerResultVarsOptions
+#
+# Description: This command registers the results variables.
+#
+########################################################################################
+proc registerResultVarsOptions {testName arguments} \
+{
+    upvar $arguments args
+
+    set testMethods [format "%s%s" $testName "Methods"]
+
+	global $testMethods
+
+	set type    $testName
+	set methods [lsort [eval set ${testMethods}(registerResultVars)]]
+
+    switch [llength $args] {
+        0 {
+            if {[llength $methods] > 0} {
+		        puts "Usage: $type registerResultVars "
+		        foreach op $methods {
+			        puts "       -$op"
+		        }
+		        return
+            }
+            set opt "registerResultVars"
+        }
+        1 {
+	        if {[string index [lindex $args 0] 0] != "-"} {
+		        puts "Usage: $type registerResultVars "
+		        foreach op $methods {
+			        puts "       -$op"
+		        }
+		        return
+	        }
+	        set opt [string trimleft [lindex $args 0] "-"]
+
+	        if {[lsearch $methods $opt] == -1} {
+		        puts "Invalid ${testName} command: $methods"
+		        return
+	        }
+            set opt [format "registerResultVars_%s" $opt]
+        }
+        default {
+		    puts "Usage: $type registerResultVars "
+		    foreach op ${testName} {
+			    puts "       -$op  <value>"
+		    }
+		    return
+        }
+    }
+
+    set mname [format "%s::%s" $testName $opt]
+	set ret [uplevel $mname]
+
+	return $ret
+}
+
+
+
+########################################################################################
+# Procedure: existsOptions
+#
+# Description: This command is used check if the options exists.
+#
+# If exists, return 
+#
+########################################################################################
+proc existsOptions {testName arguments} \
+{
+    upvar $arguments args
+
+    set retCode 0
+
+    set testMethods [format "%s%s" $testName "Methods"]
+    set testParms   [format "%s%s" $testName "Parms"]
+
+	global $testMethods $testParms
+
+	set type $testName
+	if {[llength $args] == 0} {
+        if [info exists ${testMethods}] {
+            set retCode 1
+        }
+	} else {
+	    set opt [lindex [string trimleft [lindex $args 0] "-"] 0]
+
+	    if {[lsearch [set ${testMethods}(cget)] $opt] != -1} {
+            set retCode 1
+	    }
+    }
+
+	return $retCode
+}
+
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/trafficMix.tcl b/dep/tclclient/ixTcl1.0/Generic/trafficMix.tcl
new file mode 100644
index 00000000..302727f4
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/trafficMix.tcl
@@ -0,0 +1,329 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: trafficMix.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	09-15-1999	DS
+#
+# Description: This file contains special procs to set up multiple
+#              streams w/one aggregate rate
+#
+########################################################################
+
+
+########################################################################
+# Procedure: calcTrafficMix
+#
+# This command calculates the relative percents (number of frames) for
+# a number of streams based on one aggregate percent utilization.
+#
+# Arguments(s):
+#   StreamArray         - array indexed by streamID, that
+#                         contains the framesize & percentFrameRate
+#                         for that stream
+#   BurstArray          - calc'd burst size for each stream
+#   percentUtilization  - desired aggregate percent utilization
+#
+# Return:
+#
+########################################################################
+proc calcTrafficMix {StreamArray BurstArray {percentUtilization 100}} \
+{
+    set retCode 0
+
+    upvar $StreamArray  streamArray
+    upvar $BurstArray burstArray
+
+    set maxFrameSize    0
+    foreach streamID [array names streamArray] {
+        scan $streamArray($streamID) "%d %d" fs percent
+        lappend frameSizeList   $fs
+        if {$fs > $maxFrameSize} {
+            set maxFrameSize    $fs
+            set maxFsIndex      $streamID
+        }
+    }
+
+    foreach streamID [array names streamArray] {
+        scan $streamArray($streamID) "%d %d" fs percent
+
+        set burstArray($streamID)  [expr ([lindex $streamArray($maxFsIndex) 0]/double([lindex $streamArray($maxFsIndex) end]))/$fs*double($percent)]
+    }
+
+    debugMsg "calcTrafficMix: burstArray:[array get burstArray]"
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: calcAggregateDataRate
+#
+# This command calculates the ifgs for an aggregrate data rate, assuming
+# there is one packet per stream/one packet per fs.
+#
+# Arguments(s):
+#
+#   frameSizeList   - list of framesizes to use in aggregrate calculation
+#   bitRate         - desired aggregrate bit rate
+#   speed           - in mbps, ie., 100, 10 or 1000 mbps
+#
+# Return:
+#   ifg, in nanoseconds OR 0 if bit rate is greater than achievable wire
+#   speed or error calculating
+#
+########################################################################
+proc calcAggregateDataRate {frameSizeList bitRate speed {preambleSize 8}} \
+{
+    return [calcAggregateBitRate $frameSizeList $bitRate $speed false false $preambleSize]
+}
+
+
+########################################################################
+# Procedure: calcAggregateFrameRate
+#
+# This command calculates the ifgs for an aggregrate frame rate, assuming
+# there is one packet per stream/one packet per fs.
+#
+# Arguments(s):
+#
+#   frameSizeList   - list of framesizes to use in aggregrate calculation
+#   bitRate         - desired aggregrate bit rate
+#   speed           - in mbps, ie., 100, 10 or 1000 mbps
+#
+# Return:
+#   ifg, in nanoseconds OR 0 if bit rate is greater than achievable wire
+#   speed or error calculating
+#
+########################################################################
+proc calcAggregateFrameRate {frameSizeList bitRate speed {preambleSize 8}} \
+{
+    return [calcAggregateBitRate $frameSizeList $bitRate $speed true false $preambleSize]
+}
+
+
+########################################################################
+# Procedure: calcAggregateTotalRate
+#
+# This command calculates the ifgs for an aggregrate total bit rate, assuming
+# there is one packet per stream/one packet per fs.
+#
+# Arguments(s):
+#
+#   frameSizeList   - list of framesizes to use in aggregrate calculation
+#   bitRate         - desired aggregrate bit rate
+#   speed           - in mbps, ie., 100, 10 or 1000 mbps
+#
+# Return:
+#   ifg, in nanoseconds OR 0 if bit rate is greater than achievable wire
+#   speed or error calculating
+#
+########################################################################
+proc calcAggregateTotalRate {frameSizeList bitRate speed {preambleSize 8}} \
+{
+    return [calcAggregateBitRate $frameSizeList $bitRate $speed true true $preambleSize]
+}
+
+
+########################################################################
+# Procedure: calcAggregateBitRate
+#
+# This command calculates the ifgs for an aggregrate bit rate, assuming
+# there is one packet per stream/one packet per fs.
+#
+# Arguments(s):
+#
+#   frameSizeList   - list of framesizes to use in aggregrate calculation
+#   bitRate         - desired aggregrate bit rate
+#   speed           - in mbps, ie., 100, 10 or 1000 mbps
+#
+# Return:
+#   ifg, in nanoseconds OR 0 if bit rate is greater than achievable wire
+#   speed or error calculating
+#
+########################################################################
+proc calcAggregateBitRate {frameSizeList bitRate speed {includeCRC true} {includePreamble true} {preambleSize 8}} \
+{
+    set nBits   [calcTotalBits $frameSizeList $includeCRC $includePreamble $preambleSize]
+    if [catch {mpexpr double([llength $frameSizeList] * $bitRate)/$nBits} pps] {
+        logMsg "calcAggregateBitRate: Error converting bit rate to PPS"
+        return 0
+    }
+    return [calcAggregatePPS $frameSizeList $pps $speed $preambleSize]
+}
+
+
+########################################################################
+# Procedure: calcAggregatePPS
+#
+# This command calculates the ifgs for an aggregrate pps rate, assuming
+# there is one packet per stream/one packet per fs.
+#
+# Arguments(s):
+#
+#   frameSizeList   - list of framesizes to use in aggregrate calculation
+#   pps             - desired aggregrate pps rate
+#   speed           - in mbps, ie., 100, 10 or 1000 mbps
+#
+# Return:
+#   ifg, in nanoseconds OR 0 if pps rate is greater than achievable wire
+#   speed or error calculating
+#
+########################################################################
+proc calcAggregatePPS {frameSizeList pps speed {preambleSize 8}} \
+{
+    set ifgNS 0
+
+    set nBits       [calcTotalBits $frameSizeList true true $preambleSize]
+    set speed       [mpexpr $speed*1000000.]
+
+    if [catch {mpexpr double($nBits)/$speed} dataTime] {
+        logMsg "calcAggregratePPS: Error calculating data time."
+        return $ifgNS
+    }
+
+    if [catch {mpexpr ((1./$pps) - ($dataTime/[llength $frameSizeList]))/0.000000001} ifgNS] {
+        logMsg "calcAggregratePPS: Error calculating ifg."
+        return $ifgNS
+    }
+
+    if {$ifgNS < 0} {
+        set ifgNS   0
+    }
+
+    return [mpexpr round($ifgNS)]
+}
+
+
+########################################################################
+# Procedure: calcTotalBits
+#
+# This command calculates the total bits, including preamble, of the
+# frames in the frameSizeList
+#
+# Arguments(s):
+#
+#   frameSizeList   - list of framesizes to use in aggregrate calculation
+#
+# Return:
+#   0 if pps rate is greater than achievable wire speed.
+#
+########################################################################
+proc calcTotalBits {frameSizeList {includeCRC true} {includePreamble true} {preambleSize 8}} \
+{
+    set nBits   0
+
+    if {$includePreamble != "true"} {
+        set preambleSize    0
+    }
+
+    set nPackets    [llength $frameSizeList]
+    if {$nPackets > 0} {
+        set totalFS 0
+        foreach fs $frameSizeList {
+            if {$includeCRC == "true"} {
+                incr totalFS    $fs
+            } else {
+                incr totalFS    [expr $fs - 4]
+            }
+        }
+        set nBits       [mpexpr ($totalFS + ($preambleSize * $nPackets)) * 8]
+    }
+
+    return $nBits
+}
+
+
+
+########################################################################
+# Procedure: calcTotalStreamTime
+#
+# This command calculates the total time the aggregate streams will take
+# if using the giving duration & percentUtilization & returns an array,
+# Loopcount, that contains a loopcount number for each transmit port.
+#
+# Arguments(s):
+#   TxRxArray           - array (ie., one2oneArray) or list of ports to
+#                         transmit on
+#   StreamArray         - array indexed by streamID, that
+#                         contains the framesize & percentFrameRate
+#                         for that stream
+#   BurstArray          - calc'd burst size for each stream
+#   Loopcount           - calc'd loopcount for each tx port
+#   duration            - tx time
+#   percentUtilization  - desired aggregate percent utilization
+#
+# Return:
+#
+########################################################################
+proc calcTotalStreamTime {TxRxArray StreamArray BurstArray Loopcount duration {percentUtilization 100} {numRxAddresses 1} {preambleSize 8}} \
+{
+    set retCode 0
+
+    upvar $TxRxArray    txRxArray
+    upvar $StreamArray  streamArray
+    upvar $BurstArray   burstArray
+    upvar $Loopcount    loopcount
+
+    set txList  [getTxPorts txRxArray]
+
+    foreach txMap $txList {
+        scan $txMap "%d %d %d" tx_c tx_l tx_p
+
+        if [port get $tx_c $tx_l $tx_p] {
+            logMsg "calcTotalStreamTime: Error getting port [getPortId $tx_c $tx_l $tx_p]"
+            set retCode 1
+            continue
+        }
+        set speed   [port cget -speed]
+
+        set totalTime   0
+        foreach streamID [array names streamArray] {
+            scan $streamArray($streamID) "%d %d" fs percent
+
+            set rate        [mpexpr ($percentUtilization * [calculateMaxRate $tx_c $tx_l $tx_p $fs $preambleSize])/100.]
+            set gapInBytes  [calculateGapBytes $tx_c $tx_l $tx_p $rate $fs]
+
+            set currTime    [mpexpr ((($fs + $preambleSize + $gapInBytes) * 8.) * $burstArray($streamID) * $numRxAddresses)/($speed*1000000.)]
+            set totalTime   [mpexpr $totalTime + $currTime]
+        }
+        set loopcount($tx_c,$tx_l,$tx_p)    [mpexpr round($duration / $totalTime)]
+        debugMsg "calcTotalStreamTime: totalTime:$totalTime, loopcount:$loopcount($tx_c,$tx_l,$tx_p)"
+    }
+
+    return $retCode
+}
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/utilWrappers.tcl b/dep/tclclient/ixTcl1.0/Generic/utilWrappers.tcl
new file mode 100644
index 00000000..b03199a9
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/utilWrappers.tcl
@@ -0,0 +1,357 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: utilWrappers.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	06-18-2001	HSH	Genesis
+#
+# Description: Wrappers for utility commands from IxTclHal
+#
+##################################################################################
+
+########################################################################################
+# Procedure: ixIsBgpInstalled
+#
+# Description: This command checks if Bgp client installed
+#
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsBgpInstalled {} \
+{
+	return [ixUtils isBgpInstalled]
+}
+
+
+########################################################################################
+# Procedure: ixIsIsisInstalled
+#
+# Description: This command checks if Isis client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsIsisInstalled {} \
+{
+	return [ixUtils isIsisInstalled]
+}
+
+########################################################################################
+# Procedure: ixIsRsvpInstalled
+#
+# Description: This command checks if Rsvp client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsRsvpInstalled {} \
+{
+	return [ixUtils isRsvpInstalled]
+}
+
+
+########################################################################################
+# Procedure: ixIsOspfInstalled
+#
+# Description: This command checks if Ospf client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsOspfInstalled {} \
+{
+	return [ixUtils isOspfInstalled]
+}
+
+
+########################################################################################
+# Procedure: ixIsRipInstalled
+#
+# Description: This command checks if Rip client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsRipInstalled {} \
+{
+	return [ixUtils isRipInstalled]
+}
+
+########################################################################################
+# Procedure: ixIsArpInstalled
+#
+# Description: This command checks if Arp client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsArpInstalled {} \
+{
+	return [ixUtils isArpInstalled]
+}
+
+########################################################################################
+# Procedure: ixIsIgmpInstalled
+#
+# Description: This command checks if Igmp client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsIgmpInstalled {} \
+{
+	return [ixUtils isIgmpInstalled]
+}
+
+
+########################################################################################
+# Procedure: ixIsVpnL2Installed
+#
+# Description: This command checks if VpnL2 client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsVpnL2Installed {} \
+{
+	return [ixUtils isVpnL2Installed]
+}
+
+
+########################################################################################
+# Procedure: ixIsVpnL3Installed
+#
+# Description: This command checks if VpnL3 client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsVpnL3Installed {} \
+{
+	return [ixUtils isVpnL3Installed]
+}
+
+
+########################################################################################
+# Procedure: ixIsMldInstalled
+#
+# Description: This command checks if MLD client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsMldInstalled {} \
+{
+	return [ixUtils isMldInstalled]
+}
+
+
+########################################################################################
+# Procedure: ixIsOspfV3Installed
+#
+# Description: This command checks if OSPF V3 client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsOspfV3Installed {} \
+{
+	return [ixUtils isOspfV3Installed]
+}
+
+
+########################################################################################
+# Procedure: ixIsPimsmInstalled
+#
+# Description: This command checks if PIM-SM client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsPimsmInstalled {} \
+{
+	return [ixUtils isPimsmInstalled]
+}
+
+########################################################################################
+# Procedure: ixGetLineUtilization
+#
+# Description: This command returns the total port rate.
+#
+# Input:
+#   rateType - i.e. typePercentMaxRate or typeFpsRate
+#
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixGetLineUtilization {chassis card port {rateType typePercentMaxRate}} \
+{
+	return [ixUtils getLineUtilization $chassis $card $port $rateType]
+}
+
+########################################################################################
+# Procedure: ixIsLdpInstalled
+#
+# Description: This command checks if LDP client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsLdpInstalled {} \
+{
+	return [ixUtils isLdpInstalled]
+}
+
+########################################################################################
+# Procedure: ixIsRipngInstalled
+#
+# Description: This command checks if Ripng client installed
+# Returned value : 
+#
+#               TRUE  : If it is installed.
+#				FALSE : If it is NOT installed.
+########################################################################################
+proc ixIsRipngInstalled {} \
+{
+	return [ixUtils isRipngInstalled]
+}
+
+
+########################################################################################
+# Procedure: calculateMaxRate
+#
+# This proc calculates the max rate in packets per second for this interface
+#
+# Arguments(s):
+#   chassis 
+#   card
+#   port
+#   framesize
+#   preambleSize, default == 8   
+#
+# Returned value : 
+#   returns the max rate in PPS
+#
+########################################################################################
+proc calculateMaxRate {chassis card port {framesize 64} {preambleOrAtmEncap 8} } \
+{
+	return [ixUtils calculateMaxRate $chassis $card $port $framesize $preambleOrAtmEncap ]
+}
+
+
+########################################################################################
+# Procedure: calculateGapBytes
+#
+# This proc calculates the number of bytes that fit in between each packet for this rate
+#
+# Arguments(s):
+#   chassis 
+#   card
+#   port
+#   framerate
+#   framesize, default = 64
+#   preambleSize, default == 8   
+#
+# Returned value : 
+#   returns the number of bytes that fit in a gap space of a certain rate
+#
+########################################################################################
+proc calculateGapBytes {chassis card port framerate {framesize 64} {preambleSize 8}} \
+{
+	return [ixUtils calculateGapBytes $chassis $card $port $framerate $framesize $preambleSize]
+}
+
+
+########################################################################################
+# Procedure: calculateFPS
+#
+# This proc calculates the framerate in frames per second given the percent line rate
+#
+# Arguments(s):
+#   chassis 
+#   card
+#   port
+#   percentLineRate = 100
+#   framesize, default = 64
+#   preambleSize, default == 8   
+#
+# Returned value : 
+#   returns framerate, in PPS
+#
+########################################################################################
+proc calculateFPS {chassis card port {percentLineRate 100} {framesize 64} {preambleOrAtmEncap 8} } \
+{
+	return [ixUtils calculateFPS $chassis $card $port $percentLineRate $framesize $preambleOrAtmEncap]
+}
+
+
+########################################################################################
+# Procedure: calculatePercentMaxRate
+#
+# This proc calculates percent of line rate for this PPS value
+#
+# Arguments(s):
+#   chassis 
+#   card
+#   port
+#   framerate
+#   framesize, default = 64
+#   preambleSize, default == 8   
+#
+# Returned value : 
+#   returns the number of bytes that fit in a gap space of a certain rate
+#
+########################################################################################
+proc calculatePercentMaxRate {chassis card port framerate framesize {preambleOrAtmEncap 8}} \
+{
+	return [ixUtils calculatePercentMaxRate $chassis $card $port $framerate $framesize $preambleOrAtmEncap]
+}
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/utils.tcl b/dep/tclclient/ixTcl1.0/Generic/utils.tcl
new file mode 100644
index 00000000..1352ce04
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/utils.tcl
@@ -0,0 +1,2319 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: utils.tcl
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#       Revision Log:
+#       05-7-1998       Hardev Soor
+#
+# Description: This file contains common commands used by the tests
+#
+########################################################################
+
+
+########################################################################
+# Procedure: globalSetDefault
+#                       
+# Description: This command calls the setDefault for all the IxTclHal
+# commands as a form of initialization.
+#
+# Arguments(s):
+#
+########################################################################
+proc globalSetDefault {} \
+{
+
+	# This "if" condition was added to avoid unnecessary warning messages
+	# in the TCLEvent.log
+	if {[llength $::ixTclHal::nonDeprecatedCommands] == 0} {
+
+		set deprecatedCommands {usb licenseManagement}
+		regsub -all { } $deprecatedCommands "|" deprecatedCommands
+		regsub -all $deprecatedCommands $::halCommands {} ::ixTclHal::nonDeprecatedCommands
+	}
+
+	if [info exists ::ixTclHal::nonDeprecatedCommands] {
+        foreach halCmd $::ixTclHal::nonDeprecatedCommands {
+            if {[info commands $halCmd] != ""} {
+                catch {$halCmd setDefault}
+            }
+        }
+    }
+}
+
+
+########################################################################
+# Procedure: protocolStackSetDefault
+#
+# This command calls the setDefault for all the protocol stack related
+# commands as a form of initialization.
+#
+# Arguments(s):
+#
+########################################################################
+proc protocolStackSetDefault {} \
+{
+    global ixProtocolList
+
+    foreach protocol $ixProtocolList {
+        $protocol setDefault
+    }
+}
+
+########################################################################
+# Procedure: streamSet
+#
+# Description: This command sets the stream and prints an error message based on the 
+# return code
+#
+# Argument(s):
+#   chasId      - chassis id
+#   cardId      - card id
+#   portId      - port id
+#   streamId    - stream id
+#
+# Results :     0 : No error found, else error
+#                  
+########################################################################
+proc streamSet { chasId cardId portId streamId } \
+{
+    set level [expr [info level] - 2]
+    if {$level > 0} {
+        set levelStr    "[lindex [info level $level] 0]: "
+    } else {
+        set levelStr    "Error: "
+    }
+
+    set retCode [stream set $chasId $cardId $portId $streamId] 
+    switch $retCode \
+        $::ixTcl_outOfMemory {
+            logger message "$levelStr Error setting stream $streamId on port [getPortId $chasId $cardId $portId] - Port is out of memory"
+        }\
+        $::ixTcl_generalError   {               
+            logger message "$levelStr Error setting stream $streamId on port [getPortId $chasId $cardId $portId]"
+        }\
+        $::ixTcl_notAvailable {
+            logger message "$levelStr Port [getPortId $chasId $cardId $portId] is unavailable, check ownership."
+        }\
+        $::ixTcl_ok -\
+        default {
+        }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure:    validateFramesize
+#
+# Description:  Checks the framesize against 64-1518 valid EN type 
+#                   framesize and tests against protocol restrictions
+#
+# Arguments(s): framesize   - framesize to validate
+#
+# Returns:      TCL_OK or TCL_ERROR (if invalid)
+#
+########################################################################
+proc validateFramesize {framesize} \
+{
+    set retCode $::TCL_ERROR
+
+    switch [getProtocolName [protocol cget -name]] {
+        ipV6 {
+            set minimumFramesize [ipv6::getMinimumValidFramesize]
+            if {$framesize >= $minimumFramesize} {
+                set retCode $::TCL_OK
+            }
+        }
+        ip -
+        mac -
+        default {
+            return $::TCL_OK
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure:    validateFramesizeList
+#
+# Description:  Checks the framesize against 64-1518 valid EN type 
+#                   framesize and tests against protocol restrictions
+#
+# Arguments(s): framesizeList:  framesizes to validate
+#
+# Returns:      TCL_OK or TCL_ERROR (if invalid)
+#
+########################################################################
+proc validateFramesizeList {framesizeList} \
+{
+    set retCode $::TCL_ERROR
+
+    foreach framesize $framesizeList {
+        set retCode [validateFramesize $framesize]
+        if {$retCode == $::TCL_ERROR} {
+            break
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: validatePreamblesize
+#
+# This command checks the preamble size against 2-256 valid EN preamble size
+#
+# Arguments(s):
+#       preambleSize   - Preamblesize to validate
+#
+########################################################################
+proc validatePreamblesize {preambleSize} \
+{
+    set retCode 0
+
+    if {$preambleSize > 256 || $preambleSize < 2} {
+        logMsg "Invalid preamble size, must be between 2 & 256"
+        set retCode 1
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getLearnProc
+#
+# This command determines which learn proc to use
+#
+# Arguments(s):
+#   portArray       - port map, ie. one2oneArray, one2manyArray, etc
+#
+########################################################################
+proc getLearnProc {{portArray ""}} \
+{
+    set learnproc       send_learn_frames
+
+    if {[learn cget -type] == "default"} {
+        learn config -type      [getProtocolName [protocol cget -name]]
+    }
+       
+    switch [learn cget -type]  {
+        default -
+        mac     {
+                set learnproc   send_learn_frames
+        }
+        ip      {
+                set learnproc   send_arp_frames
+        }
+        ipx     {
+                set learnproc   send_ripx_frames
+        }
+        ipV6    {
+                set learnproc   send_neighborDiscovery_frames
+        }
+
+    }
+
+    return $learnproc
+}
+
+
+########################################################################
+# Procedure:    validateProtocol
+#
+# Description:  This command validates the protocol type for this test
+#
+# Arguments:    protocols:  list of allowable protocols for this test, 
+#                               ie. {mac ip ipx ipV6}
+#
+# Returns:      ::TCL_OK or TCL_ERROR
+#
+########################################################################
+proc validateProtocol {protocols} \
+{
+    set retCode $::TCL_OK
+
+    set protocolName [getProtocolName [protocol cget -name]]
+    switch $protocolName {
+        mac  -
+        ip   -
+        ipx  -
+        ipV6 {
+            if {[lsearch $protocols $protocolName] == -1} {
+                set retCode $::TCL_ERROR
+            }
+        }
+        default {
+            set retCode $::TCL_ERROR
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: initMaxRate
+#
+# This command initializes an array containing the max rate values per
+# all TX ports in the array
+#
+# Arguments(s):
+#   PortArray       - port map, ie. one2oneArray, one2manyArray, etc
+#   maxRateArray    - array containing the max rates for each tx port
+#   framesize       - framesize ref for max rate
+#   userRateArray   - array containing the actual user rate to tx
+#   percentRate     - user-specifed percent of max rate
+#   preambleSize
+#
+########################################################################
+proc initMaxRate {PortArray maxRateArray framesize {userRateArray ""} {percentRate 100} {preambleSize 8}} \
+{
+    upvar $PortArray portArray
+    upvar $maxRateArray maxRate
+
+    if {[string length $userRateArray] > 0} {
+        upvar $userRateArray userRate
+    }
+
+    set retCode $::TCL_OK
+
+    set txRxList    [getAllPorts portArray]
+
+    foreach portMap $txRxList {
+        scan $portMap "%d %d %d" c l p
+
+        set maxRate($c,$l,$p)   [calculateMaxRate $c $l $p $framesize $preambleSize]
+        set userRate($c,$l,$p)  [expr round($percentRate/100. * $maxRate($c,$l,$p))]
+
+        if {$userRate($c,$l,$p) > $maxRate($c,$l,$p)} {
+            logMsg "****** WARNING: Rate $userRate($c,$l,$p) fps exceeded Maximum Rate $maxRate($c,$l,$p) for [getPortId $c $l $p]"
+            set userRate($c,$l,$p) $maxRate($c,$l,$p) 
+        }
+
+        if {$userRate($c,$l,$p) <= 0} {
+            logMsg "****** ERROR: Rate cannot be 0 for [getPortId $c $l $p]"
+            set retCode $::TCL_ERROR
+        }
+    }
+
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: buildIpMcastMacAddress
+#
+# This command builds the MAC address to use when transmitting multi-
+# cast packets.
+#
+# Arguments(s):
+#       groupAddress    IP multicast group address
+#
+# NOTE:The Ethernet directly supports the sending of local multicast
+# packets by allowing multicast addresses in the destination field of 
+# Ethernet packets. All that is needed to support the sending of
+# multicast IP datagrams is a procedure for mapping IP host group
+# addresses to Ethernet multicast addresses. 
+#
+# An IP host group address is mapped to an Ethernet multicast address 
+# by placing the low-order 23-bits of the IP address into the low-order
+# 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex)
+# [RFC1112]. Because there are 28 significant bits in an IP host group
+# address, more than one host group address may map to the same Ethernet
+# multicast address. 
+########################################################################
+proc buildIpMcastMacAddress {groupAddress} \
+{
+    set mcastIP [host2addr $groupAddress]
+
+    # the lower 3 bytes of DA need to match the lower 23 bits of the multicast IP addr
+    set DA  [format "%02x %02x %02x %02x %02x %02x" 01 00 0x5e \
+                    [expr "0x[lindex $mcastIP 1]" & 0x7f] \
+                    "0x[lindex $mcastIP 2]" \
+                    "0x[lindex $mcastIP 3]"]
+
+    return $DA
+}
+
+
+########################################################################
+# Procedure: setPortName
+#
+# This command sets a character string name to a specified port
+#
+# Arguments(s):
+#   portName      - name of port
+#   chassis
+#   card  
+#   port
+#
+# Return:
+#       TCL_OK if port found
+#
+########################################################################
+proc setPortName {portName chassis card pt} \
+{
+    set retCode 0
+
+    if [catch {port get $chassis $card $pt} retCode] {
+        global ixgPortNameMap
+        set ixgPortNameMap($chassis,$card,$pt)    $portName
+        set retCode 0
+    } else {
+        port config -name   $portName
+        if [port set $chassis $card $pt] {
+            set ixgPortNameMap($chassis,$card,$pt)    $portName
+        }
+    }
+
+    return $retCode
+}
+
+
+##################################################################################
+# Procedure: getPortString
+#
+# This command gets the port name as a string.
+#
+##################################################################################
+proc getPortString {c l p {testCmd results}} \
+{
+    set portname [getPortName $c $l $p]
+
+    if {[$testCmd cget -portNameOption] == "both" && $portname != ""} {   
+        set portString [format "%s.%s.%s %s" $c $l $p $portname]
+    } elseif {[$testCmd cget -portNameOption] == "number" && $portname != ""} {
+        set portString $portname
+    } elseif {[$testCmd cget -portNameOption] == "name" && $portname != ""} {
+        set portString $portname
+    } else {
+        set portString [format "%s.%s.%s" $c $l $p]
+    }
+
+    return $portString
+}
+
+
+########################################################################
+# Procedure: getPortId
+#
+# This command gets the portID + character string name of a port
+#
+# Arguments(s):
+#   c
+#   l  
+#   p
+#
+# Return:
+#       portName
+#
+########################################################################
+proc getPortId {c l p} \
+{
+
+    if [catch {port getId $c $l $p} portname] {
+        set portname  "$c.$l.$p "
+    }
+
+    return $portname
+}
+
+
+########################################################################
+# Procedure: getPortName
+#
+# This command gets the character string name from a specified port
+#
+# Arguments(s):
+#   chassis
+#   card  
+#   port
+#   default - optionally, if no name was specified, name defaults
+#             to "$chassis.$card.$port", otherwise empty string returned.
+#
+# Return:
+#       portName
+#
+########################################################################
+proc getPortName {chassis card port {default default}} \
+{
+    set retCode  0
+    set portName ""
+
+    global ixgPortNameMap
+
+    if [catch {port get $chassis $card $port} retCode] {
+        if [catch {set portName $ixgPortNameMap($chassis,$card,$port)}] {
+            set portName    ""
+        }
+    } else {
+        if [info exists ixgPortNameMap($chassis,$card,$port)] {
+            set portName $ixgPortNameMap($chassis,$card,$port)
+            setPortName  $portName $chassis $card $port
+            unset ixgPortNameMap($chassis,$card,$port)
+        } 
+     
+        if {$retCode != 0} {  
+            set portName    ""
+        } else {
+            set portName    [port cget -name]
+        }      
+    }
+
+    if {$portName == "" && $default == "default"} {
+        set portName    "$chassis.$card.$port"
+    }
+
+    return $portName
+}
+
+
+########################################################################################
+# Procedure: setPortFactoryDefaults
+#
+# Description: This command sets the factory defaults on a port
+#
+# Argument(s):
+#   chassis -
+#   card    -
+#   port    -
+#
+########################################################################################
+proc setPortFactoryDefaults {chassis card port} \
+{
+    set retCode [port setFactoryDefaults $chassis $card $port]
+    switch $retCode "
+        $::ixTcl_ok {
+        }
+        $::ixTcl_generalError {
+			errorMsg \"Error setting factory defaults on port [getPortId $chassis $card $port].\"
+        }
+        $::ixTcl_notAvailable {
+            errorMsg \"Port [getPortId $chassis $card $port] is unavailable, check ownership.\"
+        }
+    "
+
+    return $retCode
+}
+
+
+########################################################################################
+# Procedure: setFactoryDefaults
+#
+# Description: This command sets the factory defaults on all ports in the map
+#
+# Argument(s):
+#   portList     - list containing all ports to set factory defaults on, may be an array
+#
+########################################################################################
+proc setFactoryDefaults {portList {write nowrite}} \
+{
+    set retCode $::TCL_OK
+
+    foreach port $portList {
+        scan $port "%d %d %d" chassisId cardId portId
+
+        set retCode [setPortFactoryDefaults $chassisId $cardId $portId]
+        if {$retCode != $::TCL_OK} {
+            break
+        }
+    }
+
+    if {$retCode == $::TCL_OK && $write == "write"} {
+        ixWritePortsToHardware portList
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getProtocolName
+#
+# This command returns the protocol as a character string name
+#
+# Arguments(s):
+#       protocol        integer value of protocol, from protocol cget -name
+#
+# Return:
+#       character name of protocol or 0 if error
+#
+########################################################################
+proc getProtocolName {protocol} \
+{
+    global kProtocol
+
+    # this is for scripts that are sending valid ip packets, but
+    # we are treating it like an l2 test
+    if {[advancedTestParameter cget -l2DataProtocol] == "ip"} {
+        set name "mac"
+        return $name
+    }
+
+    foreach {pr name} [array get kProtocol] {
+        if {$protocol == $pr} {
+            return $name
+        }
+    }
+
+    return 0
+}
+
+
+########################################################################
+# Procedure: getDuplexModeString
+#
+# This command returns the duplex mode as a character string name
+#
+# Arguments(s):
+#       duplexMode      integer value of duplex mode, from port cget -duplex
+#
+# Return:
+#       character name of duplex mode or 0 if error
+#
+########################################################################
+proc getDuplexModeString {duplex} \
+{
+    global kDuplexMode
+
+    foreach {dp name} [array get kDuplexMode] {
+        if {$duplex == $dp} {
+                return $name
+        }
+    }
+
+    return 0
+}
+
+
+########################################################################
+# Procedure: disableUdfs
+#
+# This command disables the udfs in the list.
+#
+# Arguments(s):
+#       udfList     Tcl list of udfs to disable, in the form {1 2 3 4}
+#
+# Return:
+#       1 if error
+#
+########################################################################
+proc disableUdfs {udfList} \
+{
+    set retCode 0
+
+    udf config -enable  false
+    foreach u $udfList {
+        if [udf set $u] {
+            set retCode 1
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getIpClassName
+#
+# This command returns the class type of IP address as a character string name
+#
+# Arguments(s):
+#       classNum        integer value of IP addr class, from ip cget -class
+#
+# Return:
+#       character name of IP addr class or 0 if error
+#
+########################################################################
+proc getIpClassName {classNum} \
+{
+    global kIpAddrClass
+
+    foreach {ipclass className} [array get kIpAddrClass] {
+        if {$classNum == $ipclass} {
+                return $className
+        }
+    }
+
+    return 0
+}
+
+
+########################################################################
+# Procedure: getMinimum
+#
+# This command returns the minimum value in the passed array
+#
+# Arguments(s):
+#       ValArray        - array of values
+#
+# Return:
+#       minimum value in array
+#
+########################################################################
+proc getMinimum {ValArray} \
+{
+    upvar $ValArray valArray
+
+    foreach index [array names valArray] {
+        if {[info exists minimum] && $valArray($index) >= $minimum} {
+            continue
+        }
+        set minimum $valArray($index)
+    }
+
+    if {![info exists minimum]} {
+        set minimum 0
+    }
+
+    return $minimum
+}
+
+
+########################################################################
+# Procedure: swapPortList
+#
+# This command swaps the Tx/Rx pairs
+#
+# Argument(s):
+#       portList        list of ports, ie, one2oneArray, one2manyArray etc
+#       newList         copied list
+#
+########################################################################
+proc swapPortList {portList newList} \
+{
+    upvar $portList old
+    upvar $newList  new
+
+    set retCode 0
+
+    if [info exists new] {
+        unset new
+    }
+
+    foreach txMap [lsort [array names old]] {
+        scan $txMap "%d,%d,%d" tx_c tx_l tx_p
+
+        foreach rxMap [lsort $old($txMap)] {
+            scan [join $rxMap]  "%d %d %d" rx_c rx_l rx_p
+
+            set new($rx_c,$rx_l,$rx_p) [lappend new($rx_c,$rx_l,$rx_p) [list $tx_c $tx_l $tx_p]]
+        }
+    }
+
+        return $retCode
+}
+
+
+########################################################################
+# Procedure: copyPortList
+#
+# This command copies the port array into another local variable
+#
+# Argument(s):
+#       portList        list of ports, ie, one2oneArray, one2manyArray etc
+#       newList         copied list
+#
+########################################################################
+proc copyPortList {SourceList DestList} \
+{
+    upvar $SourceList   sourceList
+    upvar $DestList     destList
+
+    array set destList [array get sourceList]
+
+    return $::TCL_OK
+}
+
+
+########################################################################
+# Procedure: removePorts
+#
+# This command removes ports from the port array/list. 
+#
+# Argument(s):
+#       PortList        port map or list of ports, ie, one2oneArray, one2manyArray etc
+#       removePortList  list of ports to be removed from the PortList
+#
+########################################################################
+proc removePorts {PortList removePortList} \
+{
+
+    upvar $PortList portList
+
+    set retCode 0
+
+    if [array exists portList] {
+        foreach txMap [array names portList] {
+
+            scan [split [join $txMap] ,] "%d %d %d" tx_c tx_l tx_p
+
+            if {[lsearch $removePortList [list $tx_c $tx_l $tx_p]] >= 0} {
+                logMsg "Removing TX port [getPortId $tx_c $tx_l $tx_p] from map..."
+                unset portList($tx_c,$tx_l,$tx_p)
+                continue
+            }
+
+            foreach rxMap $portList($tx_c,$tx_l,$tx_p) {
+
+                set index [lsearch $removePortList $rxMap]
+
+                if {$index >= 0} {
+                    logMsg "Removing RX port [join $rxMap ,] from map..."
+                    set rmIndex [lsearch $portList($tx_c,$tx_l,$tx_p) $rxMap]
+
+                    set portList($tx_c,$tx_l,$tx_p) [lreplace $portList($tx_c,$tx_l,$tx_p) $rmIndex $rmIndex]
+
+                    if {[llength $portList($tx_c,$tx_l,$tx_p)] <= 0} {
+                        unset portList($tx_c,$tx_l,$tx_p)
+                    }
+
+                }                    
+            }
+        }
+
+        if {[llength [array names portList]] == 0} {
+            set errMsg "Error - invalid map after removing ports!!!"
+            #errorMsg "Error - invalid map after removing ports!!!"
+            set retCode 1    
+        }
+
+    } else {
+
+        if { [llength $portList] >0 && [llength  $removePortList] > 0 } {
+            foreach portMap $removePortList {
+                scan [join $portMap] "%d %d %d" c l p
+
+                set index    [lsearch $portList [list $c $l $p]]
+                if {$index >= 0} {
+                    logMsg "Removing port [join [split $portMap ,] ,] from map..."
+                    set portList [lreplace $portList $index $index]
+                }
+            }
+        } else {
+            logMsg "No ports to remove."
+            set retCode 1
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: lnumsort
+#
+# This command sorts a list (like ports) into numerical order
+#
+# Argument(s):
+#       option        -decending
+#       MyList        list of stuff
+#
+########################################################################
+proc lnumsort {option {MyList ""}} \
+{
+    if {[string index [lindex $option 0] 0] != "-"} {
+        set MyList  $option
+        set sortedList  [lsort -dictionary $MyList]
+    } else {
+        set sortedList  [lsort -dictionary $option $MyList]
+    }
+
+    return $sortedList
+}
+
+
+########################################################################
+# Procedure: mergeLists
+#
+# This command merges two lists
+#
+# Arguments(s):
+#   MergedList  - returned merged list w/dups removed
+#   args        - variable number of lists to be merged together
+#   <sortedOrder - return list in sorted order, default is no sort>
+#
+# Return values:
+#   If there are duplicate items in the list, returns number of dups, otherwise
+#   returns 0
+#
+########################################################################
+proc mergeLists {MergedList args} \
+{
+    upvar $MergedList   mergedList
+
+    set mergedList  ""
+    set sortFlag    0
+    set duplicate   0
+
+    foreach list $args {
+        if {$list == "sortedOrder"} {
+            set sortFlag    1
+            continue
+        }
+        foreach item $list {
+            if {[lsearch $mergedList $item] >= 0} {
+                incr duplicate
+            } else {
+                lappend mergedList $item
+            }
+        }
+    }
+
+    if {$sortFlag} {
+        set mergedList  [lnumsort $mergedList]
+    }
+
+    return $duplicate
+}
+
+
+
+########################################################################
+# Procedure:    host2addr
+#
+# Description:  This command converts an IP address in form 100.101.102.103 
+#               to a list of hex bytes all in upper case letters.
+#
+# Arguments(s): ipAddr: ip address to convert
+#
+# Return(s):    IP address in list of hex bytes
+#
+########################################################################
+proc host2addr {ipAddr} \
+{
+    set ipHex        {}
+
+    set delimiter .
+    regexp {([:.])} $ipAddr match delimiter
+
+    set protocol [expr [string match $delimiter :]?"ipV6":"ip"]
+
+    switch $protocol {
+        ipV6 {
+            set ipHex [ipv6::host2addr $ipAddr]
+        }
+        ip {
+            set ipname [split $ipAddr $delimiter]
+            if {[llength [string trim [join $ipname]]] == 4} {
+                foreach i $ipname {
+                    if {$i > 255 || $i < 0} {
+                        set ipHex {}
+                        break
+                    }
+                    set hexCharacter [format "%02X" $i]
+                    set ipHex [linsert $ipHex end $hexCharacter]
+                }
+            }
+        }
+    }
+
+    return $ipHex
+}
+
+
+########################################################################
+# Procedure:    long2IpAddr
+#
+# Description   Converts long word into an IP address in 
+#                   form x.y.z.a
+#
+# Argument(s):  longword to convert
+#
+# Returns:      Ip Address x.y.z.a OR 
+#               0.0.0.0 if invalid input arguments
+#
+#########################################################################
+proc long2IpAddr {value} \
+{
+    if [catch {set ipAddress "[expr {(($value >> 24) & 0xff)}].[expr {(($value >> 16) & 0xff)}].[expr {(($value >> 8 ) & 0xff)}].[expr {$value & 0xff}]"} ipAddress] {
+        set ipAddress 0.0.0.0
+    }
+
+    return $ipAddress
+}
+
+
+########################################################################
+# Procedure:    byte2IpAddr
+#
+# Description   Converts 4 hexideciaml bytes into an IP address in 
+#                   form x.y.z.a
+#
+# Argument(s):  hexBytes:   list of bytes to convert
+#
+# Returns:      Ip Address x.y.z.a OR 
+#               0.0.0.0 if invalid input arguments
+#
+#########################################################################
+proc byte2IpAddr {hexBytes} \
+{
+    set newIpAddr       "0.0.0.0"
+
+    # Validate input parameters.
+
+    # If given a string of 8 bytes instead of list of 4, convert it to a list.
+    set hexBytes       [string trim $hexBytes]
+    set hexBytesLength  [llength $hexBytes]
+
+    if {$hexBytesLength == 1} {
+
+        if {[string length [string trim $hexBytes]] == 8} {
+
+            set hexBytesString  $hexBytes
+            set hexBytes [list]
+            for {set i 0} {$i < 4} {incr i} {
+                lappend hexBytes   [string range   $hexBytesString 0 1]
+                set hexBytesString [string replace $hexBytesString 0 1]
+            }
+
+        } else {
+            set hexBytes [list 0 0 0 0]
+        }
+
+    } elseif {$hexBytesLength != 4} {
+        set hexBytes [list 0 0 0 0]
+    }
+
+
+    # Convert to decimal.
+    regsub -all {(.*) (.*) (.*) (.*)} $hexBytes \
+        {[format "%d %d %d %d" "0x\1" "0x\2" "0x\3" "0x\4"]} newIpAddr
+    if {[catch {subst $newIpAddr} newIpAddr]} {
+        set newIpAddr [list 0 0 0 0]
+    }
+
+    # If any invalid values, return 0.0.0.0
+    foreach byte $newIpAddr {
+        if {$byte < 0 || $byte > 255} {
+            set newIpAddr [list 0 0 0 0]
+            break
+        }
+    }
+    set newIpAddr [join $newIpAddr .]
+
+    debugMsg "byte2IpAddr: newIpAddr = $newIpAddr"
+    return $newIpAddr
+}
+
+
+
+
+########################################################################
+# Procedure: num2ip
+#
+# Description:
+#   This command convert a number to an IP address.
+# 
+# Arguments(s):
+#   num - number
+#
+# Returns: 
+#   An IP address.
+#             
+########################################################################
+proc num2ip {num} \
+{
+    set ipAddr [format "%d.%d.%d.%d" [expr {($num >> 24) & 255}] [expr {($num >> 16) & 255}] \
+                                     [expr {($num >>  8) & 255}] [expr { $num        & 255}]]
+    return $ipAddr
+}
+
+
+
+########################################################################
+# Procedure: ip2num
+#
+# This command converts an IP address of the form d.d.d.d into a 32-bit
+# unsigned number.
+#
+# Arguments(s):
+#   ipAddr      - ip address of the form d.d.d.d
+#
+# Return:
+#   ipNum
+#
+########################################################################
+proc ip2num {ipAddr} \
+{
+    set ipNum   0
+
+    if {[scan $ipAddr "%d.%d.%d.%d" a b c d] == 4} {
+        set ipNum   [format %u [expr {($a<<24)|($b<<16)|($c<<8)|$d}]]
+    }
+
+    return $ipNum
+}
+
+
+########################################################################
+# Procedure: long2octet
+#
+# This command converts a multi-byte number into multi octets in a list
+#
+# Argument(s):
+#       value           the value to convert
+#
+#########################################################################
+proc long2octet {value {sizeInBytes 2} } \
+{
+
+    switch $sizeInBytes {
+            2 {
+                return  [format "%02x %02x" \
+                                    [expr {(($value >> 8) & 0xff)}]   \
+                                    [expr   {$value & 0xff}]]
+            }
+            3 {
+                return  [format "%02x %02x %02x" \
+                                    [expr {(($value >> 16) & 0xff)}]  \
+                                    [expr {(($value >> 8 ) & 0xff)}]  \
+                                    [expr   {$value & 0xff}]]
+            }
+            4 {
+                return  [format "%02x %02x %02x %02x" \
+                                    [expr {(($value >> 24) & 0xff)}]  \
+                                    [expr {(($value >> 16) & 0xff)}]  \
+                                    [expr {(($value >> 8 ) & 0xff)}]  \
+                                    [expr   {$value & 0xff}]]     
+            }
+            1 -
+            default {
+                return [list [format %02x $value ]]
+            }
+    }  
+}
+
+
+########################################################################
+# Procedure: list2word
+#
+# This command converts a 2-byte list into a word
+#
+# Argument(s):
+#       mylist           the value to convert
+#
+#########################################################################
+proc list2word {mylist} \
+{
+    set listlength  [llength $mylist]
+    set result      0
+
+    if {$listlength <= 2 && $listlength > 0} {
+        incr listlength -1
+        set j 0
+        for {set i $listlength} {$i >= 0} {incr i -1} {
+            incr result  [expr [hextodec [lindex $mylist $i]] << ($j * 8)]
+            incr j                
+        }
+    }
+
+    return $result
+}
+
+########################################################################
+# Procedure: value2Hexlist
+#
+# Description:	This command converts a number into a hex
+#
+# Argument(s):
+#   value   - a number
+#	width	- the hex list lenght to be generated
+#
+#########################################################################
+proc value2Hexlist { value width } \
+{
+    set retValue {}
+    while { $width } {
+        set retValue [linsert $retValue 0 [format "%02x" [mpexpr $value & 255]]]
+        incr width -1
+        set value [mpexpr $value >> 8]
+    }
+    return $retValue
+}
+
+########################################################################
+# Procedure: hexlist2Value
+#
+# Description:	This command converts a hex list into a number
+#
+# Argument(s):
+#       hexlist		- the hex list ( example {01 02 03 04} )
+#
+#########################################################################
+proc hexlist2Value { hexlist } \
+{
+   set retValue 0
+   foreach byte $hexlist {
+      set retValue [mpexpr ($retValue << 8) | 0x$byte]
+   }
+   return $retValue
+}
+
+
+
+########################################################################
+# Procedure:    expandHexString
+#
+# Description:  Expands a string of delimited hex values:
+#
+#                   0 a b 1  becomes 00 0a 0b 01
+#                   0:a:b:21 becomes 00:0a:0b:21
+#
+#               Does not verify the validity of the original hex string.
+#
+# Argument(s):  bytesList
+#               delimiter
+#
+# Returns:      expanded hex string
+#
+#########################################################################
+proc expandHexString {byteList {delimiter :}} \
+{
+    set hexList [list]
+
+    regsub -all $delimiter $byteList " " byteList
+    foreach byte $byteList {
+        regsub -all {(.*)} $byte \
+            {[format "%02x " 0x\1]} byte 
+        append hexList [subst "$byte"]
+    }
+    regsub -all " " [string trim $hexList] $delimiter hexList
+
+    return $hexList
+}
+
+
+########################################################################
+# Procedure: getMultipleNumbers
+#
+# This procedure gives two numbers that are multiples of each other but
+# less than the allowed maximum number. If he "number" is a prime number
+# than this procedure may not be useful.
+#
+# Argument(s):
+#       number              the number whose multiple is to be found
+#       maxAllowedNum   the maximum allowed number
+#       numA                the multiplier
+#       numB                    the divider
+#
+#########################################################################
+proc getMultipleNumbers {number maxAllowedNum numA numB} \
+{
+    upvar $numA a
+    upvar $numB b
+
+    # just pick an arbitrary number for max value for loop
+    for {set divider 2} {$divider <= 1000} {incr divider} {
+        set result      [mpexpr $number/$divider]
+        set remainder   [mpexpr $number%$divider]
+        if {$remainder != 0} {
+            continue
+        }
+        if {$result > $maxAllowedNum} {
+            continue
+        }
+        set a $result
+        set b $divider
+        return 0
+    }
+
+    return 1
+}
+
+
+########################################################################
+# Procedure: hextodec
+#
+# This command converts a hex number to a decimal number
+#
+# Argument(s):
+#   number  - hex number to convert
+#
+########################################################################
+proc hextodec {number} \
+{
+    if [catch {format "%u" "0x$number"} retCode] {
+        logMsg "Invalid hex number: $number"
+        set retCode -1
+    }
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: dectohex
+#
+# This command converts a decimal number to a hex number
+#
+# Argument(s):
+#   number  - decimal number to convert
+#
+########################################################################
+proc dectohex {number} \
+{
+    if [catch {format "%x" $number} retCode] {
+        logMsg "Invalid decimal number: $number"
+        set retCode -1
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: incrMacAddress
+#
+# This command increments the last three bytes (24-bit word) of the MAC
+# address.
+#
+# Argument(s):
+#   macaddr         mac address to increment
+#   amt             increment the field by this number
+#
+########################################################################
+proc incrMacAddress {macaddr amt} \
+{
+    upvar $macaddr valList
+
+    set hexnum [format "%02x%02x%02x" "0x[lindex $valList 3]" \
+                             "0x[lindex $valList 4]" "0x[lindex $valList 5]"]
+    set decnum [hextodec $hexnum]
+    set decnum [incr decnum $amt]
+    set hexnum [format "%06x" "0x[dectohex $decnum]"]
+
+    scan $hexnum "%02s%02s%02s" byte3 byte4 byte5
+
+    set valList [lreplace $valList 3 3 $byte3]
+    set valList [lreplace $valList 4 5 $byte4 $byte5]
+    return $valList
+}
+
+
+########################################################################
+# Procedure: incrIpField
+#
+# Description: Increments the specified byte of IP address
+#
+#
+# Argument(s):
+#   ipAddress       IP address whose byte to be incremented
+#   byteNum         the byte field to be incremented
+#   amount             increment the field by this number
+#
+########################################################################
+proc incrIpField {ipAddress {byteNum 4} {amount 1}} \
+{
+    set one [ip2num $ipAddress]
+    set two [expr {$amount<<(8*(4-$byteNum))}]
+
+    return  [long2IpAddr [expr {$one + $two}]]
+}
+
+
+
+########################################################################
+# Procedure: incrIpFieldHexFormat
+#
+# Description: Increments the specified byte of IP address.  Both the input
+#              and returned IP address are in hex format.
+#
+#
+# Argument(s):
+#   ipAddress       IP address whose byte to be incremented (It's in the form
+#                    of 4 byte hex number:  ex, "4c 2e 01 05"  
+# 
+#   byteNum         the byte field to be incremented
+#   amount          increment the field by this number
+#
+########################################################################
+proc incrIpFieldHexFormat {ipAddress {byteNum 4} {amount 1}} \
+{
+    set hexIpAddr   0x[join $ipAddress ""]
+
+    set val [format %x [expr [format %d $hexIpAddr] + [expr {$amount<<(8*(4-$byteNum))}]]]
+    return [long2octet [format %d "0x$val"] 4]
+}
+
+
+########################################################################
+# Procedure: assignIncrMacAddresses
+#
+# Description: Assigns an incrementing MAC address
+#
+# Argument(s):
+#   portList       a list of sorted ports
+#
+########################################################################
+proc assignIncrMacAddresses {portList} \
+{
+    logMsg "Assigning incrementing addresses on all ports ..."
+    set retCode $::TCL_OK
+
+    scan [lindex $portList 0] "%d %d %d" c l p
+    set currMacAddr [join [list 00 [format "%02x %02x" $l $p ] 00 00 00 ]]
+
+    foreach maplist $portList {
+        scan $maplist "%d %d %d" c l p
+
+        if {![IsPOSPort $c $l $p] } {
+            if [port get $c $l $p] {
+                errorMsg "Error getting port [getPortId $c $l $p]"
+                set retCode $::TCL_ERROR
+            }
+
+            port config -MacAddress $currMacAddr
+            if [port set $c $l $p] {
+                errorMsg "Error setting port [getPortId $c $l $p]"
+                set retCode $::TCL_ERROR
+            }
+
+            logMsg "[getPortId $c $l $p] ====>  MAC: $currMacAddr"
+            set currMacAddr [incrMacAddress currMacAddr [port cget -numAddresses]]
+        }
+    }
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: incrHostIpAddr
+#
+# Description: Increments the host portion of the IP address
+#              NOTE:  will carry!!
+#
+# Argument(s):
+#   ipAddress      - ip address to increment
+#   amount         - amount to increment by
+#
+########################################################################
+proc incrHostIpAddr {ipAddress {amount 1}} \
+{
+    return [incrIpField $ipAddress 4 $amount]
+}
+
+
+########################################################################
+# Procedure: waitForResidualFrames
+#
+# Description: Waits for residual rx frames
+#
+# Argument(s):
+#   time        - time to wait
+#
+########################################################################
+proc waitForResidualFrames {time} \
+{
+    logMsg "Waiting for Residual frames to settle down for $time seconds"
+    for {set timeCtr 1} {$timeCtr <= $time} {incr timeCtr} {
+        logMsg "Waited for $timeCtr of $time seconds"
+        after 1000
+    }
+}
+
+
+########################################################################################
+# Procedure: getPerTxArray
+#
+# Description: Helper proc that seperates multiple map per Tx port
+#
+# Arguments(s):
+#   TxRxArray       - map, ie. one2oneArray
+#   PerTxArray      - per Tx map, ie. one2one or one2many
+#   txPort          - tx port
+#   testCmd         - name of test command, ie. tput
+#
+########################################################################################
+proc getPerTxArray {TxRxArray PerTxArray txPort } \
+{
+    upvar $TxRxArray    txRxArray
+    upvar $PerTxArray   perTxArray
+
+    set retCode 0
+
+    if [info exists perTxArray] {
+        unset perTxArray
+    }
+    foreach rxPort $txRxArray($txPort) {
+        scan [join $rxPort] "%d %d %d" rx_c rx_l rx_p               
+        set perTxArray($txPort)   [lappend perTxArray($txPort) [list $rx_c $rx_l $rx_p]] 
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getTxPorts
+#
+# Description: Gets all the Tx ports from any map array passed.
+#
+# Argument(s):
+#   MapArray        the reference to map array to be scanned
+#
+# Returns:
+#   txList          List containing all Tx ports
+#
+########################################################################
+proc getTxPorts {MapArray} \
+{
+    upvar $MapArray mapArray
+
+    set txList {}
+
+    if [info exists mapArray] {
+        if {[array exists mapArray]} {
+            foreach txMap [array names mapArray] {
+
+                regsub -all "," $txMap " " txPort
+
+                if {[lsearch $txList $txPort] == -1} {
+                    # add this Tx port to the list
+                    lappend txList $txPort
+                }
+            }
+        } else {
+            foreach port $mapArray {
+                lappend txList [join [split $port ',']]
+            }
+        }
+    }
+
+    return [lsort -dictionary $txList]
+}
+
+
+########################################################################
+# Procedure: getRxPorts
+#
+# Description: Gets all the Tx ports from any map array passed.
+#
+# Argument(s):
+#   MapArray        the reference to map array to be scanned
+#
+# Returns:
+#   rxList          List containing all Rx ports
+#
+########################################################################
+proc getRxPorts {MapArray} \
+{
+    upvar $MapArray mapArray
+
+    set rxList {}
+
+    if [info exists mapArray] {
+
+        if {[array exists mapArray]} {
+
+            foreach {txMap rxMap} [array get mapArray] {
+
+                foreach rxPort $rxMap {
+                    if {[lsearch $rxList $rxPort] == -1} {
+                        # add this Rx port to the list
+                        lappend rxList $rxPort
+                    }
+                }
+            }
+
+        } else {
+            foreach port $mapArray {
+                lappend rxList [join [split $port ',']]
+            }
+        }
+    }
+
+    return [lsort -dictionary $rxList]
+}
+
+
+########################################################################
+# Procedure:    getAllPorts
+#
+# Description:  Gets all the ports from any map array passed.
+#
+# Argument(s):  MapArray:   Reference to map array to be scanned
+#
+# Returns:      portList:   List containing all ports
+#
+########################################################################
+proc getAllPorts {MapArray} \
+{
+    upvar $MapArray mapArray
+
+    set portList {}
+
+    if [info exists mapArray] {
+        if {[array exists mapArray]} {
+
+            foreach {txMap rxMap} [array get mapArray] {
+
+                regsub -all "," $txMap " " txPort
+
+                if {[lsearch $portList $txPort] == -1} {
+                    # add this Tx port to the list
+                    lappend portList $txPort
+                }
+
+                foreach rxPort $rxMap {
+                    if {[lsearch $portList $rxPort] == -1} {
+                        # add this Rx port to the list
+                        lappend portList $rxPort
+                    }
+                }
+            }
+        } else {
+            foreach port $mapArray {
+                lappend portList [join [split $port ',']]
+            }
+        }
+    }
+
+    return [lsort -dictionary $portList]
+}
+
+
+########################################################################
+# Procedure: comparePortArray
+#
+# This command compares two arrays; if one array contains ports that
+#           the other array doesn't, it will optionally remove those ports
+#
+# Argument(s):
+#       KeepArray        array of ports to compare against
+#       CompareArray     array to check
+#       removePorts      optionally remove ports from compareArray that
+#                        are not in keepArray
+#
+# Return:
+#       returns 1 if ports are in CompareArray that are not in KeepArray
+#
+########################################################################
+proc comparePortArray {KeepArray CompareArray {removePorts remove}} \
+{
+    upvar $KeepArray     keepArray
+    upvar $CompareArray  compareArray
+
+    set retCode 0
+
+    set keepList   [getAllPorts keepArray]
+
+    foreach txPort [array names compareArray] {
+        scan [split [join $txPort] ,] "%d %d %d" c l p
+        # if we don't find the tx port in the keepArray, remove it from the compareArray
+        if {[lsearch $keepList "$c $l $p"] == -1 && [info exists compareArray]} {
+            if {$removePorts == "remove"} {
+                unset compareArray($txPort)
+            }
+            set retCode 1
+            continue
+        }
+        # now cycle through the rx ports & remove them if they're not in the keepArray
+        foreach rxPort $compareArray($txPort) {
+            scan [join $rxPort] "%d %d %d" c l p
+
+            if {[lsearch $keepList "$c $l $p"] == -1} {
+                if {$removePorts == "remove"} {
+                    set index                 [lsearch  $compareArray($txPort) "$c $l $p"]
+                    set compareArray($txPort) [lreplace $compareArray($txPort) $index $index]
+                }
+                set retCode 1
+            }
+            if {[llength $compareArray($txPort)] <= 0} {
+                unset compareArray($txPort)
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: mergePortArray
+#
+# Description:  This command merges the two array into one (TxRxArray and 
+#               MapArray are merged into TxRxArray
+#              
+#
+# Argument(s):
+#        TxRxArray  - first array before merge and then final array after merge
+#        mapArray   - second array to be merged into TxRxArray
+# 
+#
+########################################################################
+proc mergePortArray { TxRxArray MapArray } \
+{
+    upvar $TxRxArray    txRxArray
+    upvar $MapArray     mapArray
+
+    set retCode 0
+
+    foreach txMap [array names mapArray] {
+        scan $txMap "%d,%d,%d" tx_c tx_l tx_p
+        foreach rxMap $mapArray($txMap) {
+            scan [join $rxMap] "%d %d %d" rx_c rx_l rx_p
+            
+            if [info exists txRxArray($txMap)] {
+                if {[lsearch $txRxArray($txMap) [list $rx_c $rx_l $rx_p]] < 0} {
+                    lappend txRxArray($txMap)  [list $rx_c $rx_l $rx_p]
+                }
+            } else {
+                set txRxArray($txMap)  [list [list $rx_c $rx_l $rx_p]]
+            }  
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: getAdvancedSchedulerArray
+#
+# This command seperates the portmap that supports adand other portmap from txRxArray
+#
+# Argument(s):
+# 
+#   TxRxArray               - map, ie. one2oneArray
+#   AdvancedSchedulerArray  - map for interfaces that support advanced stream scheduler
+#   OtherArray              - map for rest of the interfaces (rest of the TxRxArray)
+#
+########################################################################
+proc getAdvancedSchedulerArray {TxRxArray AdvancedSchedulerArray OtherArray} \
+{
+    upvar $TxRxArray                txRxArray
+    upvar $AdvancedSchedulerArray   advancedSchedulerArray
+    upvar $OtherArray               otherArray
+
+    set retCode 0
+
+    if [info exists advancedSchedulerArray] {
+        unset interfaceArray
+    }
+
+    if [info exists otherArray] {
+        unset otherArray
+    }
+
+    foreach txMap [lnumsort [array names txRxArray]] {
+        scan $txMap "%d,%d,%d" tx_c tx_l tx_p
+        foreach rxMap $txRxArray($tx_c,$tx_l,$tx_p) {
+            scan [join $rxMap] "%d %d %d" rx_c rx_l rx_p
+
+            if [port isValidFeature $tx_c $tx_l $tx_p portFeatureAdvancedScheduler] {
+                if [info exist advancedSchedulerArray($tx_c,$tx_l,$tx_p)] {
+                    if { [lsearch $advancedSchedulerArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]] < 0 } {
+                        set advancedSchedulerArray($tx_c,$tx_l,$tx_p)   [lappend advancedSchedulerArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+                    }
+                } else {
+                    set advancedSchedulerArray($tx_c,$tx_l,$tx_p)   [lappend advancedSchedulerArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+                }
+            } else {
+                if [info exist otherArray($tx_c,$tx_l,$tx_p)] {
+                    if { [lsearch $otherArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]] < 0 } {
+                        set otherArray($tx_c,$tx_l,$tx_p)   [lappend otherArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+                    }
+                } else {
+                    set otherArray($tx_c,$tx_l,$tx_p)   [lappend otherArray($tx_c,$tx_l,$tx_p) [list $rx_c $rx_l $rx_p]]
+                }                
+            }
+        }
+    }
+
+    debugMsg "advancedSchedulerArray: [array get advancedSchedulerArray]"
+    debugMsg "otherArray: [array get otherArray]"
+
+    return $retCode
+}
+
+
+########################################################################
+#
+# NOTE: This proc is only used by Scriptmate, it will be removed from
+#       IxOs eventually
+#
+# Procedure: cleanUpMultiuser
+#
+# Description: Clears ownership and does ixLogout if applicable
+#
+# Argument(s):
+#
+########################################################################
+proc cleanUpMultiuser {} \
+{
+    global multiList
+
+    if {[info exists multiList] && ([llength $multiList] > 0)} {
+          ixClearOwnership $multiList
+          logMsg "Cleared ownership for the following ports:"
+          logMsg "$multiList"
+    }
+
+    if {[testConfig::getLoginId] != ""} {
+          logMsg "[testConfig::getLoginId] - logging out."
+          ixLogout
+    }
+
+}
+
+
+########################################################################
+# Procedure: cleanUp
+#
+# Description: Cleans up global memory & empties the chassis chain
+#
+# Argument(s):
+#
+########################################################################
+proc cleanUp {} \
+{
+    global halCommands testConf
+    global chassisGroup ixStopTest
+
+    # Special case that sometimes happens that a global named item existed
+    if {[string compare [info globals item] "item"] == 0} {
+        global item
+        catch {unset item}
+    }
+
+    set ixStopTest 0
+
+    dhcpStopTimers
+
+    #if {(![info exists cleanUpDone]) || ($cleanUpDone == 1)} {
+    #   return
+    #   }
+
+    # destroy the chassisGroup - we don't really care if it succeeded or not...
+    if [info exists chassisGroup] {
+        if {[info commands portGroup] != ""} {
+            portGroup destroy $chassisGroup
+        }
+    }
+
+    foreach item [info globals ixg*] {
+        global $item
+        catch {unset $item}
+    }
+
+
+
+    # delete all chassis from the chain, call destructors of SWIG commands
+    # and forget the package
+    if {[info commands chassisChain] != ""} {
+        chassisChain removeAll
+    }
+
+    if [info exists halCommands] {
+        foreach halCmd $halCommands {
+            if {[info commands $halCmd] != ""} {
+                debugMsg "Deleting      $halCmd"
+                rename $halCmd ""
+                # remove this commands from the list
+                lreplace $halCommands 0 0
+            }
+        }
+
+        # now delete the list
+        unset halCommands
+    }
+
+    # we need to delete the pointer refs too, because otherwise the next package req will be using stale pointers
+    foreach ptr [info global *Ptr] {
+        if [catch {unset ::$ptr} msg] {puts $msg}
+    }
+
+    if [info exists testConf] {
+        unset testConf
+    }
+
+    debugOff
+    logOff
+
+    ixFileUtils::closeAll
+
+    if {[isUNIX]} {
+        if [tclServer::isTclServerConnected] {
+            tclServer::disconnectTclServer
+        }
+    }
+
+    package forget IxTclHal
+	package forget IxTclProtocol
+
+    if [info exists defineCommand::commandList] {
+        foreach testCmd $defineCommand::commandList {
+            if { $testCmd != "results" } {               
+                $testCmd setDefault
+            }
+
+        }
+    }
+
+    ixTclHal::cleanUpDone
+
+    return
+}
+
+
+###############################################################################
+# Procedure: isIpAddressValid
+#
+# Description: Verify that the ip address is valid.
+#
+# Arguments: ipAddress - the ip address to validate
+#
+# Returns: true if the ip address is valid, false otherwise.
+###############################################################################
+proc isIpAddressValid {ipAddress} {
+
+    set retCode $::true
+
+    if {[info tclversion] == "8.0"} {
+        # Advanced regular expressions are not supported in 8.0
+
+        # First check to see that there are four octets
+        if {[regexp {^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$} $ipAddress]} {
+
+            # Now check each octet for a legitimate value
+            foreach byte [split $ipAddress .] {
+                if {($byte < 0) || ($byte > 255)} {
+                    set retCode $::false
+                    break
+                }
+            }
+        } else {
+            set retCode $::false
+        }
+    } else {
+
+        # The ip address should be four octets
+        if {[regexp {^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$} \
+                $ipAddress]} {
+
+            # Now check each octet for a legitimate value
+            foreach byte [split $ipAddress .] {
+                if {($byte < 0) || ($byte > 255)} {
+                    set retCode $::false
+                    break
+                }
+            }
+        } else {
+            set retCode $::false
+        }
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+# Procedure:    isMacAddressValid
+#
+# Description:  Verify that the mac address is valid.
+#
+# Input:        macAddress:    address to validate
+#
+# Output:       TCL_OK if address is valid, else
+#               TCL_ERROR
+#
+###############################################################################
+proc isMacAddressValid {macAddress} \
+{
+    set retCode $::TCL_ERROR
+
+    regsub -all { |:} $macAddress " " macAddress
+    if {[llength $macAddress] == 6} {
+
+    	set retCode $::TCL_OK
+        foreach value $macAddress {
+            if {[string length $value] == 2} {
+				if {![regexp {[0-9a-fA-F]{2}} $value match]} {
+                    set retCode $::TCL_ERROR
+                    break
+                }
+            } else {
+                set retCode $::TCL_ERROR
+                break
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+# Procedure:   isPartialMacAddressValid
+#
+# Description: Given a mac address, is it valid.  The given address does not have 
+#              to be complete
+#
+# Arguments:   macAddress - the partial address to verify
+#
+# Returns:     1 if it is valid, 0 if not valid
+###############################################################################
+proc isPartialMacAddressValid { macAddress } \
+{
+    set retCode 1
+
+    if {[info tclversion] > 8.0} {
+        if {![regexp {^([0-9a-fA-F]{1,2}( )*)*$} $macAddress]} {
+            set retCode 0
+        }
+    } else {
+        if {[string length $macAddress] > 2} {
+            set splitChar [string index $macAddress 2]
+            set macAddress [split $macAddress $splitChar]
+        }
+
+        foreach value $macAddress {
+            if {![regexp {^([0-9a-fA-F]+)$} $value]} {
+                set retCode 0
+            }
+        }
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+# Procedure:   getCommandParameters
+#
+# Description: Retrieve the parameters for a given command.
+#
+# Arguments:   command - name of the command.
+#    
+# Returns      All the parameters of the specified command.
+###############################################################################
+proc getCommandParameters {command} \
+{
+    set commandParameters {}
+
+    if {![info exists command] || ($command == "")} {
+        return $commandParameters
+    }
+
+    set testMethods [format "%s%s" $command "Methods"]
+
+    global $testMethods
+
+    foreach parm [set ${testMethods}(cget)] {
+        lappend commandParameters $parm
+    }
+
+    return $commandParameters
+}
+
+
+###############################################################################
+# Procedure:   changePortLoopback
+#
+# Description: Retrieve the parameters for a given command.
+#
+# Arguments:   TxRxArray - map, ie. one2oneArray
+#              enabled   - flag to enable or disable the port loopback 
+#    
+# Output:        TCL_OK if loopback enabled/disabled, else
+#                TCL_ERROR
+###############################################################################
+proc changePortLoopback {TxRxArray {enabled true} {verbose noVerbose}} \
+{
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    if {$verbose == "verbose" } {
+        if {$enabled == $::true} {
+            logMsg "Putting ports into loopback."    
+        } else {
+            logMsg "Getting ports out of loopback."
+        }
+    }
+
+    foreach txMap [getAllPorts txRxArray] {
+        scan $txMap "%d %d %d" c l p
+
+        if [port get $c $l $p] {
+            errorMsg "Error getting port [getPortId $c $l $p]"
+            set retCode $::TCL_ERROR
+        }
+        port config -loopback $enabled
+        
+        # This part apply only to Gig SX card
+        if { $enabled } {
+            port config -rxTxMode $::gigLoopback
+        } else {
+            port config -rxTxMode $::gigNormal
+        }
+
+        if [port set $c $l $p] {
+            errorMsg "Error setting port [getPortId $c $l $p]"
+            set retCode $::TCL_ERROR
+        }                        
+    }
+
+    if [writePortsToHardware txRxArray -noProtocolServer ] {
+        errorMsg "Error writing port configurations."
+        set retCode $::TCL_ERROR
+    }
+ 
+    return $retCode
+}
+
+
+#################################################################################
+# Procedure: validateUnidirectionalMap
+#
+# Description: This command validates the unidirectional map
+#  
+# Argument(s):
+# TxRxArray       - map, ie. one2oneArray
+#             
+# Results :       0 : No error found
+#                 1 : Error found
+#
+#################################################################################
+proc validateUnidirectionalMap {TxRxArray } \
+{   
+    upvar $TxRxArray txRxArray
+
+    set retCode $::TCL_OK
+
+    set txPortList  [getTxPorts txRxArray]
+    set rxPortList  [getRxPorts txRxArray] 
+
+    if {[map cget -echo] != "true" } {
+        foreach txMap $txPortList {
+             if { [lsearch $rxPortList $txMap] > -1 } {
+                logMsg "***** WARNING:Invalid map configuration, only unidirectional map is allowed."
+                set retCode $::TCL_ERROR
+                break
+             }
+        }
+    }
+
+    return $retCode
+}
+
+
+###############################################################################
+# Procedure:   getTxRxModeString
+#
+# Description: Retrieve the string for the value given
+#
+# Arguments:   modeType - txMode or rxMode
+#              value    - integer value of the string 
+#    
+# Output:        Returns the string corresponding that value
+#
+###############################################################################
+proc getTxRxModeString { value {modeType "TX"} } \
+{
+    set retString "Invalid"
+
+    set modeType [string toupper $modeType]
+
+    set modeTX($::portTxPacketStreams)                      portTxPacketStreams                     
+    set modeTX($::portTxPacketFlows)                        portTxPacketFlows                       
+    set modeTX($::portTxTcpSessions)                        portTxTcpSessions                       
+    set modeTX($::portTxTcpRoundTrip)                       portTxTcpRoundTrip                      
+    set modeTX($::portTxModeAdvancedScheduler)              portTxModeAdvancedScheduler             
+    set modeTX($::portTxModeBert)				            portTxModeBert				            
+    set modeTX($::portTxModeEcho)						    portTxModeEcho							
+    set modeTX($::portTxModeBertChannelized)	            portTxModeBertChannelized	            
+    set modeTX($::portTxModeDccStreams)				        portTxModeDccStreams					
+    set modeTX($::portTxModeDccAdvancedScheduler)		    portTxModeDccAdvancedScheduler			
+    set modeTX($::portTxModeDccFlowsSpeStreams)		        portTxModeDccFlowsSpeStreams			
+    set modeTX($::portTxModeDccFlowsSpeAdvancedScheduler)   portTxModeDccFlowsSpeAdvancedScheduler	
+    set modeTX($::portTxModeAdvancedSchedulerCoarse)		portTxModeAdvancedSchedulerCoarse
+    set modeTX($::portTxModePacketStreamsCoarse)			portTxModePacketStreamsCoarse
+
+    set modeRX($::portCapture)                  portCapture                                     
+    set modeRX($::portPacketGroup)              portPacketGroup  
+    set modeRX($::portRxModeWidePacketGroup)    portRxModeWidePacketGroup           
+    set modeRX($::portRxTcpSessions)            portRxTcpSessions           
+    set modeRX($::portRxTcpRoundTrip)           portRxTcpRoundTrip          
+    set modeRX($::portRxDataIntegrity)          portRxDataIntegrity         
+    set modeRX($::portRxFirstTimeStamp)         portRxFirstTimeStamp        
+    set modeRX($::portRxSequenceChecking)	    portRxSequenceChecking	    
+    set modeRX($::portRxModeBert)			    portRxModeBert			    
+    set modeRX($::portRxModeIsl)				portRxModeIsl				
+    set modeRX($::portRxModeBertChannelized)    portRxModeBertChannelized	
+    set modeRX($::portRxModeDcc) 				portRxModeDcc 				
+    set modeRX($::portRxModeEcho)				portRxModeEcho
+    set modeRX($::portRxModeWidePacketGroup)	portRxModeWidePacketGroup
+    set modeRX($::portRxModePrbs)				portRxModePrbs
+    set modeRX($::portRxModeRateMonitoring)		portRxModeRateMonitoring
+    set modeRX($::portRxModePerFlowErrorStats)	portRxModePerFlowErrorStats
+
+
+    if {$modeType == "TX"} {
+        if [info exists modeTX($value)] {
+            set retString $modeTX($value)
+        }
+    } else {
+	    set flag  0
+        set modes ""
+        for {set i 0} {$i < [llength [array names modeRX]]} {incr i} {
+            set enumValue [expr 1 << $i]
+
+            if {($enumValue > 1) && [expr $value & $enumValue] && $flag} {
+                append modes " | "
+            }
+            if {[expr $value & $enumValue]} {
+                set flag 1
+            }
+            set enumValue [expr $value & $enumValue] 
+            if [info exists modeRX($enumValue)] {
+                append modes  $modeRX($enumValue)        
+            }
+        }
+        set retString $modes
+    }
+ 
+    return $retString
+}
+
+
+########################################################################
+# Procedure: removeStreams
+#
+# Description: This proc removes all the stream on ports in given map
+#
+# Arguments: TxRxPortList       - map, ie. one2oneArray
+#
+# Results :       0 : No error found
+#                 1 : Error found
+#
+########################################################################
+proc removeStreams { TxRxPortList {verbose verbose} } \
+{
+    upvar $TxRxPortList    txRxPortList
+    
+ 	set retCode		$::TCL_OK
+    set portList	[getAllPorts txRxPortList]
+													   
+    if {$verbose == "verbose"} {
+        logMsg "Removing streams on the ports...\n"
+    }
+	
+    foreach portItem $portList {
+        scan $portItem "%d %d %d" chassId cardId portId
+
+		# since portFeaturePacketStreams is a circuit level feature, but we don't have to have
+		# a circuit id, since we want to clear all the streams under the port, therefore the below
+		# condition will cover the VCAT ports
+		set retValue [expr [port isValidFeature $chassId $cardId $portId portFeaturePacketStreams] || \
+					 [port isValidFeature $chassId $cardId $portId portFeatureAdvancedScheduler] || \
+					 [port isActiveFeature $chassId $cardId $portId portFeatureVcat]]
+
+		switch $retValue {
+		    1 {
+		        lappend featurePortList [list $chassId $cardId $portId]
+		    }
+		    0 {
+		        errorMsg "!WARNING: portFeaturePacketStreams is not supported on port [getPortId $chassId $cardId $portId]"
+		        continue
+		    }
+		}
+
+        # using a temp var retValue so I don't step on retCode
+		set retValue [port reset $chassId $cardId $portId]
+        if {$retValue == $::ixTcl_notAvailable} {
+            errorMsg "Port [getPortId $chassId $cardId $portId] is unavailable, check ownership."
+            set retCode $retValue
+        } elseif {$retValue != $::TCL_OK} {
+			errorMsg "Error deleting streams on port $chassId $cardId $portId"
+            set retCode $retValue
+        }		
+	}
+
+	if {[info exists featurePortList] && $retCode == $::TCL_OK} {
+		set retCode [ixWriteConfigToHardware featurePortList -noProtocolServer ]
+	}
+
+	return $retCode		
+}
+
+
+###############################################################################
+# Procedure:   getIpV4MaskWidth
+#
+# Description: This proc gets ip mask as input and calculates the maskWidth.
+#
+# Arguments:   ip mask - ipV4 format.
+#    
+# Returns      mask width.
+###############################################################################
+proc getIpV4MaskWidth {ipV4Mask} \
+{
+    scan $ipV4Mask "%d.%d.%d.%d" b1 b2 b3 b4
+	
+	set result  [mpexpr ($b4 | $b3 << 8 | $b2 << 16 | $b1 << 24) ^ 0xFFFFFFFF]
+	
+	for {set mask  0} { $mask < 32} {incr mask} {
+		if { [mpexpr $result >> $mask] == 0} {
+			break;
+		}
+	}
+	set mask [expr 32 - $mask]
+	
+    return $mask
+}
+
+
+###############################################################################
+# Procedure:   getIpV4MaskFromWidth
+#
+# Description: This proc takes the mask prefix as input and calculates the ip mask.
+#
+# Arguments:   mask width - an integer number between 0 and 32.
+#    
+# Returns      mask ip.
+###############################################################################
+proc getIpV4MaskFromWidth {maskWidth} \
+{
+    set mask [mpexpr (0xffffffff << (32 - $maskWidth)) & 0xffffffff]
+    return [num2ip $mask]
+}
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/vlanUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/vlanUtils.tcl
new file mode 100644
index 00000000..c92a4834
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/vlanUtils.tcl
@@ -0,0 +1,327 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: vlanUtils.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	11-02-2001	DS
+#
+# Description: This file contains common vlan utilities
+#
+########################################################################
+
+proc vlanUtilsSetDefault {} {
+    set ::vlanUtils::untaggedPortList ""
+}
+
+
+namespace eval vlanUtils {} {
+    vlanUtilsSetDefault
+}
+
+
+########################################################################
+# Procedure: vlanUtils::setPortTagged
+#
+# Description: Sets a boolean indicated whether this port is a vlan-tagged port
+#
+# Arguments:
+#   chassis - The number of the chassis
+#   card - The number of the card
+#   port - The number of the port
+#
+# Returns: TCL_OK on completion
+########################################################################
+proc vlanUtils::setPortTagged {chassis card port} \
+{
+    variable untaggedPortList
+
+    set retCode $::TCL_OK
+
+    if {[catch {lsearch $untaggedPortList [list $chassis $card $port]} found]} {
+        set found -1
+    }
+
+    if {$found >= 0} {
+        set untaggedPortList [lreplace $untaggedPortList $found $found]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: vlanUtils::setTagged
+#
+# Description: Sets a boolean indicated whether the ports in this list are vlan-tagged ports
+#
+# Arguments: portList - A list of ports to tag.  A port identifier is of the list form: chassis card port.
+#
+# Returns: TCL_OK on success and TCL_ERROR on failure
+########################################################################
+proc vlanUtils::setTagged {portList} \
+{
+    set retCode $::TCL_OK
+
+    foreach taggedPort $portList {
+        scan $taggedPort "%d %d %d" c l p
+
+        if {[setPortTagged $c $l $p]} {
+            set retCode $::TCL_ERROR
+            break
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: vlanUtils::setPortUntagged
+#
+# Description: Sets a boolean indicated whether this port is a vlan-tagged port
+#
+# Arguments:
+#   chassis - The number of the chassis for the port
+#   card - The number of the card for the port
+#   port - The number of the port
+#
+# Returns: TCL_OK on success
+########################################################################
+proc vlanUtils::setPortUntagged {chassis card port} \
+{
+    variable untaggedPortList
+
+    set retCode $::TCL_OK
+
+    if {[catch {lsearch $untaggedPortList [list $chassis $card $port]} found]} {
+        set found -1
+    }
+
+    if {$found < 0} {
+        lappend untaggedPortList [list $chassis $card $port]
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: vlanUtils::setUntagged
+#
+# Description: Sets a boolean indicated whether the ports in this list are NOT vlan-tagged ports
+#
+# Arguments: portList - A list of ports to tag.  A port identifier is of the list form: chassis card port.
+#
+# Returns: TCL_OK on success and TCL_ERROR on failure
+########################################################################
+proc vlanUtils::setUntagged {portList} \
+{
+    set retCode $::TCL_OK
+
+    foreach taggedPort $portList {
+        scan $taggedPort "%d %d %d" c l p
+
+        if {[setPortUntagged $c $l $p]} {
+            set retCode $::TCL_ERROR
+            break
+        }
+    }
+
+    return $retCode
+}
+
+
+########################################################################
+# Procedure: vlanUtils::isPortTagged
+#
+# Description: Returns a boolean indicated whether this port is a vlan-tagged port
+#
+# Arguments:
+#   chassis - The number of the chassis for the port
+#   card - The number of the card for the port
+#   port - The number of the port
+#
+# Returns: true if the port is tagged and false if it is not.
+########################################################################
+proc vlanUtils::isPortTagged {chassis card port} \
+{
+    variable untaggedPortList
+
+    if {[catch {lsearch $untaggedPortList [list $chassis $card $port]} found]} {
+        set tagged $::true
+    } else {
+
+        if {$found < 0} {
+            set tagged $::true
+        } else {
+            set tagged $::false
+        }
+    }
+
+    return $tagged
+}
+
+
+########################################################################
+# Procedure: emptyUntaggedPortList
+#
+# Description: Reset the untagged port list to a empty list.
+#
+# Arguments:
+#
+# Returns:
+########################################################################
+proc vlanUtils::emptyUntaggedPortList {} \
+{
+    variable untaggedPortList
+
+    set untaggedPortList ""
+}
+
+
+########################################################################
+# Procedure: setPortTagged
+#
+# Description: Sets a boolean indicated whether this port is a vlan-tagged port
+#
+# Arguments:
+#   chassis - The number of the chassis
+#   card - The number of the card
+#   port - The number of the port
+#
+# Returns: TCL_OK on completion
+########################################################################
+proc setPortTagged {chassis card port} \
+{
+    return [vlanUtils::setPortTagged $chassis $card $port]
+}
+
+
+########################################################################
+# Procedure: setTagged
+#
+# Description: Sets a boolean indicated whether the ports in this list are vlan-tagged ports
+#
+# Arguments: portList - A list of ports to tag.  A port identifier is of the list form: chassis card port.
+#
+# Returns: TCL_OK on success and TCL_ERROR on failure
+########################################################################
+proc setTagged {portList} \
+{
+    return [vlanUtils::setTagged $portList]
+}
+
+
+########################################################################
+# Procedure: setPortUntagged
+#
+# Description: Sets a boolean indicated whether this port is a vlan-tagged port
+#
+# Arguments:
+#   chassis - The number of the chassis for the port
+#   card - The number of the card for the port
+#   port - The number of the port
+#
+# Returns: TCL_OK on success
+########################################################################
+proc setPortUntagged {chassis card port} \
+{
+    return [vlanUtils::setPortUntagged $chassis $card $port]
+}
+
+
+########################################################################
+# Procedure: setUntagged
+#
+# Description: Sets a boolean indicated whether the ports in this list are NOT vlan-tagged ports
+#
+# Arguments: portList - A list of ports to tag.  A port identifier is of the list form: chassis card port.
+#
+# Returns: TCL_OK on success and TCL_ERROR on failure
+########################################################################
+proc setUntagged {portList} \
+{
+    return [vlanUtils::setUntagged $portList]
+}
+
+
+########################################################################
+# Procedure: isPortTagged
+#
+# Description: Returns a boolean indicated whether this port is a vlan-tagged port
+#
+# Arguments:
+#   chassis - The number of the chassis for the port
+#   card - The number of the card for the port
+#   port - The number of the port
+#
+# Returns: true if the port is tagged and false if it is not.
+########################################################################
+proc isPortTagged {chassis card port} \
+{
+    return [vlanUtils::isPortTagged $chassis $card $port]
+}
+
+
+########################################################################
+# Procedure: getUntaggedPortList
+#
+# Description: Returns the list of untagged ports
+#
+# Arguments:
+#
+# Returns: The list of untagged ports.
+########################################################################
+proc getUntaggedPortList {} \
+{
+    return $::vlanUtils::untaggedPortList
+}
+
+
+########################################################################
+# Procedure: emptyUntaggedPortList
+#
+# Description: Reset the untagged port list to a empty list.
+#
+# Arguments:
+#
+# Returns:
+########################################################################
+proc emptyUntaggedPortList {} \
+{
+    vlanUtils::emptyUntaggedPortList
+}
+
diff --git a/dep/tclclient/ixTcl1.0/Generic/xmlUtils.tcl b/dep/tclclient/ixTcl1.0/Generic/xmlUtils.tcl
new file mode 100644
index 00000000..3fa6463b
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/Generic/xmlUtils.tcl
@@ -0,0 +1,241 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: xmlUtils.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	3-7-2007	DS	Genesis
+#
+# Description: Simple XML parser.  
+#
+# credit to Keith Vetter, March 2004
+# http://wiki.tcl.tk/11020
+#
+# Modified to work with both tcl8.3 & tcl8.4.
+#
+##################################################################################
+
+ namespace eval ::ixXML { variable XML "" loc 0}
+
+ proc ::ixXML::Init {xmlData} {
+    variable XML
+    variable loc
+
+    set XML [string trim $xmlData];
+    regsub -all {<!--.*?-->} $XML {} XML        ;# Remove all comments
+    set loc 0
+ }
+
+ # Returns {XML|TXT|EOF|PI value attributes START|END|EMPTY}
+ proc ::ixXML::NextToken {{peek 0}} {
+    variable XML
+    variable loc
+
+    set n [regexp -start $loc -indices {(.*?)\s*?<(/?)(.*?)(/?)>} \
+               $XML all txt stok tok etok]
+    if {! $n} {return [list EOF]}
+    foreach {all0 all1} $all {txt0 txt1} $txt \
+        {stok0 stok1} $stok {tok0 tok1} $tok {etok0 etok1} $etok break
+
+    if {$txt1 >= $txt0} {                       ;# Got text
+        set txt [string range $XML $txt0 $txt1]
+        if {! $peek} {set loc [expr {$txt1 + 1}]}
+        return [list TXT $txt]
+    }
+
+    set token [string range $XML $tok0 $tok1]   ;# Got something in brackets
+    if {! $peek} {set loc [expr {$all1 + 1}]}
+    if {[regexp {^!\[CDATA\[(.*)\]\]} $token => txt]} { ;# Is it CDATA stuff?
+        return [list TXT $txt]
+    }
+
+    # Check for Processing Instruction <?...?>
+    set type XML
+    if {[regexp {^\?(.*)\?$} $token => token]} {
+        set type PI
+    }
+    set attr ""
+    regexp {^(.*?)\s+(.*?)$} $token => token attr
+
+    set etype START                             ;# Entity type
+    if {$etok0 <= $etok1} {
+        if {$stok0 <= $stok1} { set token "/$token"} ;# Bad XML
+        set etype EMPTY
+    } elseif {$stok0 <= $stok1} {
+        set etype END
+    }
+    return [list $type $token $attr $etype]
+ }
+ # ::ixXML::IsWellFormed
+ #  checks if the XML is well-formed )http://www.w3.org/TR/1998/REC-xml-19980210)
+ #
+ # Returns "" if well-formed, error message otherwise
+ # missing:
+ #  characters: doesn't check valid extended characters
+ #  attributes: doesn't check anything: quotes, equals, unique, etc.
+ #  text stuff: references, entities, parameters, etc.
+ #  doctype internal stuff
+ #
+ proc ::ixXML::IsWellFormed {} {
+    set result [::ixXML::_IsWellFormed]
+    set ::ixXML::loc 0
+    return $result
+ }
+ ;proc ::ixXML::_IsWellFormed {} {
+    array set emsg {
+        XMLDECLFIRST "The XML declaration must come first"
+        MULTIDOCTYPE "Only one DOCTYPE is allowed"
+        INVALID "Invalid document structure"
+        MISMATCH "Ending tag '$val' doesn't match starting tag"
+        BADELEMENT "Bad element name '$val'"
+        EOD "Only processing instructions allowed at end of document"
+        BADNAME "Bad name '$val'"
+        BADPI "No processing instruction starts with 'xml'"
+    }
+
+    # [1] document ::= prolog element Misc*
+    # [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
+    # [27] Misc ::= Comment | PI | S
+    # [28] doctypedecl ::= <!DOCTYPE...>
+    # [16] PI ::= <? Name ...?>
+    set seen 0                                  ;# 1 xml, 2 pi, 4 doctype
+    while {1} {
+        foreach {type val attr etype} [::ixXML::NextToken] break
+        if {[string equal $type "PI"]} {
+            if {! [regexp {^[a-zA-Z_:][a-zA-Z0-9.-_:\xB7]+$} $val]} {
+                return [subst $emsg(BADNAME)]
+            }
+            if {[string equal $val "xml"]} {                ;# XMLDecl
+                if {$seen != 0} { return $emsg(XMLDECLFIRST) }
+                # TODO: check version number exist and only encoding and
+                # standalone attributes are allowed
+                incr seen                       ;# Mark as seen XMLDecl
+                continue
+            }
+            if {[string equal -nocase "xml" $val]} {return $emsg(BADPI)}
+            set seen [expr {$seen | 2}]         ;# Mark as seen PI
+            continue
+        } elseif {[string equal $type "XML"] && [string equal $val "!DOCTYPE"]} { ;# Doctype
+            if {$seen & 4} { return $emsg(MULTIDOCTYPE) }
+            set seen [expr {$seen | 4}]
+            continue
+        }
+        break
+    }
+
+    # [39] element ::= EmptyElemTag | STag content ETag
+    # [40] STag ::= < Name (S Attribute)* S? >
+    # [42] ETag ::= </ Name S? >
+    # [43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*
+    # [44] EmptyElemTag ::= < Name (S Attribute)* S? />
+    #
+
+    set stack {}
+    set first 1
+    while {1} {
+        if {! $first} {                         ;# Skip first time in
+            foreach {type val attr etype} [::ixXML::NextToken] break
+        } else {
+            if {![string equal $type "XML"] && ![string equal $type "EOF"]} { return $emsg(INVALID) }
+            set first 0
+        }
+
+        if {[string equal $type "EOF"]} break
+        ;# TODO: check attributes: quotes, equals and unique
+
+        if {[string equal $type "TXT"]} continue
+        if {! [regexp {^[a-zA-Z_:][a-zA-Z0-9.-_:\xB7]+$} $val]} {
+            return [subst $emsg(BADNAME)]
+        }
+
+        if {[string equal $type "PI"]} {
+            if {[string equal -nocase xml $val]} { return $emsg(BADPI) }
+            continue
+        }
+        if {[string equal $etype "START"]} {                ;# Starting tag
+            lappend stack $val
+        } elseif {[string equal $etype "END"]} {            ;# </tag>
+            if {![string equal $val [lindex $stack end]]} { return [subst $emsg(MISMATCH)] }
+            set stack [lrange $stack 0 end-1]
+            if {[llength $stack] == 0} break    ;# Empty stack
+        } elseif {[string equal $etype "EMPTY"]} {          ;# <tag/>
+        }
+    }
+
+    # End-of-Document can only contain processing instructions
+    while {1} {
+        foreach {type val attr etype} [::ixXML::NextToken] break
+        if {[string equal $type "EOF"]} break
+        if {[string equal $type "PI"]} {
+            if {[string equal -nocase xml $val]} { return $emsg(BADPI) }
+            continue
+        }
+        return $emsg(EOD)
+    }
+    return ""
+ }
+
+ ################################################################
+ #
+ # Demo code
+ #
+ #set xml {<?xml version="1.0" encoding="ISO-8859-1"?>
+ #   <loc version="1.0" src="Groundspeak">
+ #   <waypoint>
+ #   <name id="GCGPXK"><![CDATA[Playing Poker with the Squirrels by Rino 'n Rinette]]></name>
+ #   <coord lat="40.1548166" lon="-82.5202833"/>
+ #   <type>Geocache</type>
+ #   <link text="Cache Details">http://www.geocaching.com/seek/cache_details.aspx?wp=GCGPXK</link>
+ #   </waypoint><waypoint>
+ #   <name id="GC19DF"><![CDATA[Great Playground Caper by Treasure Hunters Inc.]]></name>
+ #   <coord lat="40.0667166666667" lon="-82.5358"/>
+ #   <type>Geocache</type>
+ #   <link text="Cache Details">http://www.geocaching.com/seek/cache_details.aspx?wp=GC19DF</link>
+ #   </waypoint>
+ #   </loc>
+ #}
+#
+# ::ixXML::Init $xml
+# set wellFormed [::ixXML::IsWellFormed]
+# if {![string equal $wellFormed ""]} {
+#    puts "The xml is not well-formed: $wellFormed"
+# } else {
+#    puts "The xml is well-formed"
+#    while {1} {
+#       foreach {type val attr etype} [::ixXML::NextToken] break
+#       puts "looking at: $type '$val' '$attr' '$etype'"
+#       if {$type == "EOF"} break
+#    }
+# }
\ No newline at end of file
diff --git a/dep/tclclient/ixTcl1.0/ixInit.tcl b/dep/tclclient/ixTcl1.0/ixInit.tcl
new file mode 100644
index 00000000..6953aa5b
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/ixInit.tcl
@@ -0,0 +1,65 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 
+#   Version 6.20
+#   
+#   File: ixInit.tcl
+#
+# NOTE: This file should be sourced from the ixTcl1.0 directory structure
+#
+# Copyright ©  IXIA.
+# All Rights Reserved.
+#
+#############################################################################################
+
+# Set the initial pattern to nothing
+set newPatterns {}
+
+# Get the current directory
+set dir [pwd]
+
+# Get all items in the directory
+foreach fileItem1 [glob -nocomplain *] {
+
+    # We only are concerned with directories
+    if {[file isdirectory $fileItem1]} {
+        lappend newPatterns [file join $fileItem1 "*.tcl"]
+
+        foreach fileItem2 [glob -nocomplain $fileItem1/*] {
+            if {[file isdirectory $fileItem2]} {
+                lappend newPatterns [file join $fileItem2 "*.tcl"]
+            } 
+        }
+    } 
+}
+
+eval auto_mkindex . $newPatterns
+
+
diff --git a/dep/tclclient/ixTcl1.0/ixTclHal.tcl b/dep/tclclient/ixTcl1.0/ixTclHal.tcl
new file mode 100644
index 00000000..72ad01ca
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/ixTclHal.tcl
@@ -0,0 +1,192 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: ixTclHal.tcl
+#
+#  Package initialization file
+#
+#  This file is executed when you use "package require IxTclHal" to
+#  load the IxTclHal library package.  It sets up the IXTCLHAL_LIBRARY
+#  environment variable to point to the directory where the package
+#  resides.
+#
+#  If the package is being loaded from a multi-user template script, then continue
+#  otherwise return rightaway
+#
+#   Copyright ©  IXIA.
+#	All Rights Reserved.
+#
+#############################################################################################
+
+## basically this is a keeping room for all the method pointer stuff + ixTclHal package req procs
+namespace eval ixTclHal {
+    variable noArgList
+    variable pointerList
+    variable protocolList
+    variable commandList
+
+    variable cleanUpDone    0
+	variable nonDeprecatedCommands	[list]
+
+    proc update {MyList} \
+    {
+        upvar $MyList myList
+
+        variable noArgList
+        variable pointerList
+        variable protocolList
+        variable commandList
+        
+        set myList [join [list $noArgList $pointerList $protocolList $commandList]]
+    }
+
+    proc createCommand {object command args} \
+    {
+        # make sure the command doesn't already exist so that we don't step on it!!
+        if {[llength [info commands ::$command]] == 0} {
+            validateArgs $args
+            eval [format "proc ::%s {args}                                 \
+                          {                                                \
+                              if {\[%s %s [join $args]\] == \"\"} {        \
+	                              puts \"Error instantiating %s object!\"; \
+	                              return 1;                                \
+                              };                                           \
+                              return \[eval %s \$args];                    \
+                          }"                                               \
+                 $command $object $command $object $command] 
+        }       
+    }
+
+    proc createCommandPtr {object command args} \
+    {
+        # make sure the command doesn't already exist so that we don't step on it!!
+        if {[llength [info commands ::$command]] == 0} {
+            set ptrCmd [format "$command%s" Ptr]
+            validateArgs $args
+            eval [format "proc ::%s {args}                                   \
+                          {                                                \
+                              set ::%s \[%s %s [join $args]\];             \
+                              if {\$::%s == \"\"} {                        \
+	                              puts \"Error instantiating %s object!\"; \
+	                              return 1;                                \
+                              };                                           \
+                              return \[eval %s \$args];                    \
+                          }"                                               \
+                 $command $ptrCmd $object $command $ptrCmd $object $command $command]
+        }
+    }
+
+    # this one is scary; it adds a line of code to the created proc right before the return
+    # so that we can setup pointers in an ixTclHal object
+    proc updateCommand {command args} \
+    {
+        set commandProc [string trim [info body $command]]
+        set lastcmd     [string range $commandProc [string last return $commandProc] end]
+
+        eval [format "proc ::%s {args}                                   \
+                      {                                                \ 
+                          %s                                           \
+                      }"                                               \
+             $command [concat [string range $commandProc 0 [expr [string last return $commandProc]-1]] [format "%s;" [join $args]] $lastcmd] ]
+    }
+
+    proc validateArgs {args} \
+    {
+        set args [join $args]
+        if {$args != ""} {
+            foreach cmdPtr $args {
+                regsub -all {[$]} $cmdPtr "" cmdPtr
+                if {![info exists $cmdPtr]} {
+                    regsub -all {[;:"$']} $cmdPtr "" cmd
+                    regsub "Ptr$" $cmd "" cmd
+                    catch {$cmd}
+                }
+            }
+        }
+    }
+
+    proc cleanUpDone   {} {variable cleanUpDone; set cleanUpDone 1}
+    proc isCleanUpDone {} {variable cleanUpDone; return $cleanUpDone}
+}
+
+
+set currDir [file dirname [info script]]
+
+source [file join $currDir ixTclSetup.tcl]
+source [file join $currDir ixTclHalSetup.tcl]
+
+package provide IxTclHal 6.20
+
+
+#
+# Source the user configuration file located in the following directory.
+#
+# IXIA_DIR/TclScripts/lib/ixTcl1.0
+#
+# IXIA_DIR is the name of the directory where IXIA software is installed.
+# The directory UserFiles should be created while IXIA software is being
+# installed.
+#
+# The name of the file has to be userProfile.tcl.
+#
+catch {
+    source [file join $currDir userProfile.tcl]
+}
+
+if {[catch {source [file join $currDir ixScriptmatePackageControl.tcl]}] } {
+    catch {package require Scriptmate}
+}
+
+# Recent IxNetwork Tcl pacakges allow the user to specify a version.  Try that first:
+if {[info exists ::IxTclHal_LoadIxTclProtocolVersion]} {
+    # If the user requests "none", simply do not load the package at all
+    if {$::IxTclHal_LoadIxTclProtocolVersion != "none"} {
+        # Attempt to require the specified version of IxTclProtocol package
+        if {[catch {package require IxTclProtocol $::IxTclHal_LoadIxTclProtocolVersion} IxTclProtocol_result} {
+            # Display a helpful message on failure
+            set savInfo $::errorInfo
+            if {[catch {package versions IxTclProtocol} versionList]} {
+                set versionList [list]
+            }
+            set errMsg "Couldn't load IxTclProtocol version \"$::IxTclHal_LoadIxTclProtocolVersion\" ('set ::IxTclHal_LoadIxTclProtocolVersion \"none\"', or any of: $versionList, or unset it)"
+            error $errMsg $savInfo
+        }
+    }
+} else {
+    # If the user did not specify a version, try to load the first IxTclProtocol we can find:
+    if {[catch {package require IxTclProtocol}] } {
+        # Finally, try the legacy location:
+        catch {source [file join $currDir ixTclProtocolPackageControl.tcl] }
+        # If nothing is found, that's ok, IxNetwork is just not installed
+    }
+}
+
diff --git a/dep/tclclient/ixTcl1.0/ixTclHalSetup.tcl b/dep/tclclient/ixTcl1.0/ixTclHalSetup.tcl
new file mode 100644
index 00000000..84eaeb95
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/ixTclHalSetup.tcl
@@ -0,0 +1,400 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 
+#   Version 6.20
+#   
+#   File: ixTclHalSetup.tcl
+#
+#  Package initialization file
+#
+#  This file is executed when you use "package require IxTclHal" to
+#  load the IxTclHal library package. It sets up the TclHal related
+#  objects and commands. This file will be called by ixtclhal.tcl file
+#  on the server side or whereever the TclHal.dll file is installed.
+#
+#
+# Copyright Â©  IXIA.
+# All Rights Reserved.
+#
+#############################################################################################
+
+if [isWindows] {
+    load ixTclHal.dll
+
+	# This is done for the applications that don't know the location of the mpexpr10.dll, itm
+	set mpexprPath "$env(IXTCLHAL_LIBRARY)/../../bin"
+	if { [catch {load Mpexpr10.dll}] } {
+		catch {load $mpexprPath/Mpexpr10.dll}
+	}
+
+
+    ############################ OBJECT INSTANTIATION ##########################
+
+    foreach procName $ixTclHal::noArgList {
+        set tclCmd [format "TCL%s%s" [string toupper [string index $procName 0]] [string range $procName 1 end]]
+        ixTclHal::createCommand $tclCmd $procName
+    }
+
+    ixTclHal::createCommand TCLStatistics    stat
+    ixTclHal::createCommand TCLUtils         ixUtils
+    ixTclHal::createCommand TCLVsrStatistics vsrStat
+
+    foreach procName $ixTclHal::pointerList {
+        set tclCmd [format "TCL%s%s" [string toupper [string index $procName 0]] [string range $procName 1 end]]
+        ixTclHal::createCommandPtr $tclCmd $procName
+    }
+
+    foreach procName $ixTclHal::protocolList {
+        set tclCmd [format "TCL%s%s" [string toupper [string index $procName 0]] [string range $procName 1 end]]
+        ixTclHal::createCommand $tclCmd $procName \$::portPtr
+    }
+	ixTclHal::createCommandPtr TCLProtocolOffset	  protocolOffset   \$::portPtr
+    ixTclHal::createCommandPtr TCLStream              stream           \$::portPtr \$::protocolPtr \$::protocolOffsetPtr
+    ixTclHal::createCommandPtr TCLIgmpAddressTable    igmpAddressTable \$::igmpAddressTableItemPtr
+    ixTclHal::createCommandPtr TCLRip                 rip              \$::portPtr
+    ixTclHal::createCommandPtr TCLMpls                mpls             \$::portPtr 
+    ixTclHal::createCommand    TCLAtmHeader           atmHeader        \$::portPtr \$::atmHeaderCounterPtr
+    ixTclHal::createCommandPtr TCLSrpDiscovery        srpDiscovery     \$::portPtr \$::srpMacBindingPtr
+    ixTclHal::createCommandPtr TCLSrp                 srpHeader        \$::portPtr \$::protocolPtr
+    ixTclHal::createCommand    TCLIgmp			      igmp			   \$::portPtr	\$::igmpGroupRecordPtr
+
+    ixTclHal::createCommandPtr TCLUdf                 udf              \$::streamPtr
+    ixTclHal::createCommand    TCLTableUdf            tableUdf         \$::portPtr	\$::tableUdfColumnPtr
+    ixTclHal::createCommand    TCLSequenceNumberUdf   sequenceNumberUdf \$::portPtr
+    ixTclHal::createCommand    TCLPacketGroup         packetGroup       \$::udfPtr \$::packetGroupThresholdListPtr
+    ixTclHal::createCommand    TCLPacketLengthInsertion      packetLengthInsertion   \$::streamPtr
+
+    ixTclHal::createCommand    TCLIpAddressTable      ipAddressTable   \$::ipAddressTableItemPtr
+    ixTclHal::createCommand    TCLArpServer           arpServer        \$::arpAddressTableEntryPtr
+    ixTclHal::createCommand    TCLRipRoute            ripRoute         \$::ripPtr
+    ixTclHal::createCommand    TCLMplsLabel           mplsLabel        \$::mplsPtr
+
+    ixTclHal::createCommandPtr TCLRprRingControl            rprRingControl  \$::portPtr \$::protocolPtr
+    ixTclHal::createCommandPtr TCLRprTlvIndividualBandwidth rprTlvIndividualBandwidth   \$::rprTlvBandwidthPairPtr
+    ixTclHal::createCommand    TCLRprTopology               rprTopology     \$::portPtr \$::rprTlvIndividualBandwidthPtr \
+                                                                                        \$::rprTlvStationNamePtr    \
+                                                                                        \$::rprTlvNeighborAddressPtr    \
+                                                                                        \$::rprTlvTotalBandwidthPtr     \
+                                                                                        \$::rprTlvVendorSpecificPtr     \
+                                                                                        \$::rprTlvWeightPtr 
+																						
+
+																						
+    ixTclHal::createCommandPtr TCLIpV6HopByHop      ipV6HopByHop       \$::ipV6OptionPAD1Ptr                    \
+                                                                       \$::ipV6OptionPADNPtr                    \
+                                                                       \$::ipV6OptionJumboPtr                   \
+                                                                       \$::ipV6OptionRouterAlertPtr             \
+                                                                       \$::ipV6OptionBindingUpdatePtr           \
+                                                                       \$::ipV6OptionBindingAckPtr              \
+                                                                       \$::ipV6OptionBindingRequestPtr          \
+                                                                       \$::ipV6OptionMIpV6UniqueIdSubPtr        \
+                                                                       \$::ipV6OptionMIpV6AlternativeCoaSubPtr  \
+                                                                       \$::ipV6OptionUserDefinePtr
+
+    ixTclHal::createCommandPtr TCLIpV6Destination   ipV6Destination    \$::ipV6OptionPAD1Ptr                    \
+                                                                       \$::ipV6OptionPADNPtr                    \
+                                                                       \$::ipV6OptionHomeAddressPtr             
+																						                                          
+
+    ixTclHal::createCommand    TCLIpV6               ipV6              \$::portPtr  \$::ipV6RoutingPtr          \
+                                                                                    \$::ipV6FragmentPtr         \
+                                                                                    \$::ipV6DestinationPtr      \
+                                                                                    \$::ipV6AuthenticationPtr	\
+																					\$::ipV6HopByHopPtr
+    ixTclHal::createCommandPtr TCLCustomOrderedSet   customOrderedSet
+    ixTclHal::createCommand    TCLLinkFaultSignaling linkFaultSignaling \$::customOrderedSetPtr
+    ixTclHal::createCommandPtr TCLPacketGroupStats   packetGroupStats  \$::latencyBinPtr
+    ixTclHal::createCommandPtr TCLGfp				 gfp			   \$::portPtr
+                                                                                        
+    ixTclHal::createCommand    TCLAtmOam			atmOam				\$::portPtr		\$::atmOamAisPtr	\
+                                                                                        \$::atmOamRdiPtr	\
+                                                                                        \$::atmOamFaultManagementCCPtr	\
+                                                                                        \$::atmOamFaultManagementLBPtr  \
+																						\$::atmOamActDeactPtr
+                                                                                        
+    ixTclHal::createCommandPtr TCLAtmOamTrace		atmOamTrace			\$::portPtr
+
+    ixTclHal::createCommandPtr TCLVlan				vlan		        \$::portPtr
+    ixTclHal::createCommand	   TCLStackedVlan       stackedVlan         \$::portPtr \$::vlanPtr
+
+
+    ixTclHal::createCommandPtr TCLMmd   mmd     \$::mmdRegisterPtr
+    ixTclHal::createCommandPtr TCLMiiae miiae   \$::mmdPtr
+
+    ixTclHal::createCommandPtr TCLDhcpV4Properties		dhcpV4Properties		\$::dhcpV4TlvPtr
+    ixTclHal::createCommandPtr TCLDhcpV4DiscoveredInfo  dhcpV4DiscoveredInfo	\$::dhcpV4TlvPtr
+
+	# dhcpV6Tlv command is exactly the same as dhcpV4Tlv.  We use the same underlying C++ object.
+	ixTclHal::createCommandPtr TCLDhcpV4Tlv				dhcpV6Tlv	
+    ixTclHal::createCommandPtr TCLDhcpV6Properties		dhcpV6Properties		\$::dhcpV6TlvPtr
+    ixTclHal::createCommandPtr TCLDhcpV6DiscoveredInfo  dhcpV6DiscoveredInfo	\$::dhcpV6TlvPtr
+
+    # fipTlv command is exactly the same as dhcpV4Tlv.  We use the same underlying C++ object.
+	ixTclHal::createCommandPtr TCLDhcpV4Tlv				fipTlv
+	ixTclHal::createCommandPtr TCLFcoeProperties	fcoeProperties  \$::fipTlvPtr  \
+	                                                                \$::fcoePlogiPtr  \
+                                                                    \$::fcoeNameServerPtr \
+                                                                    \$::fcNameServerQueryPtr
+                                                                    
+    ixTclHal::createCommandPtr TCLFcProperties	   fcProperties  		\$::fcPlogiPtr  \
+																		\$::fcNameServerPtr \
+																		\$::fcNameServerQueryPtr
+	                                                                
+	ixTclHal::createCommandPtr TCLNpivProperties	npivProperties  \$::fcoePlogiPtr  \
+																	\$::fcoeNameServerPtr \
+                                                                    \$::fcNameServerPtr \
+                                                                    \$::fcNameServerQueryPtr
+																	
+	ixTclHal::createCommandPtr TCLDcbxProperties	dcbxProperties  \$::lldpPortIdPtr    \
+	                                                                \$::dcbxPriorityGroupFeaturePtr  \
+	                                                                \$::dcbxPfcFeaturePtr  \
+	                                                                \$::dcbxFcoeFeaturePtr  \
+	                                                                \$::dcbxLogicalLinkFeaturePtr  \
+                                                                    \$::dcbxCustomFeaturePtr  \
+                                                                    \$::dcbxIscsiFeaturePtr
+                                                            	
+	ixTclHal::createCommandPtr TCLInterfaceEntry     interfaceEntry     \$::interfaceIpV4Ptr	\
+																		\$::interfaceIpV6Ptr	\
+																		\$::dhcpV4PropertiesPtr \
+																		\$::dhcpV6PropertiesPtr \
+																		\$::fcoePropertiesPtr	\
+																		\$::npivPropertiesPtr	\
+																		\$::ptpPropertiesPtr    \
+																		\$::dcbxPropertiesPtr   \
+																		\$::fcPropertiesPtr 
+
+    ixTclHal::createCommandPtr TCLDiscoveredNeighbor discoveredNeighbor \$::discoveredAddressPtr
+    ixTclHal::createCommandPtr TCLDiscoveredList     discoveredList     \$::discoveredNeighborPtr \$::discoveredAddressPtr
+    
+    ixTclHal::createCommandPtr TCLDcbxDiscoveredInfo dcbxDiscoveredInfo  \$::dcbxPriorityGroupFeaturePtr  \
+																		 \$::dcbxPfcFeaturePtr  \
+																		 \$::dcbxFcoeFeaturePtr  \
+																		 \$::dcbxLogicalLinkFeaturePtr  \
+																		 \$::dcbxCustomFeaturePtr    \
+																		 \$::dcbxControlTlvPtr  \
+																		 \$::dcbxIscsiFeaturePtr
+
+    ixTclHal::createCommand    TCLInterfaceTable     interfaceTable     \$::interfaceEntryPtr			\
+																	    \$::discoveredListPtr			\
+																		\$::dhcpV4DiscoveredInfoPtr		\
+																		\$::dhcpV6DiscoveredInfoPtr		\
+																		\$::fcoeDiscoveredInfoPtr		\
+																		\$::ptpDiscoveredInfoPtr        \
+																		\$::dcbxDiscoveredInfoPtr
+
+    ixTclHal::createCommand    TCLSonetCircuitList   sonetCircuitList   \$::sonetCircuitPtr
+
+    ixTclHal::createCommand    TCLMacSecTx			 macSecTx		    \$::macSecChannelPtr 
+    ixTclHal::createCommand    TCLMacSecRx			 macSecRx		    \$::macSecChannelPtr
+    ixTclHal::createCommand    TCLMacSecTag			 macSecTag			\$::portPtr
+
+    ixTclHal::createCommandPtr TCLOamInformation     oamInformation		\$::oamLocalInformationTlvPtr	\
+																		\$::oamRemoteInformationTlvPtr  \
+																		\$::oamOrganizationSpecificTlvPtr                   
+
+    ixTclHal::createCommandPtr TCLOamEventNotification oamEventNotification	\$::oamSymbolPeriodTlvPtr	\
+																			\$::oamFrameTlvPtr			\
+																			\$::oamFramePeriodTlvPtr	\
+																			\$::oamSummaryTlvPtr		\
+																			\$::oamEventOrgTlvPtr
+
+    ixTclHal::createCommandPtr TCLOamVariableRequest oamVariableRequest		\$::oamVariableRequestTlvPtr
+    ixTclHal::createCommandPtr TCLOamVariableResponse oamVariableResponse	\$::oamVariableResponseTlvPtr
+																		
+																			                   
+    ixTclHal::createCommand    TCLOamHeader          oamHeader          \$::portPtr \$::oamInformationPtr			\
+                                                                                    \$::oamEventNotificationPtr     \
+                                                                                    \$::oamVariableRequestPtr		\
+                                                                                    \$::oamVariableResponsePtr      \
+                                                                                    \$::oamLoopbackControlPtr		\
+																					\$::oamOrganizationSpecificPtr
+
+    ixTclHal::createCommand    TCLCiscoMetaData		ciscoMetaData       \$::portPtr \$::ciscoMetaDataSourceGroupTagPtr	\
+																					\$::ciscoMetaDataCustomOptionPtr
+
+    ixTclHal::createCommand    TCLConditionalStats	conditionalStats    \$::conditionalTablePtr
+
+    ixTclHal::createCommand    TCLPtp          ptp						\$::portPtr \$::ptpAnnouncePtr			\
+                                                                                    \$::ptpDelayRequestPtr		\
+                                                                                    \$::ptpSyncPtr				\
+                                                                                    \$::ptpFollowUpPtr			\
+                                                                                    \$::ptpDelayResponsePtr		
+
+
+    ixTclHal::createCommandPtr TCLIcmpV6NeighborDiscovery	icmpV6NeighborDiscovery \$::icmpV6OptionLinkLayerSourcePtr      \
+																					\$::icmpV6OptionLinkLayerDestinationPtr \
+																					\$::icmpV6OptionPrefixInformationPtr    \
+																					\$::icmpV6OptionRedirectedHeaderPtr		\
+																					\$::icmpV6OptionMaxTransmissionUnitPtr  \
+																					\$::icmpV6OptionUserDefinePtr
+																					
+
+	ixTclHal::createCommand    TCLIcmpV6               icmpV6			\$::portPtr \$::icmpV6ErrorPtr				\
+																					\$::icmpV6InformationalPtr		\
+                                                                                    \$::icmpV6MulticastListenerPtr	\
+                                                                                    \$::icmpV6NeighborDiscoveryPtr	\
+                                                                                    \$::icmpV6UserDefinePtr
+
+    ixTclHal::createCommand    TCLCommonTransport    commonTransport    \$::portPtr                             \
+                                                                        \$::ctPreamblePtr                       \
+                                                                        \$::ctGetAllNextRequestPtr              \
+                                                                        \$::ctGetAllNextAcceptPtr               \
+                                                                        \$::ctGetPortNameRequestPtr             \
+                                                                        \$::ctGetPortNameAcceptPtr              \
+                                                                        \$::ctGetNodeNameRequestPtr             \
+                                                                        \$::ctGetNodeNameAcceptPtr              \
+                                                                        \$::ctGetFC4TypeRequestPtr              \
+                                                                        \$::ctRegisterNodeNameRequestPtr
+
+    ixTclHal::createCommandPtr TCLFcpCommandStatus     fcpCommandStatus \$::fcpSnsInfoPtr
+
+    ixTclHal::createCommand    TCLFcp                  fcp              \$::portPtr                     \
+                                                                        \$::fcpCommandStatusPtr         \
+                                                                        \$::fcpUnsolicitedCommandPtr    \
+                                                                        \$::fcpDataDescriptorPtr        \
+                                                                        \$::fcpScsiReadPtr              \
+                                                                        \$::fcpScsiWritePtr             \
+                                                                        \$::fcpScsiInquiryPtr
+
+    ixTclHal::createCommand    TCLBasicLinkServices    basicLinkServices    \$::portPtr
+
+    ixTclHal::createCommand    TCLExtendedLinkServices  extendedLinkServices    \$::portPtr  \
+                                                                                \$::elsFlogiPtr \
+                                                                                \$::elsPlogiPtr \
+                                                                                \$::elsFdiscPtr \
+                                                                                \$::elsLsAccPtr \
+                                                                                \$::elsLogoPtr  \
+                                                                                \$::elsScrPtr   \
+                                                                                \$::elsLsRjtPtr \
+                                                                                \$::elsRscnPtr
+
+    ixTclHal::createCommand    TCLFcSOF                 fcSOF           \$::portPtr
+
+    ixTclHal::createCommand    TCLFcEOF                 fcEOF           \$::portPtr
+
+
+	ixTclHal::createCommandPtr    TCLNetworkHeader    networkHeader        \$::iEEE48BitAddressSrcPtr        \
+																		   \$::iEEEExtendedSrcPtr            \
+																	       \$::locallyAssignedSrcPtr         \
+																		   \$::iEEERegisteredSrcPtr          \
+																		   \$::iEEERegisteredExtendedSrcPtr  \
+																		   \$::eUI64MappedSrcPtr             \
+                                                                           \$::iEEE48BitAddressDestPtr       \
+                                                                           \$::iEEEExtendedDestPtr           \
+                                                                           \$::locallyAssignedDestPtr        \
+                                                                           \$::iEEERegisteredDestPtr         \
+                                                                           \$::iEEERegisteredExtendedDestPtr \
+                                                                           \$::eUI64MappedDestPtr  
+	
+	ixTclHal::createCommand    TCLFibreChannel       fibreChannel       \$::portPtr                 \
+																		\$::vftHeaderPtr            \
+																		\$::ifrHeaderPtr            \
+																		\$::encHeaderPtr            \
+																		\$::espHeaderPtr            \
+																		\$::associationHeaderPtr    \
+                                                                        \$::networkHeaderPtr 
+                                                                        
+	ixTclHal::createCommandPtr    TCLProtocolPad		 protocolPad	\$::portPtr  
+
+    ixTclHal::createCommandPtr      TCLHse40GQsfpLane   hse40GQsfpLane
+    ixTclHal::createCommand         TCLHse40GQsfp       hse40GQsfp        \$::hse40GQsfpLanePtr
+    
+    ixTclHal::createCommandPtr      TCLHseCfpQsfpLane   hseCfpQsfpLane
+    ixTclHal::createCommand         TCLHseCfpQsfp       hseCfpQsfp        \$::hseCfpQsfpLanePtr    
+
+    # Enable logging of messages from SWIG
+    enableEvents true
+
+    #################################################################################
+    # Procedure: after
+    #
+    # NOTE:  This command effective 'steps on' the original after command
+    #        so that we have more control over what happens during the sleep
+    #        process (ie., so that we can make some task switches)
+    #
+    #        It is used *exactly* like the original after.
+    #
+    #        This proc is here because we don't want to overload the 'after' command
+    #        in unix, only windows.
+    #
+    # Argument(s):
+    #   duration    - time to sleep, in milliseconds
+    #
+    #################################################################################
+    proc after {args} \
+    {
+	    set retCode ""
+
+	    set argc    [llength $args]
+
+	    set duration  [lindex $args 0]  
+	    if {[stringIsInteger $duration] && $argc == 1} {
+		    ixSleep $duration
+		    set retCode ""
+	    } else {
+		    catch {eval originalAfter $args} retCode
+	    }
+
+	    set retCode [stringSubstitute $retCode originalAfter after]
+
+	    return $retCode
+    }
+
+} else {
+    catch {package req Mpexpr}
+
+    proc enableEvents {flag} {}
+	logMsg "Tcl Client is running Ixia Software version: $env(IXIA_VERSION)"
+}
+
+
+# note that mpexpr is only req'd for 8.3 & below.
+if {[info command mpexpr] == ""} {
+    # if we didn't get a real mpexpr AND we're not 8.4, that's ugly so throw an exception - otherwise just make it work
+    if {[info tclversion] <= 8.3} {
+        puts "Package req failed: Mpexpr package/file not found"
+        return -code error -errorinfo "Mpexpr package/file not found"
+    } else {    
+        proc mpexpr {args}   {return [eval expr $args]}
+        proc mpformat {args} {return [eval format $args]}
+        proc mpincr {args} \
+        {
+            set Item [lindex $args 0]
+            upvar $Item item
+            set args [lrange $args 1 end]
+            return [eval incr item $args]
+        }
+    }
+}
+
+
+useProfile false 
+
+
diff --git a/dep/tclclient/ixTcl1.0/ixTclSetup.tcl b/dep/tclclient/ixTcl1.0/ixTclSetup.tcl
new file mode 100644
index 00000000..de82f41b
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/ixTclSetup.tcl
@@ -0,0 +1,244 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: ixTclSetup.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#	Revision Log:
+#	10-29-2002      DHG     Initial Release
+#
+# Description: Package initialization file.
+#              This file is executed when you use "package require IxTclHal" to
+#              load the IxTclHal library package. It sets up the Tcl-only variables
+#              and is called by the client and server side ixTclHal.tcl files.
+#
+# Copyright ©  IXIA.
+# All Rights Reserved.
+#
+#############################################################################################
+
+set env(IXTCLHAL_LIBRARY) [file dirname [info script]]
+
+proc PromptIxia {} {
+        puts -nonewline "[pwd]> "
+}
+
+# This flag will be set when anyone calls cleanUp proc
+set cleanUpDone 0
+
+#  Not REQUIRED --- this is taken care of below..... source [file join $env(IXTCLHAL_LIBRARY) ixiarc.tcl]
+
+set genPath [file join $env(IXTCLHAL_LIBRARY) Generic]
+
+lappend auto_path $env(IXTCLHAL_LIBRARY)
+
+initializeDefineCommand
+initializeDefineTest
+
+set interfaceFile [file join $genPath interface.tcl]
+source $interfaceFile
+
+set constantsFile [file join $genPath constants.tcl]
+source $constantsFile
+
+
+# rename the system exit with our exit so that we can clean up before calling
+# system exit for Windows only
+if [isWindows] {
+	if {[info commands exit] != ""} {
+		if {[info commands exitOld] == ""} {
+			rename exit exitOld
+		}
+	}	
+	
+	# NOTE: Need to redefine this exit here, AND NOT ANYWHERE ELSE, so that the system
+	# exit gets called when exitOld is called.
+	proc exit {{exitStat 0}} \
+	{
+		cleanUp
+		exitOld $exitStat
+	}
+	# rename the system after with our after so that we can task switch for Windows only
+    if {[info commands after] != ""} {
+        if {[info commands originalAfter] == ""} {
+            rename after originalAfter
+        }
+    }
+}
+
+
+if {[isWindows] && [info commands tk] != ""} {
+    if {![regexp -nocase scriptmate [tk appname]]} {
+        console show
+    }
+}
+
+
+############################# GLOBAL VARIABLES #################################
+#### NOTE: DON'T FORGET TO ADD NEW ONES
+ 
+## these are the simple ones that don't have any ptr parameters...
+set ixTclHal::noArgList    { version session chassisChain chassis card qos streamRegion streamQueue streamQueueList \
+                             portGroup filter filterPallette statGroup statList capture captureBuffer \
+                             splitPacketGroup dataIntegrity tcpRoundTripFlow autoDetectInstrumentation \
+                             protocolServer igmpServer mii usb timeServer forcedCollisions collisionBackoff portCpu \
+                             ppp pppStatus sonet sonetError sonetOverhead atmPort dcc srpUsage \
+                             bert bertErrorGeneration bertUnframed xaui vsrError fecError opticalDigitalWrapper \
+                             ipV6Address logFile remoteConnection licenseManagement \
+							 atmStat atmFilter atmReassembly statWatch txRxPreamble streamExtractorFilter streamExtractorModifier \
+                             flexibleTimestamp pcpuCommandService gfpOverhead streamTransmitStats xfp lasi sfpPlus \
+                             poePoweredDevice poeSignalAcquisition poeAutoCalibration statAggregator \
+							 sonetCircuitProperties lcas prbsCapture oamPort oamStatus \
+							 txLane pcsLaneStatistics pcsLaneError fcPort}
+
+## these are the ones that we need simple pointers returned for other stuff...
+set ixTclHal::pointerList   { port protocol arpAddressTableEntry ipAddressTableItem igmpAddressTableItem \
+                              interfaceIpV4 interfaceIpV6 discoveredAddress atmHeaderCounter \
+                              customOrderedSet srpMacBinding mmdRegister latencyBin \
+                              ipV6Authentication ipV6Routing ipV6Fragment \
+                              rprTlvBandwidthPair rprTlvWeight rprTlvVendorSpecific \
+                              rprTlvTotalBandwidth rprTlvNeighborAddress rprTlvStationName \
+                              tableUdfColumn igmpGroupRecord dhcpV4Tlv \
+							  atmOamAis atmOamRdi atmOamFaultManagementCC atmOamFaultManagementLB atmOamActDeact \
+							  ipV6OptionPAD1 ipV6OptionPADN ipV6OptionJumbo ipV6OptionRouterAlert ipV6OptionBindingUpdate \
+                              ipV6OptionBindingAck ipV6OptionHomeAddress ipV6OptionBindingRequest ipV6OptionMIpV6UniqueIdSub \
+                              ipV6OptionMIpV6AlternativeCoaSub ipV6OptionUserDefine sonetCircuit macSecChannel \
+							  oamLocalInformationTlv oamRemoteInformationTlv oamOrganizationSpecificTlv oamSymbolPeriodTlv \
+							  oamFrameTlv oamFramePeriodTlv oamSummaryTlv oamEventOrgTlv \
+							  oamVariableRequestTlv oamVariableResponseTlv oamLoopbackControl oamOrganizationSpecific	\
+							  ciscoMetaDataSourceGroupTag ciscoMetaDataCustomOption conditionalTable \
+							  fcoeDiscoveredInfo fcoePlogi fcoeNameServer fcNameServerQuery ptpProperties ptpDiscoveredInfo\
+							  ptpAnnounce ptpDelayRequest ptpSync ptpFollowUp ptpDelayResponse packetGroupThresholdList \
+							  icmpV6OptionLinkLayerSource icmpV6OptionLinkLayerDestination icmpV6OptionPrefixInformation \
+							  icmpV6OptionRedirectedHeader icmpV6OptionMaxTransmissionUnit icmpV6OptionUserDefine \
+							  icmpV6Error icmpV6Informational icmpV6MulticastListener icmpV6UserDefine lldpPortId \
+							  dcbxPriorityGroupFeature dcbxPfcFeature dcbxFcoeFeature dcbxIscsiFeature dcbxLogicalLinkFeature \
+                              dcbxCustomFeature dcbxControlTlv ctPreamble ctGetAllNextRequest ctGetAllNextAccept \
+                              ctGetPortNameRequest ctGetPortNameAccept ctGetNodeNameRequest ctGetNodeNameAccept \
+                              ctGetFC4TypeRequest ctRegisterNodeNameRequest elsFlogi elsPlogi elsFdisc elsLsAcc elsLogo \
+                              elsScr elsLsRjt elsRscn fcpUnsolicitedCommand fcpDataDescriptor \
+                              fcpScsiRead fcpScsiWrite fcpScsiInquiry fcpSnsInfo \
+							  iEEE48BitAddressSrc iEEEExtendedSrc locallyAssignedSrc iEEERegisteredSrc iEEERegisteredExtendedSrc eUI64MappedSrc \
+  							  iEEE48BitAddressDest iEEEExtendedDest locallyAssignedDest iEEERegisteredDest iEEERegisteredExtendedDest eUI64MappedDest \
+							  vftHeader ifrHeader encHeader espHeader associationHeader \
+							  fcPlogi fcNameServer hse40GQsfpLane hseCfpQsfpLane}
+																					
+## these are basically all the protocols that require a portPtr parameter for instantiation
+set ixTclHal::protocolList { ip udp tcp ipx icmp arp dhcp gre macSecTag fcoe  \
+                             srpArp srpIps frameRelay hdlc isl pauseControl weightedRandomFramesize \
+                             rprArp rprProtection rprFairness rprOam cdlPreamble dataCenterEncapsulation \
+                             basicLinkServices fcSOF fcEOF}
+
+## this initial list is all the complicated ones
+set ixTclHal::commandList  { stat stream udf mplsLabel mpls rip ripRoute  ipAddressTable igmpAddressTable arpServer\
+                             interfaceTable interfaceEntry discoveredList discoveredNeighbor discoveredAddress  \
+							 packetGroupStats tableUdf sequenceNumberUdf igmp atmOam atmOamTrace vlan stackedVlan protocolOffset \
+							 ipV6 ipV6HopByHop ipV6Destination rprRingControl rprTopology rprTlvIndividualBandwidth  \
+                             miiae mmd srpHeader srpDiscovery atmHeader ixUtils linkFaultSignaling gfp	\
+							 dhcpV4Properties dhcpV4DiscoveredInfo dhcpV6Properties dhcpV6DiscoveredInfo \
+							 sonetCircuitList packetGroup macSecTx macSecRx oamHeader ciscoMetaData ptp \
+							 oamInformation oamEventNotification oamVariableRequest oamVariableResponse conditionalStats \
+							 fcoeProperties npivProperties icmpV6 icmpV6NeighborDiscovery dcbxProperties dcbxDiscoveredInfo \
+                             fibreChannel networkHeader commonTransport extendedLinkServices fcpCommandStatus fcp fcProperties protocolPad \
+                             hse40GQsfp packetLengthInsertion hseCfpQsfp}
+          
+ixTclHal::update ::halCommands
+## These commands needs redefinition of the body during connecting to TCL server							 
+
+set ixTclHal::redefineCommandList [list chassis card port stream captureBuffer tableUdf]
+
+set ::halRedefineCommands [join [list $ixTclHal::redefineCommandList]]
+## We need to append dhcpV6Tlv to halCommands, since it is instantiated as an TCLDhcpV4Tlv and can't be added to ixTclHal::pointerList
+lappend ::halCommands	dhcpV6Tlv
+
+## We need to append fipTlv to halCommands, since it is instantiated as an TCLDhcpV4Tlv and can't be added to ixTclHal::pointerList
+lappend ::halCommands	fipTlv
+
+set halFuncs     { enableEvents clearAllMyOwnership }
+
+set globalArrays { ixgTrialArray ixgTrialCongArray ixgTrialUncongArray \
+                   one2oneArray one2manyArray many2oneArray many2manyArray }
+
+set ixProtocolList {ip udp ptp tcp ipx igmp icmp arp vlan dhcp mpls mplsLabel qos rip ripRoute \
+                    isl frameRelay ipV6 fcoe fibreChannel commonTransport fcp basicLinkServices extendedLinkServices fcSOF fcEOF }
+
+set ixStopTest      0
+set ixStopAction    0
+
+############################ TCL FILES/DIR INITIALIZATION ##########################
+
+if [info exists env(IXIA_RESULTS_DIR)] {
+    #set RESULTS_DIR [file join $env(IXIA_RESULTS_DIR) Results]
+    set RESULTS_DIR $env(IXIA_RESULTS_DIR)
+} else {
+    set RESULTS_DIR [file join [file dirname [file dirname $env(IXTCLHAL_LIBRARY)]] Results]
+    set env(IXIA_RESULTS_DIR) $RESULTS_DIR
+}
+if {![file exists $RESULTS_DIR]} {
+        file mkdir $RESULTS_DIR
+}
+
+if [info exists env(IXIA_LOGS_DIR)] {
+    #set LOGS_DIR [file join $env(IXIA_LOGS_DIR) Logs]
+    set LOGS_DIR $env(IXIA_LOGS_DIR)
+} else {
+    set LOGS_DIR [file join [file dirname [file dirname $env(IXTCLHAL_LIBRARY)]] Logs]
+    set env(IXIA_LOGS_DIR) $LOGS_DIR
+}
+if {![file exists $LOGS_DIR]} {
+        file mkdir $LOGS_DIR
+}
+
+if {![info exists env(IXIA_SAMPLES_DIR)]} {
+    set env(IXIA_SAMPLES_DIR) [file dirname [file dirname $env(IXTCLHAL_LIBRARY)]]
+}
+
+foreach initProc [info commands initCommand_zz_*] {
+    # puts $initProc
+    ${initProc}
+}
+
+# Create dummy calls to the commands that were moved to the scriptmate package.  This is for
+# backwards compatibility but it not guaranteed to work unless the Scriptmate package is installed.
+scriptmateBackwardsCompatibility::createAllCommands
+
+############### sample script environment initialization ############################
+global ixgJitterIndex 
+set ixgJitterIndex(averageLatency)     0
+set ixgJitterIndex(standardDeviation)  1
+set ixgJitterIndex(averageDeviation)   2
+set ixgJitterIndex(minLatency)         3
+set ixgJitterIndex(maxLatency)         4
+
+
diff --git a/dep/tclclient/ixTcl1.0/ixiaDCB.tcl b/dep/tclclient/ixTcl1.0/ixiaDCB.tcl
new file mode 100644
index 00000000..8e2da3e3
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/ixiaDCB.tcl
@@ -0,0 +1,588 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+# Copyright (c) 2014, Intel Corporation All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#Config Ixia.
+proc configIxia {chasId rxcard rxport rxda txcard txport txda} {
+    set ::chasId   $chasId
+    set ::rxcard   $rxcard
+    set ::rxport   $rxport
+    set ::txcard   $txcard
+    set ::txport   $txport
+    set ::rxPortList [list [list $chasId $rxcard $rxport]]
+    set ::txPortList [list [list $chasId $txcard $txport]]
+    set ::rxsa       [format "00 00 %02x 00 %02x 00" [expr $rxcard-1] [expr $rxport-1]]
+    set ::rxda       [string trim $rxda "'"]
+    set ::txsa       [format "00 00 %02x 00 %02x 00" [expr $txcard-1] [expr $txport-1]]
+    set ::txda       [string trim $txda "'"]
+    set ::rxGroup    $rxport 
+    set ::txGroup    $txport 
+}
+
+#Config Port properties for DCB & PFC.
+proc configPort {direction tc} {
+    #direction :  rx tx
+    #tc  :  4  8
+    set ::direction     $direction
+    set ::tc            $tc
+    set ::[set direction]StreamNum   0
+    if [array exists ::[set direction]StreamUPs] {
+        unset ::[set direction]StreamUPs  
+    }
+    set da        [set ::[set direction]da]
+    set card      [set ::[set direction]card]
+    set port      [set ::[set direction]port]
+    set portList  [set ::[set direction]PortList]
+
+    port setFactoryDefaults $::chasId $card $port
+    port config -speed                              10000
+    port config -duplex                             full
+    port config -flowControl                        true
+    port config -directedAddress                    $da
+    port config -autonegotiate                      false
+    port config -transmitMode                       portTxModeAdvancedScheduler 
+    port config -portMode                           port10GigLanMode
+    port config -enableDataCenterMode               true
+    port config -flowControlType                    ieee8021Qbb
+    port config -pfcResponseDelayEnabled            0
+    port config -pfcResponseDelayQuanta             255
+
+    if [string equal "4" $tc] {
+        port config -dataCenterMode                 fourPriorityTrafficMapping
+        port config -pfcEnableValueListBitMatrix    "{1 1} {1 2} {1 4} {1 8}"
+    } elseif [string equal "8" $tc] {
+        port config -dataCenterMode                 eightPriorityTrafficMapping
+        port config -pfcEnableValueListBitMatrix    "{1 1} {1 2} {1 4} {1 8} {1 16} {1 32} {1 64} {1 128}"
+    } else {
+        errorMsg "TCs can only be 4 or 8."
+        return $::TCL_ERROR
+    }
+    if [port set $::chasId $card $port] {
+        errorMsg "Could not call port set $::chasId $card $port"
+        return $::TCL_ERROR
+    }
+    #Delete all streams from a port
+    port reset $::chasId $card $port
+
+    filter setDefault 
+    if [filter set $::chasId $card $port] {
+        errorMsg "Error calling filter set $::chasId $card $port"
+        return $::TCL_ERROR
+    }
+
+    filterPallette setDefault 
+    if [filterPallette set $::chasId $card $port] {
+        errorMsg "Error calling filterPallette set $::chasId $card $port"
+        return $::TCL_ERROR
+    }
+
+    capture setDefault
+    capture config -fullAction                         wrap
+    capture config -captureMode                        captureContinuousMode
+    if [capture set $::chasId $card $port] {
+        errorMsg "Error calling capture set $::chasId $card $port"
+        return $::TCL_ERROR
+    }
+
+    streamRegion setDefault 
+    streamRegion config -gapControlMode    streamGapControlFixed
+    if [streamRegion set $::chasId $card $port] {
+        errorMsg "Error calling streamRegion set $::chasId $card $port"
+        return $::TCL_ERROR
+    }
+
+    #Write port properties to hardware
+    puts "Write port $port properties to hardware."
+    if [ixWritePortsToHardware portList] {
+        errorMsg "Could not write port $port properties to hardware."
+        return $::TCL_ERROR
+    }
+    after 500
+}
+
+#Configure all streams.
+proc configStream {stream rate prio type {tc $::tc}} {
+    #stream : UDP PFC
+    #rate   : 1.0 100.0
+    #prio   : 0 1 2 3 4 5 6 7 8
+    #type   : on  off  - vt
+    #       : XOFF XON - pfc
+    #tc     : 8   4
+    set ::stream  $stream
+
+    stream setDefault 
+    if {$rate == "0"} {                              
+        stream config -enable                          false
+    } else {
+        stream config -enable                          true
+    }
+    stream config -percentPacketRate                   $rate
+    stream config -rateMode                            streamRateModePercentRate
+    stream config -asyncIntEnable                      true
+    stream config -enableStatistic                     true
+    stream config -enableSuspend                       false
+    stream config -dma                                 contPacket
+    stream config -priorityGroup                       "priorityGroup$prio"
+
+    switch -exact -- $stream {
+           "UDP" {
+                   #Configure UDP     
+                   stream config -sa                                  $::txsa
+                   stream config -da                                  $::txda
+                   stream config -framesize                           68
+                   stream config -frameSizeMIN                        68
+                   stream config -frameSizeMAX                        68
+                   stream config -frameType                           "08 00"
+     
+                   protocol setDefault 
+                   protocol config -name                              ipV4
+                   protocol config -ethernetType                      ethernetII
+                   protocol config -enable802dot1qTag                 vlanSingle
+ 
+                   ip setDefault 
+                   ip config -checksum                                "7a c0"
+                   ip config -sourceIpAddr                            "0.0.0.0"
+                   ip config -sourceIpAddrRepeatCount                 10
+                   ip config -sourceClass                             classA
+                   ip config -destIpAddr                              "0.0.0.0"
+                   ip config -destIpAddrRepeatCount                   10
+                   ip config -destClass                               classA
+                   ip config -destMacAddr                             "00 DE BB 00 00 02"
+                   ip config -destDutIpAddr                           "0.0.0.0"
+                   if [ip set $::chasId $::txcard $::txport] {
+                       errorMsg "Error calling ip set $::chasId $::txcard $::txport"
+                       return $::TCL_ERROR
+                   } 
+ 
+                   udp setDefault 
+                   udp config -sourcePort                            unassignedPort
+                   udp config -destPort                              unassignedPort
+                   udp config -checksum                              "b6 eb "
+                   udp config -length                                26
+                   if [udp set $::chasId $::txcard $::txport] {
+                       errorMsg "Error calling udp set $::chasId $::txcard $::txport"
+                       return $::TCL_ERROR
+                   }
+ 
+                   vlan setDefault
+                   if [string equal "on" $type] {
+                       vlan config -mode                            vIncrement
+                       vlan config -repeat                          [expr 128/$::tc]
+                   } elseif [string equal "off" $type] {
+                       vlan config -vlanID                          [expr int([expr 32 * [expr rand()]])]
+                   }
+                   vlan config -userPriority                        $prio
+                   if [vlan set $::chasId $::txcard $::txport] {
+                       errorMsg "Could not call vlan set $::chasId $::txcard $::txport"
+                       return $::TCL_ERROR
+                   }
+                   set bool 1
+                   foreach item [array names ::txStreamUPs] { 
+                       if {$prio == $::txStreamUPs($item)} {
+                           incr bool -1
+                           set id $item 
+                           break 
+                       }
+                   }  
+                   if { $bool } {
+                       incr ::txStreamNum
+                       set ::txStreamUPs($::txStreamNum) $prio
+                       set id $::txStreamNum
+                   }
+                   if [stream set $::chasId $::txcard $::txport $id] {
+                       errorMsg "Could not call stream set $::chasId $::txcard $::txport $id"
+                       return $::TCL_ERROR
+                   }
+                   if [stream write $::chasId $::txcard $::txport $id] {
+                       errorMsg "Could not write stream $::chasId $::txcard $::txport $id"
+                   }
+           }
+           "PFC" {
+                   #Configure PFC
+                   stream config -sa                                 $::rxsa
+                   stream config -da                                 $::rxda
+                   stream config -framesize                          64
+                   stream config -frameSizeMIN                       64
+                   stream config -frameSizeMAX                       64
+                   stream config -frameType                          "88 08"
+
+                   protocol setDefault 
+                   protocol config -name                             pauseControl
+                   protocol config -ethernetType                     ethernetII
+
+                   pauseControl setDefault 
+                   pauseControl config -da                           $::rxda
+                   pauseControl config -pauseTime                    255
+                   pauseControl config -pauseControlType             ieee8021Qbb
+                   pauseControl config -usePfcEnableValueList        0    
+
+                   pauseControl config -priorityEnableVector         [format "%#04x" [expr 0x01<<$prio]]
+                   for {set n 0; set paFrame ""; set pfcList ""} {$n < 8 } {incr n} { 
+                       if {$type == "XOFF" && $prio == $n} {
+                           append paFrame "FF FF "
+                           append pfcList "{1 65535} "
+                           continue
+                       }
+                       append paFrame "00 00 "
+                       append pfcList "{0 0} "
+                   }
+                   pauseControl config -pauseFrame                  [string trimright $paFrame]
+                   pauseControl config -pfcEnableValueList          [string trimright $pfcList]
+                   if [pauseControl set $::chasId $::rxcard $::rxport] {
+                       errorMsg "Error calling pauseControl set  $::chasId $::rxcard $::rxport"
+                       set retCode $::TCL_ERROR
+                   }
+                   set bool 1
+                   foreach item [array names ::rxStreamUPs] { 
+                       if {$prio == $::rxStreamUPs($item)} {
+                           incr bool -1
+                           set id $item 
+                           break 
+                       }
+                   }  
+                  if { $bool } {
+                       incr ::rxStreamNum
+                       set ::rxStreamUPs($::rxStreamNum) $prio
+                       set id $::rxStreamNum
+                   }
+                   if [stream set $::chasId $::rxcard $::rxport $id] {
+                       errorMsg "Could not call stream set $::chasId $::rxcard $::rxport $id"
+                       return $::TCL_ERROR
+                   }
+                   if [stream write $::chasId $::rxcard $::rxport $id] {
+                       errorMsg "Could not write stream $::chasId $::rxcard $::rxport $id"
+                       return $::TCL_ERROR
+                   } 
+          }
+          default { 
+                   errorMsg "Configure streams error."
+                   return $::TCL_ERROR
+          }
+    }
+
+    after 100
+}
+
+#Get the statistics counter for all stats 
+proc getAllStats {direction {type None} {prio None}} {
+    set card           [set ::[set direction]card]
+    set port           [set ::[set direction]port]
+    if [stat get statAllStats $::chasId $card $port] {
+        puts "Could not read stats on port $port."
+        return $::TCL_ERROR
+    } 
+
+    set framesSent [stat cget -framesSent]
+    set framesRecv [stat cget -framesReceived]
+    for {set upId 0; set recvSum 0} {$upId < $::tc} {incr upId} {
+         set pfcUP$upId    [stat cget -rxPausePriorityGroup[set upId]Frames]
+         incr recvSum [set pfcUP$upId]
+    }
+
+    if [stat getRate statAllStats $::chasId $card $port] {
+        puts "Could not read stat rate on port $port."
+        return $::TCL_ERROR
+    }
+    set framesSentRate [stat cget -framesSent]
+    set framesRecvRate [stat cget -framesReceived]
+    
+    puts "+---------------------------------------------+"
+    puts "[ format "| %-44s|" "Read Statistics On [string toupper $direction 0 0] Port $port Of Ixia."]"
+    puts "+---------------------------------------------+"
+    puts "[format "| %-12s| %-14s| %-14s|" "Type" "Count" "Unit"]"
+    puts "+-------------+---------------+---------------+"
+    switch -exact -- $type {
+           "FramesSent" { 
+                         puts "[format "| %-12s| %-14s| %-14s|" "Frames Sent" $framesSent "frames"]"
+                         puts "+---------------------------------------------+"
+                         after 50
+                         return $framesSent
+           }
+           "RateSent" { 
+                         puts "[format "| %-12s| %-14s| %-14s|" "Rate Sent" $framesSentRate "packets/sec"]"
+                         puts "+---------------------------------------------+"
+                         return $framesSentRate
+           }
+           "FramesRecv" { 
+                         puts "[format "| %-12s| %-14s| %-14s|" "Frames Recv" $framesRecv "frames"]"
+                         puts "+---------------------------------------------+"
+                         after 50
+                         return $framesRecv
+           }
+           "RateRecv" { 
+                         puts "[format "| %-12s| %-14s| %-14s|" "Rate Recv" $framesRecvRate "packets/sec"]"
+                         puts "+---------------------------------------------+"
+                         after 50
+                         return $framesRecvRate
+           }
+           "PfcsRecv" { 
+                         puts "[format "| %-12s| %-14s| %-14s|" "Frames Sent" $framesSent "frames"]"
+                         puts "+-------------+---------------+---------------+"
+                         puts "[format "| %-12s| %-14s| %-14s|" "Frames Recv" $framesRecv "frames"]"
+                         puts "+-------------+---------------+---------------+"
+                         for {set upId 0} {$upId < $::tc} {incr upId} {
+                             puts "[format "| %-12s| %-14s| %-14s|" "PFCs $upId Rcvd" [set pfcUP$upId] "frames"]"
+                             puts "+-------------+---------------+---------------+"
+                         }
+                         puts "[format "| %-12s| %-14s| %-14s|" "Total  Recv" $recvSum "frames"]"
+                         puts "+---------------------------------------------+"
+                         after 50
+                         if {$prio == "None"} {
+                             return $recvSum
+                         } else {
+                             return [set pfcUP$prio]
+                         }
+           }
+           default { 
+                     puts "[format "| %-12s| %-14s| %-14s|" "Frames Sent" $framesSent "frames"]"
+                     puts "+-------------+---------------+---------------+"
+                     puts "[format "| %-12s| %-14s| %-14s|" "Actual Rate" $framesSentRate "packets/sec"]"
+                     puts "+-------------+---------------+---------------+"
+                     puts "[format "| %-12s| %-14s| %-14s|" "Frames Recv" $framesRecv "frames"]"
+                     puts "+-------------+---------------+---------------+"
+                     puts "[format "| %-12s| %-14s| %-14s|" "Actual Rate" $framesRecvRate "packets/sec"]"
+                     puts "+-------------+---------------+---------------+"
+                     for {set upId 0} {$upId < $::tc} {incr upId} {
+                         puts "[format "| %-12s| %-14s| %-14s|" "PFCs $upId Rcvd" [set pfcUP$upId] "frames"]"
+                         puts "+-------------+---------------+---------------+"
+                     }
+                     puts "[format "| %-12s| %-14s| %-14s|" "Total  Recv" $recvSum "frames"]"
+                     puts "+---------------------------------------------+"
+                     after 50
+           }
+    }
+}
+    
+#Get per-stream transmit statistics on Tx port
+proc getTxPerStreamStats {} {
+    set nums [streamTransmitStats cget -numGroups]
+    puts "+-------------------------------------------------------------+"
+    puts "[format "| %-60s|" "Read $nums Streams On Tx Port $::txport Of Ixia."]"
+    puts "+-------------------------------------------------------------+"
+    puts "[format "| %-7s| %-3s| %-14s| %-14s| %-14s|" "Stream" "UP" "FramesSent" "Define Rate" "Actual Rate"]"
+    #Get the statistics for each stream
+    set rateSum 0
+    set deRateSum 0
+    set sentSum 0
+    set aveRate    [streamTransmitStats cget -theoreticalAverageFrameRate]
+    for {set streamId 1} {$streamId <= $nums} {incr streamId} {
+        if [streamTransmitStats getGroup $streamId] {
+           errorMsg "Could not get group $streamId on port $::txport."
+           return $::TCL_ERROR
+        }
+        set frameRate  [streamTransmitStats cget -frameRate]
+        set framesPSent [streamTransmitStats cget -framesSent]
+        stream get  $::chasId $::txcard $::txport $streamId
+        set deRate [expr int([stream cget -fpsRate])]
+        
+        puts "+--------+----+---------------+---------------+---------------+"
+        puts "[format "| %-7s| %-3s| %-14s| %-14s| %-14s|" $streamId $::txStreamUPs($streamId) $framesPSent $deRate $frameRate]"
+        incr rateSum $frameRate
+        incr deRateSum $deRate
+        incr sentSum $framesPSent
+    }
+    puts "+-------------------------------------------------------------+"
+    puts "[format "| %-7s| %-3s| %-14s| %-14s| %-14s|" "Total" $nums $sentSum $deRateSum $rateSum]"
+    puts "+-------------+---------------+---------------+---------------+"
+    puts "[format "| %-12s| %-14s| %-14s| %-14s|" "Unit" "frames" "packets/sec" "packets/sec"]"
+    puts "+-------------------------------------------------------------+"
+    after 50
+    }
+    
+#Get the captured frames on on Tx port
+proc getTxCaptureFrames {type {prio None}} {
+    puts "+--------------------------------------+"
+    puts "[format "| %-37s|" "Analyse frames captured on port $::txport."]"
+    if [capture get $::chasId $::txcard $::txport] {
+        puts "Could not get capture frames on port $::txport"
+        return $::TCL_ERROR
+    } 
+    set numFrames [capture cget -nPackets]
+    puts "+--------------------------------------+"
+    puts "[format "| %-16s| %-19s|" "Frames Captured" $numFrames]"
+    if [expr $numFrames] {
+        for {set frameId 1} {$frameId <= $numFrames} {incr frameId} {
+            captureBuffer get $::chasId $::txcard $::txport $frameId $frameId
+            captureBuffer getframe 1
+            set capFrame     [captureBuffer cget -frame]
+            set etherType    [lrange $capFrame 12 13]
+      
+            switch -exact -- $etherType {
+                   "08 00" { 
+                             set types "IPv4 Frame" 
+                             if {$type == "UDP"} {
+                                 return 1
+                             }
+                   }
+                   "86 DD" { 
+                             set types "IPv6 Frame"
+                             if {$type == "UDP"} {
+                                 return 1
+                             }
+                   }
+                   "81 00" { 
+                             set types "VLAN-tagged Frame"
+                             if {$type == "UDP"} {
+                                 return 1
+                             }
+                   }
+                   "88 08" {  
+                             set types "MAC Control Frame"
+                             set ctrlOpcode   [lrange $capFrame 14 15]
+                             switch -exact -- $ctrlOpcode {
+                                    "00 01" { 
+                                              set fc    "IEEE 802.3x PAUSE Frame"
+                                              if {$type == "FC-PAUSE"} {
+                                                  return 1
+                                              } 
+                                    }
+                                    "01 01" { 
+                                              set prioEnVector    [lrange $capFrame 16 17]
+                                              if {[lrange $capFrame 17 17] == [format "%02x" [expr 0x01<<$prio]]} {
+                                                  for {set timeId 0; set start 17; set ret ""} {$timeId < $::tc} {incr timeId} {
+                                                       set Time$timeId  [lrange $capFrame [incr start] [incr start]]
+                                                       if {[set Time$timeId] == "00 00" && $ret != "XOFF"} {
+                                                           set ret "XON"
+                                                       } else {
+                                                           set ret "XOFF"
+                                                       }  
+                                                  }
+                                                  if {$type == $ret} {                          
+                                                      puts "+-----------------+--------------------+"
+                                                      puts "[format "| %-16s| %-19s|" "Frames Analysed" $frameId]"
+                                                      puts "+-----------------+--------------------+"
+                                                      puts "[format "| %-16s| %-19s|" "Frames Type" $types]"
+                                                      puts "+-----------------+--------------------+"
+                                                      puts "[format "| %-16s| %-19s|" " " "PFC $type Frame"]"
+                                                      puts "+-----------------+--------------------+"
+                                                      puts "[format "| %-16s| %-19s|" "Control Opcode" $ctrlOpcode]"
+                                                      puts "+-----------------+--------------------+"
+                                                      puts "[format "| %-16s| %-19s|" "Priority Vector" $prioEnVector]"
+                                                      puts "+-----------------+--------------------+"
+                                                      puts "[format "| %-16s| %-19s|" " " $prio]"
+                                                      for {set timeId 0; set start 17; set ret ""} {$timeId < $::tc} {incr timeId} {
+                                                          puts "+-----------------+--------------------+"
+                                                          puts "[format "| %-16s| %-19s|" "Time$timeId" [set Time$timeId]]"
+                                                      }
+                                                      puts "+--------------------------------------+"
+                                                      after 50
+                                                      return 1
+                                                  }
+                                              }    
+                                    } 
+                             }               
+                   }
+                   default { puts "Unknown Frame" }
+            }
+        }
+    } 
+    puts "+--------------------------------------+"
+    return 0
+}
+        
+#Clear all statistic counters on Tx/Rx port
+proc clearStats {direction} {
+    set portList  [set ::[set direction]PortList] 
+    if [ixClearStats portList] {
+        return $::TCL_ERROR
+    }
+    after 100
+}
+
+#Start transmission on Tx/Rx port
+proc startTransmit {direction} {
+    set port      [set ::[set direction]port]
+    set portList  [set ::[set direction]PortList] 
+    puts "+------------------------------------+"
+    puts "[format "| %-35s|" "Start transmit on $direction port $port."]"
+    if [ixStartTransmit portList] {
+        return $::TCL_ERROR
+    }
+    puts "+------------------------------------+"
+    after 500
+}
+
+#Stop transmission on Tx/Rx port
+proc stopTransmit {direction} {
+    set port      [set ::[set direction]port]
+    set portList  [set ::[set direction]PortList] 
+    puts "+------------------------------------+"
+    puts "[format "| %-35s|" "Stop transmit on $direction port $port."]"
+    if [ixStopTransmit portList] {
+        return $::TCL_ERROR
+    }
+    puts "+------------------------------------+"
+    after 500
+}
+
+#Start capture on Tx/Rx port
+proc startCapture {direction} {
+    set card      [set ::[set direction]card]
+    set port      [set ::[set direction]port]
+    puts "+------------------------------------+"
+    puts "[format "| %-35s|" "Start capture on $direction port $port."]"
+    if [ixStartPortCapture $::chasId $card $port] {
+        return $::TCL_ERROR
+    }
+    puts "+------------------------------------+"
+}
+
+#Stop capture on Tx/Rx port
+proc stopCapture {direction} {
+    set card      [set ::[set direction]card]
+    set port      [set ::[set direction]port]
+    puts "+------------------------------------+"
+    puts "[format "| %-35s|" "Stop capture on $direction port $port."]"
+    if [ixStopPortCapture $::chasId $card $port] {
+       return $::TCL_ERROR
+    }
+    puts "+------------------------------------+"
+}
+
+#Get Per-stream transmit statistics on Tx port
+proc perStreamTxStats {} {
+    puts "+------------------------------------+"
+    puts "[format "| %-35s|" "Get Per-stream stats on Tx port $::txport."]"
+    if [streamTransmitStats get $::chasId $::txcard $::txport 1 $::txStreamNum] {
+       return $::TCL_ERROR
+    }
+    puts "+------------------------------------+"
+    after 1000
+}
+
+#Clean, Logoff and Disconnect
+proc clean {server portList}  {
+    #Let go of the ports that we reserved
+    ixClearOwnership $portList
+    #Log off user
+    ixLogout
+    #End a test and cleanup all variables
+    cleanUp
+}
diff --git a/dep/tclclient/ixTcl1.0/ixiaPing6.tcl b/dep/tclclient/ixTcl1.0/ixiaPing6.tcl
new file mode 100644
index 00000000..3012346d
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/ixiaPing6.tcl
@@ -0,0 +1,140 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+# Copyright (c) 2014, Intel Corporation All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+proc ping6 {destIP destMAC chasId card port } {
+
+	set retCode $::TCL_OK 
+	set streamId 1
+	set portList [list [list $chasId $card $port]]
+	set portIP "fe80:0000:0000:0000:021e:67ff:fe0d:b60a"
+
+	# Set ports to factory defaults. Dumps out on error. 
+	port setFactoryDefaults $chasId $card $port
+	port setDefault
+
+	# Writes port properties in hardware 
+	if {[ixWritePortsToHardware portList]} { 
+		return $::TCL_ERROR 
+	} 
+ 
+# Check the link state of the ports 
+	if {[ixCheckLinkState portList]} { 
+		return $::TCL_ERROR 
+	}
+
+	protocol setDefault
+	protocol config -ethernetType ethernetII 
+	protocol config -name ipV6 
+
+	icmpV6 setDefault
+	icmpV6 setType icmpV6EchoRequestMessage 
+
+	icmpV6Informational setDefault
+	icmpV6Informational config -identifier 58275
+	icmpV6Informational config -sequenceNumber 1
+
+	if {[icmpV6 set $chasId $card $port]} { 
+		return $::TCL_ERROR 
+	}
+
+	ipV6 setDefault
+	ipV6 config -sourceAddr $portIP
+	ipV6 config -sourceMask 64
+	ipV6 config -destAddr $destIP
+	ipV6 config -destMask 64
+	ipV6 config -nextHeader ipV4ProtocolIpv6Icmp
+	ipV6 config -trafficClass 3
+	ipV6 clearAllExtensionHeaders
+ 
+	if {[ipV6 addExtensionHeader ipV4ProtocolIpv6Icmp]} {
+		return $::TCL_ERROR 
+	}
+
+	if {[ipV6 set $chasId $card $port]} { 
+		return $::TCL_ERROR 
+	}
+
+	stream config -numFrames 1
+	stream config -dma stopStream 
+	stream config -framesize 122
+	stream config -rateMode usePercentRate 
+	stream config -percentPacketRate 1 
+	stream config -sa "00 00 01 00 02 00"
+	stream config -da $destMAC
+
+	if {[stream set $chasId $card $port $streamId]} { 
+		return $::TCL_ERROR 
+	}
+
+	if [ixWriteConfigToHardware portList] { 
+		return -code error 
+	}	
+
+	if [ixClearStats portList] { 
+		return -code error 
+	}
+
+	after 1000
+
+	ixStartCapture portList
+	ixStartTransmit portList
+
+	after 1000
+
+	if {[ixCheckTransmitDone portList] == $::TCL_ERROR} {
+		return -code error
+	} else {
+		ixPuts "Transmission is complete"
+	}	
+
+	if [ixStopCapture portList] {
+		return -code error
+	}
+
+	captureBuffer get $chasId $card $port
+	if {[captureBuffer cget -numFrames] == 0} {
+		ixPuts "No packets received"
+	} else {
+		captureBuffer getframe 1
+		set data [captureBuffer cget -frame]
+		icmpV6 decode $data $chasId $card $port
+		ipV6   decode $data $chasId $card $port
+		if {[icmpV6 cget -type] == 135 && [ipV6 cget -sourceAddr] == $destIP} {
+			ixPuts "64 bytes from"
+		}
+	}
+#	ixClearOwnership $portList
+#	ixDisconnectFromChassis $hostname
+#	if [isUNIX] {
+#		ixDisconnectTclServer $hostname
+#	}
+#    cleanUp
+}
diff --git a/dep/tclclient/ixTcl1.0/ixiarc.tcl b/dep/tclclient/ixTcl1.0/ixiarc.tcl
new file mode 100644
index 00000000..3c8e46d9
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/ixiarc.tcl
@@ -0,0 +1,60 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: ixiarc.tcl
+#
+#   Copyright ©  IXIA
+#   All Rights Reserved.
+#
+#   Revision Log:
+#   04-28-1998  HS  Genesis
+#
+# Description: 
+#   This file sets up environment variables and other resources before the package
+#	can be loaded. This file must be sourced before the main script is run. It can
+#	be sourced manually in the wish/tclsh shell on placed as the first line of the
+#	main script.
+#
+###################################################################################
+global env
+# Results of all Ixia tests will be placed in this directory
+set env(IXIA_RESULTS_DIR)   [file dirname [file dirname [info library]]]
+
+# Run-time Logs of all Ixia tests will be placed in this directory
+set env(IXIA_LOGS_DIR)      [file dirname [file dirname [info library]]]
+
+# The Samples files are located under this directory
+set env(IXIA_SAMPLESDIR)    [file dirname [file dirname [info library]]]
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/pkgIndex.tcl b/dep/tclclient/ixTcl1.0/pkgIndex.tcl
new file mode 100644
index 00000000..5e61c17e
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/pkgIndex.tcl
@@ -0,0 +1,54 @@
+# BSD LICENSE
+#
+# Copyright (c) 2014, Ixia All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of the copyright holder nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#   Version 6.20
+#   
+#   File: pkgIndex.tcl
+#
+#   Copyright ©  IXIA.
+#	All Rights Reserved.
+#
+#############################################################################################
+
+if {$::tcl_platform(platform) != "unix"} {
+    # if this package is already loaded, then don't load it again
+    if {[lsearch [package names] IxTclHal] != -1} {
+        return
+    }
+} else {
+    lappend ::auto_path $dir
+}
+
+package ifneeded IxTclHal 6.20 [list source [file join $dir ixTclHal.tcl]]
+
+
+
+
+
diff --git a/dep/tclclient/ixTcl1.0/tclIndex b/dep/tclclient/ixTcl1.0/tclIndex
new file mode 100644
index 00000000..8d932054
--- /dev/null
+++ b/dep/tclclient/ixTcl1.0/tclIndex
@@ -0,0 +1,836 @@
+# Tcl autoload index file, version 2.0
+# This file is generated by the "auto_mkindex" command
+# and sourced to set up indexing information for one or
+# more commands.  Typically each line is a command that
+# sets an element in the auto_index array, where the
+# element name is the name of a command and the value is
+# a script that loads the command.
+
+set auto_index(ixDapConfigPort) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapAddPortInterface) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapAddRouteTable) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapAddPortFilter) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapBaseIpAddresses) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapCleanUp) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapSetBaseIp) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapAddRoute) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapDelRoute) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(ixDapLogin) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::Log) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::Error) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::init) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::login) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::printVersion) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::viewRoutes) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::addRoute) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::delRoute) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::createViewFrame) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::setAppName) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::setChassisList) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::getBaseIpAddressList) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::addInterfaceToArray) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::getInterfacePortList) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::getSortListFromArray) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::removeInterfaceFromArray) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::addRouteToArray) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::addFilterToArray) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::getValueFromList) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::isSubnetOverlapped) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::setBaseIp) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::validateBaseIpAddresses) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::setupPortInterfaces) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::addPortInterface) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::setupRouteTable) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::setupPortFilters) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::manageFilter) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::managePcpuCommand) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::downloadPackage) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::deletePackage) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::managePackage) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::pingBaseIpAddress) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::cleanUp) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(::ixDapConfig::main) [list source [file join $dir Dap ixDapConfig.tcl]]
+set auto_index(clearStatsAndTransmit) [list source [file join $dir Generic actions.tcl]]
+set auto_index(transmitAndCollectRxRatesPerSecond) [list source [file join $dir Generic actions.tcl]]
+set auto_index(collectRxRatesPerSecond) [list source [file join $dir Generic actions.tcl]]
+set auto_index(prepareToTransmit) [list source [file join $dir Generic actions.tcl]]
+set auto_index(writeWaitForTransmit) [list source [file join $dir Generic actions.tcl]]
+set auto_index(writeWaitForPause) [list source [file join $dir Generic actions.tcl]]
+set auto_index(writeWaitMessage) [list source [file join $dir Generic actions.tcl]]
+set auto_index(issuePortGroupCommand) [list source [file join $dir Generic actions.tcl]]
+set auto_index(getPortGroupObject) [list source [file join $dir Generic actions.tcl]]
+set auto_index(issuePortGroupMethod) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startTx) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startStaggeredTx) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopTx) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startPortTx) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopPortTx) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startPrbsCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopPrbsCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPrbsCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startPortCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startPortPrbsCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopPortCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopPortPrbsCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPortPrbsCapture) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startPacketGroups) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopPacketGroups) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startPortPacketGroups) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopPortPacketGroups) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPacketGroups) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPortPacketGroups) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startCollisions) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopCollisions) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startPortCollisions) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopPortCollisions) [list source [file join $dir Generic actions.tcl]]
+set auto_index(zeroStats) [list source [file join $dir Generic actions.tcl]]
+set auto_index(zeroPortStats) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPerStreamTxStats) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPerStreamTxPortStats) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPcsLaneStatistics) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPcsLanePortStatistics) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearTimeStamp) [list source [file join $dir Generic actions.tcl]]
+set auto_index(flushAddressTable) [list source [file join $dir Generic actions.tcl]]
+set auto_index(enableArpResponse) [list source [file join $dir Generic actions.tcl]]
+set auto_index(enablePortArpResponse) [list source [file join $dir Generic actions.tcl]]
+set auto_index(disableArpResponse) [list source [file join $dir Generic actions.tcl]]
+set auto_index(disablePortArpResponse) [list source [file join $dir Generic actions.tcl]]
+set auto_index(transmitArpRequest) [list source [file join $dir Generic actions.tcl]]
+set auto_index(transmitPortArpRequest) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearArpTable) [list source [file join $dir Generic actions.tcl]]
+set auto_index(clearPortArpTable) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setDataIntegrityMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setPrbsMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setPacketGroupMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setWidePacketGroupMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setCaptureMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setTcpRoundTripFlowMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setPacketStreamMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setPacketFlowMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setAdvancedStreamSchedulerMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setFirstLastTimestampMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setDataIntegrityMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setSequenceCheckingMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(changePortTransmitMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(changePortReceiveMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(writeToHardware) [list source [file join $dir Generic actions.tcl]]
+set auto_index(writeToHardwareAsChunks) [list source [file join $dir Generic actions.tcl]]
+set auto_index(writePortsToHardware) [list source [file join $dir Generic actions.tcl]]
+set auto_index(writeConfigToHardware) [list source [file join $dir Generic actions.tcl]]
+set auto_index(resetSequenceIndex) [list source [file join $dir Generic actions.tcl]]
+set auto_index(resetPortSequenceIndex) [list source [file join $dir Generic actions.tcl]]
+set auto_index(loadPoePulse) [list source [file join $dir Generic actions.tcl]]
+set auto_index(loadPortPoePulse) [list source [file join $dir Generic actions.tcl]]
+set auto_index(armPoeTrigger) [list source [file join $dir Generic actions.tcl]]
+set auto_index(armPortPoeTrigger) [list source [file join $dir Generic actions.tcl]]
+set auto_index(abortPoeArm) [list source [file join $dir Generic actions.tcl]]
+set auto_index(abortPortPoeArm) [list source [file join $dir Generic actions.tcl]]
+set auto_index(resetSequenceIndex) [list source [file join $dir Generic actions.tcl]]
+set auto_index(resetPortSequenceIndex) [list source [file join $dir Generic actions.tcl]]
+set auto_index(loadPoEPulse) [list source [file join $dir Generic actions.tcl]]
+set auto_index(loadPortPoEPulse) [list source [file join $dir Generic actions.tcl]]
+set auto_index(restartAutoNegotiation) [list source [file join $dir Generic actions.tcl]]
+set auto_index(rebootLocalCpu) [list source [file join $dir Generic actions.tcl]]
+set auto_index(rebootPortLocalCpu) [list source [file join $dir Generic actions.tcl]]
+set auto_index(simulatePhysicalInterfaceDown) [list source [file join $dir Generic actions.tcl]]
+set auto_index(simulatePortPhysicalInterfaceDown) [list source [file join $dir Generic actions.tcl]]
+set auto_index(simulatePhysicalInterfaceUp) [list source [file join $dir Generic actions.tcl]]
+set auto_index(simulatePortPhysicalInterfaceUp) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startAtmOamTransmit) [list source [file join $dir Generic actions.tcl]]
+set auto_index(startPortAtmOamTransmit) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopAtmOamTransmit) [list source [file join $dir Generic actions.tcl]]
+set auto_index(stopPortAtmOamTransmit) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setScheduledTransmitTime) [list source [file join $dir Generic actions.tcl]]
+set auto_index(setAutoDetectInstrumentationMode) [list source [file join $dir Generic actions.tcl]]
+set auto_index(enablePortIntrinsicLatencyAdjustment) [list source [file join $dir Generic actions.tcl]]
+set auto_index(enableIntrinsicLatencyAdjustment) [list source [file join $dir Generic actions.tcl]]
+set auto_index(isIntrinsicLatencyAdjustmentEnabled) [list source [file join $dir Generic actions.tcl]]
+set auto_index(ipAddressSetDefault) [list source [file join $dir Generic addressTableUtils.tcl]]
+set auto_index(updateIpAddressTable) [list source [file join $dir Generic addressTableUtils.tcl]]
+set auto_index(mpincr) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(calculatePercentLossExact) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(calculatePercentLoss) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(calculatePercentThroughput) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(calculateDuration) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(calculateTotalBursts) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(calculateAvgLatency) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(calculateLoopCounterFromTxFrames) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(calculateStreamNumFrames) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(getTransmitTime) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(getDurationFromCapture) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(::ixMath::min) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(::ixMath::max) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(maxArray) [list source [file join $dir Generic calculate.tcl]]
+set auto_index(connectToChassis) [list source [file join $dir Generic chassisUtils.tcl]]
+set auto_index(setConnectChassisFlag) [list source [file join $dir Generic chassisUtils.tcl]]
+set auto_index(getConnectChassisFlag) [list source [file join $dir Generic chassisUtils.tcl]]
+set auto_index(clientOpen) [list source [file join $dir Generic clientUtils.tcl]]
+set auto_index(clientClose) [list source [file join $dir Generic clientUtils.tcl]]
+set auto_index(clientSend) [list source [file join $dir Generic clientUtils.tcl]]
+set auto_index(remoteDefine) [list source [file join $dir Generic clientUtils.tcl]]
+set auto_index(getConstantsValue) [list source [file join $dir Generic clientUtils.tcl]]
+set auto_index(ixMasterSet) [list source [file join $dir Generic clientUtils.tcl]]
+set auto_index(redefineCommand) [list source [file join $dir Generic clientUtils.tcl]]
+set auto_index(doFileTransfer) [list source [file join $dir Generic clientUtils.tcl]]
+set auto_index(getPercentMaxRate) [list source [file join $dir Generic conversions.tcl]]
+set auto_index(getMaxFPS) [list source [file join $dir Generic conversions.tcl]]
+set auto_index(convertPercentMaxRate) [list source [file join $dir Generic conversions.tcl]]
+set auto_index(convertKbpsRate) [list source [file join $dir Generic conversions.tcl]]
+set auto_index(convertFpsRate) [list source [file join $dir Generic conversions.tcl]]
+set auto_index(generateFullList) [list source [file join $dir Generic conversions.tcl]]
+set auto_index(::dataValidation::initialize) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::setParameter) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::getParameter) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::showRules) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::parseValues) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isPortList) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isString) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isInteger) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isDouble) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::areValuesOfTheType) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validateTest) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::getValidValueString) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validateTestConfParameter) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::doValidateTestConfParameter) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validateCommandParameter) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::setErrorString) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::getErrorString) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isDataInRange) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validatePortSpeed) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::getProtocol) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::checkIdentical) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::checkMatched) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::frameSizeProtocolSame) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validateImixList) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validateProtocolTable) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validateCmFlowMix) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validateRunType) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::validateNumber) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::checkErrFrameFrameErrorList) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::checkCmatsIpAndMacAddress) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isValidMulticastIp) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isValidUnicastIp) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isOverlappingIpAddress) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isSameSubnet) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isValidNetMask) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(::dataValidation::isValidHostPart) [list source [file join $dir Generic dataValidation.tcl]]
+set auto_index(initializeDefineCommand) [list source [file join $dir Generic defineCommand.tcl]]
+set auto_index(::defineCommand::initialize) [list source [file join $dir Generic defineCommand.tcl]]
+set auto_index(::defineCommand::isRegistered) [list source [file join $dir Generic defineCommand.tcl]]
+set auto_index(::defineCommand::getAllRegisteredCommands) [list source [file join $dir Generic defineCommand.tcl]]
+set auto_index(::defineCommand::registerCommand) [list source [file join $dir Generic defineCommand.tcl]]
+set auto_index(::defineCommand::registerMethod) [list source [file join $dir Generic defineCommand.tcl]]
+set auto_index(::defineCommand::registerParameter) [list source [file join $dir Generic defineCommand.tcl]]
+set auto_index(initializeDefineTest) [list source [file join $dir Generic defineTest.tcl]]
+set auto_index(::defineTest::initialize) [list source [file join $dir Generic defineTest.tcl]]
+set auto_index(::defineTest::registerCommand) [list source [file join $dir Generic defineTest.tcl]]
+set auto_index(::defineTest::registerParameter) [list source [file join $dir Generic defineTest.tcl]]
+set auto_index(::defineTest::registerTest) [list source [file join $dir Generic defineTest.tcl]]
+set auto_index(dhcpSetState) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpGetState) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpSetLease) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpGetLease) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpSetIP) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpGetIP) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpSetServer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpGetServer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpGetTimer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpStartTimers) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpStartTimer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpStopTimers) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpStopTimer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpSetStreamRegion) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpGetStreamRegion) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpSetPortList) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpGetPortList) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpStop) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpStopPort) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpEnableStateMachine) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(dhcpDisableStateMachine) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(DHCPdiscoverIP) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(send_DHCP_discover) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(get_DHCP_offer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(send_DHCP_request) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(get_DHCP_ack) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(send_DHCP_release) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(setupUDPbootp) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(setupDhcpBroadcastIP) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(setupDhcpUnicastIP) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(setupDefaultDhcpParameters) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(setDhcpOptions) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(sendDhcpPacket) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(buildDhcpPacket) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(get_DHCP_packet) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::Initialize) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::Stop) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::StopPort) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::SetState) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetState) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::SetLease) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetLease) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::StartTimers) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::StopTimers) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::StartTimer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::StopTimer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetTimer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::SetIP) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetIP) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::SetServer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetServer) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::SetStreamRegion) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetStreamRegion) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::SetPortList) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetPortList) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::InitStateTable) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::StateLookup) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::ActionNull) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::ActionRenew) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::ActionRebind) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::ActionInit) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetStateNames) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetStateName) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetStateCodes) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::ValidState) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetEventName) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::GetEventCodes) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::ValidEvent) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::getTransactionID) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::clearParameterRequestList) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::getParameterRequestList) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::setParameterRequestList) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::getMagicCookie) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::setStartTime) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::getStartTime) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(::dhcpClient::debug) [list source [file join $dir Generic dhcpExchange.tcl]]
+set auto_index(createDialog) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(writeDialog) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(destroyDialog) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(::dialogUtils::init) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(::dialogUtils::create) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(::dialogUtils::writeText) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(::dialogUtils::getWindowState) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(::dialogUtils::setWindowState) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(::dialogUtils::saveWindowState) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(::dialogUtils::destroyedByUser) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(::dialogUtils::destroy) [list source [file join $dir Generic dialogUtils.tcl]]
+set auto_index(setStopTestFlag) [list source [file join $dir Generic eventHandler.tcl]]
+set auto_index(stopTest) [list source [file join $dir Generic eventHandler.tcl]]
+set auto_index(isTestStopped) [list source [file join $dir Generic eventHandler.tcl]]
+set auto_index(informServerCurrentTestStopped) [list source [file join $dir Generic eventHandler.tcl]]
+set auto_index(IsPOSPort) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(Is10GigEPort) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(IsGigabitPort) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(any10100Ports) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(anyGigPorts) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(anyOc48Ports) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(anyOc192Ports) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(anyPortsByInterface) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(anyPortsBySpeed) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(supportsProtocolServer) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(supportsPortCPU) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(isValidFeature) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(isPacketFlowMode) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(isAdvancedStreamSchedulerMode) [list source [file join $dir Generic featureUtils.tcl]]
+set auto_index(::fileTransferClient::openConnectionToTclServer) [list source [file join $dir Generic fileTransferClient.tcl]]
+set auto_index(::fileTransferClient::closeTclServerConnection) [list source [file join $dir Generic fileTransferClient.tcl]]
+set auto_index(::fileTransferClient::sendTransactionToTclServer) [list source [file join $dir Generic fileTransferClient.tcl]]
+set auto_index(::fileTransferClient::getFile) [list source [file join $dir Generic fileTransferClient.tcl]]
+set auto_index(::fileTransferClient::putFile) [list source [file join $dir Generic fileTransferClient.tcl]]
+set auto_index(::fileTransferClient::getTransferOutcome) [list source [file join $dir Generic fileTransferClient.tcl]]
+set auto_index(putFtpLogWindow) [list source [file join $dir Generic ftp.tcl]]
+set auto_index(ixFileSend) [list source [file join $dir Generic ftp.tcl]]
+set auto_index(ixFileTransferStart) [list source [file join $dir Generic ftp.tcl]]
+set auto_index(ixInitialize) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixConnectToChassis) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixConnectToTclServer) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixDisconnectTclServer) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixGetChassisID) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixDisconnectFromChassis) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixGlobalSetDefault) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartPortTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartStaggeredTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopPortTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartPrbsCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopPrbsCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearPrbsCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartPortCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartPortPrbsCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopPortCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopPortPrbsCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearPortPrbsCapture) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearStats) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearPortStats) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearPerStreamTxStats) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearPerStreamTxPortStats) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixRequestStats) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearTimeStamp) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartPacketGroups) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartPortPacketGroups) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopPacketGroups) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearPacketGroups) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearPortPacketGroups) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetScheduledTransmitTime) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearScheduledTransmitTime) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopPortPacketGroups) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartCollisions) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartPortCollisions) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopCollisions) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopPortCollisions) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixLoadPoePulse) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixLoadPortPoePulse) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixArmPoeTrigger) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixArmPortPoeTrigger) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixAbortPoeArm) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixAbortPortPoeArm) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartAtmOamTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStartPortAtmOamTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopAtmOamTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixStopPortAtmOamTransmit) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixCreatePortListWildCard) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixCreateSortedPortList) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixPuts) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixiaPortSetParms) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixiaReadWriteMII) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixTclSvrConnect) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixTclSvrDisconnect) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixEnableArpResponse) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixEnablePortArpResponse) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixDisableArpResponse) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixTransmitArpRequest) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearArpTable) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixDisablePortArpResponse) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixTransmitPortArpRequest) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixClearPortArpTable) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPacketGroupMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortPacketGroupMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetAutoDetectInstrumentationMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortAutoDetectInstrumentationMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetWidePacketGroupMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortWidePacketGroupMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetCaptureMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortCaptureMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetTcpRoundTripFlowMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortTcpRoundTripFlowMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetDataIntegrityMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortDataIntegrityMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPrbsMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortPrbsMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetSequenceCheckingMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortSequenceCheckingMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPacketFlowMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortPacketFlowMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPacketStreamMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortPacketStreamMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetAdvancedStreamSchedulerMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSetPortAdvancedStreamSchedulerMode) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixWritePortsToHardware) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixWriteConfigToHardware) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixCheckTransmitDone) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixCheckPortTransmitDone) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixCheckLinkState) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixCheckPPPState) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixCollectStats) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixProxyConnect) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixResetSequenceIndex) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixResetPortSequenceIndex) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixRestartAutoNegotiation) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixRestartPortAutoNegotiation) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixRestartPPPNegotiation) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixRestartPortPPPNegotiation) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSimulatePhysicalInterfaceUp) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSimulatePortPhysicalInterfaceUp) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSimulatePhysicalInterfaceDown) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixSimulatePortPhysicalInterfaceDown) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixIsOverlappingIpAddress) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixIsSameSubnet) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixIsValidHost) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixIsValidNetMask) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixIsValidUnicastIp) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixConvertFromSeconds) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixConvertToSeconds) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixEnablePortIntrinsicLatencyAdjustment) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixEnableIntrinsicLatencyAdjustment) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(ixIsIntrinsicLatencyAdjustmentEnabled) [list source [file join $dir Generic highLevelAPI.tcl]]
+set auto_index(initCommand_zz_advancedTestParameter) [list source [file join $dir Generic interface.tcl]]
+set auto_index(initCommand_zz_fastpath) [list source [file join $dir Generic interface.tcl]]
+set auto_index(initCommand_zz_ipfastpath) [list source [file join $dir Generic interface.tcl]]
+set auto_index(initCommand_zz_learn) [list source [file join $dir Generic interface.tcl]]
+set auto_index(initCommand_zz_logger) [list source [file join $dir Generic interface.tcl]]
+set auto_index(initCommand_zz_map) [list source [file join $dir Generic interface.tcl]]
+set auto_index(initCommand_zz_tclClient) [list source [file join $dir Generic interface.tcl]]
+set auto_index(initCommand_zz_testProfile) [list source [file join $dir Generic interface.tcl]]
+set auto_index(::interfaceTable::setDefault) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::configurePort) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::configure) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::addEntry) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::updateEntry) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::updateItemIpV4) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::updateItemIpV6) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::addMultipleEntry) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::addItemIpV4) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::formatEntryDescription) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::getInterfaceId) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::getInterfaceCount) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::enableInterface) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::disableInterface) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::disableAllInterfaces) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::deleteInterface) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::getEntryList) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::interfaceTable::getGatewayArray) [list source [file join $dir Generic interfaceTableUtils.tcl]]
+set auto_index(::ipv6::host2addr) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::expandAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::compressAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertMacToIpV6) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertIpToIpV6) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertIpToIsatap) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertIptoIpV4Compatible) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertIpTo6to4) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertIpV6ToMac) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertIpV6ToIp) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertNoop) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getAddressFields) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getFieldListByPrefix) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getFieldNamesByPrefix) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getFormatPrefix) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getTopLevelAggregateId) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getNextLevelAggregateId) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getSiteLevelAggregateId) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getSubnetId) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getInterfaceId) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getLoopbackAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::isValidAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::validateAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::isReservedMCAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::isValidMCAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::isMixedVersionAddress) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::incrIpField) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertIpv6AddrToBytes) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::convertBytesToIpv6Address) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::incIpv6AddressByPrefix) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getFieldMask) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getMinimumValidFramesize) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getHeaderLength) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ipv6::getAddressFieldOffset) [list source [file join $dir Generic ipV6Utils.tcl]]
+set auto_index(::ixFileUtils::closeAll) [list source [file join $dir Generic ixFileUtils.tcl]]
+set auto_index(::ixFileUtils::addFileToList) [list source [file join $dir Generic ixFileUtils.tcl]]
+set auto_index(::ixFileUtils::removeFileFromList) [list source [file join $dir Generic ixFileUtils.tcl]]
+set auto_index(::ixFileUtils::open) [list source [file join $dir Generic ixFileUtils.tcl]]
+set auto_index(::ixFileUtils::close) [list source [file join $dir Generic ixFileUtils.tcl]]
+set auto_index(::ixGraph::create) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::reset) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::destroy) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::addLine) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::getLines) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::deleteLine) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::resetLine) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::updateLine) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::getDataVector) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::setDataVector) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::resetDataVector) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::updateDataVectorPair) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::updateDataVector) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::updateCoordinates) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::ixGraph::advanceBuffer) [list source [file join $dir Generic ixGraph.tcl]]
+set auto_index(::logger::on) [list source [file join $dir Generic log.tcl]]
+set auto_index(::logger::off) [list source [file join $dir Generic log.tcl]]
+set auto_index(::logger::message) [list source [file join $dir Generic log.tcl]]
+set auto_index(::logger::show) [list source [file join $dir Generic log.tcl]]
+set auto_index(ixCollectAndSendLogs) [list source [file join $dir Generic logCollector.tcl]]
+set auto_index(::map::new) [list source [file join $dir Generic map.tcl]]
+set auto_index(::map::add) [list source [file join $dir Generic map.tcl]]
+set auto_index(::map::del) [list source [file join $dir Generic map.tcl]]
+set auto_index(::map::show) [list source [file join $dir Generic map.tcl]]
+set auto_index(::map::validateMapType) [list source [file join $dir Generic map.tcl]]
+set auto_index(showmaps) [list source [file join $dir Generic map.tcl]]
+set auto_index(ixMiiConfigPreEmphasis) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(ixMiiConfigLossOfSignalThreshold) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(ixMiiConfigXgxsLinkMonitoring) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(ixMiiConfigAlignRxDataClock) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(ixMiiConfigReceiveEqualization) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(ixMiiConfigXauiOutput) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(ixMiiConfigXauiSerialLoopback) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(ixMiiConfigXgmiiParallelLoopback) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::preEmphasis) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::lossOfSignalThreshold) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::xgxsLinkMonitoring) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::alignRxDataClock) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::receiveEqualization) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::xauiOutput) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::xauiSerialLoopback) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::xgmiiParallelLoopback) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::isXauiSerialLoopback) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::isXgmiiParallelLoopback) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::setRegister) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiConfig::getRegister) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiaeConfig::setRegister) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(::miiaeConfig::getRegister) [list source [file join $dir Generic miiUtils.tcl]]
+set auto_index(logOn) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(logOff) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(logMsg) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(errorMsg) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(debugOn) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(debugOff) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(debugMsg) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(showCmd) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(openMyFile) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(closeMyFile) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(callTraceMsg) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(traceVariableMsg) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isDigit) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isNegative) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isValidExponentialFloat) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isValidPositiveExponentialFloat) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isValidPartialFloat) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isValidPositivePartialFloat) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isValidPositiveFloat) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isValidInteger) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(isValidPositiveInteger) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(getProcList) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(getTxBasedOnRx) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(convertFromSeconds) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(convertToSeconds) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(formatDurationTime) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(formatNumber) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(unixCludgeGetExpr) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(useProfile) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(CountGlobalMemory) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(createNamedFont) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(buildFileName) [list source [file join $dir Generic miscCmds.tcl]]
+set auto_index(ixSource) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(sourceRecursively) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(ixLogin) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(ixLogout) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(ixTakeOwnership) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(ixPortTakeOwnership) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(ixClearOwnership) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(ixPortClearOwnership) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(ixCheckOwnership) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(canUse) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(isMine) [list source [file join $dir Generic multiUser.tcl]]
+set auto_index(calculateChecksum) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(oid2octet) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildLLCHeader) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildIpHeader) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildRipBlock) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildVidHeader) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildIPXPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildIPXData) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildServerEntry) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildSapPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildNetworkEntry) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildRipxPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildArpPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildRipPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildUdpEchoPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildIgmpPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildIpPriorityPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildVlanTagPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildSnmpPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildIcmpPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(buildBpduPacket) [list source [file join $dir Generic packetBuilder.tcl]]
+set auto_index(ixGetArgument) [list source [file join $dir Generic parseArgs.tcl]]
+set auto_index(isUNIX) [list source [file join $dir Generic platform.tcl]]
+set auto_index(isWindows) [list source [file join $dir Generic platform.tcl]]
+set auto_index(RandomRange) [list source [file join $dir Generic random.tcl]]
+set auto_index(Random) [list source [file join $dir Generic random.tcl]]
+set auto_index(RandomInit) [list source [file join $dir Generic random.tcl]]
+set auto_index(RandomFromTo) [list source [file join $dir Generic random.tcl]]
+set auto_index(::scriptmateBackwardsCompatibility::createAllCommands) [list source [file join $dir Generic scriptmateBackCompat.tcl]]
+set auto_index(serverSocketAccept) [list source [file join $dir Generic socket.tcl]]
+set auto_index(readsocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(handleEvent) [list source [file join $dir Generic socket.tcl]]
+set auto_index(generatePort) [list source [file join $dir Generic socket.tcl]]
+set auto_index(putsClient) [list source [file join $dir Generic socket.tcl]]
+set auto_index(createServerSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(closeSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(closeServerSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(isTestCommandSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(isLogSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(isCommandSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(isDataSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(createClientSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(closeClientSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(closeAllSockets) [list source [file join $dir Generic socket.tcl]]
+set auto_index(readClientSocket) [list source [file join $dir Generic socket.tcl]]
+set auto_index(createClientSocketCreate) [list source [file join $dir Generic socket.tcl]]
+set auto_index(putsServer) [list source [file join $dir Generic socket.tcl]]
+set auto_index(handleCommand) [list source [file join $dir Generic socket.tcl]]
+set auto_index(checkTransmitDone) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(checkAllTransmitDone) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(requestStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectTxStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectRxStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectVlanStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectDataIntegrityStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectSequenceStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectErroredFramesStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectQosStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectStats) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(getNumErroredFrames) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(checkLinkState) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(checkPPPState) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(getRunningRate) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(getRunRatePerSecond) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(collectRates) [list source [file join $dir Generic statistics.tcl]]
+set auto_index(capitalizeString) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringRepeat) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringIsInteger) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringIsDouble) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringSubstitute) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringUnderscore) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringTitle) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringSplitToTitle) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringJoinFromTitle) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringToUpper) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringMap) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringCompare) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringFormatNumber) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(stringReplace) [list source [file join $dir Generic stringUtils.tcl]]
+set auto_index(send_learn_frames) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(OLDsend_arp_frames) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(send_arp_frames) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(configureArp) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(sendArp) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(verifyAllArpFramesSent) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(verifyArpReply) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(send_neighborDiscovery_frames) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(performNeighborDiscovery) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(sendRouterSolicitation) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(getNeighborDiscovery) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(getNeighborDiscoveryPort) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(sapStr2Asc) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(send_ripx_frames) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(send_sap_server_frames) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(send_sapgns_frames) [list source [file join $dir Generic switchLearn.tcl]]
+set auto_index(::tclServer::getTclServerName) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(::tclServer::setTclServerName) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(::tclServer::disconnectTclServer) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(::tclServer::read) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(::tclServer::connectToTclServer) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(::tclServer::isTclServerConnected) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(::tclServer::setTclServer) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(::tclServer::connectButton) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(::tclServer::cancelButton) [list source [file join $dir Generic tclServer.tcl]]
+set auto_index(parseCmd) [list source [file join $dir Generic testCmdControl.tcl]]
+set auto_index(configureOptions) [list source [file join $dir Generic testCmdControl.tcl]]
+set auto_index(cgetOptions) [list source [file join $dir Generic testCmdControl.tcl]]
+set auto_index(getParmProperty) [list source [file join $dir Generic testCmdControl.tcl]]
+set auto_index(startOptions) [list source [file join $dir Generic testCmdControl.tcl]]
+set auto_index(registerResultVarsOptions) [list source [file join $dir Generic testCmdControl.tcl]]
+set auto_index(existsOptions) [list source [file join $dir Generic testCmdControl.tcl]]
+set auto_index(calcTrafficMix) [list source [file join $dir Generic trafficMix.tcl]]
+set auto_index(calcAggregateDataRate) [list source [file join $dir Generic trafficMix.tcl]]
+set auto_index(calcAggregateFrameRate) [list source [file join $dir Generic trafficMix.tcl]]
+set auto_index(calcAggregateTotalRate) [list source [file join $dir Generic trafficMix.tcl]]
+set auto_index(calcAggregateBitRate) [list source [file join $dir Generic trafficMix.tcl]]
+set auto_index(calcAggregatePPS) [list source [file join $dir Generic trafficMix.tcl]]
+set auto_index(calcTotalBits) [list source [file join $dir Generic trafficMix.tcl]]
+set auto_index(calcTotalStreamTime) [list source [file join $dir Generic trafficMix.tcl]]
+set auto_index(globalSetDefault) [list source [file join $dir Generic utils.tcl]]
+set auto_index(protocolStackSetDefault) [list source [file join $dir Generic utils.tcl]]
+set auto_index(streamSet) [list source [file join $dir Generic utils.tcl]]
+set auto_index(validateFramesize) [list source [file join $dir Generic utils.tcl]]
+set auto_index(validateFramesizeList) [list source [file join $dir Generic utils.tcl]]
+set auto_index(validatePreamblesize) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getLearnProc) [list source [file join $dir Generic utils.tcl]]
+set auto_index(validateProtocol) [list source [file join $dir Generic utils.tcl]]
+set auto_index(initMaxRate) [list source [file join $dir Generic utils.tcl]]
+set auto_index(buildIpMcastMacAddress) [list source [file join $dir Generic utils.tcl]]
+set auto_index(setPortName) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getPortString) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getPortId) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getPortName) [list source [file join $dir Generic utils.tcl]]
+set auto_index(setPortFactoryDefaults) [list source [file join $dir Generic utils.tcl]]
+set auto_index(setFactoryDefaults) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getProtocolName) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getDuplexModeString) [list source [file join $dir Generic utils.tcl]]
+set auto_index(disableUdfs) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getIpClassName) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getMinimum) [list source [file join $dir Generic utils.tcl]]
+set auto_index(swapPortList) [list source [file join $dir Generic utils.tcl]]
+set auto_index(copyPortList) [list source [file join $dir Generic utils.tcl]]
+set auto_index(removePorts) [list source [file join $dir Generic utils.tcl]]
+set auto_index(lnumsort) [list source [file join $dir Generic utils.tcl]]
+set auto_index(mergeLists) [list source [file join $dir Generic utils.tcl]]
+set auto_index(host2addr) [list source [file join $dir Generic utils.tcl]]
+set auto_index(long2IpAddr) [list source [file join $dir Generic utils.tcl]]
+set auto_index(byte2IpAddr) [list source [file join $dir Generic utils.tcl]]
+set auto_index(num2ip) [list source [file join $dir Generic utils.tcl]]
+set auto_index(ip2num) [list source [file join $dir Generic utils.tcl]]
+set auto_index(long2octet) [list source [file join $dir Generic utils.tcl]]
+set auto_index(list2word) [list source [file join $dir Generic utils.tcl]]
+set auto_index(value2Hexlist) [list source [file join $dir Generic utils.tcl]]
+set auto_index(hexlist2Value) [list source [file join $dir Generic utils.tcl]]
+set auto_index(expandHexString) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getMultipleNumbers) [list source [file join $dir Generic utils.tcl]]
+set auto_index(hextodec) [list source [file join $dir Generic utils.tcl]]
+set auto_index(dectohex) [list source [file join $dir Generic utils.tcl]]
+set auto_index(incrMacAddress) [list source [file join $dir Generic utils.tcl]]
+set auto_index(incrIpField) [list source [file join $dir Generic utils.tcl]]
+set auto_index(incrIpFieldHexFormat) [list source [file join $dir Generic utils.tcl]]
+set auto_index(assignIncrMacAddresses) [list source [file join $dir Generic utils.tcl]]
+set auto_index(incrHostIpAddr) [list source [file join $dir Generic utils.tcl]]
+set auto_index(waitForResidualFrames) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getPerTxArray) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getTxPorts) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getRxPorts) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getAllPorts) [list source [file join $dir Generic utils.tcl]]
+set auto_index(comparePortArray) [list source [file join $dir Generic utils.tcl]]
+set auto_index(mergePortArray) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getAdvancedSchedulerArray) [list source [file join $dir Generic utils.tcl]]
+set auto_index(cleanUpMultiuser) [list source [file join $dir Generic utils.tcl]]
+set auto_index(cleanUp) [list source [file join $dir Generic utils.tcl]]
+set auto_index(isIpAddressValid) [list source [file join $dir Generic utils.tcl]]
+set auto_index(isMacAddressValid) [list source [file join $dir Generic utils.tcl]]
+set auto_index(isPartialMacAddressValid) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getCommandParameters) [list source [file join $dir Generic utils.tcl]]
+set auto_index(changePortLoopback) [list source [file join $dir Generic utils.tcl]]
+set auto_index(validateUnidirectionalMap) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getTxRxModeString) [list source [file join $dir Generic utils.tcl]]
+set auto_index(removeStreams) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getIpV4MaskWidth) [list source [file join $dir Generic utils.tcl]]
+set auto_index(getIpV4MaskFromWidth) [list source [file join $dir Generic utils.tcl]]
+set auto_index(ixIsBgpInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsIsisInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsRsvpInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsOspfInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsRipInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsArpInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsIgmpInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsVpnL2Installed) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsVpnL3Installed) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsMldInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsOspfV3Installed) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsPimsmInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixGetLineUtilization) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsLdpInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(ixIsRipngInstalled) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(calculateMaxRate) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(calculateGapBytes) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(calculateFPS) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(calculatePercentMaxRate) [list source [file join $dir Generic utilWrappers.tcl]]
+set auto_index(vlanUtilsSetDefault) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(::vlanUtils::setPortTagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(::vlanUtils::setTagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(::vlanUtils::setPortUntagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(::vlanUtils::setUntagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(::vlanUtils::isPortTagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(::vlanUtils::emptyUntaggedPortList) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(setPortTagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(setTagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(setPortUntagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(setUntagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(isPortTagged) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(getUntaggedPortList) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(emptyUntaggedPortList) [list source [file join $dir Generic vlanUtils.tcl]]
+set auto_index(::ixXML::Init) [list source [file join $dir Generic xmlUtils.tcl]]
+set auto_index(::ixXML::NextToken) [list source [file join $dir Generic xmlUtils.tcl]]
+set auto_index(::ixXML::IsWellFormed) [list source [file join $dir Generic xmlUtils.tcl]]
+set auto_index(::ixXML::_IsWellFormed) [list source [file join $dir Generic xmlUtils.tcl]]
diff --git a/dep/tgen.tgz b/dep/tgen.tgz
deleted file mode 100644
index 5b242a1ec15db3948b09456e9a8736c93ac337f2..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/dep/tgen/Pktgen.lua b/dep/tgen/Pktgen.lua
new file mode 100644
index 00000000..d8181ef7
--- /dev/null
+++ b/dep/tgen/Pktgen.lua
@@ -0,0 +1,276 @@
+-- Create some short cuts to the real functions.
+gsub		    = string.gsub
+gmatch          = string.gmatch
+strrep		    = string.rep
+strsub          = string.sub
+strfmt          = string.format
+strmatch        = string.match
+strrep          = string.rep
+strfind         = string.find
+strlen          = string.len
+tolower         = string.lower
+unlink          = os.remove
+system          = os.execute
+tinsert         = table.insert
+tgetn           = table.getn
+tconcat         = table.concat
+
+-- ===========================================================================
+-- getPwd - Get the current working directory path.
+-- Works for both dos and cygwin shell, which may emit an error if one failes.
+--
+function getPwd( func )
+	local s = syscmd("pwd", func);
+	if ( s == nil ) then
+		s = syscmd("sh pwd", func);
+	end
+	return s;
+end
+
+-- ===========================================================================
+-- d2u - convert dos backslashes to unix forward slashes.
+--
+function d2u( str )
+    return gsub(str or "", "\\", "/");
+end
+
+-- ===========================================================================
+-- u2d - convert unix forward slashes to dos backslashes.
+--
+function u2d( str )
+    return gsub(str or "", "/", "\\");
+end
+
+-- ===========================================================================
+-- str2tbl - convert a string to a table.
+--
+function str2tbl( str )
+    local t = {};
+    local s;
+
+    for s in gmatch(str or "", "(.-)\n") do
+        tinsert(t, s);
+    end
+    return t
+end
+
+-- ===========================================================================
+-- trims the string of beginning and trailing spaces and tabs.
+--
+function trim(txt) return gsub(txt, "%s*(.-)%s*$", "%1", 1); end
+
+-- ===========================================================================
+-- A formatted output routine just like the real printf.
+--
+function printf(...) io.write(strfmt(...)); io.flush(); end
+
+-- ===========================================================================
+-- returns the table size or number of items in table.
+--
+function getn( t )
+
+    local   i = 0;
+
+    if ( (t ~= nil) and (type(t) == "table") ) then
+        i = tgetn(t);
+        if ( i > 0 ) then
+            return i;
+        end
+        for k in pairs(t) do
+            i = i + 1;
+        end
+    end
+    return i;
+end
+
+-- ===========================================================================
+-- returns the 'basename' and the 'basedir' 
+--
+function basename(filename) 
+    local   fn, dn;
+
+    -- Convert the '\' to '/' in the path name.
+    filename = d2u(filename);
+
+    fn = gsub(filename, "(.*/)(.*)", "%2") or filename; 
+    dn = gsub(filename, "(.*/)(.*)", "%1") 
+
+    dn = strsub(dn, 1, -2);
+
+    return fn, dn;
+end
+
+-- ===========================================================================
+-- Default routine to read data from syscmd function.
+--
+local function __doRead(fn)
+    local   data, f;
+
+    -- Open and read all of the data.
+    f = assert(io.open(fn));
+    data = f:read("*all");
+    f:close();
+
+    unlink(fn);
+
+    return data;
+end
+
+-- ===========================================================================
+-- Execute the system command return the command output if needed.
+--
+function syscmd( cmd, funcPtr )
+    local tmpFile = "syscmd_tmp";
+
+    system( cmd .. " > " .. tmpFile );
+ 
+    funcPtr = funcPtr or __doRead;
+
+    return funcPtr(tmpFile);    -- tmpFile is removed by the function.
+end
+
+-- ===========================================================================
+-- Execute the string and return true/false.
+--
+function isTrue(f)
+    local   s;
+
+    if ( f == nil ) then
+        return 0;
+    end
+
+    s = "if ( "..f.." ) then return 1 else return 0 end";
+    return assert(loadstring(s))();
+end
+
+-- ===========================================================================
+-- Output a message and return.
+--
+function msg(m, ...)
+
+    if ( m ~= nil ) then io.write("++ "..strfmt(m, ...)); io.flush(); end
+end
+-- ===========================================================================
+-- Display an error message and exit.
+--
+function errmsg(m, ...)
+
+    if ( m ~= nil ) then printf("** %s", strfmt(m, ...)); end
+
+    os.exit(1);
+end
+
+-- ===========================================================================
+-- Output a 'C' like block comment.
+--
+function cPrintf(m, ...)
+
+    printf("/* ");
+    io.write(strfmt(m, ...));
+    printf(" */\n");
+end
+-- ===========================================================================
+-- Output a 'C' like comment.
+--
+function comment(msg)
+
+    printf("/* %s */\n", msg or "ooops");
+end
+
+-- Standard set of functions for normal operation.
+--
+
+-----------------------------------------------------------------------------
+-- serializeIt - Convert a variable to text or its type of variable.
+--
+local function serializeIt(v)
+    local   s;
+    local   t = type(v);
+
+    if (t == "number") then
+        s = tostring(v);
+    elseif (t == "table") then
+        s = tostring(v);
+    elseif (t == "string") then
+        s = strfmt("%q", v);
+    elseif (t == "boolean") then
+        s = tostring(v);
+    elseif (t == "function") then
+        s = strfmt("()");
+    elseif (t == "userdata") then
+        s = tostring(v);
+    elseif (t == "nil") then
+        s = "nil";
+    else
+        s = strfmt("<%s>", tostring(v));
+    end
+
+    return s;
+end
+
+-----------------------------------------------------------------------------
+-- Serialize a value
+--    k - is the variable name string.
+--    o - is the orignal variable name for tables.
+--    v - the value of the variable.
+--    saved - is the saved table to detect loops.
+--    tab - is the current tab depth.
+--
+local function doSerialize(k, o, v, saved, tab)
+	local s, t;
+    local space = function(t) return strrep(" ", t); end;
+
+    tab     = tab or 0;
+    t       = type(v);
+    saved   = saved or {};
+
+	if (t == "table") then
+        if ( saved[v] ~= nil ) then
+            return strfmt("%s[%s] = %s,\n", space(tab), serializeIt(o), saved[v]); 
+        else
+            local   kk, vv, mt;
+
+            saved[v] = k;
+
+            if ( tab == 0 ) then
+                s = strfmt("%s%s = {\n", space(tab), tostring(k)); 
+            else
+                s = strfmt("%s[%s] = {\n", space(tab), serializeIt(o)); 
+            end
+            for kk,vv in pairs(v) do
+                local fn = strfmt("%s[%s]", tostring(k), serializeIt(kk));
+
+                s = s .. doSerialize(fn, kk, vv, saved, tab+2);
+            end
+
+			if ( tab == 0 ) then
+            	return s .. strfmt("%s}\n", space(tab));
+			else
+            	return s .. strfmt("%s},\n", space(tab));
+			end
+        end
+	else
+        return strfmt("%s[%s] = %s,\n", space(tab), serializeIt(o), serializeIt(v));
+	end
+end
+
+-----------------------------------------------------------------------------
+-- serialize - For a given key serialize the global variable.
+--    k is a string for display and t is the table to display.
+--    e.g. printf(serialize("foo", { ["bar"] = "foobar" } ));
+--              
+function serialize(k, t)
+
+    if ( k == nil ) then
+	    k = "Globals";
+        t = _G;			-- Dump out globals
+    end
+	if ( t == nil ) then
+		t = _G;
+	end
+
+   	return doSerialize(k, k, t, {}, 0);
+end
+
+function prints(k, t) io.write(serialize(k, t)); io.flush(); end
+function sleep(t) pktgen.delay(t * 1000); end
diff --git a/dep/tgen/PktgenGUI.lua b/dep/tgen/PktgenGUI.lua
new file mode 100644
index 00000000..1ce542ab
--- /dev/null
+++ b/dep/tgen/PktgenGUI.lua
@@ -0,0 +1,113 @@
+--
+-- PktgenGUI.lua
+--
+
+gui = {}
+
+function gui.msg(...)
+	str = strfmt("msg=%s\n",strfmt(...));
+	io.write(str);
+	io.flush();
+end
+
+function gui.dumpStats(func, name, portlist)
+	stats = func(portlist);
+	printf("%s={ ", name);
+	st = stats[0];
+	for k,v in pairs(st) do 
+		printf("%s ", k);
+	end
+	printf("},");
+	for i = 0, (stats.n - 1) do
+		st = stats[i];
+		printf("%d={ ", i);
+		for k,v in pairs(st) do 
+			printf("%d ", v);
+		end
+		if ( i == (stats.n - 1) ) then
+			printf("}\n");
+		else
+			printf("},");
+		end
+	end
+end
+
+function gui.dumpInfo(func, name, portlist)
+	stats = func(portlist);
+	printf("%s={ ", name);
+	st = stats[0];
+	for k,v in pairs(st) do 
+		printf("%s ", k);
+	end
+	printf("},");
+	for i = 0, (stats.n - 1) do
+		st = stats[i];
+		printf("%d={ ", i);
+		for k,v in pairs(st) do 
+			printf("%s ", v);
+		end
+		if ( i == (stats.n - 1) ) then
+			printf("}\n");
+		else
+			printf("},");
+		end
+	end
+end
+
+function gui.getPktStats(portlist)
+	gui.dumpStats(pktgen.pktStats, "pktStats", portlist)
+end
+
+function gui.getPortStats(portlist)
+	gui.dumpStats(pktgen.portStats, "portStats", portlist)
+end
+
+function gui.getRateStats(portlist)
+	gui.dumpStats(pktgen.rateStats, "rateStats", portlist)
+end
+
+function gui.getPortSizes(portlist)
+	gui.dumpStats(pktgen.portSizes, "portSizes", portlist)
+end
+
+function gui.getPortInfo(portlist)
+	gui.dumpInfo(pktgen.portInfo, "portInfo", portlist)
+end
+
+function gui.getLinkState(portlist)
+	links = pktgen.linkState(portlist);
+	printf("linkState={ ");
+	for k,v in pairs(links) do
+		if ( k == "n" ) then break; end
+		printf("%d=%s ", k, v);
+	end
+	printf("}\n");
+end
+
+function gui.getPortFlags(portlist)
+	links = pktgen.portFlags(portlist);
+	printf("portFlags={ ");
+	for k,v in pairs(links) do
+		if ( k == "n" ) then break; end
+		printf("%d=%s ", k, v);
+	end
+	printf("}\n");
+end
+
+function gui.startTransmitting(portlist)
+	-- gui.msg("=== Start Transmit %s", portlist);
+	pktgen.start(portlist);
+end
+
+function gui.stopTransmitting(portlist)
+	-- gui.msg("=== Stop Transmit %s", portlist);
+	pktgen.stop(portlist);
+end
+
+function gui.clearAllStats()
+	pktgen.clear("all");
+end
+
+function gui.noop()
+	-- Do nothing
+end
diff --git a/dep/tgen/tgen b/dep/tgen/tgen
new file mode 100755
index 0000000000000000000000000000000000000000..63fe0f631ef4602e7a210377c0dfa121cb478887
GIT binary patch
diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index c20aa044..31f0f68a 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -4,6 +4,7 @@
 
 import os
 import re
+import subprocess
 
 from .crb import Crb
 from .dut import Dut
@@ -566,6 +567,8 @@ class DPDKtester(Tester):
                 else:
                     self.set_huge_pages(1024)
 
+            subprocess.getoutput("cd dep/tclclient && tar czvf ../tclclient.tgz *  && cd - ")
+            subprocess.getoutput("cd dep/tgen && tar czvf ../tgen.tgz *  && cd - ")
             self.session.copy_file_to("dep/tgen.tgz")
             self.session.copy_file_to("dep/tclclient.tgz")
             # unpack tgen
