xml2pib.1 12 KB

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