setpib.1.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. setpib.1
  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='sdram.1.html' title=' sdram.1 '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='ttycat.1.html' title=' ttycat.1 '>NEXT</a>]
  19. </div>
  20. <pre>
  21. setpib(1) Qualcomm Atheros Open Powerline Toolkit setpib(1)
  22. NAME
  23. setpib - Qualcomm Atheros PIB File Editor
  24. SYNOPSIS
  25. setpib [options] file base [type data] [type data] [...]
  26. DESCRIPTION
  27. Replace one or more values in a Qualcomm Atheros powerline parameter (or PIB) file and re-compute the checksum. Values
  28. are specified as a sequence of type/data pairs. Users must know the offset, length and type of the values they change or
  29. problems will certainly result. This program makes absolutely no effort to validate offsets or values.
  30. This program can be used to change any PIB value, including those that should not be changed. Be warned that some PIB
  31. values are derived from, or interact with, other PIB values. Failure to observe such dependencies may diminish perfor‐
  32. mance or render a device inoperable.
  33. Atheros does not recommend the use of this program to edit PIB parameters because small mistakes can cause big problems.
  34. In addition, Atheros is under no obligation to provide customers with the offset, length or type of any PIB file parame‐
  35. ters.
  36. Atheros recommends using program modpib to change device identity parameters and the Windows Device Manager to change
  37. other parameters whenever possible.
  38. This program handles older Thunderbolt/Lightning parameter files and newer Panther/Lynx parameter files but it has a
  39. larger footprint that may not be acceptable for embedded systems. In cases where only the older or the newer parameter
  40. files are used, consider using program setpib1 for an older Thunderbolt/Lightning only version or setpib2 for a newer
  41. Panther/Lynx only version.
  42. This program is part of the Qualcomm Atheros Powerline Toolkit. See the AMP man page for an overview and installation
  43. instructions.
  44. OPTIONS
  45. -q Enable quiet mode which has not effect.
  46. -v Print a hexdump of the edited region. Print hexdump headers if this option appears twice. The region window may
  47. be changed with option -w.
  48. -w window
  49. The display window in bytes. When option -v is present, PIB information surrounding the edited region is dis‐
  50. played to provide some sort of context. The edited region appears in the middle of this window. The default win‐
  51. dow is 32 bytes. This means that the 32 bytes before and the 32 bytes after the edited region are included in the
  52. display.
  53. -x Repair the checksum. By default, this program does not modify files that fail the size or checksum test on input.
  54. In addition, it does not re-compute the checksum on output if no data has changed. This option skips the size and
  55. checksum test on input and re-computes the checksum on output even if no data has changed. This option only works
  56. on legacy PIB files. It does not work on PIB files having NVM file format.
  57. -?, --help
  58. Print program help summary on stdout. This option takes precedence over other options on the command line.
  59. -!, --version
  60. Print program version information on stdout. This option takes precedence over other options on the command line.
  61. Usethis option when sending screen dumps to Atheros Technical Support so that they know exactly which version of
  62. the Linux Toolkit you are using.
  63. ARGUMENTS
  64. file The PIB filename. The file must exist and will be re-written. No assumptions are made based on filename and no
  65. filename conventions are enforced. This argument is required and must precede the base argument.
  66. base The byte offset where changes will start. The offset is expressed in hexadecimal with (or without) the leading
  67. &quot;0x&quot;. Changes are applied in order, left to right, and offset automatically increments by the correct amount
  68. after each change is applied. This permits consectuive PIB locations to be changed with one command. This argu‐
  69. ment is required and must follow the file argument. It must also precede all format/data pairs. Normally, you
  70. must use multiple setpib commands to change non-consecutive PIB locations but careful use of format skip can
  71. achive the same results using one command.
  72. type The implied length and encoding of the data. Valid types are byte, word, long, data and hfid. A valid format
  73. must precede each data item. A byte is 8 bits, a word is 16 bits, a long is 32 bits and a huge is 64 bits. The
  74. format implies the maximum data value except for format data which is limited by the number of octets entered on
  75. the command line.
  76. data The information written to the current PIB offset. Integer data may be expressed in binary, decimal or hexadeci‐
  77. mal but must not exceed the type minimum or maximum. String data may contain any ASCII characters that can be
  78. entered via keyboard but must be enclosed in quotes when spaces are included. Binary values start with 0b or 0B
  79. and hexadecimal values start with 0x or 0X.
  80. FORMATS
  81. byte integer
  82. A signed or unsigned integer stored as 8 bits or 1 byte. The value is expressed in decimal by default. A binary
  83. value may be expressed with a 0b prefix. A hexadecimal value may be expressed using a 0x prefix. Negative
  84. type/data values must appear at the end of the command line, after option &quot;--&quot;, to avoid parsing errors. The off‐
  85. set increments by 1 prior to the next insertion.
  86. word integer
  87. A signed or unsigned integer stored as 16 bits or 2 bytes. The value is expressed in decimal by default. A
  88. binary value may be expressed with a 0b prefix. A hexadecimal value may be expressed using a 0x prefix. Negative
  89. type/data values must appear at the end of the command line, after option &quot;--&quot;, to avoid parsing errors. The off‐
  90. set increments by 2 prior to the next insertion.
  91. long integer
  92. A signed or unsigned integer stored as 32 bits or 4 bytes. The value is expressed in decimal by default. A
  93. binary value may be expressed with a 0b prefix. A hexadecimal value may be expressed using a 0x prefix. Negative
  94. type/data values must appear at the end of the command line, after option &quot;--&quot;, to avoid parsing errors. The off‐
  95. set increments by 4 prior to the next insertions.
  96. huge integer
  97. A signed or unsigned integer stored as 64 bits or 8 bytes. The value is expressed in decimal by default. A
  98. binary value may be expressed with a 0b prefix. A hexadecimal value may be expressed using a 0x prefix. The off‐
  99. set increments by 8 prior to the next insertion. Negative type/data values must appear at the end of the command
  100. line, after option &quot;--&quot;, to avoid parsing errors. This format is only available on hosts that support 64 bit data
  101. values.
  102. data hex
  103. A sequence of hexadecimal octets. Octets may be separated by a colon for clarity. The number of octets deter‐
  104. mines the number of bytes written. The offset increments by the number of bytes written. This is similar to
  105. &quot;key&quot; and &quot;mac&quot; below but accepts variable length input.
  106. key hex
  107. A sequence of hexadecimal octets. Octets may be separated by a colon for clarity. The number of octets must con‐
  108. vert to 16 bytes or an error will occur. The offset increments by 16 prior to the next insertion. This is simi‐
  109. lar &quot;data&quot; above but accepts only fixed length input. This option may be used to set the DAK, NMK or NVAK values.
  110. mac hex
  111. A sequence of hexadecimal octets. Octets may be separated by a colon for clarity. The number of octets must con‐
  112. vert to 6 bytes or an error will occur. The offset increments by 6 prior to the next insertion. This is similar
  113. &quot;data&quot; above but accepts only fixed length input. This option may be used to set the DAK, NMK or NVAK values.
  114. text string
  115. An ASCII character string. The string string length determines the number of bytes stored. The string is stored
  116. with NUL terminator included. It is not padded or truncated. The offset increments by the number of bytes stored
  117. prior to the next insertion. This option may be used to enter a variable length string.
  118. hfid string
  119. An ASCII character string. The string is always stored as 64 bytes. Short strings are padded on the right with
  120. NUL characters. Long strings are truncated on the right and the last byte is forced to NUL. The offset incre‐
  121. ments by 64 bytes prior to the next insertion. This option may be used to enter user, network and manufacturer
  122. identification strings.
  123. zero count
  124. An unsigned integer representing the number of consecutive bytes to fill with 0x00. The offset increments by the
  125. number of bytes written. This option may be used to erase regions of the PIB.
  126. fill count
  127. An unsigned integer representing the number of consecutive bytes to fill with 0xFF. The offset increments by the
  128. number of bytes written. This option may be used to erase regions of the PIB.
  129. skip count
  130. An unsigned integer indicating the number of bytes to skip over before staring another change. Intervening data
  131. data locations are unchanged.
  132. TR69 DATA TYPES
  133. accesspassword string
  134. An ASCII character string. The string is always stored as 257 bytes. Short strings are padded on the right with
  135. NUL characters. Long strings are truncated on the right and the last byte is forced to NUL. The offset incre‐
  136. ments by 257 prior to the next insertion.
  137. accessusername string
  138. An ASCII character string. The string is always stored as 33 bytes. Short strings are padded on the right with
  139. NUL characters. Long strings are truncated on the right and the last byte is forced to NUL. The offset incre‐
  140. ments by 33 prior to the next insertion.
  141. adminpassword string
  142. An ASCII character string. The string is always stored as 33 bytes. Short strings are padded on the right with
  143. NUL characters. Long strings are truncated on the right and the last byte is forced to NUL. The offset incre‐
  144. ments by 33 prior to the next insertion.
  145. adminusername string
  146. An ASCII character string. The string is always stored as 33 bytes. Short strings are padded on the right with
  147. NUL characters. Long strings are truncated on the right and the last byte is forced to NUL. The offset incre‐
  148. ments by 33 prior to the next insertion.
  149. password string
  150. An ASCII character string. The string is always stored as 257 bytes. Short strings are padded on the right with
  151. NUL characters. Long strings are truncated on the right and the last byte is forced to NUL. The offset incre‐
  152. ments by 257 prior to the next insertion.
  153. url string
  154. An ASCII character string. The string is always stored as 257 bytes. Short strings are padded on the right with
  155. NUL characters. Long strings are truncated on the right and the last byte is forced to NUL. The offset incre‐
  156. ments by 257 prior to the next insertion.
  157. username string
  158. An ASCII character string. The string is always stored as 257 bytes. Short strings are padded on the right with
  159. NUL characters. Long strings are truncated on the right and the last byte is forced to NUL. The offset incre‐
  160. ments by 257 prior to the next insertion.
  161. EXAMPLES
  162. The following example edits file abc.pib by writing decimal value 1 at offset 01F7 followed by hexadecimal value
  163. 00B052BABE01. A partial dump is printed showing 16 bytes before and 16 bytes after the changed data because the default
  164. display windows is 16 bytes. Unless the change occurs right at the start or end of the file, it will appear in the cen‐
  165. ter of the display window.
  166. # setpib -v abc.pib 01F7 byte 1 data 00:B0:52:BA:BE:01
  167. 000001D0 00 00 00 00 00 00 00 00 00 .........
  168. 000001E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  169. 000001F0 00 00 00 00 00 00 00 01 00 B0 52 BA BE 01 00 00 ..........R.....
  170. 00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  171. 00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
  172. The following example sets the manufacturer HFID string in PIB file def.pib. HFID strings are 64 characters long and
  173. either truncated or padded on the right with NUL characters. You may need to enclose the string in quotes it it contains
  174. spaces.
  175. # setpib -v def.pib 24 hfid &quot;Galactic Software Pirates, Inc.&quot;
  176. 00000000 38 1F 00 00 30 1B EB 04 00 B0 52 00 8...0.....R.
  177. 00000010 00 66 50 D3 E4 93 3F 85 5B 70 40 78 4D F8 15 AA .fP...?.[p@xM...
  178. 00000020 8D B7 00 00 47 61 6C 61 63 74 69 63 20 53 6F 66 ....Galactic Sof
  179. 00000030 74 77 61 72 65 20 50 69 72 61 74 65 73 2C 20 49 tware Pirates, I
  180. 00000040 6E 63 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 nc..............
  181. 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  182. 00000060 00 00 00 00 50 D3 E4 93 3F 85 5B 70 40 78 4D F8 ....P...?.[p@xM.
  183. 00000070 15 AA 8D B7 49 6E 74 65 6C 6C 6F 6E 20 45 6E 61 ....Atheros Ena
  184. 00000080 62 6C 65 64 bled
  185. The following example displays the contents of PIB file abc.pib without changing any data. The region displayed is 24
  186. bytes starting at offset 0x24. The format skip specifies the region but does not change it. By default, the 32 bytes
  187. before and 32 bytes after are included in the display. This technique can be used to inspect a specific portion of a PIB
  188. file.
  189. # setpib -v abc.pib 24 skip 64
  190. 00000000 38 1F 00 00 30 1B EB 04 00 B0 52 00 8...0.....R.
  191. 00000010 00 66 50 D3 E4 93 3F 85 5B 70 40 78 4D F8 15 AA .fP...?.[p@xM...
  192. 00000020 8D B7 00 00 47 61 6C 61 63 74 69 63 20 53 6F 66 ....Galactic Sof
  193. 00000030 74 77 61 72 65 20 50 69 72 61 74 65 73 2C 20 49 tware Pirates, I
  194. 00000040 6E 63 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 nc..............
  195. 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  196. 00000060 00 00 00 00 50 D3 E4 93 3F 85 5B 70 40 78 4D F8 ....P...?.[p@xM.
  197. 00000070 15 AA 8D B7 49 6E 74 65 6C 6C 6F 6E 20 45 6E 61 ....Atheros Ena
  198. 00000080 62 6C 65 64 bled
  199. The next example does the same thing for a negative value. This is tricky because the minus sign will be interpreted as
  200. the start of another option. We must use &quot;--&quot; to end normal option parsing. This is a POSIX standard feature. See IEEE
  201. Std 1002.1-2001, Section 12.2, Utility Syntax Guidelines for more an explanation.
  202. # setpib -v abc.pib 1471 -- long -50
  203. 00001450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
  204. 00001460 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  205. 00001470 00 CE FF FF FF 00 00 00 00 00 00 00 00 00 00 00 ................
  206. 00001480 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  207. 00001490 00 00 00 00 00 .....
  208. The following example computes a new checksum without changing any data. The filename and an offset are required but no
  209. other values are needed. This technique can be used to compute a new checksum after modifying the file using software
  210. that does not update the checksum.
  211. # setpib abc.pib 0 -x
  212. DISCLAIMER
  213. PIB file structure and content is proprietary to Qualcomm Atheros, Ocala FL USA. Consequently, public information is not
  214. available. Qualcomm Atheros reserves the right to modify PIB file structure or content in future firmware releases with‐
  215. out any obligation to notify or compensate users of this program.
  216. SEE ALSO
  217. chkpib(7), chkpib2(7), getpib(7), modpib(1), pib2xml(1), pibcomp(1), pibdump(1), xml2pib(1)
  218. CREDITS
  219. Charles Maier &lt;cmaier@qca.qualcomm.com&gt; ]
  220. open-plc-utils-0.0.3 Mar 2014 setpib(1)
  221. </pre>
  222. <div class='footerlink'>
  223. [<a href='sdram.1.html' title=' sdram.1 '>PREV</a>]
  224. [<a href='toolkit.html' title=' Index '>HOME</a>]
  225. [<a href='ttycat.1.html' title=' ttycat.1 '>NEXT</a>]
  226. </div>
  227. </body>
  228. </html>