⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbquery.tcl

📁 vxworks下MV5500的BSP支持包。是支持tornad221下的版本。
💻 TCL
📖 第 1 页 / 共 3 页
字号:
############################################################################### isNLSeatAllocated -## This procedure returns if the product passed is licensed as node-locked on# the host passed## SYNOPSIS# .tS# isNLSeatAllocated prodName hostName# .tE## PARAMETERS: prodName hostName## RETURNS: 1 if node-locked license exists, else 0## ERRORS: N/A#proc isNLSeatAllocated {prodName hostName} {    global lmVals lmHostRecs lmHostRecsLen lmHostFeaturesNum    # get the record for the correct host        set recIndex [lsearch -exact $lmVals(lmHosts) $hostName]    if {$recIndex == -1} {        return "Error: no such $hostName in lmHostRecs"    }    set rec [lindex $lmHostRecs $recIndex]    set rec [split $rec |]    set featureRecs [lrange $rec 3 [expr 3 + [lindex $lmHostFeaturesNum $recIndex]]]    set recLen [llength $featureRecs]    for {set ix 0} {$ix < $recLen} {incr ix} {        if {$prodName == [lmLicProdInfoGet prodName $hostName $ix]} {            return [lmLicProdInfoGet licAllocated $hostName $ix]        }    }    return 0}############################################################################### lmLicProdInfoGet## This procedure returns licensed product info corresponding to the host# and the index into the list of licensed products for that host.## SYNOPSIS# .tS# lmLicProdInfoGet <attribute> hostName index# .tE## PARAMETERS: attribute hostName index# where attribute can be one of:#       prodName        returns the product name or feature name#       featureId        returns the featureId for the product#       licAllocated    returns the number of license already allocated#                         for this product on host hostName#       licFLAllocated  returns the number of floating licenses already#                         allocated for this product on host hostName#       licNLAllocated  returns the number of node-lockedlicenses already#                         allocated for this product on host hostName#   hostName is the host in question#   index is the index of the product in featureRecs# RETURNS: see above## ERRORS: N/A#proc lmLicProdInfoGet {attrib hostName index} {    global lmVals lmHostRecs lmHostRecsLen lmHostFeaturesNum    # get the record for the correct host        set recIndex [lsearch -exact $lmVals(lmHosts) $hostName]    if {$recIndex == -1} {        return "Error: no such $hostName in lmHostRecs"    }    set rec [lindex $lmHostRecs $recIndex]    set rec [split $rec |]    set featureRecs [lrange $rec 3 [expr 3 + [lindex $lmHostFeaturesNum $recIndex]]]    switch -exact $attrib {         prodName {            set featureRec [lindex $featureRecs $index]            return  [parseColonIndex $featureRec 0]           }        featureId {            set featureRec [lindex $featureRecs $index]            return  [parseColonIndex $featureRec 1]           }        licAllocated {            set featureRec [lindex $featureRecs $index]            return [expr [FLSeatsGet $featureRec] + [NLSeatsGet $featureRec]]        }         licFLAllocated {            set featureRec [lindex $featureRecs $index]            return [FLSeatsGet $featureRec]        }        licNLAllocated {            set featureRec [lindex $featureRecs $index]            return [NLSeatsGet $featureRec]        }        default {            puts "Error: no such attribute $attrib in lmHostRecs"            return ""        }    }}############################################################################### FLSeatsGet## This procedure returns the number of floating seats on the host #       in the featureRec passed## SYNOPSIS# .tS# FLSeatsGet featureRec# .tE## PARAMETERS: featureRec - the feature record for the host selected#      featureRec looks like this: feature:featID:FL-##:NL-#### RETURNS: the number of floating seats## ERRORproc FLSeatsGet {featureRec} {    set float [parseColonIndex $featureRec 2]    if {$float == ""} {return 0}    set float [string range $float 3 end]    return $float}############################################################################### NLSeatsGet## This procedure returns the number of nodelocked seats on the host in the#       featureRec passed#       featureRec looks like this: feature:featID:FL-##:NL-#### SYNOPSIS# .tS# NLSeatsGet featureRec# .tE## PARAMETERS: featureRec - the feature Record for the host selected#                         ## RETURNS: the number of nodelocked seats## ERRORproc NLSeatsGet {featureRec} {    set nodeLocked [parseColonIndex $featureRec 3]    if {$nodeLocked == ""} {return 0}    set nodeLocked [string range $nodeLocked 3 end]    return $nodeLocked}############################################################################### lmTotalInfoGet## This procedure returns licensed product info (based on a given index),# corresponding to the totals that are returned by the database## SYNOPSIS# .tS# lmTotalInfoGet <attribute>  index# .tE## PARAMETERS: attribute hostName index# where attribute can be one of:#       prodName        returns the product name or feature name#       featureId       returns the featureId for the product#       totAllocated    returns the number of licenses allocated#                         for this product (NL+FL)#       totFLAllocated  returns the number of floating licenses#                         allocated for this product#       totNLAllocated  returns the number of node-locked licenses#                         allocated for this product## RETURNS: see above## ERRORS: N/A#proc lmTotalInfoGet {attrib index} {    global lmVals lmTotalRecs    switch -exact $attrib {        prodName {            set totalRec [lindex $lmTotalRecs $index]            return [parseColonIndex $totalRec 0]        }        featureId {            set totalRec [lindex $lmTotalRecs $index]            return [parseColonIndex $totalRec 1]           }        totAllocated {            set totalRec [lindex $lmTotalRecs $index]            set allocated [expr [FLSeatsGet $totalRec] + [NLSeatsGet $totalRec]]            return $allocated        }        totFLAllocated {            set totalRec [lindex $lmTotalRecs $index]            return [FLSeatsGet $totalRec]        }        totNLAllocated {            set totalRec [lindex $lmTotalRecs $index]            return [NLSeatsGet $totalRec]        }        default {            puts "Error: no such attribute $attrib in lmHostRecs"            return ""        }    }}############################################################################### lmFeaturesValueGet### Given feature's name, this procedure retrieves its corresponding value # from one of the specified lmVals: #   lmFeaturesTotal#   lmFeaturesAllocated#   lmFeaturesAvailable#   lmFLFeaturesTotal#   lmNLFeaturesTotal#   lmFLFeaturesAllocated#   lmNLFeaturesAllocated#   lmFLFeaturesAvailable#   lmNLFeaturesAvailable## SYNOPSIS# .tS# lmFeaturesValueGet <attribute> prodName# .tE## PARAMETERS: attribute prodName# where attribute can be one of:#   lmFeaturesTotal       returns the total number of licenses for that #                         product for all hosts#   lmFeaturesAllocated   returns the total number of licenses allocated #                         for that product for all hosts#   lmFeaturesAvailable   returns the total number of licenses available#                         for that product for all hosts#   lmFLFeaturesTotal     returns total number of floating licenses for all hosts#   lmNLFeaturesTotal     returns total number of NL licenses for all hosts#   lmFLFeaturesAllocated returns total # of FL licenses allocated for the product#   lmNLFeaturesAllocated returns total # of FN licenses allocated for the product#   lmFLFeaturesAvailable returns total # of FL licenses available for the product#   lmNLFeaturesAvailable returns total # of NL licenses available for the product### RETURNS: see above## ERRORS: N/A#proc lmFeaturesValueGet {attrib prodName} {    global lmVals        set lmList [list lmFeaturesTotal lmFeaturesAllocated \                     lmFeaturesAvailable lmFLFeaturesTotal lmNLFeaturesTotal \                     lmFLFeaturesAllocated lmNLFeaturesAllocated \                     lmFLFeaturesAvailable lmNLFeaturesAvailable]    if { [lsearch -exact $lmList $attrib] == -1 } {            puts "Error: no such attribute $attrib in lmVals!"            return ""    }    foreach lm $lmVals($attrib) {        if { [string match $prodName [lindex $lm 0]] } {            return [lindex $lm 1]        }    }}####################################################################### parseColonIndex - routine which returns the value in colon#            separated string.## SYNOPSIS# parseColonIndex string index## PARAMETERS:#    string - string with colon separated values#    index  - index to use to fetch value, starting with 0## RETURNS: the value at index, or NULL string## ERRORS: N/A#proc parseColonIndex {string index} {    set retVal ""    set buf [split $string :]    set retVal [lindex $buf $index]    return $retVal}####################################################################### parseBarIndex - routine which returns the value in vertical bar#            separated string.## SYNOPSIS# parseBarIndex string index## PARAMETERS:#    string - string with bar separated values#    index  - index to use to fetch value, starting with 0## RETURNS: the value at index, or NULL string## ERRORS: N/A#proc parseBarIndex {string index} {    set retVal ""    set buf [split $string |]    set retVal [lindex $buf $index]    return $retVal}####################################################################### Dialog Text Messages######################################################################global setupValsset strTable(DBQUERY_TITLE) "Database Query Permission"set strTable(DBQUERY_MSG_1) \        "In order to automate this installation, SETUP will now query\        Wind River with the following information:"set strTable(DBQUERY_MSG_2) \        "Access to the World Wide Web is required to contact the Wind\        River license database. If you have a restrictive firewall or a\        proxy server, Automated License Installation is not possible,\        therefore select \"No.\""set strTable(DBQUERY_GRANT) \        "Yes, contact the Wind River web site."set strTable(DBQUERY_DENIED) \        "No, do not contact the Wind River web site."set strTable(DBQUERY_LICINFO_BANNER) \        "Retrieving license information, please wait..."set strTable(DBQUERY_ERROR) \    "License management configuration as an end-user is not complete!\     \n\nDue to network connection problems or errors received from the\     license database at Wind River you have chosen to discontinue license\     management setup.\n\nIf you desire to configure license management\     manually, an environment variable LM_LICENSE_FILE needs to be set to the\     name of the license server host. Please ask your system administrator\     for the server name and set the environment variable to it. The\     format of LM_LICENSE_FILE value is:\n\nport@server\n\nwhere:\n\"port\"\     is the port which is set by your system administrator. Port number\     can be left blank if using the default port (which is 27000).\     \n\"server\" is the name of the license server host.\n\nIf you do not\     configure license management manually, then upon invocation of any\     licensed application, you will be presented with end-user license\     management screens again."set strTable(DBQUERY_STATEMENT) \    "Note: This program will not upload any unauthorized information from\     your machine."     set strTable(DBQUERY_VSN_DETAILS) \    "This option uses your disk serial number as your host\     ID instead of your MAC address.\n\nIf you have a laptop\     with a docking station, and you switch between\     them, this option is recommended.\n\nFor more information, please\     see our web site at\     http://www.windriver.com/corporate/support/license.html"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -