CM_ENCRYPTED.sh.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. CM_ENCRYPTED.sh
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='boot.sh.html' title=' boot.sh '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='firmware.sh.html' title=' firmware.sh '>NEXT</a>]
  19. </div>
  20. <pre>
  21. #!/bin/sh
  22. # file: scripts/CM_ENCRYPTED.sh
  23. # This script formats and sends a CM_ENCRYPTED_PAYBOOT message to a
  24. # specific slave device; the message is written as a text file then
  25. # passed to efsu to send;
  26. # ====================================================================
  27. # host symbols;
  28. # --------------------------------------------------------------------
  29. . ./hardware.sh
  30. # ====================================================================
  31. # file symbols;
  32. # --------------------------------------------------------------------
  33. COUNT=1
  34. FRAME=test.hex
  35. # ====================================================================
  36. # display usage information;e
  37. # --------------------------------------------------------------------
  38. usage()
  39. {
  40. cat &lt;&lt; EOF
  41. usage: ${options}
  42. This scripts sets the up and down bandwidth on Slave devices in the network
  43. OPTIONS
  44. -h show this message
  45. -s slave device name
  46. -u Upstream Bandwidth required in Mbps
  47. -d Downstream Bandwidth required in Mbps
  48. Note: Bandwidth value support 0-15 input values and 0 selects full line rate
  49. EOF
  50. }
  51. # ====================================================================
  52. # command line parser routine
  53. # --------------------------------------------------------------------
  54. device=
  55. while getopts &quot;hs:u:d:&quot; OPTION
  56. do
  57. case ${OPTION} in
  58. h)
  59. usage
  60. exit 1
  61. ;;
  62. s)
  63. device=${OPTARG}
  64. ;;
  65. esac
  66. done
  67. if [[ -z ${device} ]]; then
  68. usage
  69. exit 1
  70. elif [ ${device} = slave1 ]; then
  71. target=${slave1}
  72. elif [ ${device} = slave2 ]; then
  73. target=${slave2}
  74. elif [ ${device} = slave3 ]; then
  75. target=${slave3}
  76. elif [ ${device} = slave4 ]; then
  77. target=${slave4}
  78. elif [ ${device} = slave5 ]; then
  79. target=${slave5}
  80. else
  81. target=${master}
  82. fi
  83. # ====================================================================
  84. # Format the MME with processed values from command line
  85. # --------------------------------------------------------------------
  86. da=&quot;ff ff ff ff ff ff&quot;
  87. sa=&quot;ff ff ff ff ff ff&quot;
  88. mtype=&quot;88 e1&quot;
  89. mmv=&quot;01&quot;
  90. mmtype=&quot;06 60&quot;
  91. FMI=&quot;00 00&quot;
  92. PEKS=&quot;0F&quot;
  93. AVLN=&quot;00&quot;
  94. PID=&quot;04&quot;
  95. PRN=&quot;09 75&quot;
  96. PMN=&quot;01&quot;
  97. UUID=&quot;55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa&quot;
  98. LEN=&quot;00 00&quot;
  99. HLE=&quot;AA 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 55&quot;
  100. fill=&quot;ff ff ff ff ff ff ff ff ff&quot;
  101. cat &gt; ${FRAME} &lt;&lt;EOF
  102. ${da} ${sa} ${mtype} ${mmv} ${mmtype} ${FMI} ${PEKS} ${AVLN} ${PID} ${PRN} ${PMN} ${UUID} ${LEN} ${HLE} ${fill} ${fill} ${fill} ${fill} ${fill} ${fill} ${fill} ${fill}
  103. EOF
  104. # ====================================================================
  105. # check environment;
  106. # --------------------------------------------------------------------
  107. if [ ! -f ${FRAME} ]; then
  108. echo &quot;File ${FRAME} is missing or misplaced&quot;
  109. exit 1
  110. fi
  111. # ====================================================================
  112. # send traffic in both directions;
  113. # --------------------------------------------------------------------
  114. efsu -i ${ETH2} -h ${FRAME} -l ${COUNT} -v
  115. rm ${FRAME}
  116. </pre>
  117. <div class='footerlink'>
  118. [<a href='boot.sh.html' title=' boot.sh '>PREV</a>]
  119. [<a href='toolkit.html' title=' Index '>HOME</a>]
  120. [<a href='firmware.sh.html' title=' firmware.sh '>NEXT</a>]
  121. </div>
  122. </body>
  123. </html>