xml2pib.1.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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. xml2pib.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='weeder.1.html' title=' weeder.1 '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='toolkit.html' title=' Index '>NEXT</a>]
  19. </div>
  20. <pre>
  21. xml2pib(1) Qualcomm Atheros Open Powerline Toolkit xml2pib(1)
  22. NAME
  23. xml2pib - Qualcomm Atheros XML driven PIB editor
  24. SYNOPSIS
  25. xml2pib [options] pib-file [pib-file] [...]
  26. DESCRIPTION
  27. The Atheros PIB XML Editor modifies an Atheros PIB file based on XML instructions defined in one or more instruction
  28. files. Instruction files must be valid XML and conform to schema file piboffset.xsd or errors will occur. Always vali‐
  29. date XML files against this schema with a validating parser before submitting them to this program. Firefox or Internet
  30. Explorer are suitable for validation purposes purpose.
  31. This program is part of the Qualcomm Atheros Powerline Toolkit. See the AMP man page for an overview and installation
  32. instructions.
  33. OPTIONS
  34. -f filename
  35. The XML instruction file. XML instruction files must conform to the Qualcomm Atheros scheme designed for this
  36. purpose. If more that one .xml file is specified then edits are applied in order of filename such that later edit
  37. instructions can over-write eariler instructions. Instruction files usually have a .xml extension but this pro‐
  38. gram makes no assumption based on filename and does not enforce any filename conventions.
  39. -o Print the appropriate XML schema on stdout. This schema should be used to validate XML instructions using a vali‐
  40. dating parser such as Firefox or Microsoft Internet Explorer.
  41. -q Suppresses printing of progress messages. This option has no effect at this time.
  42. -v Print additional information. This option has no effect at this time.
  43. -?,--help
  44. Print program help summary on stdout. This option takes precedence over other options on the command line.
  45. -!,--version
  46. Print program version information on stdout. This option takes precedence over other options on the command line.
  47. Use this option when sending screen dumps to Atheros Technical Support so that they know exactly which version of
  48. the Linux Toolkit you are using.
  49. ARGUMENTS
  50. pib-file
  51. An Atheros parameter filename. Only one parameter file can be edited at a time and so care must be taken to avoid
  52. the use of wildcard filenames. Parameter files usually have a .pib extension but this program makes no assumption
  53. based on filename and does not enforce any filename conventions.
  54. SCHEMA
  55. The official Atheros XML PIB Edit schema follows. It defines general instruction file structure and the elements used to
  56. edit PIB files. This file should be a controlled document and instruction files should always be validated against it
  57. before using them to edit a PIB file. An explanation of this file appears below.
  58. &lt;?xml version='1.0' encoding='iso-8859-1'?&gt;
  59. &lt;xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified'&gt;
  60. &lt;xs:element name='pib'&gt;
  61. &lt;xs:complexType&gt;
  62. &lt;xs:sequence&gt;
  63. &lt;xs:element maxOccurs='unbounded' ref='object'/&gt;
  64. &lt;/xs:sequence&gt;
  65. &lt;/xs:complexType&gt;
  66. &lt;/xs:element&gt;
  67. &lt;xs:element name='object'&gt;
  68. &lt;xs:complexType&gt;
  69. &lt;xs:attribute name='name' use='required' type='xs:NCName'/&gt;
  70. &lt;xs:sequence&gt;
  71. &lt;xs:sequence&gt;
  72. &lt;xs:element ref='offset'/&gt;
  73. &lt;xs:element ref='length'/&gt;
  74. &lt;/xs:sequence&gt;
  75. &lt;xs:choice&gt;
  76. &lt;xs:element ref='array'/&gt;
  77. &lt;xs:element ref='dataString'/&gt;
  78. &lt;xs:element ref='dataHuge'/&gt;
  79. &lt;xs:element ref='dataLong'/&gt;
  80. &lt;xs:element ref='dataWord'/&gt;
  81. &lt;xs:element ref='dataByte'/&gt;
  82. &lt;/xs:choice&gt;
  83. &lt;/xs:sequence&gt;
  84. &lt;/xs:complexType&gt;
  85. &lt;/xs:element&gt;
  86. &lt;xs:element name='length' type='xs:positiveInteger'/&gt;
  87. &lt;xs:element name='offset' type='xs:hexBinary'/&gt;
  88. &lt;xs:element name='array'&gt;
  89. &lt;xs:complexType&gt;
  90. &lt;xs:choice maxOccurs='unbounded'&gt;
  91. &lt;xs:element ref='dataByte'/&gt;
  92. &lt;xs:element ref='dataHex'/&gt;
  93. &lt;/xs:choice&gt;
  94. &lt;/xs:complexType&gt;
  95. &lt;/xs:element&gt;
  96. &lt;xs:element name='dataString' type='xs:string'/&gt;
  97. &lt;xs:element name='dataHuge' type='xs:unsignedLong'/&gt;
  98. &lt;xs:element name='dataLong' type='xs:unsignedInt'/&gt;
  99. &lt;xs:element name='dataWord' type='xs:unsignedShort'/&gt;
  100. &lt;xs:element name='dataByte' type='xs:unsignedByte'/&gt;
  101. &lt;xs:element name='dataHex' type='xs:hexBinary'/&gt;
  102. &lt;/xs:schema&gt;
  103. ELEMENTS
  104. &lt;pib&gt; The Parameter Information Block subject to edit. There is exactly one pib defined in an instruction file.
  105. &lt;object&gt;
  106. A data region withn a pib. There must be at least one object defined inside a pib. Each object has an offset, a
  107. length and data where data is expressed as one dataString, a dataByte, a dataHex or an array as described below.
  108. The name attribute optional but may be used for clarity or for reporting purposes.
  109. &lt;offset&gt;
  110. The relative position of the object in bytes expressed in hexadecimal. The offset plus the length of an object
  111. cannot exceed PIB length or an error will occur. The offset and length element can appear in either order but
  112. both must appear before the data element. The offset element is required.
  113. &lt;length&gt;
  114. The extent of the object expressed in decimal bytes. The offset plus length of an object cannot exceed PIB
  115. length. The the offset and length elements can occur in either order but both must precede the data element. The
  116. length element is required for elements array and dataString but may be omitted for elements dataHuge, dataLong,
  117. dataWord and dataByte.
  118. &lt;array&gt;
  119. A sequence of dataByte and/or dataHex elements. The implied length is determined by array members but must equal
  120. the object length attribute or an error will occur. A dataString is illegal inside an array.
  121. &lt;dataString&gt;
  122. Any sequence of printable characters. The implied length is 1 byte longer than the number of characters. The
  123. string will be truncated or padded with NUL bytes to match the object length attribute. An object length
  124. attribute of 0 stores one NUL byte. A dataString element is illegal within an array block.
  125. &lt;dataHuge&gt;
  126. A unsigned decimal integer string that represents any 64 bit binary value. The implied length is 8 bytes. The
  127. object length attribute is ignored and may be omitted.
  128. &lt;dataLong&gt;
  129. A unsigned decimal integer string that represents any 32 bit binary value. The implied length is 4 bytes. The
  130. object length attribute is ignored and may be omitted.
  131. &lt;dataWord&gt;
  132. A unsigned decimal integer string that represents any 16 bit binary value. The implied length is 2 bytes. The
  133. object length attribute is ignored and may be omitted.
  134. &lt;dataByte&gt;
  135. An unsigned decimal digit string that represents any 8 bit binary value. The implied length is 1 byte. The
  136. object length attribute is ignored and may be omitted.
  137. &lt;dataHex&gt;
  138. A hexadecimal digit string that represents one byte for each digit pair (octet) present. There must be an even
  139. number of digits or an error will occur. The resulting length must equal the object length unless the value
  140. appears inside an array. Inside an array, the resulting length must not exceed the remaining array length.
  141. PROCESS
  142. The program reads one PIB file and replaces selected values with new ones, computes the new checksum and re-writes the
  143. file. New values are defined by offset, length, format and value. The object name is actually irrelevant. Critical
  144. values are the offset, length and data type/value. Obviously, care must be taken when specifying offsets and lengths to
  145. avoid editing objects incorrectly.
  146. INSTRUCTIONS
  147. An example instruction file follows. It references the Qualcomm Atheros XML PIB Edit schema file, piboffset.xsd, that is
  148. shown above so that a validating parser can find the schema and perform document checks. The remainder of the file
  149. describes a series of object names, offsets, lengths and values that describe the edits to be performed.
  150. &lt;pib xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  151. xsi:noNamespaceSchemaLocation=&quot;piboffset.xsd&quot;&gt;
  152. &lt;object name=&quot;HFID_Manufacturer&quot;&gt;
  153. &lt;offset&gt;0024&lt;/offset&gt;
  154. &lt;length&gt;64&lt;/length&gt;
  155. &lt;dataString&gt;Atheros HomePlug AV Device&lt;/dataString&gt;
  156. &lt;/object&gt;
  157. &lt;object name=&quot;HFID_User&quot;&gt;
  158. &lt;length&gt;64&lt;/length&gt;
  159. &lt;offset&gt;0074&lt;/offset&gt;
  160. &lt;dataString&gt;Atheros&lt;/dataString&gt;
  161. &lt;/object&gt;
  162. &lt;object name=&quot;MDURole&quot;&gt;
  163. &lt;offset&gt;0101&lt;/offset&gt;
  164. &lt;dataByte&gt;0&lt;/dataByte&gt;
  165. &lt;/object&gt;
  166. &lt;object name=&quot;PriorityTTl&quot;&gt;
  167. &lt;offset&gt;0210&lt;/offset&gt;
  168. &lt;length&gt;16&lt;/length&gt;
  169. &lt;array&gt;
  170. &lt;dataHex&gt;80841E008084&lt;/dataHex&gt;
  171. &lt;dataHex&gt;1e&lt;/dataHex&gt;
  172. &lt;dataByte&gt;0&lt;/dataByte&gt;
  173. &lt;dataHex&gt;&lt;/dataHex&gt;
  174. &lt;dataHex&gt;&lt;/dataHex&gt;
  175. &lt;dataHex&gt;&lt;/dataHex&gt;
  176. &lt;dataHex&gt;&lt;/dataHex&gt;
  177. &lt;dataHex&gt;C0&lt;/dataHex&gt;
  178. &lt;dataByte&gt;198&lt;/dataByte&gt;
  179. &lt;dataHex&gt;2d&lt;/dataHex&gt;
  180. &lt;dataHex&gt;00&lt;/dataHex&gt;
  181. &lt;/array&gt;
  182. &lt;/object&gt;
  183. &lt;object name=&quot;VLANPrioTOSPrecMatrix&quot;&gt;
  184. &lt;length&gt;4&lt;/length&gt;
  185. &lt;offset&gt;0224&lt;/offset&gt;
  186. &lt;array&gt;
  187. &lt;dataByte&gt;65&lt;/dataByte&gt;
  188. &lt;dataByte&gt;250&lt;/dataByte&gt;
  189. &lt;dataHex&gt;&lt;/dataHex&gt;
  190. &lt;dataHex&gt;Fa&lt;/dataHex&gt;
  191. &lt;/array&gt;
  192. &lt;/object&gt;
  193. &lt;object name=&quot;EnableLEDThroughputIndicate&quot;&gt;
  194. &lt;length&gt;1&lt;/length&gt;
  195. &lt;offset&gt;1E94&lt;/offset&gt;
  196. &lt;dataByte&gt;0&lt;/dataByte&gt;
  197. &lt;/object&gt;
  198. &lt;object name=&quot;HFID_AVLN&quot;&gt;
  199. &lt;length&gt;64&lt;/length&gt;
  200. &lt;offset&gt;00B4&lt;/offset&gt;
  201. &lt;dataString&gt;Atheros-Net&lt;/dataString&gt;
  202. &lt;/object&gt;
  203. &lt;/pib&gt;
  204. EXAMPLES
  205. The following example reads PIB file abc.pib and edits it according to instructions found in XML file local.xml. The PIB
  206. file is always specified first, followed by one or more XML instruction files.
  207. # xml2pib abc.pib local.xml
  208. The following example reads PIB file abc.pib and edits it according to three XML instruction files, in the order speci‐
  209. fied. Order can be critical since later edits could over-write earlier edits.
  210. # xml2pib abc.pib standard.xml custom.xml errata.xml
  211. The following example does nothing because no instruction files are specified.
  212. # xml2pib abc.pib
  213. SEE ALSO
  214. chkpib(7), chkpib2(7), getpib(7), modpib(1), pib2xml(1), pibcomp(1), pibdump(1), setpib(1)
  215. CREDITS
  216. Charles Maier &lt;cmaier@qca.qualcomm.com&gt;
  217. open-plc-utils-0.0.3 Mar 2014 xml2pib(1)
  218. </pre>
  219. <div class='footerlink'>
  220. [<a href='weeder.1.html' title=' weeder.1 '>PREV</a>]
  221. [<a href='toolkit.html' title=' Index '>HOME</a>]
  222. [<a href='toolkit.html' title=' Index '>NEXT</a>]
  223. </div>
  224. </body>
  225. </html>