Getting Route Data

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library Getting Route Data

  • Creator
    Topic
  • #55539
    Rob Lindsey
    Participant

    Thanks to James Cobain for posting some code a while back to pull out Routing and Xlate information I was able to update the code to pull out any of the tclprocs on the Route and have it display: Prexlate, Xlate and Postxlate information.  If it is not a Xlate route but uses tclprocs it will also show those.  Below is the code.  SOURCE , DESTINATION , TRX ID  and XLATE/TCLPROCS are displayed on a single line for each route/destination.

    Code:


    #!/hci/cloverleaf/cis6.1/integrator/bin/hcitcl
    ######################################################
    # Tcl program to obtain Routing info for each thread

    global hciRoot
    global hciSite
    global siteDir

    set hciRoot $env(HCIROOT)
    set hciSite $env(HCISITE)
    set siteDir $env(HCISITEDIR)

    set fmt “%-20s %-20s %-35s %s”
    set hdr [format $fmt “SOURCE” “DESTINATION” “TRX ID” “XLATE/TCLPROCS”]
    puts $hdr
    puts “——————————————————————————————————————————- ”

    netcfgLoad

    set connList [lsort [netcfgGetConnList]]

    foreach connection $connList {

       set connData [netcfgGetConnData $connection]
       set destList “”
       keylget connData DATAXLATE dataXlate
       if {[llength $dataXlate] > 0} {
           foreach route $dataXlate {
               keylget route TRXID trxid
               keylget route ROUTE_DETAILS route_details
               foreach routeDetail $route_details {
                   set dest “”
                   set xlate “”
                   set OutTrans “”
                   set XlatePreProcs “”
                   set XlatePostProcs “”
                   keylget routeDetail DEST dest

                   keylget routeDetail PREPROCS.PROCS XlatePreProcs
                   if { $XlatePreProcs ne “” } { append OutTrans $XlatePreProcs ” ” }

                   keylget routeDetail XLATE xlate
                   if { $xlate ne “” } { append OutTrans $xlate ” ” }

                   keylget routeDetail POSTPROCS.PROCS XlatePostProcs
                   if { $XlatePostProcs ne “” } { append OutTrans $XlatePostProcs ” ” }

                   keylget routeDetail PROCS.PROCS RouteTclprocs
                   if { $RouteTclprocs ne “” } { append OutTrans $RouteTclprocs }

                   set OutTrans [string map {” ” “,”} $OutTrans]
                   set OutTrans [string trimright $OutTrans “,”]
                   if { $OutTrans eq “” } { set OutTrans “none” }

                   lappend destList [format $fmt $connection $dest $trxid $OutTrans]
               }
           }
           foreach dest $destList {
               puts “$dest”
           }
           puts ” ”
       }
       keylget connData SMS.IN_DATA inTclProcs
       # puts “inTclProcs –> $inTclProcs”

       keylget connData SMS.OUT_DATA outTclProcs
       # puts “outTclProcs –> $outTclProcs”

    }

    Have fun if you want to use it.  From the command line we use named it  getroutedata.  This way we can use command line stuff to find all of the routes that have certain TCL procs.

  • The forum ‘Tcl Library’ is closed to new topics and replies.

Forum Statistics

Registered Users
4,985
Forums
28
Topics
9,139
Replies
33,761
Topic Tags
258