PageRenderTime 101ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/_SolutionItems_/Documents/BitTorrentSpecification - TheoryOrg.mht

https://bitbucket.org/titolarz/bitspecslibrary
Unknown | 6548 lines | 6497 code | 51 blank | 0 comment | 0 complexity | 3e35ac6feb90327a6c4170a32cd0a36c MD5 | raw file
  1. From: "Saved by Windows Internet Explorer 9"
  2. Subject: BitTorrentSpecification - TheoryOrg
  3. Date: Thu, 8 Sep 2011 06:20:06 +0800
  4. MIME-Version: 1.0
  5. Content-Type: multipart/related;
  6. type="text/html";
  7. boundary="----=_NextPart_000_0000_01CC6DEF.5A1D4220"
  8. X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.17609
  9. This is a multi-part message in MIME format.
  10. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  11. Content-Type: text/html;
  12. charset="utf-8"
  13. Content-Transfer-Encoding: quoted-printable
  14. Content-Location: http://wiki.theory.org/BitTorrentSpecification
  15. =EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  16. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" =
  17. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><HTML=20
  18. dir=3D"ltr" lang=3D"en"><HEAD><TITLE>BitTorrentSpecification - =
  19. TheoryOrg</TITLE>
  20. <META content=3D"text/html; charset=3Dutf-8" =
  21. http-equiv=3D"Content-Type">
  22. <META name=3D"GENERATOR" content=3D"MSHTML 9.00.8112.16434"><LINK =
  23. rel=3D"shortcut icon"=20
  24. href=3D"/favicon.ico"><LINK title=3D"TheoryOrg (en)" rel=3D"search" =
  25. type=3D"application/opensearchdescription+xml"=20
  26. href=3D"/opensearch_desc.php"><LINK title=3D"Creative Commons" =
  27. rel=3D"meta" type=3D"application/rdf+xml"=20
  28. href=3D"/index.php?title=3DBitTorrentSpecification&amp;action=3Dcreativec=
  29. ommons"><LINK=20
  30. rel=3D"copyright" =
  31. href=3D"http://www.gnu.org/licenses/old-licenses/fdl-1.2.txt">
  32. <LINK title=3D"TheoryOrg Atom feed" rel=3D"alternate" =
  33. type=3D"application/atom+xml"=20
  34. href=3D"/index.php?title=3DSpecial:RecentChanges&amp;feed=3Datom"><LINK =
  35. rel=3D"stylesheet"=20
  36. href=3D"http://wiki.theory.org/skins/common/shared.css?270" =
  37. media=3D"screen"><LINK=20
  38. rel=3D"stylesheet" =
  39. href=3D"http://wiki.theory.org/skins/common/commonPrint.css?270"=20
  40. media=3D"print"><LINK rel=3D"stylesheet" =
  41. href=3D"http://wiki.theory.org/skins/monobook/main.css?270"=20
  42. media=3D"screen"><!--[if lt IE 5.5000]><link rel=3D"stylesheet" =
  43. href=3D"/skins/monobook/IE50Fixes.css?270" media=3D"screen" =
  44. /><![endif]--><!--[if IE 5.5000]><link rel=3D"stylesheet" =
  45. href=3D"/skins/monobook/IE55Fixes.css?270" media=3D"screen" =
  46. /><![endif]--><!--[if IE 6]><link rel=3D"stylesheet" =
  47. href=3D"/skins/monobook/IE60Fixes.css?270" media=3D"screen" =
  48. /><![endif]--><!--[if IE 7]><link rel=3D"stylesheet" =
  49. href=3D"/skins/monobook/IE70Fixes.css?270" media=3D"screen" =
  50. /><![endif]-->
  51. <LINK rel=3D"stylesheet" =
  52. href=3D"/index.php?title=3DMediaWiki:Common.css&amp;usemsgcache=3Dyes&amp=
  53. ;ctype=3Dtext%2Fcss&amp;smaxage=3D18000&amp;action=3Draw&amp;maxage=3D180=
  54. 00">
  55. <LINK rel=3D"stylesheet" =
  56. href=3D"/index.php?title=3DMediaWiki:Print.css&amp;usemsgcache=3Dyes&amp;=
  57. ctype=3Dtext%2Fcss&amp;smaxage=3D18000&amp;action=3Draw&amp;maxage=3D1800=
  58. 0"=20
  59. media=3D"print"><LINK rel=3D"stylesheet" =
  60. href=3D"/index.php?title=3DMediaWiki:Monobook.css&amp;usemsgcache=3Dyes&a=
  61. mp;ctype=3Dtext%2Fcss&amp;smaxage=3D18000&amp;action=3Draw&amp;maxage=3D1=
  62. 8000">
  63. <LINK rel=3D"stylesheet" =
  64. href=3D"http://wiki.theory.org/index.php?title=3D-&amp;action=3Draw&amp;m=
  65. axage=3D18000&amp;gen=3Dcss">
  66. <SCRIPT>=0A=
  67. var skin=3D"monobook",=0A=
  68. stylepath=3D"/skins",=0A=
  69. wgUrlProtocols=3D"http\\:\\/\\/|https\\:\\/\\/|ftp\\:\\/\\/|irc\\:\\/\\/|=
  70. gopher\\:\\/\\/|telnet\\:\\/\\/|nntp\\:\\/\\/|worldwind\\:\\/\\/|mailto\\=
  71. :|news\\:|svn\\:\\/\\/",=0A=
  72. wgArticlePath=3D"/$1",=0A=
  73. wgScriptPath=3D"",=0A=
  74. wgScriptExtension=3D".php",=0A=
  75. wgScript=3D"/index.php",=0A=
  76. wgVariantArticlePath=3Dfalse,=0A=
  77. wgActionPaths=3D{},=0A=
  78. wgServer=3D"http://wiki.theory.org",=0A=
  79. wgCanonicalNamespace=3D"",=0A=
  80. wgCanonicalSpecialPageName=3Dfalse,=0A=
  81. wgNamespaceNumber=3D0,=0A=
  82. wgPageName=3D"BitTorrentSpecification",=0A=
  83. wgTitle=3D"BitTorrentSpecification",=0A=
  84. wgAction=3D"view",=0A=
  85. wgArticleId=3D1427,=0A=
  86. wgIsArticle=3Dtrue,=0A=
  87. wgUserName=3Dnull,=0A=
  88. wgUserGroups=3Dnull,=0A=
  89. wgUserLanguage=3D"en",=0A=
  90. wgContentLanguage=3D"en",=0A=
  91. wgBreakFrames=3Dfalse,=0A=
  92. wgCurRevisionId=3D4218,=0A=
  93. wgVersion=3D"1.16.5",=0A=
  94. wgEnableAPI=3Dtrue,=0A=
  95. wgEnableWriteAPI=3Dtrue,=0A=
  96. wgSeparatorTransformTable=3D["", ""],=0A=
  97. wgDigitTransformTable=3D["", ""],=0A=
  98. wgMainPageTitle=3D"Main Page",=0A=
  99. wgFormattedNamespaces=3D{"-2": "Media", "-1": "Special", "0": "", "1": =
  100. "Talk", "2": "User", "3": "User talk", "4": "TheoryOrg", "5": "TheoryOrg =
  101. talk", "6": "File", "7": "File talk", "8": "MediaWiki", "9": "MediaWiki =
  102. talk", "10": "Template", "11": "Template talk", "12": "Help", "13": =
  103. "Help talk", "14": "Category", "15": "Category talk"},=0A=
  104. wgNamespaceIds=3D{"media": -2, "special": -1, "": 0, "talk": 1, "user": =
  105. 2, "user_talk": 3, "theoryorg": 4, "theoryorg_talk": 5, "file": 6, =
  106. "file_talk": 7, "mediawiki": 8, "mediawiki_talk": 9, "template": 10, =
  107. "template_talk": 11, "help": 12, "help_talk": 13, "category": 14, =
  108. "category_talk": 15, "image": 6, "image_talk": 7},=0A=
  109. wgSiteName=3D"TheoryOrg",=0A=
  110. wgCategories=3D["PhpWiki"],=0A=
  111. wgRestrictionEdit=3D[],=0A=
  112. wgRestrictionMove=3D[];=0A=
  113. </SCRIPT>
  114. <SCRIPT =
  115. src=3D"http://wiki.theory.org/skins/common/wikibits.js?270"></SCRIPT>
  116. <SCRIPT =
  117. src=3D"http://wiki.theory.org/skins/common/ajax.js?270"></SCRIPT>
  118. <SCRIPT =
  119. src=3D"http://wiki.theory.org/index.php?title=3D-&amp;action=3Draw&amp;ge=
  120. n=3Djs&amp;useskin=3Dmonobook&amp;270"></SCRIPT>
  121. </HEAD>
  122. <BODY class=3D"mediawiki ltr ns-0 ns-subject =
  123. page-BitTorrentSpecification skin-monobook">
  124. <DIV id=3D"globalWrapper">
  125. <DIV id=3D"column-content">
  126. <DIV id=3D"content"><A id=3D"top"></A>
  127. <H1 id=3D"firstHeading" =
  128. class=3D"firstHeading">BitTorrentSpecification</H1>
  129. <DIV id=3D"bodyContent">
  130. <H3 id=3D"siteSub">From TheoryOrg</H3>
  131. <DIV id=3D"contentSub"></DIV>
  132. <DIV id=3D"jump-to-nav">Jump to: <A =
  133. href=3D"http://wiki.theory.org/BitTorrentSpecification#column-one">naviga=
  134. tion</A>,=20
  135. <A=20
  136. href=3D"http://wiki.theory.org/BitTorrentSpecification#searchInput">searc=
  137. h</A></DIV><!-- start content -->
  138. <P><BIG><BIG><BIG> <I><B>Bittorrent Protocol Specification v1.0</B></I>=20
  139. </BIG></BIG></BIG></P>
  140. <TABLE id=3D"toc" class=3D"toc">
  141. <TBODY>
  142. <TR>
  143. <TD>
  144. <DIV id=3D"toctitle">
  145. <H2>Contents</H2></DIV>
  146. <UL>
  147. <LI class=3D"toclevel-1 tocsection-1"><A =
  148. href=3D"http://wiki.theory.org/BitTorrentSpecification#Identification"><S=
  149. PAN=20
  150. class=3D"tocnumber">1</SPAN> <SPAN=20
  151. class=3D"toctext">Identification</SPAN></A></LI>
  152. <LI class=3D"toclevel-1 tocsection-2"><A =
  153. href=3D"http://wiki.theory.org/BitTorrentSpecification#Purpose"><SPAN=20
  154. class=3D"tocnumber">2</SPAN> <SPAN =
  155. class=3D"toctext">Purpose</SPAN></A></LI>
  156. <LI class=3D"toclevel-1 tocsection-3"><A =
  157. href=3D"http://wiki.theory.org/BitTorrentSpecification#Scope"><SPAN=20
  158. class=3D"tocnumber">3</SPAN> <SPAN =
  159. class=3D"toctext">Scope</SPAN></A></LI>
  160. <LI class=3D"toclevel-1 tocsection-4"><A =
  161. href=3D"http://wiki.theory.org/BitTorrentSpecification#Related_Documents"=
  162. ><SPAN=20
  163. class=3D"tocnumber">4</SPAN> <SPAN class=3D"toctext">Related=20
  164. Documents</SPAN></A></LI>
  165. <LI class=3D"toclevel-1 tocsection-5"><A =
  166. href=3D"http://wiki.theory.org/BitTorrentSpecification#Conventions"><SPAN=
  167. =20
  168. class=3D"tocnumber">5</SPAN> <SPAN=20
  169. class=3D"toctext">Conventions</SPAN></A></LI>
  170. <LI class=3D"toclevel-1 tocsection-6"><A =
  171. href=3D"http://wiki.theory.org/BitTorrentSpecification#Bencoding"><SPAN=20
  172. class=3D"tocnumber">6</SPAN> <SPAN =
  173. class=3D"toctext">Bencoding</SPAN></A>
  174. <UL>
  175. <LI class=3D"toclevel-2 tocsection-7"><A =
  176. href=3D"http://wiki.theory.org/BitTorrentSpecification#Bencoded_Strings">=
  177. <SPAN=20
  178. class=3D"tocnumber">6.1</SPAN> <SPAN =
  179. class=3D"toctext">Bencoded=20
  180. Strings</SPAN></A></LI>
  181. <LI class=3D"toclevel-2 tocsection-8"><A =
  182. href=3D"http://wiki.theory.org/BitTorrentSpecification#Integers"><SPAN=20
  183. class=3D"tocnumber">6.2</SPAN> <SPAN=20
  184. class=3D"toctext">Integers</SPAN></A></LI>
  185. <LI class=3D"toclevel-2 tocsection-9"><A =
  186. href=3D"http://wiki.theory.org/BitTorrentSpecification#Lists"><SPAN=20
  187. class=3D"tocnumber">6.3</SPAN> <SPAN=20
  188. class=3D"toctext">Lists</SPAN></A></LI>
  189. <LI class=3D"toclevel-2 tocsection-10"><A =
  190. href=3D"http://wiki.theory.org/BitTorrentSpecification#Dictionaries"><SPA=
  191. N=20
  192. class=3D"tocnumber">6.4</SPAN> <SPAN=20
  193. class=3D"toctext">Dictionaries</SPAN></A></LI>
  194. <LI class=3D"toclevel-2 tocsection-11"><A =
  195. href=3D"http://wiki.theory.org/BitTorrentSpecification#Implementations"><=
  196. SPAN=20
  197. class=3D"tocnumber">6.5</SPAN> <SPAN=20
  198. class=3D"toctext">Implementations</SPAN></A></LI></UL></LI>
  199. <LI class=3D"toclevel-1 tocsection-12"><A =
  200. href=3D"http://wiki.theory.org/BitTorrentSpecification#Metainfo_File_Stru=
  201. cture"><SPAN=20
  202. class=3D"tocnumber">7</SPAN> <SPAN class=3D"toctext">Metainfo =
  203. File=20
  204. Structure</SPAN></A>
  205. <UL>
  206. <LI class=3D"toclevel-2 tocsection-13"><A =
  207. href=3D"http://wiki.theory.org/BitTorrentSpecification#Info_Dictionary"><=
  208. SPAN=20
  209. class=3D"tocnumber">7.1</SPAN> <SPAN class=3D"toctext">Info=20
  210. Dictionary</SPAN></A>
  211. <UL>
  212. <LI class=3D"toclevel-3 tocsection-14"><A =
  213. href=3D"http://wiki.theory.org/BitTorrentSpecification#Info_in_Single_Fil=
  214. e_Mode"><SPAN=20
  215. class=3D"tocnumber">7.1.1</SPAN> <SPAN =
  216. class=3D"toctext">Info in Single=20
  217. File Mode</SPAN></A></LI>
  218. <LI class=3D"toclevel-3 tocsection-15"><A =
  219. href=3D"http://wiki.theory.org/BitTorrentSpecification#Info_in_Multiple_F=
  220. ile_Mode"><SPAN=20
  221. class=3D"tocnumber">7.1.2</SPAN> <SPAN =
  222. class=3D"toctext">Info in=20
  223. Multiple File Mode</SPAN></A></LI></UL></LI>
  224. <LI class=3D"toclevel-2 tocsection-16"><A =
  225. href=3D"http://wiki.theory.org/BitTorrentSpecification#Notes"><SPAN=20
  226. class=3D"tocnumber">7.2</SPAN> <SPAN=20
  227. class=3D"toctext">Notes</SPAN></A></LI></UL></LI>
  228. <LI class=3D"toclevel-1 tocsection-17"><A =
  229. href=3D"http://wiki.theory.org/BitTorrentSpecification#Tracker_HTTP.2FHTT=
  230. PS_Protocol"><SPAN=20
  231. class=3D"tocnumber">8</SPAN> <SPAN class=3D"toctext">Tracker =
  232. HTTP/HTTPS=20
  233. Protocol</SPAN></A>
  234. <UL>
  235. <LI class=3D"toclevel-2 tocsection-18"><A =
  236. href=3D"http://wiki.theory.org/BitTorrentSpecification#Tracker_Request_Pa=
  237. rameters"><SPAN=20
  238. class=3D"tocnumber">8.1</SPAN> <SPAN class=3D"toctext">Tracker =
  239. Request=20
  240. Parameters</SPAN></A></LI>
  241. <LI class=3D"toclevel-2 tocsection-19"><A =
  242. href=3D"http://wiki.theory.org/BitTorrentSpecification#Tracker_Response">=
  243. <SPAN=20
  244. class=3D"tocnumber">8.2</SPAN> <SPAN class=3D"toctext">Tracker =
  245. Response</SPAN></A></LI></UL></LI>
  246. <LI class=3D"toclevel-1 tocsection-20"><A =
  247. href=3D"http://wiki.theory.org/BitTorrentSpecification#Tracker_.27scrape.=
  248. 27_Convention"><SPAN=20
  249. class=3D"tocnumber">9</SPAN> <SPAN class=3D"toctext">Tracker =
  250. 'scrape'=20
  251. Convention</SPAN></A>
  252. <UL>
  253. <LI class=3D"toclevel-2 tocsection-21"><A =
  254. href=3D"http://wiki.theory.org/BitTorrentSpecification#Unofficial_extensi=
  255. ons_to_scrape"><SPAN=20
  256. class=3D"tocnumber">9.1</SPAN> <SPAN =
  257. class=3D"toctext">Unofficial=20
  258. extensions to scrape</SPAN></A></LI></UL></LI>
  259. <LI class=3D"toclevel-1 tocsection-22"><A =
  260. href=3D"http://wiki.theory.org/BitTorrentSpecification#Peer_wire_protocol=
  261. _.28TCP.29"><SPAN=20
  262. class=3D"tocnumber">10</SPAN> <SPAN class=3D"toctext">Peer wire =
  263. protocol=20
  264. (TCP)</SPAN></A>
  265. <UL>
  266. <LI class=3D"toclevel-2 tocsection-23"><A =
  267. href=3D"http://wiki.theory.org/BitTorrentSpecification#Overview"><SPAN=20
  268. class=3D"tocnumber">10.1</SPAN> <SPAN=20
  269. class=3D"toctext">Overview</SPAN></A></LI>
  270. <LI class=3D"toclevel-2 tocsection-24"><A =
  271. href=3D"http://wiki.theory.org/BitTorrentSpecification#Data_Types"><SPAN =
  272. class=3D"tocnumber">10.2</SPAN> <SPAN class=3D"toctext">Data=20
  273. Types</SPAN></A></LI>
  274. <LI class=3D"toclevel-2 tocsection-25"><A =
  275. href=3D"http://wiki.theory.org/BitTorrentSpecification#Message_flow"><SPA=
  276. N=20
  277. class=3D"tocnumber">10.3</SPAN> <SPAN =
  278. class=3D"toctext">Message=20
  279. flow</SPAN></A></LI>
  280. <LI class=3D"toclevel-2 tocsection-26"><A =
  281. href=3D"http://wiki.theory.org/BitTorrentSpecification#Handshake"><SPAN=20
  282. class=3D"tocnumber">10.4</SPAN> <SPAN=20
  283. class=3D"toctext">Handshake</SPAN></A>
  284. <UL>
  285. <LI class=3D"toclevel-3 tocsection-27"><A =
  286. href=3D"http://wiki.theory.org/BitTorrentSpecification#peer_id"><SPAN=20
  287. class=3D"tocnumber">10.4.1</SPAN> <SPAN=20
  288. class=3D"toctext">peer_id</SPAN></A></LI></UL></LI>
  289. <LI class=3D"toclevel-2 tocsection-28"><A =
  290. href=3D"http://wiki.theory.org/BitTorrentSpecification#Messages"><SPAN=20
  291. class=3D"tocnumber">10.5</SPAN> <SPAN=20
  292. class=3D"toctext">Messages</SPAN></A>
  293. <UL>
  294. <LI class=3D"toclevel-3 tocsection-29"><A =
  295. href=3D"http://wiki.theory.org/BitTorrentSpecification#keep-alive:_.3Clen=
  296. .3D0000.3E"><SPAN=20
  297. class=3D"tocnumber">10.5.1</SPAN> <SPAN =
  298. class=3D"toctext">keep-alive:=20
  299. &lt;len=3D0000&gt;</SPAN></A></LI>
  300. <LI class=3D"toclevel-3 tocsection-30"><A =
  301. href=3D"http://wiki.theory.org/BitTorrentSpecification#choke:_.3Clen.3D00=
  302. 01.3E.3Cid.3D0.3E"><SPAN=20
  303. class=3D"tocnumber">10.5.2</SPAN> <SPAN =
  304. class=3D"toctext">choke:=20
  305. &lt;len=3D0001&gt;&lt;id=3D0&gt;</SPAN></A></LI>
  306. <LI class=3D"toclevel-3 tocsection-31"><A =
  307. href=3D"http://wiki.theory.org/BitTorrentSpecification#unchoke:_.3Clen.3D=
  308. 0001.3E.3Cid.3D1.3E"><SPAN=20
  309. class=3D"tocnumber">10.5.3</SPAN> <SPAN =
  310. class=3D"toctext">unchoke:=20
  311. &lt;len=3D0001&gt;&lt;id=3D1&gt;</SPAN></A></LI>
  312. <LI class=3D"toclevel-3 tocsection-32"><A =
  313. href=3D"http://wiki.theory.org/BitTorrentSpecification#interested:_.3Clen=
  314. .3D0001.3E.3Cid.3D2.3E"><SPAN=20
  315. class=3D"tocnumber">10.5.4</SPAN> <SPAN =
  316. class=3D"toctext">interested:=20
  317. &lt;len=3D0001&gt;&lt;id=3D2&gt;</SPAN></A></LI>
  318. <LI class=3D"toclevel-3 tocsection-33"><A =
  319. href=3D"http://wiki.theory.org/BitTorrentSpecification#not_interested:_.3=
  320. Clen.3D0001.3E.3Cid.3D3.3E"><SPAN=20
  321. class=3D"tocnumber">10.5.5</SPAN> <SPAN =
  322. class=3D"toctext">not=20
  323. interested: &lt;len=3D0001&gt;&lt;id=3D3&gt;</SPAN></A></LI>
  324. <LI class=3D"toclevel-3 tocsection-34"><A =
  325. href=3D"http://wiki.theory.org/BitTorrentSpecification#have:_.3Clen.3D000=
  326. 5.3E.3Cid.3D4.3E.3Cpiece_index.3E"><SPAN=20
  327. class=3D"tocnumber">10.5.6</SPAN> <SPAN =
  328. class=3D"toctext">have:=20
  329. &lt;len=3D0005&gt;&lt;id=3D4&gt;&lt;piece =
  330. index&gt;</SPAN></A></LI>
  331. <LI class=3D"toclevel-3 tocsection-35"><A =
  332. href=3D"http://wiki.theory.org/BitTorrentSpecification#bitfield:_.3Clen.3=
  333. D0001.2BX.3E.3Cid.3D5.3E.3Cbitfield.3E"><SPAN=20
  334. class=3D"tocnumber">10.5.7</SPAN> <SPAN =
  335. class=3D"toctext">bitfield:=20
  336. =
  337. &lt;len=3D0001+X&gt;&lt;id=3D5&gt;&lt;bitfield&gt;</SPAN></A></LI>
  338. <LI class=3D"toclevel-3 tocsection-36"><A =
  339. href=3D"http://wiki.theory.org/BitTorrentSpecification#request:_.3Clen.3D=
  340. 0013.3E.3Cid.3D6.3E.3Cindex.3E.3Cbegin.3E.3Clength.3E"><SPAN=20
  341. class=3D"tocnumber">10.5.8</SPAN> <SPAN =
  342. class=3D"toctext">request:=20
  343. =
  344. &lt;len=3D0013&gt;&lt;id=3D6&gt;&lt;index&gt;&lt;begin&gt;&lt;length&gt;<=
  345. /SPAN></A></LI>
  346. <LI class=3D"toclevel-3 tocsection-37"><A =
  347. href=3D"http://wiki.theory.org/BitTorrentSpecification#piece:_.3Clen.3D00=
  348. 09.2BX.3E.3Cid.3D7.3E.3Cindex.3E.3Cbegin.3E.3Cblock.3E"><SPAN=20
  349. class=3D"tocnumber">10.5.9</SPAN> <SPAN =
  350. class=3D"toctext">piece:=20
  351. =
  352. &lt;len=3D0009+X&gt;&lt;id=3D7&gt;&lt;index&gt;&lt;begin&gt;&lt;block&gt;=
  353. </SPAN></A></LI>
  354. <LI class=3D"toclevel-3 tocsection-38"><A =
  355. href=3D"http://wiki.theory.org/BitTorrentSpecification#cancel:_.3Clen.3D0=
  356. 013.3E.3Cid.3D8.3E.3Cindex.3E.3Cbegin.3E.3Clength.3E"><SPAN=20
  357. class=3D"tocnumber">10.5.10</SPAN> <SPAN =
  358. class=3D"toctext">cancel:=20
  359. =
  360. &lt;len=3D0013&gt;&lt;id=3D8&gt;&lt;index&gt;&lt;begin&gt;&lt;length&gt;<=
  361. /SPAN></A></LI>
  362. <LI class=3D"toclevel-3 tocsection-39"><A =
  363. href=3D"http://wiki.theory.org/BitTorrentSpecification#port:_.3Clen.3D000=
  364. 3.3E.3Cid.3D9.3E.3Clisten-port.3E"><SPAN=20
  365. class=3D"tocnumber">10.5.11</SPAN> <SPAN =
  366. class=3D"toctext">port:=20
  367. =
  368. &lt;len=3D0003&gt;&lt;id=3D9&gt;&lt;listen-port&gt;</SPAN></A></LI></UL>
  369. </LI></UL></LI>
  370. <LI class=3D"toclevel-1 tocsection-40"><A =
  371. href=3D"http://wiki.theory.org/BitTorrentSpecification#Algorithms"><SPAN =
  372. class=3D"tocnumber">11</SPAN> <SPAN =
  373. class=3D"toctext">Algorithms</SPAN></A>
  374. <UL>
  375. <LI class=3D"toclevel-2 tocsection-41"><A =
  376. href=3D"http://wiki.theory.org/BitTorrentSpecification#Queuing"><SPAN=20
  377. class=3D"tocnumber">11.1</SPAN> <SPAN=20
  378. class=3D"toctext">Queuing</SPAN></A></LI>
  379. <LI class=3D"toclevel-2 tocsection-42"><A =
  380. href=3D"http://wiki.theory.org/BitTorrentSpecification#Super_Seeding"><SP=
  381. AN=20
  382. class=3D"tocnumber">11.2</SPAN> <SPAN class=3D"toctext">Super=20
  383. Seeding</SPAN></A></LI>
  384. <LI class=3D"toclevel-2 tocsection-43"><A =
  385. href=3D"http://wiki.theory.org/BitTorrentSpecification#Piece_downloading_=
  386. strategy"><SPAN=20
  387. class=3D"tocnumber">11.3</SPAN> <SPAN class=3D"toctext">Piece =
  388. downloading=20
  389. strategy</SPAN></A></LI>
  390. <LI class=3D"toclevel-2 tocsection-44"><A =
  391. href=3D"http://wiki.theory.org/BitTorrentSpecification#End_Game"><SPAN=20
  392. class=3D"tocnumber">11.4</SPAN> <SPAN class=3D"toctext">End=20
  393. Game</SPAN></A></LI>
  394. <LI class=3D"toclevel-2 tocsection-45"><A =
  395. href=3D"http://wiki.theory.org/BitTorrentSpecification#Choking_and_Optimi=
  396. stic_Unchoking"><SPAN=20
  397. class=3D"tocnumber">11.5</SPAN> <SPAN =
  398. class=3D"toctext">Choking and=20
  399. Optimistic Unchoking</SPAN></A>
  400. <UL>
  401. <LI class=3D"toclevel-3 tocsection-46"><A =
  402. href=3D"http://wiki.theory.org/BitTorrentSpecification#Anti-snubbing"><SP=
  403. AN=20
  404. class=3D"tocnumber">11.5.1</SPAN> <SPAN=20
  405. =
  406. class=3D"toctext">Anti-snubbing</SPAN></A></LI></UL></LI></UL></LI>
  407. <LI class=3D"toclevel-1 tocsection-47"><A =
  408. href=3D"http://wiki.theory.org/BitTorrentSpecification#Official_Extension=
  409. s_To_The_Protocol"><SPAN=20
  410. class=3D"tocnumber">12</SPAN> <SPAN class=3D"toctext">Official =
  411. Extensions To=20
  412. The Protocol</SPAN></A>
  413. <UL>
  414. <LI class=3D"toclevel-2 tocsection-48"><A =
  415. href=3D"http://wiki.theory.org/BitTorrentSpecification#Fast_Peers_Extensi=
  416. ons"><SPAN=20
  417. class=3D"tocnumber">12.1</SPAN> <SPAN class=3D"toctext">Fast =
  418. Peers=20
  419. Extensions</SPAN></A></LI>
  420. <LI class=3D"toclevel-2 tocsection-49"><A =
  421. href=3D"http://wiki.theory.org/BitTorrentSpecification#Distributed_Hash_T=
  422. able"><SPAN=20
  423. class=3D"tocnumber">12.2</SPAN> <SPAN =
  424. class=3D"toctext">Distributed Hash=20
  425. Table</SPAN></A></LI>
  426. <LI class=3D"toclevel-2 tocsection-50"><A =
  427. href=3D"http://wiki.theory.org/BitTorrentSpecification#Connection_Obfusca=
  428. tion"><SPAN=20
  429. class=3D"tocnumber">12.3</SPAN> <SPAN =
  430. class=3D"toctext">Connection=20
  431. Obfuscation</SPAN></A></LI></UL></LI>
  432. <LI class=3D"toclevel-1 tocsection-51"><A =
  433. href=3D"http://wiki.theory.org/BitTorrentSpecification#Unofficial_Extensi=
  434. ons_To_The_Protocol"><SPAN=20
  435. class=3D"tocnumber">13</SPAN> <SPAN class=3D"toctext">Unofficial =
  436. Extensions=20
  437. To The Protocol</SPAN></A>
  438. <UL>
  439. <LI class=3D"toclevel-2 tocsection-52"><A =
  440. href=3D"http://wiki.theory.org/BitTorrentSpecification#Azureus_Messaging_=
  441. Protocol"><SPAN=20
  442. class=3D"tocnumber">13.1</SPAN> <SPAN =
  443. class=3D"toctext">Azureus Messaging=20
  444. Protocol</SPAN></A></LI>
  445. <LI class=3D"toclevel-2 tocsection-53"><A =
  446. href=3D"http://wiki.theory.org/BitTorrentSpecification#WebSeeding"><SPAN =
  447. class=3D"tocnumber">13.2</SPAN> <SPAN=20
  448. class=3D"toctext">WebSeeding</SPAN></A></LI>
  449. <LI class=3D"toclevel-2 tocsection-54"><A =
  450. href=3D"http://wiki.theory.org/BitTorrentSpecification#Extension_protocol=
  451. "><SPAN=20
  452. class=3D"tocnumber">13.3</SPAN> <SPAN =
  453. class=3D"toctext">Extension=20
  454. protocol</SPAN></A></LI>
  455. <LI class=3D"toclevel-2 tocsection-55"><A =
  456. href=3D"http://wiki.theory.org/BitTorrentSpecification#Extension_Negotiat=
  457. ion_Protocol"><SPAN=20
  458. class=3D"tocnumber">13.4</SPAN> <SPAN =
  459. class=3D"toctext">Extension=20
  460. Negotiation Protocol</SPAN></A></LI>
  461. <LI class=3D"toclevel-2 tocsection-56"><A =
  462. href=3D"http://wiki.theory.org/BitTorrentSpecification#BitTorrent_Locatio=
  463. n-aware_Protocol_1.0"><SPAN=20
  464. class=3D"tocnumber">13.5</SPAN> <SPAN =
  465. class=3D"toctext">BitTorrent=20
  466. Location-aware Protocol 1.0</SPAN></A></LI>
  467. <LI class=3D"toclevel-2 tocsection-57"><A =
  468. href=3D"http://wiki.theory.org/BitTorrentSpecification#SimpleBT_Extension=
  469. _Protocol"><SPAN=20
  470. class=3D"tocnumber">13.6</SPAN> <SPAN =
  471. class=3D"toctext">SimpleBT Extension=20
  472. Protocol</SPAN></A></LI>
  473. <LI class=3D"toclevel-2 tocsection-58"><A =
  474. href=3D"http://wiki.theory.org/BitTorrentSpecification#BitComet_Extension=
  475. _Protocol"><SPAN=20
  476. class=3D"tocnumber">13.7</SPAN> <SPAN =
  477. class=3D"toctext">BitComet Extension=20
  478. Protocol</SPAN></A></LI></UL></LI>
  479. <LI class=3D"toclevel-1 tocsection-59"><A =
  480. href=3D"http://wiki.theory.org/BitTorrentSpecification#Reserved_Bytes"><S=
  481. PAN=20
  482. class=3D"tocnumber">14</SPAN> <SPAN class=3D"toctext">Reserved=20
  483. Bytes</SPAN></A></LI>
  484. <LI class=3D"toclevel-1 tocsection-60"><A =
  485. href=3D"http://wiki.theory.org/BitTorrentSpecification#Change_Log"><SPAN =
  486. class=3D"tocnumber">15</SPAN> <SPAN class=3D"toctext">Change=20
  487. Log</SPAN></A></LI>
  488. <LI class=3D"toclevel-1 tocsection-61"><A =
  489. href=3D"http://wiki.theory.org/BitTorrentSpecification#Related_Links"><SP=
  490. AN=20
  491. class=3D"tocnumber">16</SPAN> <SPAN class=3D"toctext">Related=20
  492. Links</SPAN></A></LI></UL></TD></TR></TBODY></TABLE>
  493. <SCRIPT>if (window.showTocToggle) { var tocShowText =3D "show"; var =
  494. tocHideText =3D "hide"; showTocToggle(); } </SCRIPT>
  495. <H2> <SPAN id=3D"Identification" class=3D"mw-headline"> Identification =
  496. </SPAN></H2>
  497. <P><A class=3D"new" title=3D"BitTorrent (page does not exist)" =
  498. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrent&amp;action=3D=
  499. edit&amp;redlink=3D1">BitTorrent</A>=20
  500. is a peer-to-peer file sharing protocol designed by Bram Cohen. Visit =
  501. his pages=20
  502. at <A class=3D"external free" href=3D"http://www.bittorrent.com/"=20
  503. rel=3D"nofollow">http://www.bittorrent.com/</A> BitTorrent is designed =
  504. to=20
  505. facilitate file transfers among multiple peers across unreliable =
  506. networks.</P>
  507. <H2> <SPAN id=3D"Purpose" class=3D"mw-headline"> Purpose </SPAN></H2>
  508. <P>The purpose of this specification is to document version 1.0 of the=20
  509. BitTorrent protocol specification in detail. Bram's <A =
  510. class=3D"external text"=20
  511. href=3D"http://bittorrent.org/beps/bep_0003.html" =
  512. rel=3D"nofollow">protocol=20
  513. specification page</A> outlines the protocol in somewhat general terms, =
  514. and=20
  515. lacks behaviorial detail in some areas. The hope is that this document =
  516. will=20
  517. become a <B>formal</B> specification, written in clear, unambiguous =
  518. terms, which=20
  519. can be used as a basis for discussion and implementation in the =
  520. future.</P>
  521. <P>This document is intended to be maintained and used by the BitTorrent =
  522. development community. Everyone is invited to contribute to this =
  523. document, with=20
  524. the understanding that the content here is intended to represent the =
  525. current=20
  526. protocol (What if the current protocol is 2.0? The scope is then =
  527. conflicting),=20
  528. which is already deployed in a number of existing client =
  529. implementations.</P>
  530. <P>This is not the place to suggest feature requests. For that, please =
  531. go to=20
  532. the <A class=3D"external text" =
  533. href=3D"http://lists.ibiblio.org/mailman/listinfo/bittorrent"=20
  534. rel=3D"nofollow">mailing list</A>.</P>
  535. <H2> <SPAN id=3D"Scope" class=3D"mw-headline"> Scope </SPAN></H2>
  536. <P>This document applies to the first version (i.e. version 1.0) of the=20
  537. BitTorrent protocol specification. Currently, this applies to the =
  538. torrent file=20
  539. structure, peer wire protocol, and the Tracker HTTP/HTTPS protocol=20
  540. specifications. As newer revisions of each protocol are defined, they =
  541. should be=20
  542. specified on their own separate pages, <B>not here</B>.</P>
  543. <H2> <SPAN id=3D"Related_Documents" class=3D"mw-headline"> Related =
  544. Documents=20
  545. </SPAN></H2>
  546. <UL>
  547. <LI> <A class=3D"external text" =
  548. href=3D"http://bittorrent.org/beps/bep_0003.html"=20
  549. rel=3D"nofollow">Official protocol specification</A></LI>
  550. <LI> <A title=3D"BitTorrentWishList" =
  551. href=3D"http://wiki.theory.org/BitTorrentWishList">Developer=20
  552. and user wishlist</A></LI>
  553. <LI> <A title=3D"BitTorrentTrackerExtensions" =
  554. href=3D"http://wiki.theory.org/BitTorrentTrackerExtensions">Tracker=20
  555. protocol extensions</A></LI></UL>
  556. <H2> <SPAN id=3D"Conventions" class=3D"mw-headline"> Conventions =
  557. </SPAN></H2>
  558. <P>In this document, a number of conventions are used in an attempt to =
  559. present=20
  560. information in a concise and unambiguous fashion.</P>
  561. <UL>
  562. <LI> <I>peer</I> v/s <I>client</I>: In this document, a <I>peer</I> is =
  563. any=20
  564. BitTorrent client participating in a download. The <I>client</I> is =
  565. also a=20
  566. peer, however it is the BitTorrent client that is running on the local =
  567. machine. Readers of this specification may choose to think of =
  568. themselves as=20
  569. the <I>client</I> which connects to numerous <I>peers</I>.</LI>
  570. <LI> <I>piece</I> v/s <I>block</I>: In this document, a <I>piece</I> =
  571. refers to=20
  572. a portion of the downloaded data that is described in the metainfo =
  573. file, which=20
  574. can be verified by a SHA1 hash. A <I>block</I> is a portion of data =
  575. that a=20
  576. <I>client</I> may request from at least one <I>peer</I>. Two or more=20
  577. <I>blocks</I> make up a whole <I>piece</I>, which may then be =
  578. verified.</LI>
  579. <LI> <I>defacto standard</I>: Large blocks of text in <I>italics</I> =
  580. indicates=20
  581. a practice so common in various client implementations of BitTorrent =
  582. that it=20
  583. is considered a defacto standard.</LI></UL>
  584. <P>In order to help others find recent changes that have been made to =
  585. this=20
  586. document, please fill out the change log (last section). This should =
  587. contain a=20
  588. brief (i.e. one-line) entry for each major change that you've made to =
  589. the=20
  590. document.</P>
  591. <H2> <SPAN id=3D"Bencoding" class=3D"mw-headline"> Bencoding =
  592. </SPAN></H2>
  593. <P>Bencoding is a way to specify and organize data in a terse format. =
  594. It=20
  595. supports the following types: byte strings, integers, lists, and =
  596. dictionaries.
  597. </P>
  598. <H3> <SPAN id=3D"Bencoded_Strings" class=3D"mw-headline"> Bencoded =
  599. Strings=20
  600. </SPAN></H3>
  601. <P>Bencoded strings are encoded as follows: <I>&lt;string length encoded =
  602. in base=20
  603. ten ASCII&gt;<B>:</B>&lt;string data&gt;</I>, or =
  604. <I>key</I>:<I>value</I><BR>Note=20
  605. that there is no constant beginning delimiter, and no ending =
  606. delimiter.</P>
  607. <DL>
  608. <DD><B>Example</B>: <I>4<B>:</B>spam</I> represents the string =
  609. "spam"</DD></DL>
  610. <H3> <SPAN id=3D"Integers" class=3D"mw-headline"> Integers </SPAN></H3>
  611. <P>Integers are encoded as follows: <I><B>i</B>&lt;integer encoded in =
  612. base ten=20
  613. ASCII&gt;<B>e</B></I><BR>The initial <B>i</B> and trailing <B>e</B> are=20
  614. beginning and ending delimiters. You can have negative numbers such as=20
  615. <I><B>i</B>-3<B>e</B></I>. Only the significant digits should be used, =
  616. one=20
  617. cannot pad the Integer with zeroes. such as <I><B>i</B>04<B>e</B></I>. =
  618. However,=20
  619. <I><B>i</B>0<B>e</B></I> is valid.</P>
  620. <DL>
  621. <DD><B>Example</B>: <I><B>i</B>3<B>e</B></I> represents the integer =
  622. "3"
  623. </DD></DL>
  624. <UL>
  625. <LI> <I>NOTE:</I> The maximum number of bit of this integer is =
  626. unspecified,=20
  627. but to handle it as a signed 64bit integer is mandatory to handle =
  628. "large=20
  629. files" aka .torrent for more that 4Gbyte.</LI></UL>
  630. <H3> <SPAN id=3D"Lists" class=3D"mw-headline"> Lists </SPAN></H3>
  631. <P>Lists are encoded as follows: <I><B>l</B>&lt;bencoded=20
  632. values&gt;<B>e</B></I><BR>The initial <B>l</B> and trailing <B>e</B> are =
  633. beginning and ending delimiters. Lists may contain any bencoded type, =
  634. including=20
  635. integers, strings, dictionaries, and even lists within other lists.</P>
  636. <DL>
  637. <DD><B>Example:</B> <I><B>l</B>4:spam4:eggs<B>e</B></I> represents the =
  638. list of=20
  639. two strings: [ "spam", "eggs" ]</DD></DL>
  640. <H3> <SPAN id=3D"Dictionaries" class=3D"mw-headline"> Dictionaries =
  641. </SPAN></H3>
  642. <P>Dictionaries are encoded as follows: <I><B>d</B>&lt;bencoded=20
  643. string&gt;&lt;bencoded element&gt;<B>e</B></I> <BR>The initial <B>d</B> =
  644. and=20
  645. trailing <B>e</B> are the beginning and ending delimiters. Note that the =
  646. keys=20
  647. must be bencoded strings. The values may be any bencoded type, =
  648. including=20
  649. integers, strings, lists, and other dictionaries. Keys must be strings =
  650. and=20
  651. appear in sorted order (sorted as raw strings, not alphanumerics). The =
  652. strings=20
  653. should be compared using a binary comparison, not a culture-specific =
  654. "natural"=20
  655. comparison.</P>
  656. <DL>
  657. <DD><B>Example</B>: <I><B>d</B>3:cow3:moo4:spam4:eggs<B>e</B> =
  658. represents the=20
  659. dictionary { "cow" =3D&gt; "moo", "spam" =3D&gt; "eggs" } =
  660. <BR></I></DD>
  661. <DD><B>Example</B>: <I><B>d</B>4:spaml1:a1:b<B>ee'</B> represents the=20
  662. dictionary { "spam" =3D&gt; [ "a", "b" ] } <BR></I></DD>
  663. <DD><B>Example</B>:=20
  664. =
  665. <I><B>d</B>9:publisher3:bob17:publisher-webpage15:www.example.com18:publi=
  666. sher.location4:home<B>e</B></I>=20
  667. represents { "publisher" =3D&gt; "bob", "publisher-webpage" =3D&gt;=20
  668. "www.example.com", "publisher.location" =3D&gt; "home" }</DD></DL>
  669. <H3> <SPAN id=3D"Implementations" class=3D"mw-headline"> Implementations =
  670. </SPAN></H3>
  671. <UL>
  672. <LI> <A class=3D"external text" =
  673. href=3D"http://funzix.git.sourceforge.net/git/gitweb.cgi?p=3Dfunzix/funzi=
  674. x;a=3Dblob;f=3Dbencode/bencode.c"=20
  675. rel=3D"nofollow">C</A> by <A class=3D"new" title=3D"User:Vapier (page =
  676. does not exist)"=20
  677. =
  678. href=3D"http://wiki.theory.org/index.php?title=3DUser:Vapier&amp;action=3D=
  679. edit&amp;redlink=3D1">Mike=20
  680. Frysinger</A></LI>
  681. <LI> <A class=3D"external text" =
  682. href=3D"http://search.cpan.org/dist/Convert-Bencode/lib/Convert/Bencode.p=
  683. m"=20
  684. rel=3D"nofollow">Perl</A></LI>
  685. <LI> <A class=3D"external text" =
  686. href=3D"http://www.koders.com/java/fid47111A56F2466C232E09AEF75A39915EC70=
  687. D3536.aspx#L52"=20
  688. rel=3D"nofollow">Java</A></LI>
  689. <LI> <A title=3D"Decoding bencoded data with python" =
  690. href=3D"http://wiki.theory.org/Decoding_bencoded_data_with_python">Python=
  691. </A>=20
  692. by <A class=3D"new" title=3D"User:Hackeron (page does not exist)" =
  693. href=3D"http://wiki.theory.org/index.php?title=3DUser:Hackeron&amp;action=
  694. =3Dedit&amp;redlink=3D1">Hackeron</A>
  695. </LI>
  696. <LI> <A title=3D"Decoding encoding bencoded data with haskell" =
  697. href=3D"http://wiki.theory.org/Decoding_encoding_bencoded_data_with_haske=
  698. ll">Decoding=20
  699. encoding bencoded data with haskell</A> by <A class=3D"new" =
  700. title=3D"User:Edi (page does not exist)"=20
  701. =
  702. href=3D"http://wiki.theory.org/index.php?title=3DUser:Edi&amp;action=3Ded=
  703. it&amp;redlink=3D1">Edi</A>
  704. </LI>
  705. <LI> <A class=3D"external text" =
  706. href=3D"http://www.stupendous.net/projects/bencoding-obj-c-class/"=20
  707. rel=3D"nofollow">Objective-C</A> by <A class=3D"new" =
  708. title=3D"User:Chrome (page does not exist)"=20
  709. =
  710. href=3D"http://wiki.theory.org/index.php?title=3DUser:Chrome&amp;action=3D=
  711. edit&amp;redlink=3D1">Chrome</A>
  712. </LI>
  713. <LI> <A title=3D"JScript: Converting a torrent file to a JScript =
  714. dictionary"=20
  715. =
  716. href=3D"http://wiki.theory.org/JScript:_Converting_a_torrent_file_to_a_JS=
  717. cript_dictionary">JScript</A>=20
  718. by <A class=3D"new" title=3D"User:Sergej B. (page does not exist)" =
  719. href=3D"http://wiki.theory.org/index.php?title=3DUser:Sergej_B.&amp;actio=
  720. n=3Dedit&amp;redlink=3D1">Sergej=20
  721. B.</A></LI>
  722. <LI> <A class=3D"external text" =
  723. href=3D"http://demon.tw/my-work/javascript-bencode.html"=20
  724. rel=3D"nofollow">JavaScript</A> by <A class=3D"external text" =
  725. href=3D"http://demon.tw/"=20
  726. rel=3D"nofollow">Demon</A>]</LI>
  727. <LI> <A class=3D"external text" =
  728. href=3D"http://demon.tw/my-work/vbs-bencode.html"=20
  729. rel=3D"nofollow">VBScript</A> by <A class=3D"external text" =
  730. href=3D"http://demon.tw/"=20
  731. rel=3D"nofollow">Demon</A>]</LI>
  732. <LI> <A class=3D"external text" =
  733. href=3D"http://nakkaya.com/2009/11/02/decoding-bencoded-streams-in-clojur=
  734. e/"=20
  735. rel=3D"nofollow">Clojure</A> by <A class=3D"new" title=3D"User:Nakkaya =
  736. (page does not exist)"=20
  737. =
  738. href=3D"http://wiki.theory.org/index.php?title=3DUser:Nakkaya&amp;action=3D=
  739. edit&amp;redlink=3D1">nakkaya</A>
  740. </LI>
  741. <LI> <A title=3D"Decoding encoding bencoded data with erlang" =
  742. href=3D"http://wiki.theory.org/Decoding_encoding_bencoded_data_with_erlan=
  743. g">Erlang</A>
  744. </LI>
  745. <LI> <A title=3D"Decoding encoding bencoded data with PHP" =
  746. href=3D"http://wiki.theory.org/Decoding_encoding_bencoded_data_with_PHP">=
  747. PHP</A>
  748. </LI>
  749. <LI> <A class=3D"external text" =
  750. href=3D"http://code.google.com/p/php-bencode-extension/"=20
  751. rel=3D"nofollow">PHP Extension</A></LI>
  752. <LI> <A class=3D"external text" =
  753. href=3D"http://snipplr.com/view/37790/bencoding-encoder-and-decoder/"=20
  754. rel=3D"nofollow">C#</A> by <A class=3D"new" title=3D"User:SuprDewd =
  755. (page does not exist)"=20
  756. =
  757. href=3D"http://wiki.theory.org/index.php?title=3DUser:SuprDewd&amp;action=
  758. =3Dedit&amp;redlink=3D1">SuprDewd</A>
  759. </LI>
  760. <LI> <A class=3D"external text" =
  761. href=3D"http://cvs.savannah.gnu.org/viewvc/mldonkey/mldonkey/src/networks=
  762. /bittorrent/bencode.ml?view=3Dmarkup"=20
  763. rel=3D"nofollow">OCaml</A> by <A class=3D"external text" =
  764. href=3D"http://mldonkey.sourceforge.net/Main_Page"=20
  765. rel=3D"nofollow">MLDonkey</A></LI>
  766. <LI> <A class=3D"external text" =
  767. href=3D"https://github.com/jsz/gorrent/tree/master/bencode"=20
  768. rel=3D"nofollow">Go</A> by <A class=3D"external text" =
  769. href=3D"http://jsz.github.com/"=20
  770. rel=3D"nofollow">Leon Szpilewski</A></LI></UL>
  771. <H2> <SPAN id=3D"Metainfo_File_Structure" class=3D"mw-headline"> =
  772. Metainfo File=20
  773. Structure </SPAN></H2>
  774. <P>All data in a metainfo file is bencoded. The specification for =
  775. bencoding is=20
  776. defined above.</P>
  777. <P>The content of a metainfo file (the file ending in ".torrent") is a =
  778. bencoded=20
  779. dictionary, containing the keys listed below. All character string =
  780. values are=20
  781. UTF-8 encoded.</P>
  782. <UL>
  783. <LI> <B>info</B>: a dictionary that describes the file(s) of the =
  784. torrent. =20
  785. There are two possible forms: one for the case of a 'single-file' =
  786. torrent with=20
  787. no directory structure, and one for the case of a 'multi-file' torrent =
  788. (see=20
  789. below for details)</LI>
  790. <LI> <B>announce</B>: The announce URL of the tracker (string)</LI>
  791. <LI> <B>announce-list</B>: (optional) this is an extention to the =
  792. official=20
  793. specification, offering backwards-compatibility. (list of lists of =
  794. strings).
  795. <UL>
  796. <LI>The official request for a specification change is <A =
  797. class=3D"external text"=20
  798. href=3D"http://bittorrent.org/beps/bep_0012.html" =
  799. rel=3D"nofollow">here</A>.
  800. </LI></UL></LI>
  801. <LI> <B>creation date</B>: (optional) the creation time of the =
  802. torrent, in=20
  803. standard UNIX epoch format (integer, seconds since 1-Jan-1970 00:00:00 =
  804. UTC)
  805. </LI>
  806. <LI> <B>comment</B>: (optional) free-form textual comments of the =
  807. author=20
  808. (string)</LI>
  809. <LI> <B>created by</B>: (optional) name and version of the program =
  810. used to=20
  811. create the .torrent (string)</LI>
  812. <LI> <B>encoding</B>: (optional) the string encoding format used to =
  813. generate=20
  814. the <B>pieces</B> part of the <B>info</B> dictionary in the .torrent =
  815. metafile=20
  816. (string)</LI></UL>
  817. <H3> <SPAN id=3D"Info_Dictionary" class=3D"mw-headline">Info =
  818. Dictionary</SPAN></H3>
  819. <P>This section contains the field which are common to both mode, =
  820. "single file"=20
  821. and "multiple file".</P>
  822. <UL>
  823. <LI> <B>piece length</B>: number of bytes in each piece (integer)</LI>
  824. <LI> <B>pieces</B>: string consisting of the concatenation of all =
  825. 20-byte SHA1=20
  826. hash values, one per piece (byte string, i.e. not urlencoded)</LI>
  827. <LI> <B>private</B>: (optional) this field is an integer. If it is set =
  828. to "1",=20
  829. the client MUST publish its presence to get other peers ONLY via the =
  830. trackers=20
  831. explicitly described in the metainfo file. If this field is set to "0" =
  832. or is=20
  833. not present, the client may obtain peer from other means, e.g. PEX =
  834. peer=20
  835. exchange, dht. Here, "private" may be read as "no external peer =
  836. source".
  837. <UL>
  838. <LI> <B>NOTE:</B> There is much debate surrounding private =
  839. trackers.</LI>
  840. <LI> The official request for a specification change is <A =
  841. class=3D"external text"=20
  842. href=3D"http://bittorrent.org/beps/bep_0027.html" =
  843. rel=3D"nofollow">here</A>.
  844. </LI>
  845. <LI> Azureus was the first client to respect private trackers, <A =
  846. class=3D"external text"=20
  847. href=3D"http://www.azureuswiki.com/index.php/Secure_Torrents"=20
  848. rel=3D"nofollow">see their wiki</A> for more =
  849. details.</LI></UL></LI></UL>
  850. <H4> <SPAN id=3D"Info_in_Single_File_Mode" class=3D"mw-headline">Info in =
  851. Single File=20
  852. Mode</SPAN></H4>
  853. <P>For the case of the <B>single-file</B> mode, the <B>info</B> =
  854. dictionary=20
  855. contains the following structure:</P>
  856. <UL>
  857. <LI> <B>name</B>: the filename. This is purely advisory. =
  858. (string)</LI>
  859. <LI> <B>length</B>: length of the file in bytes (integer)</LI>
  860. <LI> <B>md5sum</B>: (optional) a 32-character hexadecimal string =
  861. corresponding=20
  862. to the MD5 sum of the file. This is not used by BitTorrent at all, =
  863. but it is=20
  864. included by some programs for greater compatibility.</LI></UL>
  865. <H4> <SPAN id=3D"Info_in_Multiple_File_Mode" class=3D"mw-headline">Info =
  866. in Multiple=20
  867. File Mode</SPAN></H4>
  868. <P>For the case of the <B>multi-file</B> mode, the <B>info</B> =
  869. dictionary=20
  870. contains the following structure:</P>
  871. <UL>
  872. <LI> <B>name</B>: the file path of the directory in which to store all =
  873. the=20
  874. files. This is purely advisory. (string)</LI>
  875. <LI> <B>files</B>: a list of dictionaries, one for each file. Each =
  876. dictionary=20
  877. in this list contains the following keys:
  878. <UL>
  879. <LI> <B>length</B>: length of the file in bytes (integer)</LI>
  880. <LI> <B>md5sum</B>: (optional) a 32-character hexadecimal string=20
  881. corresponding to the MD5 sum of the file. This is not used by =
  882. BitTorrent at=20
  883. all, but it is included by some programs for greater =
  884. compatibility.</LI>
  885. <LI> <B>path</B>: a list containing one or more string elements that =
  886. together represent the path and filename. Each element in the list=20
  887. corresponds to either a directory name or (in the case of the final =
  888. element)=20
  889. the filename. For example, a the file "dir1/dir2/file.ext" would =
  890. consist of=20
  891. three string elements: "dir1", "dir2", and "file.ext". This is =
  892. encoded as a=20
  893. bencoded list of strings such as=20
  894. =
  895. <I>l<B>4</B>:dir1<B>4</B>:dir2<B>8</B>:file.ext<B>e</B></I></LI></UL></LI=
  896. ></UL>
  897. <H3> <SPAN id=3D"Notes" class=3D"mw-headline">Notes</SPAN></H3>
  898. <UL>
  899. <LI> The <B>piece length</B> specifies the nominal piece size, and is =
  900. usually=20
  901. a power of 2. The piece size is typically chosen based on the total =
  902. amount of=20
  903. file data in the torrent, and is constrained by the fact that =
  904. too-large piece=20
  905. sizes cause inefficiency, and too-small piece sizes cause large =
  906. .torrent=20
  907. metadata file. Historically, piece size was chosen to result in a =
  908. .torrent=20
  909. file no greater than approx. 50 - 75 kB (presumably to ease the load =
  910. on the=20
  911. server hosting the torrent files). =20
  912. <UL>
  913. <LI>Current best-practice is to <I>keep the piece size to 512KB or =
  914. less,</I>=20
  915. for torrents around 8-10GB, even if that results in a larger =
  916. .torrent file. =20
  917. This results in a more efficient swarm for sharing files. The most =
  918. common=20
  919. sizes are 256 kB, 512 kB, and 1 MB. </LI>
  920. <LI>Every piece is of equal length except for the final piece, which =
  921. is=20
  922. irregular. The number of pieces is thus determined by 'ceil( total =
  923. length /=20
  924. piece size )'. </LI>
  925. <LI>For the purposes of piece boundaries in the multi-file case, =
  926. consider=20
  927. the file data as one long continuous stream, composed of the =
  928. concatenation=20
  929. of each file in the order listed in the <I>files</I> list. The =
  930. number of=20
  931. pieces and their boundaries are then determined in the same manner =
  932. as the=20
  933. case of a single file. Pieces may overlap file =
  934. boundaries.</LI></UL></LI>
  935. <LI> Each piece has a corresponding SHA1 hash of the data contained =
  936. within=20
  937. that piece. These hashes are concatenated to form the <I>pieces<B> =
  938. value in=20
  939. the above </B></I><B>info</B> dictionary. Note that this is =
  940. <B>not</B> a list=20
  941. but rather a single string. The length of the string must be a =
  942. multiple of 20.
  943. </LI></UL>
  944. <H2> <SPAN id=3D"Tracker_HTTP.2FHTTPS_Protocol" class=3D"mw-headline"> =
  945. Tracker=20
  946. HTTP/HTTPS Protocol </SPAN></H2>
  947. <P>The tracker is an HTTP/HTTPS service which responds to HTTP GET =
  948. requests. The=20
  949. requests include metrics from clients that help the tracker keep overall =
  950. statistics about the torrent. The response includes a peer list that =
  951. helps the=20
  952. client participate in the torrent. The base URL consists of the =
  953. "announce URL"=20
  954. as defined in the metainfo (.torrent) file. The parameters are then =
  955. added to=20
  956. this URL, using standard CGI methods (i.e. a '?' after the announce URL, =
  957. followed by 'param=3Dvalue' sequences separated by '&amp;').</P>
  958. <P>Note that all binary data in the URL (particularly info_hash and =
  959. peer_id)=20
  960. must be properly escaped. This means any byte not in the set 0-9, a-z, =
  961. A-Z,=20
  962. '.', '-', '_' and '~', must be encoded using the "%nn" format, where nn =
  963. is the=20
  964. hexadecimal value of the byte. (See <A class=3D"external text" =
  965. href=3D"http://www.faqs.org/rfcs/rfc1738.html"=20
  966. rel=3D"nofollow">RFC1738</A> for details.) </P>
  967. <P>For a 20-byte hash of=20
  968. \x12\x34\x56\x78\x9a\xbc\xde\xf1\x23\x45\x67\x89\xab\xcd\xef\x12\x34\x56\=
  969. x78\x9a,<BR>
  970. The right encoded form =
  971. is&nbsp;%124Vx%9A%BC%DE%F1%23Eg%89%AB%CD%EF%124Vx%9A</P>
  972. <H3> <SPAN id=3D"Tracker_Request_Parameters" =
  973. class=3D"mw-headline">Tracker Request=20
  974. Parameters</SPAN></H3>
  975. <P>The parameters used in the client-&gt;tracker GET request are as =
  976. follows:</P>
  977. <UL>
  978. <LI> <B>info_hash</B>: urlencoded 20-byte SHA1 hash of the =
  979. <I>value</I> of the=20
  980. <I>info</I> key from the Metainfo file. Note that the <I>value</I> =
  981. will be a=20
  982. bencoded dictionary, given the definition of the <I>info</I> key =
  983. above. </LI>
  984. <LI> <B><A=20
  985. =
  986. href=3D"http://wiki.theory.org/BitTorrentSpecification#peer_id">peer_id</=
  987. A></B>:=20
  988. urlencoded 20-byte string used as a unique ID for the client, =
  989. generated by the=20
  990. client at startup. This is allowed to be any value, and may be binary =
  991. data. =20
  992. <I>There are currently no guidelines for generating this peer ID. =
  993. However,=20
  994. one may rightly presume that it must at least be unique for your local =
  995. machine, thus should probably incorporate things like process ID and =
  996. perhaps a=20
  997. timestamp recorded at startup. See <A =
  998. href=3D"http://wiki.theory.org/BitTorrentSpecification#peer_id">peer_id=20
  999. </A> below for common client encodings of this field.</I></LI>
  1000. <LI> <B>port</B>: The port number that the client is listening on. =
  1001. Ports=20
  1002. reserved for BitTorrent are typically 6881-6889. Clients may choose =
  1003. to give=20
  1004. up if it cannot establish a port within this range.</LI>
  1005. <LI> <B>uploaded</B>: The total amount uploaded (since the client sent =
  1006. the=20
  1007. 'started' event to the tracker) in base ten ASCII. While not =
  1008. explicitly=20
  1009. stated in the official specification, the concensus is that this =
  1010. should be the=20
  1011. total number of bytes uploaded.</LI>
  1012. <LI> <B>downloaded</B>: The total amount downloaded (since the client =
  1013. sent the=20
  1014. 'started' event to the tracker) in base ten ASCII. While not =
  1015. explicitly=20
  1016. stated in the official specification, the consensus is that this =
  1017. should be the=20
  1018. total number of bytes downloaded.</LI>
  1019. <LI> <B>left</B>: The number of bytes this client still has to =
  1020. download in=20
  1021. base ten ASCII.</LI>
  1022. <LI> <B>compact</B>: Setting this to 1 indicates that the client =
  1023. accepts a=20
  1024. compact response. The announce-list is replaced by a peers string with =
  1025. 6 bytes=20
  1026. per peer. The first four bytes are the host (in network byte order), =
  1027. the last=20
  1028. two bytes are the port (again in network byte order). It should be =
  1029. noted that=20
  1030. some trackers only support compact responses (for saving bandwidth) =
  1031. and either=20
  1032. refuse requests without "compact=3D1" or simply send a compact =
  1033. response unless=20
  1034. the request contains "compact=3D0" (in which case they will refuse the =
  1035. request.)
  1036. </LI>
  1037. <LI> <B>no_peer_id</B>: Indicates that the tracker can omit peer id =
  1038. field in=20
  1039. announce-list dictionary. This option is ignored if compact is =
  1040. enabled.</LI>
  1041. <LI> <B>event</B>: If specified, must be one of <I>started</I>,=20
  1042. <I>completed</I>, <I>stopped</I>, (or empty which is the same as not =
  1043. being=20
  1044. specified). If not specified, then this request is one performed at =
  1045. regular=20
  1046. intervals.
  1047. <UL>
  1048. <LI> <B>started</B>: The first request to the tracker <I>must</I> =
  1049. include=20
  1050. the event key with this value.</LI>
  1051. <LI> <B>stopped</B>: Must be sent to the tracker if the client is =
  1052. shutting=20
  1053. down gracefully.</LI>
  1054. <LI> <B>completed</B>: Must be sent to the tracker when the download =
  1055. completes. However, must not be sent if the download was already =
  1056. 100%=20
  1057. complete when the client started. Presumably, this is to allow the =
  1058. tracker=20
  1059. to increment the "completed downloads" metric based solely on this =
  1060. event.
  1061. </LI></UL></LI>
  1062. <LI> <B>ip</B>: Optional. The true IP address of the client machine, =
  1063. in=20
  1064. dotted quad format or rfc3513 defined hexed IPv6 address. <I>Notes: =
  1065. In=20
  1066. general this parameter is not necessary as the address of the client =
  1067. can be=20
  1068. determined from the IP address from which the HTTP request came. The=20
  1069. parameter is only needed in the case where the IP address that the =
  1070. request=20
  1071. came in on is not the IP address of the client. This happens if the =
  1072. client is=20
  1073. communicating to the tracker through a proxy (or a transparent web=20
  1074. proxy/cache.) It also is necessary when both the client and the =
  1075. tracker are=20
  1076. on the same local side of a NAT gateway. The reason for this is that=20
  1077. otherwise the tracker would give out the internal (RFC1918) address of =
  1078. the=20
  1079. client, which is not routable. Therefore the client must explicitly =
  1080. state its=20
  1081. (external, routable) IP address to be given out to external peers. =
  1082. Various=20
  1083. trackers treat this parameter differently. Some only honor it only if =
  1084. the IP=20
  1085. address that the request came in on is in RFC1918 space. Others honor =
  1086. it=20
  1087. unconditionally, while others ignore it completely. In case of IPv6 =
  1088. address=20
  1089. (e.g.: 2001:db8:1:2::100) it indicates only that client can =
  1090. communicate via=20
  1091. IPv6.</I></LI>
  1092. <LI> <B>numwant</B>: Optional. Number of peers that the client would =
  1093. like to=20
  1094. receive from the tracker. This value is permitted to be zero. If =
  1095. omitted,=20
  1096. typically defaults to 50 peers.</LI>
  1097. <LI> <B>key</B>: Optional. An additional client identification =
  1098. mechanism that=20
  1099. is not shared with any peers. It is intended to allow a client to =
  1100. prove their=20
  1101. identity should their IP address change.</LI>
  1102. <LI> <B>trackerid</B>: Optional. If a previous announce contained a =
  1103. tracker=20
  1104. id, it should be set here.</LI></UL>
  1105. <H3> <SPAN id=3D"Tracker_Response" class=3D"mw-headline">Tracker=20
  1106. Response</SPAN></H3>
  1107. <P>The tracker responds with "text/plain" document consisting of a =
  1108. bencoded=20
  1109. dictionary with the following keys:</P>
  1110. <UL>
  1111. <LI> <B>failure reason</B>: If present, then no other keys may be =
  1112. present. =20
  1113. The value is a human-readable error message as to why the request =
  1114. failed=20
  1115. (string).</LI>
  1116. <LI> <B>warning message</B>: (new, optional) Similar to failure =
  1117. reason, but=20
  1118. the response still gets processed normally. The warning message is =
  1119. shown just=20
  1120. like an error.</LI>
  1121. <LI> <B>interval</B>: Interval in seconds that the client should wait =
  1122. between=20
  1123. sending regular requests to the tracker</LI>
  1124. <LI> <B>min interval</B>: (optional) Minimum announce interval. If =
  1125. present=20
  1126. clients must not reannounce more frequently than this.</LI>
  1127. <LI> <B>tracker id</B>: A string that the client should send back on =
  1128. its next=20
  1129. announcements. If absent and a previous announce sent a tracker id, do =
  1130. not=20
  1131. discard the old value; keep using it.</LI>
  1132. <LI> <B>complete</B>: number of peers with the entire file, i.e. =
  1133. seeders=20
  1134. (integer)</LI>
  1135. <LI> <B>incomplete</B>: number of non-seeder peers, aka "leechers" =
  1136. (integer)
  1137. </LI>
  1138. <LI> <B>peers</B>: (dictionary model) The value is a list of =
  1139. dictionaries,=20
  1140. each with the following keys:
  1141. <UL>
  1142. <LI> <B>peer id</B>: peer's self-selected ID, as described above for =
  1143. the=20
  1144. tracker request (string)</LI>
  1145. <LI> <B>ip</B>: peer's IP address either IPv6 (hexed) or IPv4 =
  1146. (dotted quad)=20
  1147. or DNS name (string)</LI>
  1148. <LI> <B>port</B>: peer's port number (integer)</LI></UL></LI>
  1149. <LI> <B>peers</B>: (binary model) Instead of using the dictionary =
  1150. model=20
  1151. described above, the <B>peers</B> value may be a string consisting of=20
  1152. multiples of 6 bytes. First 4 bytes are the IP address and last 2 =
  1153. bytes are=20
  1154. the port number. All in network (big endian) notation.</LI></UL>
  1155. <P>As mentioned above, the list of peers is length 50 by default. If =
  1156. there are=20
  1157. fewer peers in the torrent, then the list will be smaller. Otherwise, =
  1158. the=20
  1159. tracker randomly selects peers to include in the response. <I>The =
  1160. tracker may=20
  1161. choose to implement a more intelligent mechanism for peer selection when =
  1162. responding to a request. For instance, reporting seeds to other seeders =
  1163. could=20
  1164. be avoided.</I></P>
  1165. <P>Clients may send a request to the tracker more often than the =
  1166. specified=20
  1167. interval, if an event occurs (i.e. stopped or completed) or if the =
  1168. client needs=20
  1169. to learn about more peers. However, it is considered bad practice to =
  1170. "hammer"=20
  1171. on a tracker to get multiple peers. If a client wants a large peer list =
  1172. in the=20
  1173. response, then it should specify the <B>numwant</B> parameter.</P>
  1174. <P><I><B>Implementer's Note</B>: Even 30 peers is <B>plenty</B>, the =
  1175. official=20
  1176. client version 3 in fact only actively forms new connections if it has =
  1177. less than=20
  1178. 30 peers and will refuse connections if it has 55. <B>This value is =
  1179. important to=20
  1180. performance</B>. When a new piece has completed download, HAVE messages =
  1181. (see=20
  1182. below) will need to be sent to most active peers. As a result the cost =
  1183. of=20
  1184. broadcast traffic grows in direct proportion to the number of peers. =
  1185. Above 25,=20
  1186. new peers are highly unlikely to increase download speed. UI designers =
  1187. are=20
  1188. <B>strongly</B> advised to make this obscure and hard to change as it is =
  1189. very=20
  1190. rare to be useful to do so.</I></P>
  1191. <H2> <SPAN id=3D"Tracker_.27scrape.27_Convention" class=3D"mw-headline"> =
  1192. Tracker=20
  1193. 'scrape' Convention </SPAN></H2>
  1194. <P>By convention most trackers support another form of request, which =
  1195. queries=20
  1196. the state of a given torrent (or all torrents) that the tracker is =
  1197. managing. =20
  1198. This is referred to as the "scrape page" because it automates the =
  1199. otherwise=20
  1200. tedious process of "screen scraping" the tracker's stats page.</P>
  1201. <P>The scrape URL is also a HTTP GET method, similar to the one =
  1202. described above.=20
  1203. However the base URL is different. To derive the scrape URL use the =
  1204. following=20
  1205. steps: Begin with the announce URL. Find the last '/' in it. If the =
  1206. text=20
  1207. immediately following that '/' isn't 'announce' it will be taken as a =
  1208. sign that=20
  1209. that tracker doesn't support the scrape convention. If it does, =
  1210. substitute=20
  1211. 'scrape' for 'announce' to find the scrape page.</P>
  1212. <P>Examples: (announce URL -&gt; scrape URL)</P><PRE> =
  1213. ~http://example.com/announce -&gt; ~http://example.com/scrape=0A=
  1214. ~http://example.com/x/announce -&gt; =
  1215. ~http://example.com/x/scrape=0A=
  1216. ~http://example.com/announce.php -&gt; =
  1217. ~http://example.com/scrape.php=0A=
  1218. ~http://example.com/a -&gt; (scrape not supported)=0A=
  1219. ~http://example.com/announce?x2%0644 -&gt; =
  1220. ~http://example.com/scrape?x2%0644=0A=
  1221. ~http://example.com/announce?x=3D2/4 -&gt; (scrape not supported)=0A=
  1222. ~http://example.com/x%064announce -&gt; (scrape not supported)=0A=
  1223. </PRE>
  1224. <P>Note especially that entity unquoting is <I>not</I> to be done. This =
  1225. standard is documented by Bram in the <A class=3D"new" =
  1226. title=3D"BitTorrent (page does not exist)"=20
  1227. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrent&amp;action=3D=
  1228. edit&amp;redlink=3D1">BitTorrent</A>=20
  1229. development list archive: <A class=3D"external free" =
  1230. href=3D"http://groups.yahoo.com/group/BitTorrent/message/3275"=20
  1231. rel=3D"nofollow">http://groups.yahoo.com/group/BitTorrent/message/3275</A=
  1232. ></P>
  1233. <P>The scrape URL may be supplemented by the optional parameter=20
  1234. <I>info_hash</I>, a 20-byte value as described above. This restricts =
  1235. the=20
  1236. tracker's report to that particular torrent. Otherwise stats for all =
  1237. torrents=20
  1238. that the tracker is managing are returned. Software authors are =
  1239. strongly=20
  1240. encouraged to use the <I>info_hash</I> parameter when at all possible, =
  1241. to reduce=20
  1242. the load and bandwidth of the tracker.</P>
  1243. <P>You may also specify multiple info_hash parameters to trackers that =
  1244. support=20
  1245. it. While this isn't part of the official specifications it has become =
  1246. somewhat=20
  1247. a defacto standard - for example:</P><PRE> =
  1248. http://example.com/scrape.php?info_hash=3Daaaaaaaaaaaaaaaaaaaa&amp;info_h=
  1249. ash=3Dbbbbbbbbbbbbbbbbbbbb&amp;info_hash=3Dcccccccccccccccccccc=0A=
  1250. </PRE>
  1251. <P>The response of this HTTP GET method is a "text/plain" or sometimes =
  1252. gzip=20
  1253. compressed document consisting of a bencoded dictionary, containing the=20
  1254. following keys:</P>
  1255. <UL>
  1256. <LI> <B>files</B>: a dictionary containing one key/value pair for each =
  1257. torrent=20
  1258. for which there are stats. If <I>info_hash</I> was supplied and was =
  1259. valid,=20
  1260. this dictionary will contain a single key/value. Each key consists of =
  1261. a=20
  1262. 20-byte binary <I>info_hash</I>. The value of each entry is another=20
  1263. dictionary containing the following:
  1264. <UL>
  1265. <LI> <B>complete</B>: number of peers with the entire file, i.e. =
  1266. seeders=20
  1267. (integer)</LI>
  1268. <LI> <B>downloaded</B>: total number of times the tracker has =
  1269. registered a=20
  1270. completion ("event=3Dcomplete", i.e. a client finished downloading =
  1271. the=20
  1272. torrent)</LI>
  1273. <LI> <B>incomplete</B>: number of non-seeder peers, aka "leechers" =
  1274. (integer)
  1275. </LI>
  1276. <LI> <B>name</B>: (optional) the torrent's internal name, as =
  1277. specified by=20
  1278. the "name" file in the info section of the .torrent =
  1279. file</LI></UL></LI></UL>
  1280. <P>Note that this response has three levels of dictionary nesting. =
  1281. Here's an=20
  1282. example:</P>
  1283. <P><TT>d5:<I>files</I>d20:....................d8:<I>complete</I>i<B>5</B>=
  1284. e10:<I>downloaded</I>i<B>50</B>e10:<I>incomplete</I>i<B>10</B>eeee</TT>
  1285. </P>
  1286. <P>Where <TT>....................</TT> is the 20 byte info_hash and =
  1287. there are 5=20
  1288. seeders, 10 leechers, and 50 complete downloads.</P>
  1289. <H3> <SPAN id=3D"Unofficial_extensions_to_scrape" class=3D"mw-headline"> =
  1290. Unofficial=20
  1291. extensions to scrape </SPAN></H3>
  1292. <P>Below are the response keys are being unofficially used. Since they =
  1293. are=20
  1294. unofficial, they are all optional.</P>
  1295. <UL>
  1296. <LI> <B>failure reason</B>: Human-readable error message as to why the =
  1297. request=20
  1298. failed (string). Clients known to handle this key: Azureus.</LI>
  1299. <LI> <B>flags</B>: a dictionary containing miscellaneous flags. The =
  1300. value of=20
  1301. the flags key is another nested dictionary, possibly containing the =
  1302. following:
  1303. <UL>
  1304. <LI> <B>min_request_interval</B>: The value for this key is an =
  1305. integer=20
  1306. specifying how the minimum number of seconds for the client to wait =
  1307. before=20
  1308. scraping the tracker again. Trackers known to send this key: BNBT. =
  1309. Clients=20
  1310. known to handle this key: Azureus.</LI></UL></LI></UL>
  1311. <H2> <SPAN id=3D"Peer_wire_protocol_.28TCP.29" class=3D"mw-headline"> =
  1312. Peer wire=20
  1313. protocol (TCP) </SPAN></H2>
  1314. <H3> <SPAN id=3D"Overview" class=3D"mw-headline"> Overview </SPAN></H3>
  1315. <P>The peer protocol facilitates the exchange of pieces as described in =
  1316. the=20
  1317. '<I>metainfo</I> file.</P>
  1318. <P><I>Note here that the original specification also used the term =
  1319. "piece" when=20
  1320. describing the peer protocol, but as a different term than "piece" in =
  1321. the=20
  1322. metainfo file. For that reason, the term "block" will be used in this=20
  1323. specification to describe the data that is exchanged between peers over =
  1324. the=20
  1325. wire.</I></P>
  1326. <P>A client must maintain state information for each connection that it =
  1327. has with=20
  1328. a remote peer:</P>
  1329. <UL>
  1330. <LI> <B>choked</B>: Whether or not the remote peer has choked this =
  1331. client. =20
  1332. When a peer chokes the client, it is a notification that no requests =
  1333. will be=20
  1334. answered until the client is unchoked. The client should not attempt =
  1335. to send=20
  1336. requests for blocks, and it should consider all pending (unanswered) =
  1337. requests=20
  1338. to be discarded by the remote peer.</LI>
  1339. <LI> <B>interested</B>: Whether or not the remote peer is interested =
  1340. in=20
  1341. something this client has to offer. This is a notification that the =
  1342. remote=20
  1343. peer will begin requesting blocks when the client unchokes =
  1344. them.</LI></UL>
  1345. <P><I>Note that this also implies that the client will also need to keep =
  1346. track=20
  1347. of whether or not it is interested in the remote peer, and if it has the =
  1348. remote=20
  1349. peer choked or unchoked. So, the real list looks something like =
  1350. this:</I></P>
  1351. <UL>
  1352. <LI> <B>am_choking</B>: this client is choking the peer</LI>
  1353. <LI> <B>am_interested</B>: this client is interested in the peer</LI>
  1354. <LI> <B>peer_choking</B>: peer is choking this client</LI>
  1355. <LI> <B>peer_interested</B>: peer is interested in this =
  1356. client</LI></UL>
  1357. <P>Client connections start out as "choked" and "not interested". In =
  1358. other=20
  1359. words:</P>
  1360. <UL>
  1361. <LI> <B>am_choking</B> =3D 1</LI>
  1362. <LI> <B>am_interested</B> =3D 0</LI>
  1363. <LI> <B>peer_choking</B> =3D 1</LI>
  1364. <LI> <B>peer_interested</B> =3D 0</LI></UL>
  1365. <P>A block is downloaded by the client when the client is interested in =
  1366. a peer,=20
  1367. and that peer is not choking the client. A block is uploaded by a =
  1368. client when=20
  1369. the client is not choking a peer, and that peer is interested in the =
  1370. client.</P>
  1371. <P>It is important for the client to keep its peers informed as to =
  1372. whether or=20
  1373. not it is interested in them. This state information should be kept =
  1374. up-to-date=20
  1375. with each peer even when the client is choked. This will allow peers to =
  1376. know if=20
  1377. the client will begin downloading when it is unchoked (and =
  1378. vice-versa).</P>
  1379. <H3> <SPAN id=3D"Data_Types" class=3D"mw-headline"> Data Types =
  1380. </SPAN></H3>
  1381. <P>Unless specified otherwise, all integers in the peer wire protocol =
  1382. are=20
  1383. encoded as four byte big-endian values. This includes the length prefix =
  1384. on all=20
  1385. messages that come after the handshake.</P>
  1386. <H3> <SPAN id=3D"Message_flow" class=3D"mw-headline"> Message flow =
  1387. </SPAN></H3>
  1388. <P>The peer wire protocol consists of an initial handshake. After that, =
  1389. peers=20
  1390. communicate via an exchange of length-prefixed messages. The =
  1391. length-prefix is=20
  1392. an integer as described above.</P>
  1393. <H3> <SPAN id=3D"Handshake" class=3D"mw-headline"> Handshake =
  1394. </SPAN></H3>
  1395. <P>The handshake is a required message and must be the first message =
  1396. transmitted=20
  1397. by the client. It is (49+len(pstr)) bytes long.</P>
  1398. <P><I>handshake:=20
  1399. &lt;pstrlen&gt;&lt;pstr&gt;&lt;reserved&gt;&lt;info_hash&gt;&lt;peer_id&g=
  1400. t;</I>
  1401. </P>
  1402. <UL>
  1403. <LI> <B>pstrlen</B>: string length of &lt;pstr&gt;, as a single raw =
  1404. byte</LI>
  1405. <LI> <B>pstr</B>: string identifier of the protocol</LI>
  1406. <LI> <B>reserved</B>: eight (8) reserved bytes. All current =
  1407. implementations=20
  1408. use all zeroes. Each bit in these bytes can be used to change the =
  1409. behavior of=20
  1410. the protocol. <I>An email from Bram suggests that trailing bits =
  1411. should be=20
  1412. used first, so that leading bits may be used to change the meaning of =
  1413. trailing=20
  1414. bits.</I></LI>
  1415. <LI> <B>info_hash</B>: 20-byte SHA1 hash of the info key in the =
  1416. metainfo file.=20
  1417. This is the same info_hash that is transmitted in tracker =
  1418. requests.</LI>
  1419. <LI> <B>peer_id</B>: 20-byte string used as a unique ID for the =
  1420. client. This=20
  1421. is usually the same peer_id that is transmitted in tracker requests =
  1422. (but not=20
  1423. always e.g. an anonymity option in Azureus).</LI></UL>
  1424. <P>In version 1.0 of the BitTorrent protocol, pstrlen =3D 19, and pstr =
  1425. =3D=20
  1426. "BitTorrent protocol".</P>
  1427. <P>The initiator of a connection is expected to transmit their handshake =
  1428. immediately. The recipient may wait for the initiator's handshake, if =
  1429. it is=20
  1430. capable of serving multiple torrents simultaneously (torrents are =
  1431. uniquely=20
  1432. identified by their info<I>hash). However, the recipient must respond =
  1433. as soon=20
  1434. as it sees the info_hash part of the handshake (the peer id will =
  1435. presumably be=20
  1436. sent after the recipient sends its own handshake). The tracker's =
  1437. NAT-checking=20
  1438. feature does not send the peer_id field of the handshake.</I></P>
  1439. <P>If a client receives a handshake with an info_hash that it is not =
  1440. currently=20
  1441. serving, then the client must drop the connection.</P>
  1442. <P>If the initiator of the connection receives a handshake in which the =
  1443. peer_id=20
  1444. does not match the expected peer<I>id, then the initiator is expected to =
  1445. drop=20
  1446. the connection. </I>Note that the initiator presumably received the =
  1447. peer=20
  1448. information from the tracker, which includes the peer_id that was =
  1449. registered by=20
  1450. the peer. The peer_id from the tracker and in the handshake are =
  1451. expected to=20
  1452. match.</P>
  1453. <H4> <SPAN id=3D"peer_id" class=3D"mw-headline"> peer_id </SPAN></H4>
  1454. <P>The peer_id is exactly 20 bytes (characters) long.</P>
  1455. <P>There are mainly two conventions how to encode client and client =
  1456. version=20
  1457. information into the peer_id, Azureus-style and Shadow's-style.</P>
  1458. <P>Azureus-style uses the following encoding: '-', two characters for =
  1459. client id,=20
  1460. four ascii digits for version number, '-', followed by random =
  1461. numbers.</P>
  1462. <P>For example: '-AZ2060-'...</P>
  1463. <P>known clients that uses this encoding style are:</P>
  1464. <UL>
  1465. <LI> 'AG' - <A class=3D"external text" =
  1466. href=3D"http://aresgalaxy.sourceforge.net/"=20
  1467. rel=3D"nofollow">Ares</A></LI>
  1468. <LI> 'A~' - <A class=3D"external text" =
  1469. href=3D"http://aresgalaxy.sourceforge.net/"=20
  1470. rel=3D"nofollow">Ares</A></LI>
  1471. <LI> 'AR' - <A class=3D"external text" =
  1472. href=3D"http://dev.int64.org/arctic.html"=20
  1473. rel=3D"nofollow">Arctic</A></LI>
  1474. <LI> 'AT' - <A class=3D"external text" =
  1475. href=3D"http://www.cyberartemis.com/" rel=3D"nofollow">Artemis</A>
  1476. </LI>
  1477. <LI> 'AX' - <A class=3D"external text" =
  1478. href=3D"http://www.analogx.com/contents/download/network/bitpump.htm"=20
  1479. rel=3D"nofollow">BitPump</A></LI>
  1480. <LI> 'AZ' - <A class=3D"external text" href=3D"http://azureus.sf.net/" =
  1481. rel=3D"nofollow">Azureus</A>
  1482. </LI>
  1483. <LI> 'BB' - <A class=3D"external text" =
  1484. href=3D"http://www.btvampire.com/" rel=3D"nofollow">BitBuddy</A>
  1485. </LI>
  1486. <LI> 'BC' - <A class=3D"external text" =
  1487. href=3D"http://www.bitcomet.com/" rel=3D"nofollow">BitComet</A>
  1488. </LI>
  1489. <LI> 'BF' - <A class=3D"external text" =
  1490. href=3D"http://bitflu.workaround.ch/" rel=3D"nofollow">Bitflu</A>
  1491. </LI>
  1492. <LI> 'BG' - <A class=3D"external text" href=3D"http://btg.berlios.de/" =
  1493. rel=3D"nofollow">BTG=20
  1494. (uses Rasterbar libtorrent)</A></LI>
  1495. <LI> 'BL' - <A class=3D"external text" =
  1496. href=3D"http://www.bitblinder.com/" rel=3D"nofollow">BitBlinder</A>
  1497. </LI>
  1498. <LI> 'BP' - <A class=3D"external text" =
  1499. href=3D"http://www.intelpeers.com/" rel=3D"nofollow">BitTorrent=20
  1500. Pro (Azureus + spyware)</A></LI>
  1501. <LI> 'BR' - <A class=3D"external text" =
  1502. href=3D"http://www.bitrocket.org/" rel=3D"nofollow">BitRocket</A>
  1503. </LI>
  1504. <LI> 'BS' - <A class=3D"external text" =
  1505. href=3D"http://btslave.sourceforge.net/"=20
  1506. rel=3D"nofollow">BTSlave</A></LI>
  1507. <LI> 'BW' - <A class=3D"external text" href=3D"http://bitwombat.com/" =
  1508. rel=3D"nofollow">BitWombat</A>
  1509. </LI>
  1510. <LI> 'BX' - ~Bittorrent X</LI>
  1511. <LI> 'CD' - <A class=3D"external text" =
  1512. href=3D"http://www.rahul.net/dholmes/ctorrent/"=20
  1513. rel=3D"nofollow">Enhanced CTorrent</A></LI>
  1514. <LI> 'CT' - <A class=3D"external text" =
  1515. href=3D"http://ctorrent.sourceforge.net/"=20
  1516. rel=3D"nofollow">CTorrent</A></LI>
  1517. <LI> 'DE' - <A class=3D"external text" =
  1518. href=3D"http://www.deluge-torrent.org/"=20
  1519. rel=3D"nofollow">DelugeTorrent</A></LI>
  1520. <LI> 'DP' - <A class=3D"external text" =
  1521. href=3D"http://www.propagatedata.com/" rel=3D"nofollow">Propagate=20
  1522. Data Client</A></LI>
  1523. <LI> 'EB' - <A class=3D"external text" href=3D"http://dywt.com.cn/"=20
  1524. rel=3D"nofollow">EBit</A></LI>
  1525. <LI> 'ES' - <A class=3D"external text" =
  1526. href=3D"http://electricsheep.org/" rel=3D"nofollow">electric=20
  1527. sheep</A></LI>
  1528. <LI> 'FC' - <A class=3D"external text" =
  1529. href=3D"http://www.filecroc.com/" rel=3D"nofollow">FileCroc</A>
  1530. </LI>
  1531. <LI> 'FT' - <A class=3D"external text" =
  1532. href=3D"http://www.foxtorrent.com/" rel=3D"nofollow">FoxTorrent</A>
  1533. </LI>
  1534. <LI> 'GS' - <A class=3D"external text" =
  1535. href=3D"http://sourceforge.net/projects/gstorrent"=20
  1536. rel=3D"nofollow">GSTorrent</A></LI>
  1537. <LI> 'HK' - <A class=3D"external text" =
  1538. href=3D"http://www.pps.jussieu.fr/~jch/software/hekate/"=20
  1539. rel=3D"nofollow">Hekate</A></LI>
  1540. <LI> 'HL' - <A class=3D"external text" =
  1541. href=3D"http://www.binarynotions.com/halite.php"=20
  1542. rel=3D"nofollow">Halite</A></LI>
  1543. <LI> 'HN' - <A class=3D"external text" href=3D"http://hydranode.com/" =
  1544. rel=3D"nofollow">Hydranode</A>
  1545. </LI>
  1546. <LI> 'KG' - <A class=3D"external text" =
  1547. href=3D"http://kget.sourceforge.net/" rel=3D"nofollow">KGet</A>
  1548. </LI>
  1549. <LI> 'KT' - <A class=3D"external text" href=3D"http://ktorrent.org/" =
  1550. rel=3D"nofollow">KTorrent</A>
  1551. </LI>
  1552. <LI> 'LC' - <A class=3D"external text" href=3D"http://leechcraft.org/" =
  1553. rel=3D"nofollow">LeechCraft</A>
  1554. </LI>
  1555. <LI> 'LH' - <A class=3D"external text" =
  1556. href=3D"http://code.google.com/p/lh-abc"=20
  1557. rel=3D"nofollow">LH-ABC</A></LI>
  1558. <LI> 'LP' - <A class=3D"external text" href=3D"http://www.lphant.com/" =
  1559. rel=3D"nofollow">Lphant</A>
  1560. </LI>
  1561. <LI> 'LT' - <A class=3D"external text" =
  1562. href=3D"http://libtorrent.sf.net/" rel=3D"nofollow">libtorrent</A>
  1563. </LI>
  1564. <LI> 'lt' - <A class=3D"external text" =
  1565. href=3D"http://libtorrent.rakshasa.no/"=20
  1566. rel=3D"nofollow">libTorrent</A></LI>
  1567. <LI> 'LW' - <A class=3D"external text" =
  1568. href=3D"http://www.limewire.org/" rel=3D"nofollow">LimeWire</A>
  1569. </LI>
  1570. <LI> 'MK' - <A class=3D"external text" =
  1571. href=3D"http://www.themeerkat.net/" rel=3D"nofollow">Meerkat</A>
  1572. </LI>
  1573. <LI> 'MO' - <A class=3D"external text" =
  1574. href=3D"http://monotorrent.blogspot.com/"=20
  1575. rel=3D"nofollow">MonoTorrent</A></LI>
  1576. <LI> 'MP' - <A class=3D"external text" =
  1577. href=3D"http://www.moopolice.de/" rel=3D"nofollow">MooPolice</A>
  1578. </LI>
  1579. <LI> 'MR' - <A class=3D"external text" =
  1580. href=3D"http://www.getmiro.com/" rel=3D"nofollow">Miro</A>
  1581. </LI>
  1582. <LI> 'MT' - <A class=3D"external text" =
  1583. href=3D"http://www.moonlighttorrent.com/"=20
  1584. rel=3D"nofollow">MoonlightTorrent</A></LI>
  1585. <LI> 'NX' - <A class=3D"external text" =
  1586. href=3D"http://www.xi-soft.com/" rel=3D"nofollow">Net=20
  1587. Transport</A></LI>
  1588. <LI> 'OS' - <A class=3D"external text" =
  1589. href=3D"http://oneswarm.cs.washington.edu/"=20
  1590. rel=3D"nofollow">OneSwarm</A></LI>
  1591. <LI> 'OT' - <A class=3D"external text" =
  1592. href=3D"http://www.omegatorrent.com/" rel=3D"nofollow">OmegaTorrent</A>
  1593. </LI>
  1594. <LI> 'PD' - <A class=3D"external text" href=3D"http://www.pando.com/" =
  1595. rel=3D"nofollow">Pando</A>
  1596. </LI>
  1597. <LI> 'PT' - <A class=3D"external text" =
  1598. href=3D"http://php-tracker.org/" rel=3D"nofollow">PHPTracker</A>
  1599. </LI>
  1600. <LI> 'qB' - <A class=3D"external text" =
  1601. href=3D"http://www.qbittorrent.org/" rel=3D"nofollow">qBittorrent</A>
  1602. </LI>
  1603. <LI> 'QD' - <A class=3D"external text" =
  1604. href=3D"http://im.qq.com/cyclone/" rel=3D"nofollow">QQDownload</A>
  1605. </LI>
  1606. <LI> 'QT' - Qt 4 Torrent example</LI>
  1607. <LI> 'RT' - <A class=3D"external text" =
  1608. href=3D"http://www.halogenware.com/software/retriever.html"=20
  1609. rel=3D"nofollow">Retriever</A></LI>
  1610. <LI> 'RZ' - <A class=3D"external text" =
  1611. href=3D"https://launchpad.net/reztorrent"=20
  1612. rel=3D"nofollow">RezTorrent</A></LI>
  1613. <LI> 'S~' - <A class=3D"external text" =
  1614. href=3D"http://shareaza.sourceforge.net/"=20
  1615. rel=3D"nofollow">Shareaza alpha/beta</A></LI>
  1616. <LI> 'SB' - ~Swiftbit</LI>
  1617. <LI> 'SD' - <A class=3D"external text" href=3D"http://www.xunlei.com/" =
  1618. rel=3D"nofollow">Thunder=20
  1619. (aka X=C3=B9nL=C3=A9i)</A></LI>
  1620. <LI> 'SM' - <A class=3D"external text" href=3D"http://www.somud.com/" =
  1621. rel=3D"nofollow">SoMud</A>
  1622. </LI>
  1623. <LI> 'SS' - SwarmScope</LI>
  1624. <LI> 'ST' - <A class=3D"external text" =
  1625. href=3D"http://symtorrent.aut.bme.hu/" rel=3D"nofollow">SymTorrent</A>
  1626. </LI>
  1627. <LI> 'st' - <A class=3D"external text" =
  1628. href=3D"http://sharktorrent.com/" rel=3D"nofollow">sharktorrent</A>
  1629. </LI>
  1630. <LI> 'SZ' - <A class=3D"external text" =
  1631. href=3D"http://shareaza.sourceforge.net/"=20
  1632. rel=3D"nofollow">Shareaza</A></LI>
  1633. <LI> 'TN' - TorrentDotNET</LI>
  1634. <LI> 'TR' - <A class=3D"external text" =
  1635. href=3D"http://www.transmissionbt.com/"=20
  1636. rel=3D"nofollow">Transmission</A></LI>
  1637. <LI> 'TS' - <A class=3D"external text" =
  1638. href=3D"http://www.torrentstorm.com/" rel=3D"nofollow">Torrentstorm</A>
  1639. </LI>
  1640. <LI> 'TT' - <A class=3D"external text" href=3D"http://www.tuotu.com/" =
  1641. rel=3D"nofollow">TuoTu</A>
  1642. </LI>
  1643. <LI> 'UL' - uLeecher!</LI>
  1644. <LI> 'UM' - <A class=3D"external text" =
  1645. href=3D"http://mac.utorrent.com/" rel=3D"nofollow">=C2=B5Torrent=20
  1646. for Mac</A></LI>
  1647. <LI> 'UT' - <A class=3D"external text" =
  1648. href=3D"http://www.utorrent.com/" rel=3D"nofollow">=C2=B5Torrent</A>
  1649. </LI>
  1650. <LI> 'VG' - <A class=3D"external text" href=3D"http://www.vagaa.com/" =
  1651. rel=3D"nofollow">Vagaa</A>
  1652. </LI>
  1653. <LI> 'WT' - <A class=3D"external text" href=3D"http://www.bitlet.org/" =
  1654. rel=3D"nofollow">BitLet</A>
  1655. </LI>
  1656. <LI> 'WY' - <A class=3D"external text" =
  1657. href=3D"http://www.wyzo.com/firetorrent/"=20
  1658. rel=3D"nofollow">FireTorrent</A></LI>
  1659. <LI> 'XL' - <A class=3D"external text" href=3D"http://www.xunlei.com/" =
  1660. rel=3D"nofollow">Xunlei</A>
  1661. </LI>
  1662. <LI> 'XS' - XSwifter</LI>
  1663. <LI> 'XT' - <A class=3D"external text" =
  1664. href=3D"http://www.xantorrent.pwp.blueyonder.co.uk/xantorrent.zip"=20
  1665. rel=3D"nofollow">XanTorrent</A></LI>
  1666. <LI> 'XX' - <A class=3D"external text" =
  1667. href=3D"http://www.xtorrent.com/" rel=3D"nofollow">Xtorrent</A>
  1668. </LI>
  1669. <LI> 'ZT' - <A class=3D"external text" =
  1670. href=3D"http://www.ziptorrent.com/" rel=3D"nofollow">ZipTorrent</A>
  1671. </LI></UL>
  1672. <P>Clients which have been seen in the wild and need to be =
  1673. identified:</P>
  1674. <UL>
  1675. <LI> 'BD' (example: -BD0300-)</LI>
  1676. <LI> 'NP' (example: -NP0201-)</LI>
  1677. <LI> 'wF' (example: -wF2200-)</LI>
  1678. <LI> 'hk' (example: -hk0010-) Chinese IP address, unrequestedly sends =
  1679. info=20
  1680. dict in message 0xA, reconnects immediately after being disconnected, =
  1681. reserved=20
  1682. bytes =3D 01,01,01,01,00,00,02,01</LI></UL>
  1683. <P>Shadow's style uses the following encoding: one ascii alphanumeric =
  1684. for client=20
  1685. identification, up to five characters for version number (padded with =
  1686. '-' if=20
  1687. less than five), followed by three characters (commonly '---', but not =
  1688. always=20
  1689. the case), followed by random characters. Each character in the version =
  1690. string=20
  1691. represents a number from 0 to 63. '0'=3D0, ..., '9'=3D9, 'A'=3D10, ..., =
  1692. 'Z'=3D35,=20
  1693. 'a'=3D36, ..., 'z'=3D61, '.'=3D62, '-'=3D63.</P>
  1694. <P>A full explanation by Shad0w about the encoding style (including =
  1695. information=20
  1696. about existing conventions on how the three characters after the version =
  1697. string=20
  1698. are used) can be found <A class=3D"external text" =
  1699. href=3D"http://forums.degreez.net/viewtopic.php?t=3D7070"=20
  1700. rel=3D"nofollow">here</A>.</P>
  1701. <P>For example: 'S58B-----'... for Shadow's 5.8.11</P>
  1702. <P>known clients that uses this encoding style are:</P>
  1703. <UL>
  1704. <LI> 'A' - <A class=3D"external text" =
  1705. href=3D"http://pingpong-abc.sourceforge.net/"=20
  1706. rel=3D"nofollow">ABC</A></LI>
  1707. <LI> 'O' - <A class=3D"external text" =
  1708. href=3D"http://osprey.ibiblio.org/" rel=3D"nofollow">Osprey=20
  1709. Permaseed</A></LI>
  1710. <LI> 'Q' - <A class=3D"external text" =
  1711. href=3D"http://btqueue.sourceforge.net/"=20
  1712. rel=3D"nofollow">BTQueue</A></LI>
  1713. <LI> 'R' - <A class=3D"external text" href=3D"http://www.tribler.org/" =
  1714. rel=3D"nofollow">Tribler</A>
  1715. </LI>
  1716. <LI> 'S' - <A class=3D"external text" href=3D"http://bt.degreez.net/" =
  1717. rel=3D"nofollow">Shadow's=20
  1718. client</A></LI>
  1719. <LI> 'T' - <A class=3D"external text" href=3D"http://bittornado.com/" =
  1720. rel=3D"nofollow">BitTornado</A>
  1721. </LI>
  1722. <LI> 'U' - <A class=3D"external text" =
  1723. href=3D"http://aaron2003.myftp.org/upnpclient.html"=20
  1724. rel=3D"nofollow">UPnP NAT Bit Torrent</A></LI></UL>
  1725. <P>Bram's client now uses this style... 'M3-4-2--' or 'M4-20-8-'.</P>
  1726. <P><A class=3D"external text" href=3D"http://www.bitcomet.com/"=20
  1727. rel=3D"nofollow">BitComet</A> does something different still. Its =
  1728. peer_id consists=20
  1729. of four ASCII characters 'exbc', followed by two bytes x and y, followed =
  1730. by=20
  1731. random characters. The version number is x in decimal before the decimal =
  1732. point=20
  1733. and y as two decimal digits after the decimal point. <A =
  1734. class=3D"external text"=20
  1735. href=3D"http://www.bitlord.com/" rel=3D"nofollow">BitLord</A> uses the =
  1736. same scheme,=20
  1737. but adds 'LORD' after the version bytes. An <A class=3D"external text" =
  1738. href=3D"http://solidox.org/bc/"=20
  1739. rel=3D"nofollow">unofficial patch</A> for BitComet once replaced 'exbc' =
  1740. with=20
  1741. 'FUTB'. The encoding for BitComet Peer IDs changed to Azureus-style as =
  1742. of=20
  1743. BitComet version 0.59.</P>
  1744. <P><A class=3D"external text" =
  1745. href=3D"http://xbtt.sourceforge.net/client/" rel=3D"nofollow">XBT=20
  1746. Client</A> has its own style too. Its peer_id consists of the three =
  1747. uppercase=20
  1748. characters 'XBT' followed by three ASCII digits representing the version =
  1749. number.=20
  1750. If the client is a debug build, the seventh byte is the lowercase =
  1751. character=20
  1752. 'd', otherwise it is a '-'. Following that is a '-' then random digits, =
  1753. uppercase and lowercase letters. Example: 'XBT054d-' at the beginning =
  1754. would=20
  1755. indicate a debug build of version 0.5.4.</P>
  1756. <P><A class=3D"external text" href=3D"http://www.opera.com/" =
  1757. rel=3D"nofollow">Opera 8=20
  1758. previews and Opera 9.x releases</A> use the following peer_id scheme: =
  1759. The first=20
  1760. two characters are 'OP' and the next four digits equal the build number. =
  1761. All=20
  1762. following characters are random lowercase hexdecimal digits.</P>
  1763. <P><A class=3D"external text" =
  1764. href=3D"http://mldonkey.sourceforge.net/Main_Page"=20
  1765. rel=3D"nofollow">MLdonkey</A> use the following peer_id scheme: the =
  1766. first=20
  1767. characters are '-ML' followed by a dotted version then a '-' followed by =
  1768. randomness. e.g. '-ML2.7.2-kgjjfkd'</P>
  1769. <P><A class=3D"external text" href=3D"http://www.bitsonwheels.com/"=20
  1770. rel=3D"nofollow">Bits on Wheels</A> uses the pattern =
  1771. '-BOWxxx-yyyyyyyyyyyy', where=20
  1772. y is random (uppercase letters) and x depends on the version. Version =
  1773. 1.0.6 has=20
  1774. xxx =3D A0C.</P>
  1775. <P><A class=3D"external text" href=3D"http://queenbee.se/" =
  1776. rel=3D"nofollow">Queen=20
  1777. Bee</A> uses Bram's new style: 'Q1-0-0--' or 'Q1-10-0-' followed by =
  1778. random=20
  1779. bytes.</P>
  1780. <P><A class=3D"external text" =
  1781. href=3D"http://bittyrant.cs.washington.edu/" =
  1782. rel=3D"nofollow">BitTyrant</A>=20
  1783. is an Azureus fork and simply uses 'AZ2500BT' + random bytes as peer ID =
  1784. in its=20
  1785. 1.1 version. Note the missing dashes.</P>
  1786. <P><A class=3D"external text" href=3D"http://www.torrentopia.org/"=20
  1787. rel=3D"nofollow">TorrenTopia</A> version 1.90 pretends to be or is =
  1788. derived from=20
  1789. Mainline 3.4.6. Its peer ID starts with '346------'.</P>
  1790. <P><A class=3D"external text" href=3D"http://www.167bt.com/intl/"=20
  1791. rel=3D"nofollow">BitSpirit</A> has several modes for its peer ID. In one =
  1792. mode it=20
  1793. reads the ID of its peer and reconnects using the first eight bytes as a =
  1794. basis=20
  1795. for its own ID. Its real ID appears to use '\0\3BS' (C notation) as the =
  1796. first=20
  1797. four bytes for version 3.x and '\0\2BS' for version 2.x. In all modes =
  1798. the ID may=20
  1799. end in 'UDP0'. Since BitSpirit 3.6 the peer ID uses Azureus style with=20
  1800. characters 'SP' but without trailing '-' (as FlashGet).</P>
  1801. <P><A class=3D"external text" href=3D"http://rufus.sourceforge.net/"=20
  1802. rel=3D"nofollow">Rufus</A> uses its version as decimal ASCII values for =
  1803. the first=20
  1804. two bytes. The third and fourth bytes are 'RS'. What then follows is the =
  1805. nickname of the user and some random bytes.</P>
  1806. <P><A class=3D"external text" href=3D"http://g3torrent.sourceforge.net/" =
  1807. rel=3D"nofollow">G3=20
  1808. Torrent</A> starts its peer ID with '-G3' and appends up to 9 characters =
  1809. of the=20
  1810. nickname of the user.</P>
  1811. <P><A class=3D"external text" href=3D"http://www.flashget.com/"=20
  1812. rel=3D"nofollow">FlashGet</A> uses Azureus style with 'FG' but without =
  1813. the=20
  1814. trailing '-'. Version 1.82.1002 still uses the version digits =
  1815. '0180'.</P>
  1816. <P><A class=3D"external text" href=3D"http://www.btnext.com/" =
  1817. rel=3D"nofollow">BT Next=20
  1818. Evolution</A> is derived from BitTornado but tries to mimic Azureus =
  1819. style. The=20
  1820. result is that its peer ID starts with '-NE', continues with a 4 digit =
  1821. version=20
  1822. number and then directly goes on with the three characters that describe =
  1823. the=20
  1824. type of client in Shad0w's peer ID style.</P>
  1825. <P><A class=3D"external text" href=3D"http://www.allpeers.com/"=20
  1826. rel=3D"nofollow">AllPeers</A> takes the sha1 hash of a user dependent =
  1827. string and=20
  1828. replaces the first few characters with "AP" + version string + "-".</P>
  1829. <P><A class=3D"external text" href=3D"http://www.qvod.com/" =
  1830. rel=3D"nofollow">Qvod</A>=20
  1831. starts its id with the four letters "QVOD" and continues with its build =
  1832. number=20
  1833. in four decimal digits (currently "0054"). The remaining 12 characters =
  1834. are=20
  1835. random uppercase hexdecimal digits. There appears to be a popular =
  1836. modified=20
  1837. client in China that replaces the four characters in the beginning with =
  1838. random=20
  1839. bytes.</P>
  1840. <P><A class=3D"external text" href=3D"http://www.spywareterminator.com/" =
  1841. rel=3D"nofollow">SpywareTerminator</A>=20
  1842. uses libtorrent to share its signature updates among users. It uses =
  1843. Azureus=20
  1844. style with 'CS' and version digits '2500'. </P>
  1845. <P>Many clients are using all random numbers or 12 zeroes followed by =
  1846. random=20
  1847. numbers (like older versions of <A class=3D"external text" =
  1848. href=3D"http://www.bittorrent.com/"=20
  1849. rel=3D"nofollow">Bram's client</A>).</P>
  1850. <H3> <SPAN id=3D"Messages" class=3D"mw-headline">Messages</SPAN></H3>
  1851. <P>All of the remaining messages in the protocol take the form of =
  1852. &lt;length=20
  1853. prefix&gt;&lt;message ID&gt;&lt;payload&gt;. The length prefix is a =
  1854. four byte=20
  1855. big-endian value. The message ID is a single decimal byte. The payload =
  1856. is=20
  1857. message dependent.</P>
  1858. <H4> <SPAN id=3D"keep-alive:_.3Clen.3D0000.3E" =
  1859. class=3D"mw-headline">keep-alive:=20
  1860. &lt;len=3D0000&gt;</SPAN></H4>
  1861. <P>The <B>keep-alive</B> message is a message with zero bytes, specified =
  1862. with=20
  1863. the length prefix set to zero. There is no message ID and no payload. =
  1864. Peers=20
  1865. may close a connection if they receive no messages (<B>keep-alive</B> or =
  1866. any=20
  1867. other message) for a certain period of time, so a keep-alive message =
  1868. must be=20
  1869. sent to maintain the connection <I>alive</I> if no command have been =
  1870. sent for a=20
  1871. given amount of time. This amount of time is generally two minutes.</P>
  1872. <H4> <SPAN id=3D"choke:_.3Clen.3D0001.3E.3Cid.3D0.3E" =
  1873. class=3D"mw-headline">choke:=20
  1874. &lt;len=3D0001&gt;&lt;id=3D0&gt;</SPAN></H4>
  1875. <P>The <B>choke</B> message is fixed-length and has no payload.</P>
  1876. <H4> <SPAN id=3D"unchoke:_.3Clen.3D0001.3E.3Cid.3D1.3E" =
  1877. class=3D"mw-headline">=20
  1878. unchoke: &lt;len=3D0001&gt;&lt;id=3D1&gt; </SPAN></H4>
  1879. <P>The <B>unchoke</B> message is fixed-length and has no payload.</P>
  1880. <H4> <SPAN id=3D"interested:_.3Clen.3D0001.3E.3Cid.3D2.3E" =
  1881. class=3D"mw-headline">=20
  1882. interested: &lt;len=3D0001&gt;&lt;id=3D2&gt; </SPAN></H4>
  1883. <P>The <B>interested</B> message is fixed-length and has no payload.</P>
  1884. <H4> <SPAN id=3D"not_interested:_.3Clen.3D0001.3E.3Cid.3D3.3E"=20
  1885. class=3D"mw-headline"> not interested: &lt;len=3D0001&gt;&lt;id=3D3&gt; =
  1886. </SPAN></H4>
  1887. <P>The <B>not interested</B> message is fixed-length and has no =
  1888. payload.</P>
  1889. <H4> <SPAN id=3D"have:_.3Clen.3D0005.3E.3Cid.3D4.3E.3Cpiece_index.3E" =
  1890. class=3D"mw-headline">=20
  1891. have: &lt;len=3D0005&gt;&lt;id=3D4&gt;&lt;piece index&gt; </SPAN></H4>
  1892. <P>The <B>have</B> message is fixed length. The payload is the =
  1893. zero-based index=20
  1894. of a piece that has just been successfully downloaded and verified via =
  1895. the hash.
  1896. </P>
  1897. <P><I>Implementer's Note: That is the strict definition, in reality some =
  1898. games=20
  1899. may be played. In particular because peers are extremely unlikely to =
  1900. download=20
  1901. pieces that they already have, a peer may choose not to advertise having =
  1902. a piece=20
  1903. to a peer that already has that piece. At a minimum "HAVE suppression" =
  1904. will=20
  1905. result in a 50% reduction in the number of HAVE messages, this =
  1906. translates to=20
  1907. around a 25-35% reduction in protocol overhead. At the same time, it may =
  1908. be=20
  1909. worthwhile to send a HAVE message to a peer that has that piece already =
  1910. since it=20
  1911. will be useful in determining which piece is rare.</I></P>
  1912. <P><I>A malicious peer might also choose to advertise having pieces that =
  1913. it=20
  1914. knows the peer will never download. Due to this attempting to model =
  1915. peers using=20
  1916. this information is a <B>bad idea</B></I>.</P>
  1917. <H4> <SPAN =
  1918. id=3D"bitfield:_.3Clen.3D0001.2BX.3E.3Cid.3D5.3E.3Cbitfield.3E" =
  1919. class=3D"mw-headline">=20
  1920. bitfield: &lt;len=3D0001+X&gt;&lt;id=3D5&gt;&lt;bitfield&gt; =
  1921. </SPAN></H4>
  1922. <P>The <B>bitfield</B> message may only be sent immediately after the=20
  1923. handshaking sequence is completed, and before any other messages are =
  1924. sent. It=20
  1925. is optional, and need not be sent if a client has no pieces.</P>
  1926. <P>The <B>bitfield</B> message is variable length, where X is the length =
  1927. of the=20
  1928. bitfield. The payload is a bitfield representing the pieces that have =
  1929. been=20
  1930. successfully downloaded. The high bit in the first byte corresponds to =
  1931. piece=20
  1932. index 0. Bits that are cleared indicated a missing piece, and set bits =
  1933. indicate=20
  1934. a valid and available piece. Spare bits at the end are set to zero.</P>
  1935. <P>Some clients (Deluge for example) send <B>bitfield</B> with missing =
  1936. pieces=20
  1937. even if it has all data. Then it sends rest of pieces as <B>have</B> =
  1938. messages.=20
  1939. They are saying this helps against ISP filtering of BitTorrent protocol. =
  1940. It is=20
  1941. called <B>lazy bitfield</B>.</P>
  1942. <P><I>A bitfield of the wrong length is considered an error. Clients =
  1943. should drop=20
  1944. the connection if they receive bitfields that are not of the correct =
  1945. size, or if=20
  1946. the bitfield has any of the spare bits set.</I></P>
  1947. <H4> <SPAN =
  1948. id=3D"request:_.3Clen.3D0013.3E.3Cid.3D6.3E.3Cindex.3E.3Cbegin.3E.3Clengt=
  1949. h.3E"=20
  1950. class=3D"mw-headline"> request:=20
  1951. &lt;len=3D0013&gt;&lt;id=3D6&gt;&lt;index&gt;&lt;begin&gt;&lt;length&gt; =
  1952. </SPAN></H4>
  1953. <P>The <B>request</B> message is fixed length, and is used to request a =
  1954. block. =20
  1955. The payload contains the following information:</P>
  1956. <UL>
  1957. <LI> <B>index</B>: integer specifying the zero-based piece index</LI>
  1958. <LI> <B>begin</B>: integer specifying the zero-based byte offset =
  1959. within the=20
  1960. piece</LI>
  1961. <LI> <B>length</B>: integer specifying the requested length.</LI></UL>
  1962. <P><I><B>This section is under dispute! Please use the <A =
  1963. class=3D"external text"=20
  1964. href=3D"http://wiki.theory.org/Talk:BitTorrentSpecification#Messages:_req=
  1965. uest"=20
  1966. rel=3D"nofollow">discussion page</A> to resolve this!</B></I></P>
  1967. <P><I><B>View #1</B></I>According to the official specification, "All =
  1968. current=20
  1969. implementations use 2^15 (32KB), and close connections which request an =
  1970. amount=20
  1971. greater than 2^17 (128KB)." As early as version 3 or 2004, this behavior =
  1972. was=20
  1973. changed to use 2^14 (16KB) blocks. As of version 4.0 or mid-2005, the =
  1974. mainline=20
  1975. disconnected on requests larger than 2^14 (16KB); and some clients have =
  1976. followed=20
  1977. suit. Note that block requests are smaller than pieces (&gt;=3D2^18 =
  1978. bytes), so=20
  1979. multiple requests will be needed to download a whole piece.</P>
  1980. <P><I>Strictly, the specification allows 2^15 (32KB) requests. The =
  1981. reality is=20
  1982. near all clients will now use 2^14 (16KB) requests. Due to clients that =
  1983. enforce=20
  1984. that size, it is recommended that implementations make requests of that =
  1985. size.=20
  1986. Due to smaller requests resulting in higher overhead due to tracking a =
  1987. greater=20
  1988. number of requests, implementers are advised against going below 2^14=20
  1989. (16KB).</I></P>
  1990. <P><I>The choice of request block size limit enforcement is not nearly =
  1991. so clear=20
  1992. cut. With mainline version 4 enforcing 16KB requests, most clients will =
  1993. use that=20
  1994. size. At the same time 2^14 (16KB) is the </I>semi<I>-official (only =
  1995. </I>semi<I>=20
  1996. because the official protocol document has not been updated) limit now, =
  1997. so=20
  1998. enforcing that isn't wrong. At the same time, allowing larger requests =
  1999. enlarges=20
  2000. the set of possible peers, and except on very low bandwidth connections=20
  2001. (&lt;256kbps) multiple blocks will be downloaded in one =
  2002. choke-timeperiod, thus=20
  2003. merely enforcing the old limit causes minimal performance degradation. =
  2004. Due to=20
  2005. this factor, it is recommended that only the older 2^17 (128KB) maximum =
  2006. size=20
  2007. limit be enforced.</I></P>
  2008. <P><I><B>View #2</B></I>This section has contained falsehoods for a =
  2009. large=20
  2010. portion of the time this page has existed. This is the third time I =
  2011. (uau) am=20
  2012. correcting this same section for incorrect information being added, so I =
  2013. won't=20
  2014. rewrite it completely since it'll probably be broken again... Current =
  2015. version=20
  2016. has at least the following errors: Mainline started using 2^14 (16384) =
  2017. byte=20
  2018. requests when it was still the only client in existence; only the =
  2019. "official=20
  2020. specification" still talked about the obsolete 32768 byte value which =
  2021. was in=20
  2022. reality neither the default size nor maximum allowed. In version 4 the =
  2023. request=20
  2024. behavior did not change, but the maximum allowed size did change to =
  2025. equal the=20
  2026. default size. In latest mainline versions the max has changed to 32768 =
  2027. (note=20
  2028. that this is the first appearance of 32768 for either default or max =
  2029. size since=20
  2030. the first ancient versions). "Most older clients use 32KB requests" is =
  2031. false.=20
  2032. Discussion of larger requests fails to take latency effects into =
  2033. account.</P>
  2034. <H4> <SPAN =
  2035. id=3D"piece:_.3Clen.3D0009.2BX.3E.3Cid.3D7.3E.3Cindex.3E.3Cbegin.3E.3Cblo=
  2036. ck.3E"=20
  2037. class=3D"mw-headline"> piece:=20
  2038. &lt;len=3D0009+X&gt;&lt;id=3D7&gt;&lt;index&gt;&lt;begin&gt;&lt;block&gt;=
  2039. =20
  2040. </SPAN></H4>
  2041. <P>The <B>piece</B> message is variable length, where X is the length of =
  2042. the=20
  2043. block. The payload contains the following information:</P>
  2044. <UL>
  2045. <LI> <B>index</B>: integer specifying the zero-based piece index</LI>
  2046. <LI> <B>begin</B>: integer specifying the zero-based byte offset =
  2047. within the=20
  2048. piece</LI>
  2049. <LI> <B>block</B>: block of data, which is a subset of the piece =
  2050. specified by=20
  2051. index.</LI></UL>
  2052. <H4> <SPAN =
  2053. id=3D"cancel:_.3Clen.3D0013.3E.3Cid.3D8.3E.3Cindex.3E.3Cbegin.3E.3Clength=
  2054. .3E"=20
  2055. class=3D"mw-headline"> cancel:=20
  2056. &lt;len=3D0013&gt;&lt;id=3D8&gt;&lt;index&gt;&lt;begin&gt;&lt;length&gt; =
  2057. </SPAN></H4>
  2058. <P>The <B>cancel</B> message is fixed length, and is used to cancel =
  2059. block=20
  2060. requests. The payload is identical to that of the "request" message. =
  2061. It is=20
  2062. typically used during "End Game" (see the Algorithms section below).</P>
  2063. <H4> <SPAN id=3D"port:_.3Clen.3D0003.3E.3Cid.3D9.3E.3Clisten-port.3E" =
  2064. class=3D"mw-headline">=20
  2065. port: &lt;len=3D0003&gt;&lt;id=3D9&gt;&lt;listen-port&gt; </SPAN></H4>
  2066. <P>The <B>port</B> message is sent by newer versions of the Mainline =
  2067. that=20
  2068. implements a DHT tracker. The listen port is the port this peer's DHT =
  2069. node is=20
  2070. listening on. This peer should be inserted in the local routing table =
  2071. (if DHT=20
  2072. tracker is supported).</P>
  2073. <H2> <SPAN id=3D"Algorithms" class=3D"mw-headline"> Algorithms =
  2074. </SPAN></H2>
  2075. <H3> <SPAN id=3D"Queuing" class=3D"mw-headline"> Queuing </SPAN></H3>
  2076. <P><I><B>This section is under dispute! Please use the <A =
  2077. class=3D"external text"=20
  2078. href=3D"http://wiki.theory.org/Talk:BitTorrentSpecification#Algorithms:_Q=
  2079. ueuing"=20
  2080. rel=3D"nofollow">discussion page</A> to resolve this!</B></I></P>
  2081. <P><I><B>View #1</B></I>In general peers are advised to keep a few =
  2082. unfullfilled=20
  2083. requests on each connection. This is done because otherwise a full round =
  2084. trip is=20
  2085. required from the download of one block to begining the download of a =
  2086. new block=20
  2087. (round trip between PIECE message and next REQUEST message). On links =
  2088. with high=20
  2089. BDP (bandwidth-delay-product, high latency or high bandwidth), this can =
  2090. result=20
  2091. in a substantial performance loss.</P>
  2092. <P><I>Implementer's note: This is the <B>most crucial performance =
  2093. item</B>. A=20
  2094. static queue of 10 requests is reasonable for 16KB blocks on a 5mbps =
  2095. link with=20
  2096. 50ms latency. Links with greater bandwidth are becoming very common so =
  2097. UI=20
  2098. designers are urged to make this readily available for changing. Notably =
  2099. cable=20
  2100. modems were known for traffic policing and increasing this might of =
  2101. alleviated=20
  2102. some of the problems caused by this.</I></P>
  2103. <P><I><B>View #2</B></I>NOTE: much of the information in this "Queuing" =
  2104. section=20
  2105. is false or misleading. I'll just note that the "defaults to 5 =
  2106. outstanding=20
  2107. requests" hasn't been true for a long time, "32 KB blocks" is misleading =
  2108. since=20
  2109. you normally don't use 32 KB blocks, and tuning queue length by changing =
  2110. it and=20
  2111. trying to measure the effects is a bad idea.</P>
  2112. <H3> <SPAN id=3D"Super_Seeding" class=3D"mw-headline"> Super Seeding =
  2113. </SPAN></H3>
  2114. <P><I>(This was not part of the original specification)</I></P>
  2115. <P><I>The super-seed feature in S-5.5 and on is a new seeding algorithm =
  2116. designed=20
  2117. to help a torrent initiator with limited bandwidth "pump up" a large =
  2118. torrent,=20
  2119. reducing the amount of data it needs to upload in order to spawn new =
  2120. seeds in=20
  2121. the torrent.</I></P>
  2122. <P><I>When a seeding client enters "super-seed mode", it will not act as =
  2123. a=20
  2124. standard seed, but masquerades as a normal client with no data. As =
  2125. clients=20
  2126. connect, it will then inform them that it received a piece -- a piece =
  2127. that was=20
  2128. never sent, or if all pieces were already sent, is very rare. This will =
  2129. induce=20
  2130. the client to attempt to download only that piece.</I></P>
  2131. <P><I>When the client has finished downloading the piece, the seed will =
  2132. not=20
  2133. inform it of any other pieces until it has seen the piece it had sent =
  2134. previously=20
  2135. present on at least one other client. Until then, the client will not =
  2136. have=20
  2137. access to any of the other pieces of the seed, and therefore will not =
  2138. waste the=20
  2139. seed's bandwidth.</I></P>
  2140. <P><I>This method has resulted in much higher seeding efficiencies, by =
  2141. both=20
  2142. inducing peers into taking only the rarest data, reducing the amount of=20
  2143. redundant data sent, and limiting the amount of data sent to peers which =
  2144. do not=20
  2145. contribute to the swarm. Prior to this, a seed might have to upload 150% =
  2146. to 200%=20
  2147. of the total size of a torrent before other clients became seeds. =
  2148. However, a=20
  2149. large torrent seeded with a single client running in super-seed mode was =
  2150. able to=20
  2151. do so after only uploading 105% of the data. This is 150-200% more =
  2152. efficient=20
  2153. than when using a standard seed.</I></P>
  2154. <P><I>Super-seed mode is '</I>NOT<I> recommended for general use. While =
  2155. it does=20
  2156. assist in the wider distribution of rare data, because it limits the =
  2157. selection=20
  2158. of pieces a client can downlad, it also limits the ability of those =
  2159. clients to=20
  2160. download data for pieces they have already partially retrieved. =
  2161. Therefore,=20
  2162. super-seed mode is only recommended for initial seeding =
  2163. servers.</I></P><PRE><I>Why not rename it to e.g. "Initial Seeding Mode" =
  2164. or "Releaser Mode" then?</I>=0A=
  2165. </PRE>
  2166. <H3> <SPAN id=3D"Piece_downloading_strategy" class=3D"mw-headline"> =
  2167. Piece=20
  2168. downloading strategy </SPAN></H3>
  2169. <P>Clients may choose to download pieces in random order.</P>
  2170. <P><I>A better strategy is to download pieces in </I><A =
  2171. title=3D"Availability"=20
  2172. href=3D"http://wiki.theory.org/Availability">rarest first</A><I> order. =
  2173. The=20
  2174. client can determine this by keeping the initial bitfield from each =
  2175. peer, and=20
  2176. updating it with every <B>have</B> message. Then, the client can =
  2177. download the=20
  2178. pieces that appear least frequently in these peer bitfields. Note that =
  2179. any=20
  2180. Rarest First strategy should include randomization among at least =
  2181. several of the=20
  2182. least common pieces, as having many clients all attempting to jump on =
  2183. the same=20
  2184. "least common" piece would be counter productive.</I></P>
  2185. <H3> <SPAN id=3D"End_Game" class=3D"mw-headline"> End Game </SPAN></H3>
  2186. <P>When a download is almost complete, there's a tendency for the last =
  2187. few=20
  2188. blocks to trickle in slowly. To speed this up, the client sends requests =
  2189. for all=20
  2190. of its missing blocks to all of its peers. To keep this from becoming =
  2191. horribly=20
  2192. inefficient, the client also sends a cancel to everyone else every time =
  2193. a block=20
  2194. arrives.</P>
  2195. <P><I>There is no documented thresholds, recommended percentages, or =
  2196. block=20
  2197. counts that could be used as a guide or Recommended Best Practice =
  2198. here.</I></P>
  2199. <P><I>When to enter end game mode is an area of discussion. Some clients =
  2200. enter=20
  2201. end game when all pieces have been requested. Others wait until the =
  2202. number of=20
  2203. blocks left is lower than the number of blocks in transit, and no more =
  2204. than 20.=20
  2205. There seems to be agreement that it's a good idea to keep the number of =
  2206. pending=20
  2207. blocks low (1 or 2 blocks) to minimize the overhead, and if you =
  2208. randomize the=20
  2209. blocks requested, there's a lower chance of downloading duplicates. More =
  2210. on the=20
  2211. protocol overhead can be found here:</I> <A class=3D"external free" =
  2212. href=3D"http://hal.inria.fr/inria-00000156/en"=20
  2213. rel=3D"nofollow">http://hal.inria.fr/inria-00000156/en</A>.</P>
  2214. <H3> <SPAN id=3D"Choking_and_Optimistic_Unchoking" =
  2215. class=3D"mw-headline"> Choking=20
  2216. and Optimistic Unchoking </SPAN></H3>
  2217. <P>Choking is done for several reasons. TCP congestion control behaves =
  2218. very=20
  2219. poorly when sending over many connections at once. Also, choking lets =
  2220. each peer=20
  2221. use a tit-for-tat-ish algorithm to ensure that they get a consistent =
  2222. download=20
  2223. rate.</P>
  2224. <P>The choking algorithm described below is the currently deployed one. =
  2225. It is=20
  2226. very important that all new algorithms work well both in a network =
  2227. consisting=20
  2228. entirely of themselves and in a network consisting mostly of this =
  2229. one.</P>
  2230. <P>There are several criteria a good choking algorithm should meet. It =
  2231. should=20
  2232. cap the number of simultaneous uploads for good TCP performance. It =
  2233. should avoid=20
  2234. choking and unchoking quickly, known as 'fibrillation'. It should =
  2235. reciprocate to=20
  2236. peers who let it download. Finally, it should try out unused connections =
  2237. once in=20
  2238. a while to find out if they might be better than the currently used =
  2239. ones, known=20
  2240. as optimistic unchoking.</P>
  2241. <P>The currently deployed choking algorithm avoids fibrillation by only =
  2242. changing=20
  2243. choked peers once every ten seconds.</P>
  2244. <P>Reciprocation and number of uploads capping is managed by unchoking =
  2245. the four=20
  2246. peers which have the best upload rate and are interested. This =
  2247. maximizes the=20
  2248. client's download rate. These four peers are referred to as =
  2249. <I>downloaders</I>,=20
  2250. because they are interested in downloading from the client.</P>
  2251. <P>Peers which have a better upload rate (as compared to the =
  2252. <I>downloaders</I>)=20
  2253. but aren't interested get unchoked. If they become interested, the=20
  2254. <I>downloader</I> with the worst upload rate gets choked. If a client =
  2255. has a=20
  2256. complete file, it uses its upload rate rather than its download rate to =
  2257. decide=20
  2258. which peers to unchoke.</P>
  2259. <P>For optimistic unchoking, at any one time there is a single peer =
  2260. which is=20
  2261. unchoked regardless of its upload rate (if interested, it counts as one =
  2262. of the=20
  2263. four allowed <I>downloaders</I>). Which peer is optimistically unchoked =
  2264. rotates=20
  2265. every 30 seconds. Newly connected peers are three times as likely to =
  2266. start as=20
  2267. the current optimistic unchoke as anywhere else in the rotation. This =
  2268. gives=20
  2269. them a decent chance of getting a complete piece to upload.</P>
  2270. <H4> <SPAN id=3D"Anti-snubbing" class=3D"mw-headline"> Anti-snubbing =
  2271. </SPAN></H4>
  2272. <P>Occasionally a <A class=3D"new" title=3D"BitTorrent (page does not =
  2273. exist)" =
  2274. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrent&amp;action=3D=
  2275. edit&amp;redlink=3D1">BitTorrent</A>=20
  2276. peer will be choked by all peers which it was formerly downloading from. =
  2277. In such=20
  2278. cases it will usually continue to get poor download rates until the =
  2279. optimistic=20
  2280. unchoke finds better peers. To mitigate this problem, when over a minute =
  2281. goes by=20
  2282. without getting any piece data while downloading from a peer, <A =
  2283. class=3D"new"=20
  2284. title=3D"BitTorrent (page does not exist)" =
  2285. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrent&amp;action=3D=
  2286. edit&amp;redlink=3D1">BitTorrent</A>=20
  2287. assumes it is "snubbed" by that peer and doesn't upload to it except as =
  2288. an=20
  2289. optimistic unchoke. This frequently results in more than one concurrent=20
  2290. optimistic unchoke, (an exception to the exactly one optimistic unchoke =
  2291. rule=20
  2292. mentioned above), which causes download rates to recover much more =
  2293. quickly when=20
  2294. they falter.</P>
  2295. <H2> <SPAN id=3D"Official_Extensions_To_The_Protocol" =
  2296. class=3D"mw-headline">=20
  2297. Official Extensions To The Protocol </SPAN></H2>
  2298. <P>Currently there are a few official extensions to the protocol.</P>
  2299. <H4> <SPAN id=3D"Fast_Peers_Extensions" class=3D"mw-headline"> Fast =
  2300. Peers Extensions=20
  2301. </SPAN></H4>
  2302. <UL>
  2303. <LI>Reserved Bit: The third least significant bit in the 8th reserved =
  2304. byte=20
  2305. i.e. reserved[7] |=3D 0x04 </LI></UL>
  2306. <P>These extensions serve multiple purposes. They allow a peer to more =
  2307. quickly=20
  2308. bootstrap into a swarm by giving a peer a specific set of pieces which =
  2309. they will=20
  2310. be allowed download regardless of choked status. They reduce message =
  2311. overhead by=20
  2312. adding HaveAll and HaveNone messages and allow explicit rejection of =
  2313. piece=20
  2314. requests whereas previously only implicit rejection was possible meaning =
  2315. that a=20
  2316. peer might be left waiting for a piece that would never be =
  2317. delivered.</P>
  2318. <P>The specification is documented at the <A class=3D"new" =
  2319. title=3D"BitTorrent (page does not exist)"=20
  2320. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrent&amp;action=3D=
  2321. edit&amp;redlink=3D1">BitTorrent</A>=20
  2322. site here: <A class=3D"external free" =
  2323. href=3D"http://bittorrent.org/beps/bep_0006.html"=20
  2324. rel=3D"nofollow">http://bittorrent.org/beps/bep_0006.html</A>.</P>
  2325. <H4> <SPAN id=3D"Distributed_Hash_Table" class=3D"mw-headline"> =
  2326. Distributed Hash=20
  2327. Table </SPAN></H4>
  2328. <UL>
  2329. <LI> Reserved Bit: The last bit in the 8th reserved byte i.e. =
  2330. reserved[7] |=3D=20
  2331. 0x01</LI></UL>
  2332. <P>This extension is to allow for the tracking of peers downloading =
  2333. torrents=20
  2334. without the use of a standard tracker. A peer implementing this protocol =
  2335. becomes=20
  2336. a "tracker" and stores lists of other nodes/peers which can be used to =
  2337. locate=20
  2338. new peers.</P>
  2339. <P>The specification is documented at the <A class=3D"new" =
  2340. title=3D"BitTorrent (page does not exist)"=20
  2341. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrent&amp;action=3D=
  2342. edit&amp;redlink=3D1">BitTorrent</A>=20
  2343. site here: <A class=3D"external free" =
  2344. href=3D"http://bittorrent.org/beps/bep_0005.html"=20
  2345. rel=3D"nofollow">http://bittorrent.org/beps/bep_0005.html</A>.</P>
  2346. <P>BEP-32 extends the DHT with support for IPv6, and updates the =
  2347. specification=20
  2348. in some minor ways. <A class=3D"external free" =
  2349. href=3D"http://www.pps.jussieu.fr/~jch/software/bittorrent/bep-dht-ipv6.h=
  2350. tml"=20
  2351. rel=3D"nofollow">http://www.pps.jussieu.fr/~jch/software/bittorrent/bep-d=
  2352. ht-ipv6.html</A>
  2353. </P>
  2354. <H4> <SPAN id=3D"Connection_Obfuscation" class=3D"mw-headline"> =
  2355. Connection=20
  2356. Obfuscation </SPAN></H4>
  2357. <P>This extension allows the creation of obfuscated (encrypted) =
  2358. connections=20
  2359. between peers. This can be used to bypass ISPs throttling BitTorrent =
  2360. traffic.
  2361. </P>
  2362. <P>The specification is documented at <A class=3D"external free" =
  2363. href=3D"http://www.azureuswiki.com/index.php/Message_Stream_Encryption"=20
  2364. rel=3D"nofollow">http://www.azureuswiki.com/index.php/Message_Stream_Encr=
  2365. yption</A>.
  2366. </P>
  2367. <P><I> The documentation is fairly complete, but ideally it would be =
  2368. clarified=20
  2369. on several points including guidance on when encrypted connections =
  2370. should be=20
  2371. attempted, fallback procedures to regular connections etc. </I></P>
  2372. <H2> <SPAN id=3D"Unofficial_Extensions_To_The_Protocol" =
  2373. class=3D"mw-headline">=20
  2374. Unofficial Extensions To The Protocol </SPAN></H2>
  2375. <H4> <SPAN id=3D"Azureus_Messaging_Protocol" class=3D"mw-headline"> =
  2376. Azureus=20
  2377. Messaging Protocol </SPAN></H4>
  2378. <UL>
  2379. <LI> Reserved Bit: 1</LI></UL>
  2380. <P>A protocol in its own right - if two clients indicate they support =
  2381. the=20
  2382. protocol, then they should switch over to using it. It allows normal =
  2383. BitTorrent=20
  2384. as well extension messages to be sent over it, and is documented <A =
  2385. class=3D"external text"=20
  2386. href=3D"http://www.azureuswiki.com/index.php/Azureus_messaging_protocol" =
  2387. rel=3D"nofollow">here</A>.=20
  2388. Currently implemented by Azureus and Transmission.</P>
  2389. <P>It is not possible to use both this protocol and the LibTorrent =
  2390. extension=20
  2391. protocol at the same time - if both clients indicate they support both, =
  2392. then=20
  2393. they should follow the semantics defined by the <A class=3D"external =
  2394. text" =
  2395. href=3D"http://www.azureuswiki.com/index.php/Extension_negotiation_protoc=
  2396. ol"=20
  2397. rel=3D"nofollow">Extension Negotiation Protocol</A>.</P>
  2398. <H4> <SPAN id=3D"WebSeeding" class=3D"mw-headline"> WebSeeding =
  2399. </SPAN></H4>
  2400. <P>The possibility to seed a torrent via a web server is generally =
  2401. called=20
  2402. WebSeeding. It allows the HTTP server to work as a peer in the =
  2403. BitTorrent=20
  2404. network.</P>
  2405. <P>There are at least two specification for how to combine a torrent =
  2406. download=20
  2407. with a HTTP download. The first standard, implemented by BitTornado is =
  2408. quite=20
  2409. easy to implement in the client, but is intrusive on the HTTP in that it =
  2410. requires a script handling requests on the server side. i.e. A plain =
  2411. HTTP server=20
  2412. that just serves plain files isn't enough. The benfits is that the =
  2413. script can be=20
  2414. more abuse resistant. This specification is found here: <A =
  2415. class=3D"external free"=20
  2416. href=3D"http://bittornado.com/docs/webseed-spec.txt"=20
  2417. rel=3D"nofollow">http://bittornado.com/docs/webseed-spec.txt</A>.</P>
  2418. <P>The second specification requires slightly more from the client, but=20
  2419. downloads from plain HTTP servers. It is specified here: <A =
  2420. class=3D"external free"=20
  2421. href=3D"http://www.getright.com/seedtorrent.html"=20
  2422. rel=3D"nofollow">http://www.getright.com/seedtorrent.html</A>. It has =
  2423. been=20
  2424. implemented by GetRight, libtorrent, Mainline, BitComet, Vuze.</P>
  2425. <H4> <SPAN id=3D"Extension_protocol" class=3D"mw-headline"> Extension =
  2426. protocol=20
  2427. </SPAN></H4>
  2428. <UL>
  2429. <LI> Reserved Bit: 44, the fourth most significant bit in the 6th =
  2430. reserved=20
  2431. byte i.e. reserved[5] |=3D 0x10</LI></UL>
  2432. <P>This is a protocol for exchanging extension information and was =
  2433. derived from=20
  2434. an early version of azureus' extension protocol. It adds one message for =
  2435. exchanging arbitrary handshake information including defined extension =
  2436. messages,=20
  2437. mapping extensions to specific message IDs. It is documented here:<A =
  2438. class=3D"external free"=20
  2439. href=3D"http://www.libtorrent.org/extension_protocol.html"=20
  2440. rel=3D"nofollow">http://www.libtorrent.org/extension_protocol.html</A> =
  2441. and is=20
  2442. implemented at least by libtorrent, uTorrent, Mainline, Transmission, =
  2443. Azureus=20
  2444. and BitComet.</P>
  2445. <P>It is not possible to use both this protocol and the Azureus =
  2446. Messaging=20
  2447. Protocol at the same time - if both clients indicate they support both, =
  2448. then=20
  2449. they should follow the semantics defined by the <A class=3D"external =
  2450. text" =
  2451. href=3D"http://www.azureuswiki.com/index.php/Extension_negotiation_protoc=
  2452. ol"=20
  2453. rel=3D"nofollow">Extension Negotiation Protocol</A>.</P>
  2454. <H4> <SPAN id=3D"Extension_Negotiation_Protocol" class=3D"mw-headline"> =
  2455. Extension=20
  2456. Negotiation Protocol </SPAN></H4>
  2457. <UL>
  2458. <LI> Reserved bits: 47 and 48</LI></UL>
  2459. <P>These bits are used to allow two clients that support both the =
  2460. Azureus=20
  2461. Messaging Protocol and LibTorrent's extension protocol to decide which =
  2462. of the=20
  2463. two extensions should be used for communication, and is defined <A =
  2464. class=3D"external text"=20
  2465. href=3D"http://www.azureuswiki.com/index.php/Extension_negotiation_protoc=
  2466. ol" rel=3D"nofollow">here</A>.
  2467. </P>
  2468. <H4> <SPAN id=3D"BitTorrent_Location-aware_Protocol_1.0" =
  2469. class=3D"mw-headline">=20
  2470. BitTorrent Location-aware Protocol 1.0 </SPAN></H4>
  2471. <UL>
  2472. <LI> Reserved Bit: 21</LI></UL>
  2473. <P>A Protocol, considering peers location (in geographical terms) for =
  2474. better=20
  2475. performance. Specification can be found <A class=3D"external text" =
  2476. href=3D"http://wiki.theory.org/BitTorrent_Location-aware_Protocol_1.0_Spe=
  2477. cification"=20
  2478. rel=3D"nofollow">here</A>.</P>
  2479. <H4> <SPAN id=3D"SimpleBT_Extension_Protocol" class=3D"mw-headline"> =
  2480. SimpleBT=20
  2481. Extension Protocol </SPAN></H4>
  2482. <UL>
  2483. <LI> Reserved Bits: fist reserved byte =3D 0x01, following bytes may =
  2484. need to be=20
  2485. set to zero</LI></UL>
  2486. <P>An extension using message id 9 to add peer exchange and connection=20
  2487. statistics exchange. The specification can be found <A class=3D"external =
  2488. text"=20
  2489. href=3D"http://web.archive.org/web/20031002201124/btfans.3322.org/simpleb=
  2490. t/ProtocalExtension.txt"=20
  2491. rel=3D"nofollow">here</A>. The extension was in use in SimpleBT 0.32 to =
  2492. 0.36.1.=20
  2493. Later versions of SimpleBT were called BitComet and used the similar but =
  2494. incompatible BitComet Extension Protocol.</P>
  2495. <H4> <SPAN id=3D"BitComet_Extension_Protocol" class=3D"mw-headline"> =
  2496. BitComet=20
  2497. Extension Protocol </SPAN></H4>
  2498. <UL>
  2499. <LI> Reserved Bits: first two reserved bytes =3D "ex"</LI></UL>
  2500. <P>There appears to be no official documentation.</P>
  2501. <P>In this protocol a peer announces the supported extensions by sending =
  2502. a=20
  2503. message &lt;len=3D0001+X&gt;&lt;id=3D0xA0&gt;&lt;extension =
  2504. 1&gt;...&lt;extension=20
  2505. X&gt; where &lt;extension n&gt; is (usually) the message id of the =
  2506. supported=20
  2507. extension. When an extension consists of multiple messages, all ids need =
  2508. to be=20
  2509. mentioned.</P>
  2510. <P>Extensions currently in use (TODO: reverse engineer semantics):</P>
  2511. <UL>
  2512. <LI> 0xA0 (EXT_SUPPORT) see above, needs to be included in its =
  2513. parameter list
  2514. </LI>
  2515. <LI> 0xA1 (EXT_PEERREQ) ask for peer exchange, used in conjunction =
  2516. with=20
  2517. EXT_PEERS</LI>
  2518. <LI> 0xA2 (EXT_PEERS) in reply to EXT_PEERREQ and for updates =
  2519. afterwards</LI>
  2520. <LI> 0xA3 (EXT_AUTH_SEED) appeared in BitComet 0.53, used in =
  2521. conjunction with=20
  2522. EXT_AUTH_CRYPTOED</LI>
  2523. <LI> 0xA4 (EXT_AUTH_CRYPTOED)</LI>
  2524. <LI> 0xA5 (EXT_CONNGRANT) appeared in BitComet 0.48, used in =
  2525. conjunction with=20
  2526. EXT_CONNACCEPT</LI>
  2527. <LI> 0xA6 (EXT_CONNACCEPT)</LI>
  2528. <LI> 0x06 (?) announced by BitSpirit instead of EXT_CONNACCEPT</LI>
  2529. <LI> 0xA7 (EXT_CHAT_MESSAGE) appeared in BitComet 0.53, vanished in =
  2530. 0.71</LI>
  2531. <LI> 0xA9 (EXT_HASH_REQ) appeared in BitComet 0.54, vanished in 0.71, =
  2532. used in=20
  2533. conjunction with EXT_HASH</LI>
  2534. <LI> 0xAA (EXT_HASH)</LI>
  2535. <LI> 0xAB (EXT_REPORT_RATE_old) appeared in BitComet 0.54, was =
  2536. replaced by=20
  2537. EXT_REPORT_RATE_new in 0.57</LI>
  2538. <LI> 0xAC (EXT_REPORT_INFO) appeared in BitComet 0.54, vanished in =
  2539. 0.71,=20
  2540. reappeared in 0.82</LI>
  2541. <LI> 0xAD (EXT_REPORT_RATE_new) appeared in BitComet 0.57, vanished in =
  2542. 0.75,=20
  2543. reappeared in 0.82</LI>
  2544. <LI> 0xAE (EXT_BC_PASSPORT) appeared in BitComet 0.75</LI>
  2545. <LI> 0xAF (EXT_DHE_PREFERRED) appeared in BitComet 0.75</LI>
  2546. <LI> 0xB0 (?) appeared in BitComet 0.86</LI>
  2547. <LI> 0xC0 (?) does not correspond to a message id, appeared in =
  2548. BitComet 0.49
  2549. </LI></UL>
  2550. <P>A minimum implementation needs only accept EXT_SUPPORT, but =
  2551. EXT_PEERREQ and=20
  2552. EXT_PEERS are supported by all known implementations.</P>
  2553. <H2> <SPAN id=3D"Reserved_Bytes" class=3D"mw-headline"> Reserved Bytes =
  2554. </SPAN></H2>
  2555. <P><I>The reserved bits are numbered 1-64 in the following table for =
  2556. ease of=20
  2557. identification. Bit 1 corresponds to the most significant bit of the =
  2558. first=20
  2559. reserved byte. Bit 8 corresponds to the least significant bit of the =
  2560. first=20
  2561. reserved byte (i.e. byte[0] |=3D 0x01). Bit 64 is the least significant =
  2562. bit of the=20
  2563. last reserved byte i.e. byte[7] |=3D 0x01</I></P>
  2564. <P><I> An orange bit is a known unofficial extension, a red bit is an =
  2565. unknown=20
  2566. unofficial extension.</I></P>
  2567. <TABLE border=3D"1">
  2568. <CAPTION> Reserved Bits</CAPTION>
  2569. <TBODY>
  2570. <TR>
  2571. <TH> Bit </TH>
  2572. <TH> Use </TH>
  2573. <TH> Azureus </TH>
  2574. <TH> BitComet </TH>
  2575. <TH> MainLine </TH>
  2576. <TH> MonoTorrent </TH>
  2577. <TH> =C2=B5Torrent </TH>
  2578. <TH> libtorrent </TH>
  2579. <TH> KTorrent </TH>
  2580. <TH> BitLord </TH>
  2581. <TH> XBT </TH>
  2582. <TH> Transmission</TH></TR>
  2583. <TR style=3D"background: orange;">
  2584. <TD> 1 </TD>
  2585. <TD> Azureus Extended Messaging </TD>
  2586. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2587. Yes </TD>
  2588. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2589. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2590. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2591. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2592. <TD style=3D"text-align: center;"> No </TD>
  2593. <TD style=3D"text-align: center;"> No </TD>
  2594. <TD style=3D"text-align: center;"> No </TD>
  2595. <TD style=3D"text-align: center;"> No </TD>
  2596. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2597. Yes</TD></TR>
  2598. <TR style=3D"background: orange;">
  2599. <TD> 1-16 </TD>
  2600. <TD> BitComet Extension protocol </TD>
  2601. <TD style=3D"text-align: center;"> No </TD>
  2602. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2603. Yes </TD>
  2604. <TD style=3D"text-align: center;"> No </TD>
  2605. <TD style=3D"text-align: center;"> No </TD>
  2606. <TD style=3D"text-align: center;"> No </TD>
  2607. <TD style=3D"text-align: center;"> No </TD>
  2608. <TD style=3D"text-align: center;"> No </TD>
  2609. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2610. Yes </TD>
  2611. <TD style=3D"text-align: center;"> No </TD>
  2612. <TD style=3D"text-align: center;"> No</TD></TR>
  2613. <TR style=3D"background: orange;">
  2614. <TD> 21 </TD>
  2615. <TD> BitTorrent Location-aware Protocol 1.0 </TD>
  2616. <TD style=3D"text-align: center;"> No </TD>
  2617. <TD style=3D"text-align: center;"> No </TD>
  2618. <TD style=3D"text-align: center;"> No </TD>
  2619. <TD style=3D"text-align: center;"> No </TD>
  2620. <TD style=3D"text-align: center;"> No </TD>
  2621. <TD style=3D"text-align: center;"> No </TD>
  2622. <TD style=3D"text-align: center;"> No </TD>
  2623. <TD style=3D"text-align: center;"> No </TD>
  2624. <TD style=3D"text-align: center;"> No </TD>
  2625. <TD style=3D"text-align: center;"> No</TD></TR>
  2626. <TR style=3D"background: orange;">
  2627. <TD> 44 </TD>
  2628. <TD> Extension protocol </TD>
  2629. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2630. Yes </TD>
  2631. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2632. Yes </TD>
  2633. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2634. Yes </TD>
  2635. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2636. Yes </TD>
  2637. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2638. Yes </TD>
  2639. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2640. Yes </TD>
  2641. <TD style=3D"text-align: center;"> No </TD>
  2642. <TD style=3D"text-align: center;"> No </TD>
  2643. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2644. Yes </TD>
  2645. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2646. Yes</TD></TR>
  2647. <TR style=3D"background: orange;">
  2648. <TD> 47 - 48 </TD>
  2649. <TD> Extension Negotiation Protocol </TD>
  2650. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2651. Yes </TD>
  2652. <TD style=3D"text-align: center;"> No </TD>
  2653. <TD style=3D"text-align: center;"> No </TD>
  2654. <TD style=3D"text-align: center;"> No </TD>
  2655. <TD style=3D"text-align: center;"> No </TD>
  2656. <TD style=3D"text-align: center;"> No </TD>
  2657. <TD style=3D"text-align: center;"> No </TD>
  2658. <TD style=3D"text-align: center;"> No </TD>
  2659. <TD style=3D"text-align: center;"> No </TD>
  2660. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2661. Yes</TD></TR>
  2662. <TR style=3D"background: orange;">
  2663. <TD> 61 </TD>
  2664. <TD> NAT Traversal </TD>
  2665. <TD style=3D"text-align: center;"> No </TD>
  2666. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2667. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2668. Yes </TD>
  2669. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2670. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2671. <TD style=3D"text-align: center;"> No </TD>
  2672. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2673. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2674. <TD style=3D"text-align: center;"> No </TD>
  2675. <TD style=3D"text-align: center;">&nbsp;?</TD></TR>
  2676. <TR>
  2677. <TD> 62 </TD>
  2678. <TD> Fast Peers </TD>
  2679. <TD style=3D"text-align: center;"> No </TD>
  2680. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2681. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2682. Yes </TD>
  2683. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2684. Yes </TD>
  2685. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2686. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2687. Yes </TD>
  2688. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2689. Yes </TD>
  2690. <TD style=3D"text-align: center;"> No </TD>
  2691. <TD style=3D"text-align: center;"> No </TD>
  2692. <TD style=3D"text-align: center;">&nbsp;?</TD></TR>
  2693. <TR style=3D"background: orange;">
  2694. <TD> 63 </TD>
  2695. <TD> XBT Peer Exchange </TD>
  2696. <TD style=3D"text-align: center;"> No </TD>
  2697. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2698. <TD style=3D"text-align: center;"> No </TD>
  2699. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2700. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2701. <TD style=3D"text-align: center;"> No </TD>
  2702. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2703. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2704. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2705. Yes </TD>
  2706. <TD style=3D"text-align: center;">&nbsp;?</TD></TR>
  2707. <TR>
  2708. <TD> 64 </TD>
  2709. <TD> DHT </TD>
  2710. <TD style=3D"text-align: center;"> No </TD>
  2711. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2712. Yes </TD>
  2713. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2714. Yes </TD>
  2715. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2716. Yes </TD>
  2717. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2718. Yes </TD>
  2719. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2720. Yes </TD>
  2721. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2722. Yes </TD>
  2723. <TD style=3D"text-align: center;"> No </TD>
  2724. <TD style=3D"text-align: center;"> No </TD>
  2725. <TD style=3D"text-align: center;">&nbsp;?</TD></TR>
  2726. <TR style=3D"background: orange;">
  2727. <TD> 64 </TD>
  2728. <TD> XBT Metadata Exchange </TD>
  2729. <TD style=3D"text-align: center;"> No </TD>
  2730. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2731. <TD style=3D"text-align: center;"> No </TD>
  2732. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2733. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2734. <TD style=3D"text-align: center;"> No </TD>
  2735. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2736. <TD style=3D"text-align: center;">&nbsp;? </TD>
  2737. <TD style=3D"background: rgb(136, 255, 136); text-align: center;"> =
  2738. Yes </TD>
  2739. <TD style=3D"text-align: center;">&nbsp;?</TD></TR></TBODY></TABLE>
  2740. <H2> <SPAN id=3D"Change_Log" class=3D"mw-headline"> Change Log =
  2741. </SPAN></H2>
  2742. <P>Put your changes below this line, so that the most recent changes =
  2743. appear=20
  2744. first. The change log should be purged from time to time. Please =
  2745. preserve the=20
  2746. last month's worth of change logs.</P>
  2747. <P>doverosx - 2011-05-30 - minor: changed in notations "a block is a =
  2748. portion of=20
  2749. data that the client requests from AT LEAST ONE peer" since it is not =
  2750. necessary=20
  2751. to request a block from only ONE peer at a time.</P>
  2752. <P><A class=3D"new" title=3D"SuprDewd (page does not exist)" =
  2753. href=3D"http://wiki.theory.org/index.php?title=3DSuprDewd&amp;action=3Ded=
  2754. it&amp;redlink=3D1">SuprDewd</A>=20
  2755. - 2010-07-23 - Added a link to my implementation of bencoding for =
  2756. C#.</P>
  2757. <P>greywiz - 2010-01-01 - Added support for Extension Protocol and DHT =
  2758. for=20
  2759. BitComet in the Reserved Bytes table</P>
  2760. <P>SiDi - 2009-04-18 - Added RezTorrent peer_id</P>
  2761. <P>HighInBC - 2008-02-12 - Minor change. Added parsed result for final =
  2762. example=20
  2763. of bencoded dictionary, added &lt;nowiki&gt; tags to top example to =
  2764. avoid=20
  2765. issues.</P>
  2766. <P>amc1 - 2007-09-12 - Azureus now supports the LibTorrent Extension =
  2767. Protocol=20
  2768. (LTEP, as I refer to it).</P>
  2769. <P>amc1 - 2007-08-16 - Added description and links to Extension =
  2770. Negotiation=20
  2771. Protocol, and formatted the reserved bits table a bit.</P>
  2772. <P>Denial - 2007-08-13 - Added description of the SimpleBT and BitComet=20
  2773. extension protocols</P>
  2774. <P>amc1 - 2007-07-16 - Added SymTorrent's peer ID identifier, as well as =
  2775. some=20
  2776. other clients I've come across which need to be identified.</P>
  2777. <P>amc1 - 2007-07-14 - Corrected information about Shadow's style of =
  2778. peer ID -=20
  2779. existing text made incorrect assumptions.</P>
  2780. <P>mitchman - 2007-07-12 - Clarified the Opera peed-id</P>
  2781. <P>roee88- 2007-06-11 - Added LH-ABC peer_id</P>
  2782. <P>Boian V Petkantchin - April 26, 2007. Listed another unoffcial =
  2783. extension -=20
  2784. BitTorrent Location-aware Protocol 1.0. Included it in the table of =
  2785. reserved=20
  2786. bits.</P>
  2787. <P>daniel-gl at gmx.net - Corrected reserved bit numbers - Added NAT =
  2788. traversal=20
  2789. and XBT extensions to table</P>
  2790. <P>stuge - 2006-11-20 - Added Queen Bee peer_id</P>
  2791. <P><A class=3D"mw-redirect" title=3D"EHeM"=20
  2792. href=3D"http://wiki.theory.org/EHeM">EHeM</A> - 2006-10-16 - Update of =
  2793. view #1 on=20
  2794. <I>Message: request</I> to hopefully reflect a possible compromise =
  2795. position. -=20
  2796. Trimming of changelog.</P>
  2797. <P><A class=3D"mw-redirect" title=3D"EHeM"=20
  2798. href=3D"http://wiki.theory.org/EHeM">EHeM</A> - 2006-10-11 - Firmly =
  2799. marked the=20
  2800. <I>Message: request</I> section as being under dispute - Firmly marked =
  2801. the=20
  2802. <I>Algorithms: Queuing</I> section as being under dispute - Removed =
  2803. personal=20
  2804. insults by uau, could we be reasonable humans and try to resolve =
  2805. disputes=20
  2806. peacefully? Perhaps using the attached <A class=3D"external text" =
  2807. href=3D"http://wiki.theory.org/Talk:BitTorrentSpecification"=20
  2808. rel=3D"nofollow">talk/discussion</A> page?</P>
  2809. <P>Joris Guisson - 2006-09-12 - Added KTorrent specific information =
  2810. (peer id and=20
  2811. extension table)</P>
  2812. <P>Arvid - 2006-09-12 - Added Extension protocol to the unofficial =
  2813. extensions=20
  2814. section</P>
  2815. <P>Alan - 2006-09-12 -Removed some older history. Update the reserved =
  2816. bytes=20
  2817. section.</P>
  2818. <P>Alan - 2006-09-11 - Added section about Extensions to Protocol</P>
  2819. <P>uau - 2006-08-17 - Added warning about the misleading information in =
  2820. the=20
  2821. Queuing and requests packet sections.</P>
  2822. <P><A class=3D"new" title=3D"WikiWordsAreEllFourEmmThree (page does not =
  2823. exist)"=20
  2824. href=3D"http://wiki.theory.org/index.php?title=3DWikiWordsAreEllFourEmmTh=
  2825. ree&amp;action=3Dedit&amp;redlink=3D1">WikiWordsAreEllFourEmmThree</A>=20
  2826. - 2006-07-08- Added <A class=3D"new" title=3D"BitPump (page does not =
  2827. exist)" =
  2828. href=3D"http://wiki.theory.org/index.php?title=3DBitPump&amp;action=3Dedi=
  2829. t&amp;redlink=3D1">BitPump</A>=20
  2830. peer_id</P>
  2831. <P>daniel-gl at gmx.net - 2006-04-28- Added Bits on Wheels &amp; <A =
  2832. class=3D"new"=20
  2833. title=3D"BitLord (page does not exist)" =
  2834. href=3D"http://wiki.theory.org/index.php?title=3DBitLord&amp;action=3Dedi=
  2835. t&amp;redlink=3D1">BitLord</A>=20
  2836. peer_id.</P>
  2837. <P><A class=3D"new" title=3D"DennisHolmes (page does not exist)" =
  2838. href=3D"http://wiki.theory.org/index.php?title=3DDennisHolmes&amp;action=3D=
  2839. edit&amp;redlink=3D1">DennisHolmes</A>=20
  2840. - 2006-04-22- Added Enhanced CTorrent peer_id</P>
  2841. <P><A class=3D"new" title=3D"WikiWordsAre (page does not exist)" =
  2842. href=3D"http://wiki.theory.org/index.php?title=3DWikiWordsAre&amp;action=3D=
  2843. edit&amp;redlink=3D1">WikiWordsAre</A>=EF=BF=BDberGay=20
  2844. - 2006-04-16- Anti-snubbing '<I>is</I> part of the official protocol. =
  2845. Check out=20
  2846. the paper on <A class=3D"new" title=3D"BitTorrent (page does not exist)" =
  2847. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrent&amp;action=3D=
  2848. edit&amp;redlink=3D1">BitTorrent</A>=20
  2849. economics at <A class=3D"external free" =
  2850. href=3D"http://www.bittorrent.org/" =
  2851. rel=3D"nofollow">http://www.bittorrent.org/</A>
  2852. </P>
  2853. <P><A class=3D"new" title=3D"JoshElsasser (page does not exist)" =
  2854. href=3D"http://wiki.theory.org/index.php?title=3DJoshElsasser&amp;action=3D=
  2855. edit&amp;redlink=3D1">JoshElsasser</A>=20
  2856. - 2006-04-11- Added Transmission peer_id</P>
  2857. <P>daniel-gl at gmx.net - 2006-03-23- Added Tribler peer_id</P>
  2858. <P><A class=3D"new" title=3D"MaSiniavine (page does not exist)" =
  2859. href=3D"http://wiki.theory.org/index.php?title=3DMaSiniavine&amp;action=3D=
  2860. edit&amp;redlink=3D1">MaSiniavine</A>
  2861. - Corrected dictionary example</P>
  2862. <P>Juanjo 2006-03-10- Added Lphant peer ID</P>
  2863. <P><A class=3D"mw-redirect" title=3D"EHeM"=20
  2864. href=3D"http://wiki.theory.org/EHeM">EHeM</A> 2006-03-07- Added mention =
  2865. of another=20
  2866. parameter to the baseline for queuing.- Another link adjustment.- Added=20
  2867. exposition on request block size.- Sample link changes, the domain =
  2868. "example.com"=20
  2869. is explicitly reserved for examples, as such that should be used instead =
  2870. of=20
  2871. spam.com.- Added qualification to recommended number of peers.</P>
  2872. <P><A class=3D"mw-redirect" title=3D"EHeM"=20
  2873. href=3D"http://wiki.theory.org/EHeM">EHeM</A> 2006-03-01 (minor)- Link =
  2874. changes,=20
  2875. the official <A class=3D"new" title=3D"BitTorrent (page does not exist)" =
  2876. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrent&amp;action=3D=
  2877. edit&amp;redlink=3D1">BitTorrent</A>=20
  2878. pages are no longer on bitconjurer.org, but bittorent.com.- Removed =
  2879. unneeded=20
  2880. line breaks from paragraph.- Typo fixes in changelog (yeah, I suppose do =
  2881. have a=20
  2882. bit of vanity)</P>
  2883. <P><A class=3D"mw-redirect" title=3D"EHeM"=20
  2884. href=3D"http://wiki.theory.org/EHeM">EHeM</A> 2006-03-01- Restored the =
  2885. section on=20
  2886. queueing, as it '<I>is</I> a highly crucial performance item. Feel free =
  2887. to=20
  2888. rewrite me if you desire, uau. The developer's list, <A =
  2889. class=3D"external free"=20
  2890. href=3D"http://lists.ibiblio.org/mailman/listinfo/bittorrent"=20
  2891. rel=3D"nofollow">http://lists.ibiblio.org/mailman/listinfo/bittorrent</A>=
  2892. is a=20
  2893. better place for debates.- Trimmed changelog entries older than one =
  2894. year, the=20
  2895. above specifies one month, but this is changing slowly so more history =
  2896. seems=20
  2897. pertinent.</P>
  2898. <P>haylegend - 2006-01-08- Added Retriever's peer id.</P>
  2899. <P>uau - 2005-12-13- Fixed sizes in request message description AGAIN. =
  2900. They had=20
  2901. been changed to incorrect values.- Removed "Queuing" section. It had so =
  2902. many=20
  2903. errors and inaccuracies that it did more harm than good as it was, and I =
  2904. didn't=20
  2905. feel like rewriting it.</P>
  2906. <HR>
  2907. <PRE>Last edit: Tue, 12 Sep 2006 22:38:05 -0700=0A=
  2908. (TresNi)=0A=
  2909. Revisions: 158=0A=
  2910. </PRE>
  2911. <H2> <SPAN id=3D"Related_Links" class=3D"mw-headline">Related =
  2912. Links</SPAN></H2><!-- =0A=
  2913. NewPP limit report=0A=
  2914. Preprocessor node count: 616/1000000=0A=
  2915. Post-expand include size: 3903/2097152 bytes=0A=
  2916. Template argument size: 0/2097152 bytes=0A=
  2917. Expensive parser function count: 0/100=0A=
  2918. --><!-- Saved in parser cache with key =
  2919. mw_theoryorg:pcache:idhash:1427-0!1!0!!en!2!edit=3D0 and timestamp =
  2920. 20110907042952 -->
  2921. <DIV class=3D"printfooter">Retrieved from "<A =
  2922. href=3D"http://wiki.theory.org/BitTorrentSpecification">http://wiki.theor=
  2923. y.org/BitTorrentSpecification</A>"</DIV>
  2924. <DIV id=3D"catlinks" class=3D"catlinks">
  2925. <DIV id=3D"mw-normal-catlinks"><A title=3D"Special:Categories" =
  2926. href=3D"http://wiki.theory.org/Special:Categories">Category</A>:=20
  2927. <SPAN dir=3D"ltr"><A class=3D"new" title=3D"Category:PhpWiki (page does =
  2928. not exist)"=20
  2929. href=3D"http://wiki.theory.org/index.php?title=3DCategory:PhpWiki&amp;act=
  2930. ion=3Dedit&amp;redlink=3D1">PhpWiki</A></SPAN></DIV></DIV><!-- end =
  2931. content -->
  2932. <DIV class=3D"visualClear"></DIV></DIV></DIV></DIV>
  2933. <DIV id=3D"column-one">
  2934. <DIV id=3D"p-cactions" class=3D"portlet">
  2935. <H5>Views</H5>
  2936. <DIV class=3D"pBody">
  2937. <UL>
  2938. <LI id=3D"ca-nstab-main" class=3D"selected"><A accessKey=3D"c" =
  2939. title=3D"View the content page [c]"=20
  2940. href=3D"http://wiki.theory.org/BitTorrentSpecification">Page</A></LI>
  2941. <LI id=3D"ca-talk"><A accessKey=3D"t" title=3D"Discussion about the =
  2942. content page [t]"=20
  2943. =
  2944. href=3D"http://wiki.theory.org/Talk:BitTorrentSpecification">Discussion</=
  2945. A></LI>
  2946. <LI id=3D"ca-viewsource"><A accessKey=3D"e" title=3D"This page is =
  2947. protected.&#10;You can view its source [e]"=20
  2948. =
  2949. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrentSpecification&=
  2950. amp;action=3Dedit">View=20
  2951. source</A></LI>
  2952. <LI id=3D"ca-history"><A accessKey=3D"h" title=3D"Past revisions of =
  2953. this page [h]"=20
  2954. =
  2955. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrentSpecification&=
  2956. amp;action=3Dhistory">History</A></LI></UL></DIV></DIV>
  2957. <DIV id=3D"p-personal" class=3D"portlet">
  2958. <H5>Personal tools</H5>
  2959. <DIV class=3D"pBody">
  2960. <UL>
  2961. <LI id=3D"pt-login"><A accessKey=3D"o" title=3D"You are encouraged to =
  2962. log in; however, it is not mandatory [o]"=20
  2963. =
  2964. href=3D"http://wiki.theory.org/index.php?title=3DSpecial:UserLogin&amp;re=
  2965. turnto=3DBitTorrentSpecification">Log=20
  2966. in / create account</A></LI></UL></DIV></DIV>
  2967. <DIV id=3D"p-logo" class=3D"portlet"><A style=3D'background-image: =
  2968. url("/skins/theoryorg.png");'=20
  2969. title=3D"Visit the main page" =
  2970. href=3D"http://wiki.theory.org/Main_Page"></A></DIV>
  2971. <SCRIPT type=3D"text/javascript"> if (window.isMSIE55) fixalpha(); =
  2972. </SCRIPT>
  2973. <DIV id=3D"p-navigation" class=3D"generated-sidebar portlet">
  2974. <H5>Navigation</H5>
  2975. <DIV class=3D"pBody">
  2976. <UL>
  2977. <LI id=3D"n-mainpage-description"><A accessKey=3D"z" title=3D"Visit =
  2978. the main page [z]"=20
  2979. href=3D"http://wiki.theory.org/Main_Page">Main page</A></LI>
  2980. <LI id=3D"n-portal"><A title=3D"About the project, what you can do, =
  2981. where to find things"=20
  2982. href=3D"http://wiki.theory.org/TheoryOrg:Community_portal">Community=20
  2983. portal</A></LI>
  2984. <LI id=3D"n-currentevents"><A title=3D"Find background information on =
  2985. current events"=20
  2986. href=3D"http://wiki.theory.org/TheoryOrg:Current_events">Current =
  2987. events</A></LI>
  2988. <LI id=3D"n-recentchanges"><A accessKey=3D"r" title=3D"The list of =
  2989. recent changes in the wiki [r]"=20
  2990. href=3D"http://wiki.theory.org/Special:RecentChanges">Recent =
  2991. changes</A></LI>
  2992. <LI id=3D"n-randompage"><A accessKey=3D"x" title=3D"Load a random page =
  2993. [x]" href=3D"http://wiki.theory.org/Special:Random">Random=20
  2994. page</A></LI>
  2995. <LI id=3D"n-help"><A title=3D"The place to find out" =
  2996. href=3D"http://wiki.theory.org/Help:Contents">Help</A></LI></UL></DIV></D=
  2997. IV>
  2998. <DIV id=3D"p-search" class=3D"portlet">
  2999. <H5><LABEL for=3D"searchInput">Search</LABEL></H5>
  3000. <DIV id=3D"searchBody" class=3D"pBody">
  3001. <FORM id=3D"searchform" action=3D"/index.php"><INPUT name=3D"title" =
  3002. value=3D"Special:Search"=20
  3003. type=3D"hidden"><INPUT accessKey=3D"f" id=3D"searchInput" =
  3004. title=3D"Search TheoryOrg"=20
  3005. name=3D"search" type=3D"search"><INPUT id=3D"searchGoButton" =
  3006. class=3D"searchButton" title=3D"Go to a page with this exact name if =
  3007. exists" name=3D"go" value=3D"Go" type=3D"submit">&nbsp;
  3008. <INPUT id=3D"mw-searchButton" class=3D"searchButton" title=3D"Search =
  3009. the pages for this text" name=3D"fulltext" value=3D"Search" =
  3010. type=3D"submit"></FORM></DIV></DIV>
  3011. <DIV id=3D"p-tb" class=3D"portlet">
  3012. <H5>Toolbox</H5>
  3013. <DIV class=3D"pBody">
  3014. <UL>
  3015. <LI id=3D"t-whatlinkshere"><A accessKey=3D"j" title=3D"List of all =
  3016. wiki pages that link here [j]"=20
  3017. =
  3018. href=3D"http://wiki.theory.org/Special:WhatLinksHere/BitTorrentSpecificat=
  3019. ion">What=20
  3020. links here</A></LI>
  3021. <LI id=3D"t-recentchangeslinked"><A accessKey=3D"k" title=3D"Recent =
  3022. changes in pages linked from this page [k]"=20
  3023. =
  3024. href=3D"http://wiki.theory.org/Special:RecentChangesLinked/BitTorrentSpec=
  3025. ification">Related=20
  3026. changes</A></LI>
  3027. <LI id=3D"t-specialpages"><A accessKey=3D"q" title=3D"List of all =
  3028. special pages [q]"=20
  3029. href=3D"http://wiki.theory.org/Special:SpecialPages">Special =
  3030. pages</A></LI>
  3031. <LI id=3D"t-print"><A accessKey=3D"p" title=3D"Printable version of =
  3032. this page [p]"=20
  3033. =
  3034. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrentSpecification&=
  3035. amp;printable=3Dyes"=20
  3036. rel=3D"alternate">Printable version</A></LI>
  3037. <LI id=3D"t-permalink"><A title=3D"Permanent link to this revision of =
  3038. the page"=20
  3039. =
  3040. href=3D"http://wiki.theory.org/index.php?title=3DBitTorrentSpecification&=
  3041. amp;oldid=3D4218">Permanent=20
  3042. link</A></LI></UL></DIV></DIV></DIV><!-- end of the left (by default =
  3043. at least) column -->
  3044. <DIV class=3D"visualClear"></DIV>
  3045. <DIV id=3D"footer">
  3046. <DIV id=3D"f-poweredbyico"><A href=3D"http://www.mediawiki.org/"><IMG =
  3047. alt=3D"Powered by MediaWiki"=20
  3048. src=3D"http://wiki.theory.org/skins/common/images/poweredby_mediawiki_88x=
  3049. 31.png"=20
  3050. width=3D"88" height=3D"31"></A></DIV>
  3051. <DIV id=3D"f-copyrightico"><A =
  3052. href=3D"http://www.gnu.org/licenses/old-licenses/fdl-1.2.txt"><IMG=20
  3053. alt=3D"GNU Free Documentation License 1.2" =
  3054. src=3D"http://wiki.theory.org/skins/common/images/gnu-fdl.png"=20
  3055. width=3D"88" height=3D"31"></A></DIV>
  3056. <UL id=3D"f-list">
  3057. <LI id=3D"lastmod"> This page was last modified on 7 June 2011, at =
  3058. 00:43.</LI>
  3059. <LI id=3D"viewcount">This page has been accessed 738,800 times.</LI>
  3060. <LI id=3D"copyright">Content is available under <A class=3D"external " =
  3061. href=3D"http://www.gnu.org/licenses/old-licenses/fdl-1.2.txt">GNU=20
  3062. Free Documentation License 1.2</A>.</LI>
  3063. <LI id=3D"privacy"><A title=3D"TheoryOrg:Privacy policy" =
  3064. href=3D"http://wiki.theory.org/TheoryOrg:Privacy_policy">Privacy=20
  3065. policy</A></LI>
  3066. <LI id=3D"about"><A title=3D"TheoryOrg:About" =
  3067. href=3D"http://wiki.theory.org/TheoryOrg:About">About=20
  3068. TheoryOrg</A></LI>
  3069. <LI id=3D"disclaimer"><A title=3D"TheoryOrg:General disclaimer" =
  3070. href=3D"http://wiki.theory.org/TheoryOrg:General_disclaimer">Disclaimers<=
  3071. /A></LI></UL>
  3072. </DIV></DIV>
  3073. <SCRIPT>if (window.runOnloadHook) runOnloadHook();</SCRIPT>
  3074. <!-- Served in 0.629 secs. --></BODY></HTML>
  3075. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  3076. Content-Type: image/png
  3077. Content-Transfer-Encoding: base64
  3078. Content-Location: http://wiki.theory.org/skins/common/images/poweredby_mediawiki_88x31.png
  3079. iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSAAAAA3NCSVQICAjb4U/gAAAClFBMVEUC
  3080. KWuqqtbmxQbRvxS1xc+BdgdzlKmEq76qqqpBeZ3HxHrt7OZbZ1LWxE0lX3hxeUWzq2nY3N5WhKPQ
  3081. dQoAUIThyiSwrTY9RpT29vbGwqSjtsTHzdDAaQoAZplPepgATICdo6vp1Asyao7o59vO1NfQx2Ph
  3082. 2XiOkTeKjY3yzQnW1smGla7s2yNemLXflg06hK0wO3h2pLvm2D/1sgfn4akHV4uYscEbLHZEdphO
  3083. hKauspWsrr4ObZ3q2RqqbRTWyS8haJa5xJuFhbgrS4Ipe6WrusXX0rXW1tY4cpfBztff2Zrlqg7w
  3084. yhTIuEyFo7dSkbFskKjShg3Yyhj91geVrb7EvnPy3TXd0WchZZKHp7xmi6Ln1lLdxUWMm7ayv8fT
  3085. zZbe3sm7w8/AcA7w8PDNtzQaW4YmJpoybZTOzcXe3taes8D0ywDh5OZAXIvo5Lzg14rk1zTPzr40
  3086. gafr1RBJZJFCU1rbugvlziGWehNqnbd0nLWlvsv13hsIVIaRkqXF0NfwvANEiq0wToIYX4zgnRHm
  3087. 0A7UiRL36Efc4OJMf6PoxxqgpJXYzlX/yQYbdKGNkrv4xhHq4RLO1tzo0TKUbg5biqgGHXn31xDu
  3088. 3hnj12rHuUSclS1ijqzWzozm3IXsvxLZ2ebBag2ambbMfRU4dJvlpxG1chKdtcb05D3q6M2LpLXz
  3089. 3ynExc5ika/VnBnMzMze3t6mu8h8nbMiY42sv8ufq8AQWozGdBXgz0zWvQ6Oq77gsQlNepnDwMLo
  3090. vQJSg6NGYY4XXIvc1644Q2fu2EdNVV31vAf3zwZ7p73m5uYpapTUfQ8AU4mboKarqK2UtMS6sEDR
  3091. ymyVmYq5taFUWZrt0R/Hdg/L0dTBvnnOy4Hi2pLr2FEpPiAVAAAACXBIWXMAAArwAAAK8AFCrDSY
  3092. AAAEiklEQVR42u3Q/1dTZRzA8dtczHkjvTQrmPMLTA0kT0NDSyRM8tkNGwv5MjTEdSVAn6FuJLAx
  3093. 5xyzOyLN0dq0panoZIy6406E+SWwYD2TXF9F8Z/pGUjQzukcz1F+6JzePzzP53yec18/XGL+HEXM
  3094. /25O+h+eDY//o7rUurq68ScvAa4+dP/MoerqpwODWSX/mry4+q3qbV9nZWXNbEN6vTUE/iX95Lve
  3095. l7BOhEtK2ptKKnKqtw1UzMhpMtCiBzGFVOoDPmlI6lNItSERwBcQ+WST7wosa7WJcCAQGB8P3Hxw
  3096. GyQbDAKBwHBwVban4yYA2kAA4IKyFqtVYRUVgryQLHZCYVXoWwpFInzhURZ/1+NlrFiUCOsa10g3
  3097. vfT2osUHOuyZ+wWCFR6P58qRPzZJ1zTqHsGicWsQyECxtdha2HJCr29pAfHLGgOTMAjmxYpPgESY
  3098. OCYHv42kgvfmtQv2jx49ut996tTp06s/BeAYAXAmGT5iha/i3yGj834y4QnD8QsvZfF3faEe5BUn
  3099. wBRFDFGgbK8n54Prt663tbUVjUYMBvuOr+5S1BBB4eSm+CmMnyZKKKdoE0XTFL7wEm/xu0lIiWRC
  3100. alYY5jhCx9X/PLI3M/Oz0ePXrl27+O1oRNBTtuEkx+kI7nELm7jZTcO3z7x4sNWw49KdJfn5Sy6u
  3101. i9jLFzy3fBp+/BLhIW7PghJPp6f9+L385ub8F4oinasefFz1hDDLEjqWfeaH5B73uXuXm59tvnzn
  3102. UqSzgf3oJMvqCBZnrtnHsiC9Rsr+nf95bbqLmxzDvJZVb2TltWql358e36WYWRbDEBI6CO8uLG/N
  3103. zFx7Pv8L/CuKIivKV44sh1BHQNzYmBfCtP7+AIQ0DXEWi9+mXeOPDxwU2sKcWANDtn19u421HCeH
  3104. /qUQYhghYgg1nJlnt293u9feO3/+w7Zbh+09Kxe+iZCOQLjXJTyNvJJhOeXi+T4I+4ajfNSS5Id9
  3105. tqjDERCnUJphuYq3qN/pE6MUJee/gdAU3Ii6F61e+WP7n62RdWvfb/vcPThY/uC1Cwg1TsEbeQWl
  3106. 3BiVe/tDlZLcYL8xGC0YV/bmmo1pUYmwsivE87kpXkqjUolV5jASS6bhrVp0YcP98sXZ2dvdnZ2j
  3107. 51o32z/5/cuTSLt1Clb3OSpd+HubptdlczkcCJmitNIYH0LDIYtGqQ6nDweRJhyWSCoR+n4arqq6
  3108. Sn3zStmBzs1NTe6HVzIPbz6Yc+qXIxR1taoK4cbUTn5ZqS+qLYiaYq40r4ZCKo1FaXR1IRQzh5DY
  3109. 7KMlvBNi2MZ3sdMwSZIIl5ExcXrXRI5hYmBwsCl7/dmBBpKEkIw35iLfkDh9Nmeuzdhba3Fqal39
  3110. BU5lryUq9trMQtLYT1PDDpLVhFUOOS8mvRKSxDDzKJJcP0HusndXzEs++/Ah9pjpbviZ0p2kMIVi
  3111. cpfVhBiG5mtUKirJTwprakqTaEa4E8KkUgbu3J2mZvbxdO5ShpmBcRkk2dFBNnSsf7d7VQPzZM2G
  3112. cWhLPcPc3pNaz5BPAZ6TMPzynPSfhOeovwCx6Xbt5tzVdAAAAABJRU5ErkJggg==
  3113. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  3114. Content-Type: image/png
  3115. Content-Transfer-Encoding: base64
  3116. Content-Location: http://wiki.theory.org/skins/common/images/gnu-fdl.png
  3117. iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSAAACoFBMVEUAAQAAAgABBAACBQEFCAQH
  3118. CQUKDAgMDwsOEAwPEQ0RExASFBETFBIUFRMVFhQWGBUXGBYYGRcZGxgaHBkbHBocHRsdHxweHx0g
  3119. IR8hIyAiJCEjJCIkJSMrLSovMS4yMzEzNDI0NjM1NzQ6Ozk9Pzw+QD1BQ0FXQiBYRCdGSEVaRSNH
  3120. SUZISUdbRipcRypKS0ldSCteSSxMTktfSi1gSy5hTC9PUU5iTTBkTzFmUDNXWVZrVTdZW1htVzlb
  3121. XVptWUBcXltuWkFdX1xvW0JwXENfYV5xXURgYl9zX0ZiZGF1YUh2YUh3Ykl4Y0p5ZEt2Z0x6ZUx4
  3122. aU58Z059aE96a1Bsbmt7bFF/alFtb2x8bVJ9blNvcW5/clxzdXKCdV+Fd2B4eneGeGGHeWKIemOJ
  3123. e2SKfGV+gH2Mfmd/gX6Agn+Bg4CPgWqChIGDhYKVgH2Fh4SMjouYjHqNj4yajnyPkY6UlpOilYOW
  3124. mJWXmZalmIeam5immYinmomom4qpnIuqnYyeoJ2sn46toI+ipKGuopCto5avo5GkpqOwpJKlp6Sv
  3125. pZimqKWwppqnqaaoqqeqrKm3rKC4raG5rqK6r6O7sKSytLG8sqW9s6a+tKe1t7TDuKu5u7i7vbrG
  3126. u669v7zIwLnCxMHDxcLLw7zFx8TGyMXOxr/HycbIysfRyMHJy8jUzMTNz8vVzcbWzsfP0c7Xz8jQ
  3127. 0s/Y0MnR09DZ0crS1NHa0svc08zX1s3d1M3V19Tg2NDc3tvk3NXd39zm3dbe4N3h5ODo4+Lk5uPq
  3128. 5OPr5eTm6OXn6ebo6ufp6+jq7Onv6ujr7urx7Ort7+vu8O307u317+7w8u/x8/D38fDy9PHz9fL0
  3129. 9/P2+PT3+fb4+vf5+/j6/Pn/+vn7/fr8//v+//ybsc4MAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
  3130. B3RJTUUH1AQLARkvVukrLgAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVu
  3131. AAADjElEQVR42rWW908UQRTHnWxQT+yKd2dDsayiQZDD3lBskdjF3rFg9+y9N4gNFXvvIjk9CLao
  3132. JFhQETlEj9uTfP8VZ/Z2dnfOO36Q8E1u3ryX7Gdf3n539uqtqyPVWyfXoNU38Z8yg1P3uoq93mLX
  3133. vokC+O2wFiSiSQxASBZb1J+2sMCkxvrdbmh1ATzNBV35Mw3w+8aWkxW/Hq5ll3QMBQaPuVbp9j/g
  3134. HmcBz6VlKYmJKek55cC5WA4eSXYCvLnLNYFxkvQKBic9gXLcIWtKPOxDXn8N3Jx80sF9utYILiGW
  3135. IHDsE3yfKZs0tRR5sQEwIX4dfIvcDTVjnvqJFATOxvdkWd56/d2PPxWvMwfTytBS5ATATclHgGi8
  3136. Ln1r7ri1CE6DkkYp0KRsYs/ShzkqeATZAv2ZXVDv0Jx8wRfS6B/waTJWBOfjuEz1bk9aUtyEbACM
  3137. fBCFAVdENsiq9PJGO7BlPsmoWkkhIrj6sc3yRgBPQrlDNrQRUOg0HOWYzMB4M6yVFNG6e+CSQ+os
  3138. M2xS0xneIDCx9HtlGJuB9+GibNZ9IJOGHByo5ZvnQroAXgq8VsPzWoKLkSKABwI/aUjGh1qCvUgQ
  3139. wLGAn4YEeBnYOAss6wFTahjZusgHOG2SzQmger1datJLBf+GQwAPAMpV8B8VDCYW7kUAphR858uN
  3140. nosNndyKO5qSV8U8Uz5e0EYxTgAvAVw0jEKZAPadiA4NBgqaweYG4LYBUQWmh7dUAD8CdtCQjnw+
  3141. CoCFdkWAKTXdQpEgKYEY2ECz2yUzdzfgYbO5iEyh40r7tXAdu9trHduBKLcOToUnXvXv6pR4x7w7
  3142. QPVCmjk8mC6AcTWqLCRYye28Gc5OBUpBjBNY3vGhUnKKv9JHGRiafi5m2RFqZhGM0YNCu6Id5cFp
  3143. lews+jOsUstZ+iGUyt7lK/R08xTuTmLc6QoW1P6bl41vY2RBQ0vZ4EWw1iG3qtH92kB5exvSuCev
  3144. 6gd9yTQzd0opCuPCgLlVjXlHPlD39a/6Pl8Ggj9N/oNJHJtwoAqFNAsN5lY1wMfaVrB970PVaip+
  3145. TM8AledXDE+IT158rgzIjpPDgblVDU9jxEhWrto2ZG4Rrxqf/6l50PVyAauE79gtdowKe1Zgf7eD
  3146. uWOuCbueFv9Svr7InM2y8GBuVfMxEkmX/UXKtYYCOKxEsOYB3aogegVr6DLeSqyneLUu/7vVkf4C
  3147. RKKsEaKFTNMAAAAASUVORK5CYII=
  3148. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  3149. Content-Type: text/css;
  3150. charset="iso-8859-1"
  3151. Content-Transfer-Encoding: quoted-printable
  3152. Content-Location: http://wiki.theory.org/skins/common/shared.css?270
  3153. .mw-plusminus-pos {
  3154. color: rgb(0, 100, 0);
  3155. }
  3156. .mw-plusminus-neg {
  3157. color: rgb(139, 0, 0);
  3158. }
  3159. .mw-plusminus-null {
  3160. color: rgb(170, 170, 170);
  3161. }
  3162. span.comment {
  3163. font-style: italic;
  3164. }
  3165. span.changedby {
  3166. font-size: 95%;
  3167. }
  3168. .texvc {
  3169. unicode-bidi: embed; direction: ltr;
  3170. }
  3171. img.tex {
  3172. vertical-align: middle;
  3173. }
  3174. span.texhtml {
  3175. font-family: serif;
  3176. }
  3177. .ontop#wikiPreview {
  3178. margin-bottom: 1em;
  3179. }
  3180. #editform {
  3181. clear: both;
  3182. }
  3183. #toolbar {
  3184. clear: both;
  3185. }
  3186. #wpTextbox1 {
  3187. clear: both;
  3188. }
  3189. div#mw-js-message {
  3190. margin: 1em 5%; padding: 0.5em 2.5%; border: 1px solid rgb(221, 221, =
  3191. 221); background-color: rgb(252, 252, 252);
  3192. }
  3193. .editsection {
  3194. margin-left: 5px; float: right;
  3195. }
  3196. h2#filehistory {
  3197. clear: both;
  3198. }
  3199. table.filehistory th {
  3200. vertical-align: top;
  3201. }
  3202. table.filehistory td {
  3203. vertical-align: top;
  3204. }
  3205. table.filehistory th {
  3206. text-align: left;
  3207. }
  3208. table.filehistory td.mw-imagepage-filesize {
  3209. white-space: nowrap;
  3210. }
  3211. table.filehistory th.mw-imagepage-filesize {
  3212. white-space: nowrap;
  3213. }
  3214. table.filehistory td.filehistory-selected {
  3215. font-weight: bold;
  3216. }
  3217. li span.deleted {
  3218. color: rgb(136, 136, 136); font-style: italic; text-decoration: =
  3219. line-through;
  3220. }
  3221. span.history-deleted {
  3222. color: rgb(136, 136, 136); font-style: italic; text-decoration: =
  3223. line-through;
  3224. }
  3225. .not-patrolled {
  3226. background-color: rgb(255, 255, 170);
  3227. }
  3228. .unpatrolled {
  3229. color: red; font-weight: bold;
  3230. }
  3231. div.patrollink {
  3232. text-align: right; font-size: 75%;
  3233. }
  3234. body.ltr td.mw-label {
  3235. text-align: right;
  3236. }
  3237. body.ltr td.mw-input {
  3238. text-align: left;
  3239. }
  3240. body.ltr td.mw-submit {
  3241. text-align: left;
  3242. }
  3243. body.rtl td.mw-label {
  3244. text-align: left;
  3245. }
  3246. body.rtl td.mw-input {
  3247. text-align: right;
  3248. }
  3249. body.rtl td.mw-submit {
  3250. text-align: right;
  3251. }
  3252. td.mw-label {
  3253. vertical-align: top;
  3254. }
  3255. .prefsection td.mw-label {
  3256. width: 20%;
  3257. }
  3258. .prefsection table {
  3259. width: 100%;
  3260. }
  3261. td.mw-submit {
  3262. white-space: nowrap;
  3263. }
  3264. table.mw-htmlform-nolabel td.mw-label {
  3265. width: 0px !important;
  3266. }
  3267. body.rtl .thumbcaption {
  3268. text-align: right;
  3269. }
  3270. body.rtl .magnify {
  3271. float: left;
  3272. }
  3273. body.ltr .thumbcaption {
  3274. text-align: left;
  3275. }
  3276. body.ltr .magnify {
  3277. float: right;
  3278. }
  3279. .mw-hidden-cats-hidden {
  3280. display: none;
  3281. }
  3282. .catlinks-allhidden {
  3283. display: none;
  3284. }
  3285. p.mw-ipb-conveniencelinks {
  3286. font-size: 90%; float: right;
  3287. }
  3288. p.mw-protect-editreasons {
  3289. font-size: 90%; float: right;
  3290. }
  3291. p.mw-filedelete-editreasons {
  3292. font-size: 90%; float: right;
  3293. }
  3294. p.mw-delete-editreasons {
  3295. font-size: 90%; float: right;
  3296. }
  3297. p.mw-revdel-editreasons {
  3298. font-size: 90%; float: right;
  3299. }
  3300. .searchresults {
  3301. =09
  3302. }
  3303. .searchresults p {
  3304. margin-top: 1em; margin-bottom: 1.2em; margin-left: 0.4em;
  3305. }
  3306. div.searchresult {
  3307. width: 38em; font-size: 95%;
  3308. }
  3309. .mw-search-results {
  3310. margin-left: 0.4em;
  3311. }
  3312. .mw-search-results li {
  3313. list-style: none; padding-bottom: 1em;
  3314. }
  3315. .mw-search-results li a {
  3316. font-size: 108%;
  3317. }
  3318. .mw-search-result-data {
  3319. color: green; font-size: 97%;
  3320. }
  3321. .mw-search-formheader {
  3322. border: 1px solid silver; margin-top: 1em; background-color: rgb(243, =
  3323. 243, 243);
  3324. }
  3325. .mw-search-formheader div.search-types {
  3326. padding-left: 0.25em; float: left;
  3327. }
  3328. .rtl .mw-search-formheader div.search-types {
  3329. float: right;
  3330. }
  3331. .mw-search-formheader div.search-types ul {
  3332. list-style: none !important; margin: 0px !important; padding: 0px =
  3333. !important;
  3334. }
  3335. .mw-search-formheader div.search-types ul li {
  3336. margin: 0px; padding: 0px; float: left;
  3337. }
  3338. .mw-search-formheader div.search-types ul li a {
  3339. padding: 0.5em; display: block;
  3340. }
  3341. .mw-search-formheader div.search-types ul li.current a {
  3342. color: rgb(51, 51, 51); cursor: default;
  3343. }
  3344. .mw-search-formheader div.search-types ul li.current a:hover {
  3345. text-decoration: none;
  3346. }
  3347. .mw-search-formheader div.results-info {
  3348. padding: 0.5em 0.75em 0.5em 0.5em; float: right;
  3349. }
  3350. .mw-search-formheader div.results-info ul {
  3351. list-style: none !important; margin: 0px !important; padding: 0px =
  3352. !important;
  3353. }
  3354. .mw-search-formheader div.results-info ul li {
  3355. margin: 0px; padding: 0px; float: right;
  3356. }
  3357. fieldset#mw-searchoptions {
  3358. border-width: 0px 1px 1px !important; border-style: solid !important; =
  3359. border-color: silver !important; margin: 0px; padding: 0.5em 0.75em =
  3360. !important; background-color: rgb(249, 249, 249);
  3361. }
  3362. fieldset#mw-searchoptions legend {
  3363. display: none;
  3364. }
  3365. fieldset#mw-searchoptions h4 {
  3366. margin: 0px; padding: 0px; float: left;
  3367. }
  3368. .rtl fieldset#mw-searchoptions h4 {
  3369. float: right;
  3370. }
  3371. fieldset#mw-searchoptions div#mw-search-togglebox {
  3372. float: right;
  3373. }
  3374. .rtl fieldset#mw-searchoptions div#mw-search-togglebox {
  3375. float: left;
  3376. }
  3377. fieldset#mw-searchoptions div#mw-search-togglebox label {
  3378. margin-right: 0.25em;
  3379. }
  3380. fieldset#mw-searchoptions div#mw-search-togglebox input {
  3381. margin-left: 0.25em;
  3382. }
  3383. fieldset#mw-searchoptions table {
  3384. margin-right: 3em; float: left;
  3385. }
  3386. fieldset#mw-searchoptions table td {
  3387. padding-right: 1em;
  3388. }
  3389. .rtl fieldset#mw-searchoptions table td {
  3390. padding-right: 0px; padding-left: 1em;
  3391. }
  3392. body.rtl fieldset#mw-searchoptions table {
  3393. margin-right: 0px; margin-left: 3em; float: right;
  3394. }
  3395. fieldset#mw-searchoptions div.divider {
  3396. padding-top: 0.5em; clear: both; margin-bottom: 0.5em; =
  3397. border-bottom-color: rgb(221, 221, 221); border-bottom-width: 1px; =
  3398. border-bottom-style: solid;
  3399. }
  3400. td#mw-search-menu {
  3401. padding-left: 6em; font-size: 85%;
  3402. }
  3403. div#mw-search-interwiki {
  3404. border: 1px solid rgb(170, 170, 170); width: 18em; margin-top: 2ex; =
  3405. float: right;
  3406. }
  3407. .rtl div#mw-search-interwiki {
  3408. float: left;
  3409. }
  3410. div#mw-search-interwiki li {
  3411. font-size: 95%;
  3412. }
  3413. .mw-search-interwiki-more {
  3414. font-size: 90%; float: right;
  3415. }
  3416. .rtl .mw-search-interwiki-more {
  3417. float: left;
  3418. }
  3419. div#mw-search-interwiki-caption {
  3420. text-align: center; font-size: 95%; font-weight: bold;
  3421. }
  3422. .mw-search-interwiki-project {
  3423. padding: 0.15em 0.15em 0.2em 0.2em; text-align: left; font-size: 97%; =
  3424. border-top-color: rgb(187, 187, 187); border-top-width: 1px; =
  3425. border-top-style: solid; background-color: rgb(236, 236, 236);
  3426. }
  3427. .rtl .mw-search-interwiki-project {
  3428. text-align: right;
  3429. }
  3430. span.searchalttitle {
  3431. font-size: 95%;
  3432. }
  3433. div.searchdidyoumean {
  3434. color: rgb(204, 0, 0); font-size: 127%; margin-top: 0.8em;
  3435. }
  3436. div.searchdidyoumean em {
  3437. font-weight: bold;
  3438. }
  3439. .searchmatch {
  3440. font-weight: bold;
  3441. }
  3442. table#mw-search-top-table {
  3443. background-color: transparent;
  3444. }
  3445. td#mw-search-togglebox {
  3446. text-align: right;
  3447. }
  3448. table#mw-search-powertable {
  3449. width: 100%;
  3450. }
  3451. form#powersearch {
  3452. clear: both;
  3453. }
  3454. .mw-userrights-disabled {
  3455. color: rgb(136, 136, 136);
  3456. }
  3457. table.mw-userrights-groups * td {
  3458. padding-right: 1.5em;
  3459. }
  3460. table.mw-userrights-groups * th {
  3461. padding-right: 1.5em;
  3462. }
  3463. .os-suggest {
  3464. border: 1px solid rgb(170, 170, 170); left: 0px; top: 0px; width: 0px; =
  3465. overflow: auto; font-size: 95%; position: absolute; z-index: 99; =
  3466. overflow-x: hidden; background-color: window;
  3467. }
  3468. table.os-suggest-results {
  3469. border: 0px currentColor; width: 100%; font-size: 95%; border-collapse: =
  3470. collapse; cursor: pointer;
  3471. }
  3472. .os-suggest-result {
  3473. padding: 2px; color: windowtext; white-space: nowrap; background-color: =
  3474. window;
  3475. }
  3476. .os-suggest-result-hl {
  3477. padding: 2px; color: windowtext; white-space: nowrap; background-color: =
  3478. window;
  3479. }
  3480. .os-suggest-result-hl {
  3481. color: white; background-color: rgb(76, 89, 166);
  3482. }
  3483. .os-suggest-result-hl-webkit {
  3484. color: white; background-color: rgb(76, 89, 166);
  3485. }
  3486. .os-suggest-result-hl {
  3487. color: highlighttext; background-color: highlight;
  3488. }
  3489. .os-suggest-toggle {
  3490. left: 1ex; font-size: 65%; position: relative;
  3491. }
  3492. .os-suggest-toggle-def {
  3493. left: 0px; top: 0px; font-size: 65%; visibility: hidden; position: =
  3494. absolute;
  3495. }
  3496. .autocomment {
  3497. color: gray;
  3498. }
  3499. #pagehistory .history-user {
  3500. margin-right: 0.2em; margin-left: 0.4em;
  3501. }
  3502. #pagehistory span.minor {
  3503. font-weight: bold;
  3504. }
  3505. #pagehistory li {
  3506. border: 1px solid white;
  3507. }
  3508. #pagehistory li.selected {
  3509. border: 1px dashed rgb(170, 170, 170); background-color: rgb(249, 249, =
  3510. 249);
  3511. }
  3512. .newpage {
  3513. font-weight: bold;
  3514. }
  3515. .minor {
  3516. font-weight: bold;
  3517. }
  3518. .bot {
  3519. font-weight: bold;
  3520. }
  3521. .mw-uctop {
  3522. font-weight: bold;
  3523. }
  3524. table.mw-listgrouprights-table tr {
  3525. vertical-align: top;
  3526. }
  3527. .listgrouprights-revoked {
  3528. text-decoration: line-through;
  3529. }
  3530. td.mw-statistics-numbers {
  3531. text-align: right;
  3532. }
  3533. h4.mw-specialpagesgroup {
  3534. margin: 0.3em 0em 0em; padding: 2px; background-color: rgb(220, 220, =
  3535. 220);
  3536. }
  3537. .mw-specialpagerestricted {
  3538. font-weight: bold;
  3539. }
  3540. #shared-image-dup {
  3541. font-style: italic;
  3542. }
  3543. #shared-image-conflict {
  3544. font-style: italic;
  3545. }
  3546. table.mw-emailuser-table {
  3547. width: 98%;
  3548. }
  3549. td#mw-emailuser-sender {
  3550. font-weight: bold;
  3551. }
  3552. td#mw-emailuser-recipient {
  3553. font-weight: bold;
  3554. }
  3555. table.allpageslist {
  3556. background-color: transparent;
  3557. }
  3558. table.mw-allpages-table-form {
  3559. width: 100%; background-color: transparent;
  3560. }
  3561. table.mw-allpages-table-chunk {
  3562. width: 100%; background-color: transparent;
  3563. }
  3564. td.mw-allpages-alphaindexline {
  3565. text-align: right;
  3566. }
  3567. td.mw-allpages-nav {
  3568. text-align: right; font-size: smaller; margin-bottom: 1em;
  3569. }
  3570. p.mw-allpages-nav {
  3571. text-align: right; font-size: smaller; margin-bottom: 1em;
  3572. }
  3573. table.mw-allpages-table-form tr {
  3574. vertical-align: top;
  3575. }
  3576. table#mw-prefixindex-list-table {
  3577. width: 98%; background-color: transparent;
  3578. }
  3579. table#mw-prefixindex-nav-table {
  3580. width: 98%; background-color: transparent;
  3581. }
  3582. td#mw-prefixindex-nav-form {
  3583. text-align: right; font-size: smaller; margin-bottom: 1em; =
  3584. vertical-align: top;
  3585. }
  3586. div.mw-warning-with-logexcerpt {
  3587. padding: 3px; border: 2px solid rgb(47, 111, 171); clear: both; =
  3588. margin-bottom: 3px;
  3589. }
  3590. div.mw-warning-with-logexcerpt ul li {
  3591. font-size: 90%;
  3592. }
  3593. span.mw-revdelundel-link {
  3594. font-size: 90%;
  3595. }
  3596. strong.mw-revdelundel-link {
  3597. font-size: 90%;
  3598. }
  3599. span.mw-revdelundel-hidden {
  3600. visibility: hidden;
  3601. }
  3602. input.mw-revdelundel-hidden {
  3603. visibility: hidden;
  3604. }
  3605. td.mw-revdel-checkbox {
  3606. text-align: center; padding-right: 10px;
  3607. }
  3608. th.mw-revdel-checkbox {
  3609. text-align: center; padding-right: 10px;
  3610. }
  3611. a.feedlink {
  3612. background: url("images/feed-icon.png") no-repeat left; padding-left: =
  3613. 16px;
  3614. }
  3615. .plainlinks a {
  3616. padding: 0px !important;
  3617. }
  3618. table.wikitable {
  3619. background: rgb(249, 249, 249); margin: 1em 1em 1em 0px; border: 1px =
  3620. solid rgb(170, 170, 170); border-collapse: collapse;
  3621. }
  3622. .wikitable th {
  3623. padding: 0.2em; border: 1px solid rgb(170, 170, 170);
  3624. }
  3625. .wikitable td {
  3626. padding: 0.2em; border: 1px solid rgb(170, 170, 170);
  3627. }
  3628. .wikitable th {
  3629. background: rgb(242, 242, 242); text-align: center;
  3630. }
  3631. .wikitable caption {
  3632. font-weight: bold;
  3633. }
  3634. table.collapsed tr.collapsable {
  3635. display: none;
  3636. }
  3637. .success {
  3638. color: green; font-size: larger;
  3639. }
  3640. .error {
  3641. color: red; font-size: larger;
  3642. }
  3643. .errorbox {
  3644. padding: 0.5em 1em; border: 2px solid currentColor; color: rgb(0, 0, =
  3645. 0); font-size: larger; margin-bottom: 2em; float: left;
  3646. }
  3647. .successbox {
  3648. padding: 0.5em 1em; border: 2px solid currentColor; color: rgb(0, 0, =
  3649. 0); font-size: larger; margin-bottom: 2em; float: left;
  3650. }
  3651. .errorbox {
  3652. border-color: red; background-color: rgb(255, 242, 242);
  3653. }
  3654. .successbox {
  3655. border-color: green; background-color: rgb(221, 255, 221);
  3656. }
  3657. .errorbox h2 {
  3658. margin: 0px 0.5em 0px 0px; border: currentColor; font-size: 1em; =
  3659. font-weight: bold; display: inline;
  3660. }
  3661. .successbox h2 {
  3662. margin: 0px 0.5em 0px 0px; border: currentColor; font-size: 1em; =
  3663. font-weight: bold; display: inline;
  3664. }
  3665. .visualClear {
  3666. clear: both;
  3667. }
  3668. #mw_trackbacks {
  3669. padding: 0.2em; border: 1px solid rgb(187, 187, 255); background-color: =
  3670. rgb(238, 238, 255);
  3671. }
  3672. .TablePager {
  3673. min-width: 80%;
  3674. }
  3675. .TablePager_nav a {
  3676. text-decoration: none;
  3677. }
  3678. .TablePager {
  3679. border-collapse: collapse;
  3680. }
  3681. .TablePager {
  3682. padding: 0px 0.15em; border: 1px solid rgb(170, 170, 170);
  3683. }
  3684. .TablePager td {
  3685. padding: 0px 0.15em; border: 1px solid rgb(170, 170, 170);
  3686. }
  3687. .TablePager th {
  3688. padding: 0px 0.15em; border: 1px solid rgb(170, 170, 170);
  3689. }
  3690. .TablePager th {
  3691. background-color: rgb(238, 238, 255);
  3692. }
  3693. .TablePager td {
  3694. background-color: rgb(255, 255, 255);
  3695. }
  3696. .TablePager tr:hover td {
  3697. background-color: rgb(238, 238, 255);
  3698. }
  3699. .imagelist td {
  3700. white-space: nowrap;
  3701. }
  3702. .imagelist th {
  3703. white-space: nowrap;
  3704. }
  3705. .imagelist .TablePager_col_links {
  3706. background-color: rgb(238, 238, 255);
  3707. }
  3708. .imagelist .TablePager_col_img_description {
  3709. white-space: normal;
  3710. }
  3711. .imagelist th.TablePager_sort {
  3712. background-color: rgb(204, 204, 255);
  3713. }
  3714. #mw-allmessagestable .allmessages-customised td.am_default {
  3715. background-color: rgb(252, 255, 196);
  3716. }
  3717. #mw-allmessagestable tr.allmessages-customised:hover td.am_default {
  3718. background-color: rgb(250, 255, 144);
  3719. }
  3720. #mw-allmessagestable td.am_actual {
  3721. background-color: rgb(226, 255, 226);
  3722. }
  3723. #mw-allmessagestable tr.allmessages-customised:hover + =
  3724. tr.allmessages-customised td.am_actual {
  3725. background-color: rgb(177, 255, 177);
  3726. }
  3727. ul#filetoc {
  3728. padding: 5px; border: 1px solid rgb(170, 170, 170); text-align: center; =
  3729. font-size: 95%; margin-right: 0px; margin-bottom: 0.5em; margin-left: =
  3730. 0px; background-color: rgb(249, 249, 249);
  3731. }
  3732. #filetoc li {
  3733. padding-right: 2em; display: inline; list-style-type: none;
  3734. }
  3735. table.mw_metadata {
  3736. width: 300px; font-size: 0.8em; margin-bottom: 0.5em; margin-left: =
  3737. 0.5em;
  3738. }
  3739. table.mw_metadata caption {
  3740. font-weight: bold;
  3741. }
  3742. table.mw_metadata th {
  3743. font-weight: normal;
  3744. }
  3745. table.mw_metadata td {
  3746. padding: 0.1em;
  3747. }
  3748. table.mw_metadata {
  3749. border: currentColor; border-collapse: collapse;
  3750. }
  3751. table.mw_metadata td {
  3752. border: 1px solid rgb(170, 170, 170); text-align: center; =
  3753. padding-right: 0.1em; padding-left: 0.1em;
  3754. }
  3755. table.mw_metadata th {
  3756. border: 1px solid rgb(170, 170, 170); text-align: center; =
  3757. padding-right: 0.1em; padding-left: 0.1em;
  3758. }
  3759. table.mw_metadata th {
  3760. background-color: rgb(249, 249, 249);
  3761. }
  3762. table.mw_metadata td {
  3763. background-color: rgb(252, 252, 252);
  3764. }
  3765. table.gallery {
  3766. margin: 2px; padding: 2px; border: 1px solid rgb(204, 204, 204); =
  3767. background-color: white;
  3768. }
  3769. table.gallery tr {
  3770. vertical-align: top;
  3771. }
  3772. table.gallery td {
  3773. border: 2px solid white; vertical-align: top; background-color: =
  3774. rgb(249, 249, 249);
  3775. }
  3776. table.gallery caption {
  3777. font-weight: bold;
  3778. }
  3779. div.gallerybox {
  3780. margin: 2px;
  3781. }
  3782. div.gallerybox div.thumb {
  3783. margin: 2px; border: 1px solid rgb(204, 204, 204); text-align: center;
  3784. }
  3785. div.gallerytext {
  3786. padding: 2px 4px; overflow: hidden; font-size: 94%;
  3787. }
  3788. table.mw-enhanced-rc {
  3789. border: 0px currentColor; border-spacing: 0;
  3790. }
  3791. td.mw-enhanced-rc {
  3792. padding: 0px; font-family: monospace; vertical-align: top; white-space: =
  3793. nowrap;
  3794. }
  3795. #mw-addcategory-prompt {
  3796. margin-left: 1em; display: inline;
  3797. }
  3798. #mw-addcategory-prompt input {
  3799. margin-right: 0.5em; margin-left: 0.5em;
  3800. }
  3801. .mw-remove-category {
  3802. background-position: center; padding: 8px; background-image: =
  3803. url("images/remove.png"); background-repeat: no-repeat;
  3804. }
  3805. .mw-ajax-addcategory {
  3806. background-position: left; padding-left: 20px; background-image: =
  3807. url("images/add.png"); background-repeat: no-repeat;
  3808. }
  3809. .mw-ajax-loader {
  3810. background-position: center; padding: 16px; top: -16px; position: =
  3811. relative; background-image: url("images/ajax-loader.gif"); =
  3812. background-repeat: no-repeat;
  3813. }
  3814. .mw-small-spinner {
  3815. background-position: center; padding: 10px !important; margin-right: =
  3816. 0.6em; background-image: url("images/spinner.gif"); background-repeat: =
  3817. no-repeat;
  3818. }
  3819. a.sortheader {
  3820. margin: 0px 0.3em;
  3821. }
  3822. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  3823. Content-Type: text/css;
  3824. charset="iso-8859-1"
  3825. Content-Transfer-Encoding: quoted-printable
  3826. Content-Location: http://wiki.theory.org/skins/common/commonPrint.css?270
  3827. a.stub {
  3828. color: rgb(186, 0, 0); text-decoration: none;
  3829. }
  3830. a.new {
  3831. color: rgb(186, 0, 0); text-decoration: none;
  3832. }
  3833. #toc {
  3834. padding: 5px; border: 1px solid rgb(170, 170, 170); background-color: =
  3835. rgb(249, 249, 249);
  3836. }
  3837. .tocindent {
  3838. margin-left: 2em;
  3839. }
  3840. .tocline {
  3841. margin-bottom: 0px;
  3842. }
  3843. div.floatright {
  3844. border-width: 0.5em 0px 0.8em 1.4em; border-style: solid; border-color: =
  3845. white; margin: 0px; clear: right; float: right; position: relative;
  3846. }
  3847. div.floatright p {
  3848. font-style: italic;
  3849. }
  3850. div.floatleft {
  3851. border-width: 0.5em 1.4em 0.8em 0px; border-style: solid; border-color: =
  3852. white; margin: 0.3em 0.5em 0.5em 0px; float: left; position: relative;
  3853. }
  3854. div.floatleft p {
  3855. font-style: italic;
  3856. }
  3857. div.thumb {
  3858. border-style: solid; border-color: white; width: auto; overflow: =
  3859. hidden; margin-bottom: 0.5em;
  3860. }
  3861. div.thumbinner {
  3862. padding: 3px !important; border: 1px solid rgb(204, 204, 204); =
  3863. text-align: center; font-size: 94%; background-color: rgb(249, 249, =
  3864. 249);
  3865. }
  3866. html .thumbimage {
  3867. border: 1px solid rgb(204, 204, 204);
  3868. }
  3869. html .thumbcaption {
  3870. padding: 0.3em 0px 0.1em; border: currentColor;
  3871. }
  3872. div.magnify {
  3873. display: none;
  3874. }
  3875. div.tright {
  3876. border-width: 0.5em 0px 0.8em 1.4em; clear: right; float: right;
  3877. }
  3878. div.tleft {
  3879. border-width: 0.5em 1.4em 0.8em 0px; margin-right: 0.5em; float: left;
  3880. }
  3881. img.thumbborder {
  3882. border: 1px solid rgb(221, 221, 221);
  3883. }
  3884. table.rimage {
  3885. width: 1pt; text-align: center; margin-bottom: 1em; margin-left: 1em; =
  3886. float: right; position: relative;
  3887. }
  3888. body {
  3889. background: white; margin: 0px; padding: 0px; color: black;
  3890. }
  3891. .noprint {
  3892. display: none;
  3893. }
  3894. div#jump-to-nav {
  3895. display: none;
  3896. }
  3897. div.top {
  3898. display: none;
  3899. }
  3900. div#column-one {
  3901. display: none;
  3902. }
  3903. #colophon {
  3904. display: none;
  3905. }
  3906. .editsection {
  3907. display: none;
  3908. }
  3909. .toctoggle {
  3910. display: none;
  3911. }
  3912. .tochidden {
  3913. display: none;
  3914. }
  3915. div#f-poweredbyico {
  3916. display: none;
  3917. }
  3918. div#f-copyrightico {
  3919. display: none;
  3920. }
  3921. li#viewcount {
  3922. display: none;
  3923. }
  3924. li#about {
  3925. display: none;
  3926. }
  3927. li#disclaimer {
  3928. display: none;
  3929. }
  3930. li#privacy {
  3931. display: none;
  3932. }
  3933. #mw-hidden-catlinks {
  3934. display: none;
  3935. }
  3936. ul {
  3937. list-style-type: square;
  3938. }
  3939. #content {
  3940. margin: 0px !important; padding: 0px !important; border: currentColor =
  3941. !important;
  3942. }
  3943. #footer {
  3944. background: white; color: black; border-top-color: black; =
  3945. border-top-width: 1px; border-top-style: solid;
  3946. }
  3947. h1 {
  3948. font-weight: bold;
  3949. }
  3950. h2 {
  3951. font-weight: bold;
  3952. }
  3953. h3 {
  3954. font-weight: bold;
  3955. }
  3956. h4 {
  3957. font-weight: bold;
  3958. }
  3959. h5 {
  3960. font-weight: bold;
  3961. }
  3962. h6 {
  3963. font-weight: bold;
  3964. }
  3965. p {
  3966. margin: 1em 0px !important; line-height: 1.2em;
  3967. }
  3968. .documentDescription {
  3969. margin: 1em 0px !important; line-height: 1.2em;
  3970. }
  3971. .tocindent p {
  3972. margin: 0px !important;
  3973. }
  3974. pre {
  3975. background: white; padding: 1em 0px; border: 1pt dashed black; color: =
  3976. black; overflow: auto; font-size: 8pt; white-space: pre;
  3977. }
  3978. table.listing {
  3979. border: 1pt solid black; border-collapse: collapse;
  3980. }
  3981. table.listing td {
  3982. border: 1pt solid black; border-collapse: collapse;
  3983. }
  3984. a {
  3985. padding: 0px !important; color: black !important;
  3986. }
  3987. a:link {
  3988. color: rgb(85, 34, 0); text-decoration: underline;
  3989. }
  3990. a:visited {
  3991. color: rgb(85, 34, 0); text-decoration: underline;
  3992. }
  3993. #content a.text.external::after {
  3994. content: " (" attr(href) ") ";
  3995. }
  3996. #content a.autonumber.external::after {
  3997. content: " (" attr(href) ") ";
  3998. }
  3999. #globalWrapper {
  4000. width: 100% !important; min-width: 0px !important;
  4001. }
  4002. #content {
  4003. background: white; color: black;
  4004. }
  4005. #column-content {
  4006. margin: 0px !important;
  4007. }
  4008. #column-content #content {
  4009. margin: 0px !important; padding: 1em;
  4010. }
  4011. a {
  4012. color: black !important; text-decoration: none !important;
  4013. }
  4014. a.external {
  4015. color: black !important; text-decoration: none !important;
  4016. }
  4017. a.new {
  4018. color: black !important; text-decoration: none !important;
  4019. }
  4020. a.stub {
  4021. color: black !important; text-decoration: none !important;
  4022. }
  4023. a {
  4024. color: inherit !important; text-decoration: inherit !important;
  4025. }
  4026. a.external {
  4027. color: inherit !important; text-decoration: inherit !important;
  4028. }
  4029. a.new {
  4030. color: inherit !important; text-decoration: inherit !important;
  4031. }
  4032. a.stub {
  4033. color: inherit !important; text-decoration: inherit !important;
  4034. }
  4035. img {
  4036. border: currentColor;
  4037. }
  4038. img.tex {
  4039. vertical-align: middle;
  4040. }
  4041. span.texhtml {
  4042. font-family: serif;
  4043. }
  4044. #siteNotice {
  4045. display: none;
  4046. }
  4047. div.gallerybox {
  4048. border: 1px solid rgb(204, 204, 204); width: 150px; background-color: =
  4049. rgb(249, 249, 249);
  4050. }
  4051. div.gallerytext {
  4052. overflow: visible;
  4053. }
  4054. table.diff {
  4055. background: white;
  4056. }
  4057. td.diff-otitle {
  4058. background: rgb(255, 255, 255);
  4059. }
  4060. td.diff-ntitle {
  4061. background: rgb(255, 255, 255);
  4062. }
  4063. td.diff-addedline {
  4064. background: rgb(204, 255, 204); border: 2px solid black; font-size: =
  4065. smaller;
  4066. }
  4067. td.diff-deletedline {
  4068. background: rgb(255, 255, 170); border: 2px dotted black; font-size: =
  4069. smaller;
  4070. }
  4071. td.diff-context {
  4072. background: rgb(238, 238, 238); font-size: smaller;
  4073. }
  4074. .diffchange {
  4075. color: silver; font-weight: bold; text-decoration: underline;
  4076. }
  4077. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  4078. Content-Type: text/css;
  4079. charset="iso-8859-1"
  4080. Content-Transfer-Encoding: quoted-printable
  4081. Content-Location: http://wiki.theory.org/skins/monobook/main.css?270
  4082. #column-content {
  4083. margin: 0px 0px 0.6em -12.2em; padding: 0px; width: 100%; float: right;
  4084. }
  4085. #content {
  4086. margin: 2.8em 0px 0px 12.2em; padding: 0px 1em 1em; position: relative; =
  4087. z-index: 2;
  4088. }
  4089. #column-one {
  4090. padding-top: 160px;
  4091. }
  4092. #content {
  4093. background: white; border-width: 1px medium 1px 1px; border-style: =
  4094. solid none solid solid; border-color: rgb(170, 170, 170) currentColor =
  4095. rgb(170, 170, 170) rgb(170, 170, 170); color: black; line-height: 1.5em;
  4096. }
  4097. body {
  4098. background: url("headbg.jpg") no-repeat 0px 0px rgb(249, 249, 249); =
  4099. font: x-small/normal sans-serif; margin: 0px; padding: 0px; color: =
  4100. black; font-size-adjust: none; font-stretch: normal;
  4101. }
  4102. #globalWrapper {
  4103. margin: 0px; padding: 0px; width: 100%; font-size: 127%;
  4104. }
  4105. table {
  4106. color: black; font-size: 100%; background-color: white;
  4107. }
  4108. fieldset table {
  4109. =09
  4110. }
  4111. a {
  4112. color: rgb(0, 43, 184); text-decoration: none;
  4113. }
  4114. a:visited {
  4115. color: rgb(90, 54, 150);
  4116. }
  4117. a:active {
  4118. color: rgb(250, 167, 0);
  4119. }
  4120. a:hover {
  4121. text-decoration: underline;
  4122. }
  4123. a.stub {
  4124. color: rgb(119, 34, 51);
  4125. }
  4126. a.new {
  4127. color: rgb(186, 0, 0);
  4128. }
  4129. #p-personal a.new {
  4130. color: rgb(186, 0, 0);
  4131. }
  4132. a.new:visited {
  4133. color: rgb(165, 88, 88);
  4134. }
  4135. #p-personal a.new:visited {
  4136. color: rgb(165, 88, 88);
  4137. }
  4138. img {
  4139. border: currentColor; vertical-align: middle;
  4140. }
  4141. p {
  4142. margin: 0.4em 0px 0.5em; line-height: 1.5em;
  4143. }
  4144. p img {
  4145. margin: 0px;
  4146. }
  4147. hr {
  4148. margin: 0.2em 0px; border: 0px currentColor; height: 1px; color: =
  4149. rgb(170, 170, 170); background-color: rgb(170, 170, 170);
  4150. }
  4151. h1 {
  4152. margin: 0px; color: black; padding-top: 0.5em; padding-bottom: 0.17em; =
  4153. font-weight: normal; border-bottom-color: rgb(170, 170, 170); =
  4154. border-bottom-width: 1px; border-bottom-style: solid;
  4155. }
  4156. h2 {
  4157. margin: 0px; color: black; padding-top: 0.5em; padding-bottom: 0.17em; =
  4158. font-weight: normal; border-bottom-color: rgb(170, 170, 170); =
  4159. border-bottom-width: 1px; border-bottom-style: solid;
  4160. }
  4161. h3 {
  4162. margin: 0px; color: black; padding-top: 0.5em; padding-bottom: 0.17em; =
  4163. font-weight: normal; border-bottom-color: rgb(170, 170, 170); =
  4164. border-bottom-width: 1px; border-bottom-style: solid;
  4165. }
  4166. h4 {
  4167. margin: 0px; color: black; padding-top: 0.5em; padding-bottom: 0.17em; =
  4168. font-weight: normal; border-bottom-color: rgb(170, 170, 170); =
  4169. border-bottom-width: 1px; border-bottom-style: solid;
  4170. }
  4171. h5 {
  4172. margin: 0px; color: black; padding-top: 0.5em; padding-bottom: 0.17em; =
  4173. font-weight: normal; border-bottom-color: rgb(170, 170, 170); =
  4174. border-bottom-width: 1px; border-bottom-style: solid;
  4175. }
  4176. h6 {
  4177. margin: 0px; color: black; padding-top: 0.5em; padding-bottom: 0.17em; =
  4178. font-weight: normal; border-bottom-color: rgb(170, 170, 170); =
  4179. border-bottom-width: 1px; border-bottom-style: solid;
  4180. }
  4181. h1 {
  4182. font-size: 188%;
  4183. }
  4184. h1 .editsection {
  4185. font-size: 53%;
  4186. }
  4187. h2 {
  4188. font-size: 150%;
  4189. }
  4190. h2 .editsection {
  4191. font-size: 67%;
  4192. }
  4193. h3 {
  4194. font-weight: bold; border-bottom-color: currentColor; =
  4195. border-bottom-width: medium; border-bottom-style: none;
  4196. }
  4197. h4 {
  4198. font-weight: bold; border-bottom-color: currentColor; =
  4199. border-bottom-width: medium; border-bottom-style: none;
  4200. }
  4201. h5 {
  4202. font-weight: bold; border-bottom-color: currentColor; =
  4203. border-bottom-width: medium; border-bottom-style: none;
  4204. }
  4205. h6 {
  4206. font-weight: bold; border-bottom-color: currentColor; =
  4207. border-bottom-width: medium; border-bottom-style: none;
  4208. }
  4209. h3 {
  4210. font-size: 132%;
  4211. }
  4212. h3 .editsection {
  4213. font-size: 76%; font-weight: normal;
  4214. }
  4215. h4 {
  4216. font-size: 116%;
  4217. }
  4218. h4 .editsection {
  4219. font-size: 86%; font-weight: normal;
  4220. }
  4221. h5 {
  4222. font-size: 100%;
  4223. }
  4224. h5 .editsection {
  4225. font-weight: normal;
  4226. }
  4227. h6 {
  4228. font-size: 80%;
  4229. }
  4230. h6 .editsection {
  4231. font-size: 125%; font-weight: normal;
  4232. }
  4233. ul {
  4234. margin: 0.3em 0px 0px 1.5em; padding: 0px; line-height: 1.5em; =
  4235. list-style-type: square; list-style-image: url("bullet.gif");
  4236. }
  4237. ol {
  4238. margin: 0.3em 0px 0px 3.2em; padding: 0px; line-height: 1.5em; =
  4239. list-style-image: none;
  4240. }
  4241. li {
  4242. margin-bottom: 0.1em;
  4243. }
  4244. dt {
  4245. font-weight: bold; margin-bottom: 0.1em;
  4246. }
  4247. dl {
  4248. margin-top: 0.2em; margin-bottom: 0.5em;
  4249. }
  4250. dd {
  4251. line-height: 1.5em; margin-bottom: 0.1em; margin-left: 2em;
  4252. }
  4253. fieldset {
  4254. margin: 1em 0px; padding: 0px 1em 1em; border: 1px solid rgb(47, 111, =
  4255. 171); line-height: 1.5em;
  4256. }
  4257. fieldset.nested {
  4258. margin: 0px 0px 0.5em; padding: 0px 0.5em 0.5em;
  4259. }
  4260. legend {
  4261. padding: 0.5em; font-size: 95%;
  4262. }
  4263. form {
  4264. margin: 0px; border: currentColor;
  4265. }
  4266. textarea {
  4267. padding: 0.1em; width: 100%;
  4268. }
  4269. input.historysubmit {
  4270. padding: 0px 0.3em 0.3em !important; height: 1.7em !important; =
  4271. font-size: 94%; margin-left: 1.6em; cursor: pointer;
  4272. }
  4273. select {
  4274. vertical-align: top;
  4275. }
  4276. abbr {
  4277. color: black; border-bottom-color: black; border-bottom-width: 1px; =
  4278. border-bottom-style: dotted; cursor: help;
  4279. }
  4280. acronym {
  4281. color: black; border-bottom-color: black; border-bottom-width: 1px; =
  4282. border-bottom-style: dotted; cursor: help;
  4283. }
  4284. .explain {
  4285. color: black; border-bottom-color: black; border-bottom-width: 1px; =
  4286. border-bottom-style: dotted; cursor: help;
  4287. }
  4288. q {
  4289. font-family: Times, "Times New Roman", serif; font-style: italic;
  4290. }
  4291. code {
  4292. background-color: rgb(249, 249, 249);
  4293. }
  4294. pre {
  4295. padding: 1em; border: 1px dashed rgb(47, 111, 171); color: black; =
  4296. line-height: 1.1em; background-color: rgb(249, 249, 249);
  4297. }
  4298. #siteSub {
  4299. display: none;
  4300. }
  4301. #jump-to-nav {
  4302. display: none;
  4303. }
  4304. #contentSub {
  4305. margin: 0px 0px 1.4em 1em; width: auto; color: rgb(125, 125, 125); =
  4306. line-height: 1.2em; font-size: 84%;
  4307. }
  4308. #contentSub2 {
  4309. margin: 0px 0px 1.4em 1em; width: auto; color: rgb(125, 125, 125); =
  4310. line-height: 1.2em; font-size: 84%;
  4311. }
  4312. span.subpages {
  4313. display: block;
  4314. }
  4315. #bodyContent h1 {
  4316. margin-bottom: 0.6em;
  4317. }
  4318. #bodyContent h2 {
  4319. margin-bottom: 0.6em;
  4320. }
  4321. #bodyContent h3 {
  4322. margin-bottom: 0.3em;
  4323. }
  4324. #bodyContent h4 {
  4325. margin-bottom: 0.3em;
  4326. }
  4327. #bodyContent h5 {
  4328. margin-bottom: 0.3em;
  4329. }
  4330. #firstHeading {
  4331. line-height: 1.2em; padding-bottom: 0px; margin-bottom: 0.1em;
  4332. }
  4333. .usermessage {
  4334. margin: 2em 0px 1em; padding: 0.5em 1em; border: 1px solid rgb(255, =
  4335. 165, 0); color: black; font-weight: bold; vertical-align: middle; =
  4336. background-color: rgb(255, 206, 123);
  4337. }
  4338. #siteNotice {
  4339. padding: 0px 0.9em; text-align: center; font-size: 95%;
  4340. }
  4341. #siteNotice p {
  4342. margin: 0px; padding: 0px;
  4343. }
  4344. .catlinks {
  4345. padding: 5px; border: 1px solid rgb(170, 170, 170); clear: both; =
  4346. margin-top: 1em; background-color: rgb(249, 249, 249);
  4347. }
  4348. .documentDescription {
  4349. margin: 1em 0px; line-height: 1.5em; font-weight: bold; display: block;
  4350. }
  4351. .documentByLine {
  4352. text-align: right; color: rgb(118, 121, 124); clear: both; font-size: =
  4353. 90%; font-weight: normal;
  4354. }
  4355. .center {
  4356. width: 100%; text-align: center;
  4357. }
  4358. *.center * {
  4359. margin-right: auto; margin-left: auto;
  4360. }
  4361. .small {
  4362. font-size: 94%;
  4363. }
  4364. .small * {
  4365. font-size: 94%;
  4366. }
  4367. table.small {
  4368. font-size: 100%;
  4369. }
  4370. #toc {
  4371. padding: 5px; border: 1px solid rgb(170, 170, 170); font-size: 95%; =
  4372. background-color: rgb(249, 249, 249);
  4373. }
  4374. .toc {
  4375. padding: 5px; border: 1px solid rgb(170, 170, 170); font-size: 95%; =
  4376. background-color: rgb(249, 249, 249);
  4377. }
  4378. .mw-warning {
  4379. padding: 5px; border: 1px solid rgb(170, 170, 170); font-size: 95%; =
  4380. background-color: rgb(249, 249, 249);
  4381. }
  4382. #toc h2 {
  4383. padding: 0px; border: currentColor; font-size: 100%; font-weight: bold; =
  4384. display: inline;
  4385. }
  4386. .toc h2 {
  4387. padding: 0px; border: currentColor; font-size: 100%; font-weight: bold; =
  4388. display: inline;
  4389. }
  4390. #toc #toctitle {
  4391. text-align: center;
  4392. }
  4393. .toc #toctitle {
  4394. text-align: center;
  4395. }
  4396. #toc .toctitle {
  4397. text-align: center;
  4398. }
  4399. .toc .toctitle {
  4400. text-align: center;
  4401. }
  4402. #toc ul {
  4403. text-align: left; padding-left: 0px; margin-left: 0px; list-style-type: =
  4404. none; list-style-image: none;
  4405. }
  4406. .toc ul {
  4407. text-align: left; padding-left: 0px; margin-left: 0px; list-style-type: =
  4408. none; list-style-image: none;
  4409. }
  4410. #toc ul ul {
  4411. margin: 0px 0px 0px 2em;
  4412. }
  4413. .toc ul ul {
  4414. margin: 0px 0px 0px 2em;
  4415. }
  4416. #toc .toctoggle {
  4417. font-size: 94%;
  4418. }
  4419. .toc .toctoggle {
  4420. font-size: 94%;
  4421. }
  4422. .mw-warning {
  4423. text-align: center; margin-right: 50px; margin-left: 50px;
  4424. }
  4425. div.floatright {
  4426. margin: 0px 0px 0.5em 0.5em; border: 0px currentColor; clear: right; =
  4427. float: right; position: relative;
  4428. }
  4429. table.floatright {
  4430. margin: 0px 0px 0.5em 0.5em; border: 0px currentColor; clear: right; =
  4431. float: right; position: relative;
  4432. }
  4433. div.floatright p {
  4434. font-style: italic;
  4435. }
  4436. div.floatleft {
  4437. margin: 0px 0.5em 0.5em 0px; border: 0px currentColor; clear: left; =
  4438. float: left; position: relative;
  4439. }
  4440. table.floatleft {
  4441. margin: 0px 0.5em 0.5em 0px; border: 0px currentColor; clear: left; =
  4442. float: left; position: relative;
  4443. }
  4444. div.floatleft p {
  4445. font-style: italic;
  4446. }
  4447. div.thumb {
  4448. border-style: solid; border-color: white; width: auto; margin-bottom: =
  4449. 0.5em;
  4450. }
  4451. div.thumbinner {
  4452. padding: 3px !important; border: 1px solid rgb(204, 204, 204); =
  4453. text-align: center; overflow: hidden; font-size: 94%; background-color: =
  4454. rgb(249, 249, 249);
  4455. }
  4456. html .thumbimage {
  4457. border: 1px solid rgb(204, 204, 204);
  4458. }
  4459. html .thumbcaption {
  4460. padding: 3px !important; border: currentColor; text-align: left; =
  4461. line-height: 1.4em; font-size: 94%;
  4462. }
  4463. div.magnify {
  4464. border: currentColor !important; float: right;
  4465. }
  4466. div.magnify a {
  4467. border: currentColor !important; display: block;
  4468. }
  4469. div.magnify img {
  4470. border: currentColor !important; display: block;
  4471. }
  4472. div.tright {
  4473. border-width: 0.5em 0px 0.8em 1.4em; clear: right; float: right;
  4474. }
  4475. div.tleft {
  4476. border-width: 0.5em 1.4em 0.8em 0px; clear: left; margin-right: 0.5em; =
  4477. float: left;
  4478. }
  4479. img.thumbborder {
  4480. border: 1px solid rgb(221, 221, 221);
  4481. }
  4482. .hiddenStructure {
  4483. display: none;
  4484. }
  4485. table.rimage {
  4486. text-align: center; margin-bottom: 1em; margin-left: 1em; float: right; =
  4487. position: relative;
  4488. }
  4489. .toccolours {
  4490. padding: 5px; border: 1px solid rgb(170, 170, 170); font-size: 95%; =
  4491. background-color: rgb(249, 249, 249);
  4492. }
  4493. .special li {
  4494. margin: 0px; padding: 0px; line-height: 1.4em;
  4495. }
  4496. #bodyContent a.external {
  4497. background: url("external.png") no-repeat right; padding: 0px 13px;
  4498. }
  4499. #bodyContent a[href^=3D'gopher://'].external {
  4500. background: url("external.png") no-repeat right; padding: 0px 13px;
  4501. }
  4502. .rtl #bodyContent a.external {
  4503. background-image: url("external-rtl.png");
  4504. }
  4505. .rtl #bodyContent a[href^=3D'gopher://'].external {
  4506. background-image: url("external-rtl.png");
  4507. }
  4508. #bodyContent a[href^=3D'https://'].external {
  4509. background: url("lock_icon.gif") no-repeat right; padding: 0px 16px;
  4510. }
  4511. .link-https {
  4512. background: url("lock_icon.gif") no-repeat right; padding: 0px 16px;
  4513. }
  4514. #bodyContent a[href^=3D'mailto:'].external {
  4515. background: url("mail_icon.gif") no-repeat right; padding: 0px 18px;
  4516. }
  4517. .link-mailto {
  4518. background: url("mail_icon.gif") no-repeat right; padding: 0px 18px;
  4519. }
  4520. #bodyContent a[href^=3D'news://'].external {
  4521. background: url("news_icon.png") no-repeat right; padding: 0px 18px;
  4522. }
  4523. #bodyContent a[href^=3D'ftp://'].external {
  4524. background: url("file_icon.gif") no-repeat right; padding: 0px 18px;
  4525. }
  4526. .link-ftp {
  4527. background: url("file_icon.gif") no-repeat right; padding: 0px 18px;
  4528. }
  4529. #bodyContent a[href^=3D'irc://'].external {
  4530. background: url("discussionitem_icon.gif") no-repeat right; padding: =
  4531. 0px 18px;
  4532. }
  4533. .link-irc {
  4534. background: url("discussionitem_icon.gif") no-repeat right; padding: =
  4535. 0px 18px;
  4536. }
  4537. #bodyContent a[href$=3D'.ogg'].external {
  4538. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4539. }
  4540. #bodyContent a[href$=3D'.OGG'].external {
  4541. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4542. }
  4543. #bodyContent a[href$=3D'.mid'].external {
  4544. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4545. }
  4546. #bodyContent a[href$=3D'.MID'].external {
  4547. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4548. }
  4549. #bodyContent a[href$=3D'.midi'].external {
  4550. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4551. }
  4552. #bodyContent a[href$=3D'.MIDI'].external {
  4553. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4554. }
  4555. #bodyContent a[href$=3D'.mp3'].external {
  4556. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4557. }
  4558. #bodyContent a[href$=3D'.MP3'].external {
  4559. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4560. }
  4561. #bodyContent a[href$=3D'.wav'].external {
  4562. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4563. }
  4564. #bodyContent a[href$=3D'.WAV'].external {
  4565. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4566. }
  4567. #bodyContent a[href$=3D'.wma'].external {
  4568. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4569. }
  4570. #bodyContent a[href$=3D'.WMA'].external {
  4571. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4572. }
  4573. .link-audio {
  4574. background: url("audio.png") no-repeat right; padding: 0px 13px;
  4575. }
  4576. #bodyContent a[href$=3D'.ogm'].external {
  4577. background: url("video.png") no-repeat right; padding: 0px 13px;
  4578. }
  4579. #bodyContent a[href$=3D'.OGM'].external {
  4580. background: url("video.png") no-repeat right; padding: 0px 13px;
  4581. }
  4582. #bodyContent a[href$=3D'.avi'].external {
  4583. background: url("video.png") no-repeat right; padding: 0px 13px;
  4584. }
  4585. #bodyContent a[href$=3D'.AVI'].external {
  4586. background: url("video.png") no-repeat right; padding: 0px 13px;
  4587. }
  4588. #bodyContent a[href$=3D'.mpeg'].external {
  4589. background: url("video.png") no-repeat right; padding: 0px 13px;
  4590. }
  4591. #bodyContent a[href$=3D'.MPEG'].external {
  4592. background: url("video.png") no-repeat right; padding: 0px 13px;
  4593. }
  4594. #bodyContent a[href$=3D'.mpg'].external {
  4595. background: url("video.png") no-repeat right; padding: 0px 13px;
  4596. }
  4597. #bodyContent a[href$=3D'.MPG'].external {
  4598. background: url("video.png") no-repeat right; padding: 0px 13px;
  4599. }
  4600. .link-video {
  4601. background: url("video.png") no-repeat right; padding: 0px 13px;
  4602. }
  4603. #bodyContent a[href$=3D'.pdf'].external {
  4604. background: url("document.png") no-repeat right; padding: 0px 12px;
  4605. }
  4606. #bodyContent a[href$=3D'.PDF'].external {
  4607. background: url("document.png") no-repeat right; padding: 0px 12px;
  4608. }
  4609. #bodyContent a[href*=3D'.pdf#'].external {
  4610. background: url("document.png") no-repeat right; padding: 0px 12px;
  4611. }
  4612. #bodyContent a[href*=3D'.PDF#'].external {
  4613. background: url("document.png") no-repeat right; padding: 0px 12px;
  4614. }
  4615. #bodyContent a[href*=3D'.pdf?'].external {
  4616. background: url("document.png") no-repeat right; padding: 0px 12px;
  4617. }
  4618. #bodyContent a[href*=3D'.PDF?'].external {
  4619. background: url("document.png") no-repeat right; padding: 0px 12px;
  4620. }
  4621. .link-document {
  4622. background: url("document.png") no-repeat right; padding: 0px 12px;
  4623. }
  4624. .rtl #bodyContent a.external {
  4625. background-position: left; padding-right: 0px;
  4626. }
  4627. .rtl a.feedlink {
  4628. background-position: right; padding-right: 16px; padding-left: 0px;
  4629. }
  4630. .ltr #bodyContent a.external {
  4631. padding-left: 0px;
  4632. }
  4633. #bodyContent a.extiw {
  4634. color: rgb(51, 102, 187);
  4635. }
  4636. #bodyContent a.extiw:active {
  4637. color: rgb(51, 102, 187);
  4638. }
  4639. #bodyContent a.external {
  4640. color: rgb(51, 102, 187);
  4641. }
  4642. .portlet {
  4643. margin: 0px 0px 0.5em; padding: 0px; border: currentColor; width: =
  4644. 11.6em; overflow: hidden; float: none;
  4645. }
  4646. .portlet h4 {
  4647. font-size: 95%; font-weight: normal; white-space: nowrap;
  4648. }
  4649. .portlet h5 {
  4650. padding: 0px 1em 0px 0.5em; height: 1em; text-transform: lowercase; =
  4651. font-size: 91%; font-weight: normal; display: inline; white-space: =
  4652. nowrap;
  4653. }
  4654. .portlet h6 {
  4655. background: rgb(255, 174, 46); border-width: 1px; border-style: solid =
  4656. solid none; border-color: rgb(47, 111, 171); padding: 0px 1em; height: =
  4657. 1.2em; text-transform: lowercase; font-size: 1em; font-weight: normal; =
  4658. display: block; white-space: nowrap;
  4659. }
  4660. .pBody {
  4661. padding: 0px 0.8em 0.3em 0.5em; border: 1px solid rgb(170, 170, 170); =
  4662. color: black; font-size: 95%; border-collapse: collapse; =
  4663. background-color: white;
  4664. }
  4665. .portlet h1 {
  4666. margin: 0px; padding: 0px;
  4667. }
  4668. .portlet h2 {
  4669. margin: 0px; padding: 0px;
  4670. }
  4671. .portlet h3 {
  4672. margin: 0px; padding: 0px;
  4673. }
  4674. .portlet h4 {
  4675. margin: 0px; padding: 0px;
  4676. }
  4677. .portlet ul {
  4678. line-height: 1.5em; font-size: 95%; list-style-type: square; =
  4679. list-style-image: url("bullet.gif");
  4680. }
  4681. .portlet li {
  4682. margin: 0px; padding: 0px;
  4683. }
  4684. #p-logo {
  4685. left: 0px; top: 0px; width: 12em; height: 155px; overflow: visible; =
  4686. position: absolute; z-index: 3;
  4687. }
  4688. #p-logo h5 {
  4689. display: none;
  4690. }
  4691. #p-logo a {
  4692. background-position: 35% 50% !important; width: 12.2em; height: 155px; =
  4693. text-decoration: none; display: block; background-repeat: no-repeat;
  4694. }
  4695. #p-logo a:hover {
  4696. background-position: 35% 50% !important; width: 12.2em; height: 155px; =
  4697. text-decoration: none; display: block; background-repeat: no-repeat;
  4698. }
  4699. #p-search {
  4700. position: relative; z-index: 3;
  4701. }
  4702. input.searchButton {
  4703. font-size: 95%; margin-top: 1px;
  4704. }
  4705. #searchGoButton {
  4706. padding-right: 0.5em; padding-left: 0.5em; font-weight: bold;
  4707. }
  4708. #searchInput {
  4709. margin: 0px; width: 10.9em; font-size: 95%;
  4710. }
  4711. #p-search .pBody {
  4712. padding: 0.5em 0.4em 0.4em; text-align: center;
  4713. }
  4714. #p-search #searchform div div {
  4715. font-size: 95%; margin-top: 0.4em;
  4716. }
  4717. #p-personal {
  4718. left: 0px; top: 0px; position: absolute; z-index: 0;
  4719. }
  4720. #p-personal {
  4721. margin: 0px; padding: 0px; border: currentColor; width: 100%; =
  4722. line-height: 1.2em; overflow: visible; white-space: nowrap;
  4723. }
  4724. #p-personal h5 {
  4725. display: none;
  4726. }
  4727. #p-personal .portlet {
  4728. margin: 0px; padding: 0px; border: currentColor; overflow: visible; =
  4729. z-index: 0;
  4730. }
  4731. #p-personal .pBody {
  4732. margin: 0px; padding: 0px; border: currentColor; overflow: visible; =
  4733. z-index: 0;
  4734. }
  4735. #p-personal ul {
  4736. list-style: none; margin: 0px; padding: 0px 2em 0px 3em; border: =
  4737. currentColor; text-align: right; color: rgb(47, 111, 171); line-height: =
  4738. 1.4em; z-index: 0; cursor: default;
  4739. }
  4740. #p-personal li {
  4741. padding: 0px; border: currentColor; color: rgb(47, 111, 171); =
  4742. line-height: 1.2em; margin-left: 1em; display: inline; z-index: 0;
  4743. }
  4744. #p-personal li a {
  4745. color: rgb(0, 88, 150); padding-bottom: 0.2em; text-decoration: none;
  4746. }
  4747. #p-personal li a:hover {
  4748. padding-bottom: 0.2em; text-decoration: none; background-color: white;
  4749. }
  4750. #p-personal li.active a:hover {
  4751. background-color: transparent;
  4752. }
  4753. li#pt-userpage {
  4754. background: url("user.gif") no-repeat left top; text-transform: none; =
  4755. padding-left: 20px;
  4756. }
  4757. li#pt-anonuserpage {
  4758. background: url("user.gif") no-repeat left top; text-transform: none; =
  4759. padding-left: 20px;
  4760. }
  4761. li#pt-login {
  4762. background: url("user.gif") no-repeat left top; text-transform: none; =
  4763. padding-left: 20px;
  4764. }
  4765. #p-personal ul {
  4766. text-transform: lowercase;
  4767. }
  4768. #p-personal li.active {
  4769. font-weight: bold;
  4770. }
  4771. #p-cactions {
  4772. list-style: none; margin: 0px; left: 11.5em; top: 1.3em; width: 76%; =
  4773. line-height: 1.1em; overflow: visible; padding-left: 1em; font-size: =
  4774. 95%; white-space: nowrap; border-collapse: collapse; position: absolute;
  4775. }
  4776. #p-cactions ul {
  4777. list-style: none;
  4778. }
  4779. #p-cactions li {
  4780. background: white; border-width: 1px 1px medium; border-style: solid =
  4781. solid none; border-color: rgb(170, 170, 170) rgb(170, 170, 170) =
  4782. currentColor; margin: 0px 0.3em 0px 0px; padding: 0px 0px 0.1em; =
  4783. overflow: visible; display: inline;
  4784. }
  4785. #p-cactions li.selected {
  4786. border-color: rgb(250, 189, 35); padding: 0px 0px 0.2em; font-weight: =
  4787. bold;
  4788. }
  4789. #p-cactions li a {
  4790. margin: 0px; padding: 0px 0.8em 0.3em; border: currentColor; color: =
  4791. rgb(0, 43, 184); text-decoration: none; position: relative; z-index: 0; =
  4792. background-color: rgb(251, 251, 251);
  4793. }
  4794. #p-cactions li.selected a {
  4795. padding: 0px 1em 0.2em !important; z-index: 3; background-color: white;
  4796. }
  4797. #p-cactions .new a {
  4798. color: rgb(186, 0, 0);
  4799. }
  4800. #p-cactions li a:hover {
  4801. text-decoration: none; z-index: 3; background-color: white;
  4802. }
  4803. #p-cactions h5 {
  4804. display: none;
  4805. }
  4806. #p-cactions li.istalk {
  4807. margin-right: 0px;
  4808. }
  4809. #p-cactions li.istalk a {
  4810. padding-right: 0.5em;
  4811. }
  4812. #p-cactions #ca-addsection a {
  4813. padding-right: 0.4em; padding-left: 0.4em;
  4814. }
  4815. li#ca-talk {
  4816. margin-right: 1.6em;
  4817. }
  4818. li#ca-watch {
  4819. margin-left: 1.6em;
  4820. }
  4821. li#ca-unwatch {
  4822. margin-left: 1.6em;
  4823. }
  4824. li#ca-varlang-0 {
  4825. margin-left: 1.6em;
  4826. }
  4827. li#ca-print {
  4828. margin-left: 1.6em;
  4829. }
  4830. #p-cactions .pBody {
  4831. padding: 0px; border: 0px currentColor; color: inherit; font-size: 1em; =
  4832. border-collapse: inherit; background-color: transparent;
  4833. }
  4834. #p-cactions .hiddenStructure {
  4835. display: none;
  4836. }
  4837. #p-cactions li a {
  4838. text-transform: lowercase;
  4839. }
  4840. #p-lang {
  4841. position: relative; z-index: 3;
  4842. }
  4843. .capitalize-all-nouns .portlet h5 {
  4844. text-transform: none;
  4845. }
  4846. .capitalize-all-nouns .portlet h6 {
  4847. text-transform: none;
  4848. }
  4849. .capitalize-all-nouns #p-personal ul {
  4850. text-transform: none;
  4851. }
  4852. .capitalize-all-nouns #p-cactions ul li a {
  4853. text-transform: none;
  4854. }
  4855. #t-ispermalink {
  4856. color: rgb(153, 153, 153);
  4857. }
  4858. #t-iscite {
  4859. color: rgb(153, 153, 153);
  4860. }
  4861. #footer {
  4862. margin: 0.6em 0px 1em; padding: 0.4em 0px 1.2em; text-align: center; =
  4863. font-size: 90%; border-top-color: rgb(250, 189, 35); =
  4864. border-bottom-color: rgb(250, 189, 35); border-top-width: 1px; =
  4865. border-bottom-width: 1px; border-top-style: solid; border-bottom-style: =
  4866. solid; background-color: white;
  4867. }
  4868. #footer li {
  4869. margin: 0px 1.3em; display: inline;
  4870. }
  4871. #f-poweredbyico {
  4872. margin: 0px 8px; top: -2px; position: relative;
  4873. }
  4874. #f-copyrightico {
  4875. margin: 0px 8px; top: -2px; position: relative;
  4876. }
  4877. #f-poweredbyico {
  4878. height: 1%; float: right;
  4879. }
  4880. #f-copyrightico {
  4881. height: 1%; float: left;
  4882. }
  4883. .mw-htmlform-submit {
  4884. padding-right: 0.3em; padding-left: 0.3em; font-weight: bold; =
  4885. margin-right: 2em;
  4886. }
  4887. #preftoc {
  4888. margin: 0px; padding: 0px; width: 100%; clear: both;
  4889. }
  4890. #preftoc li {
  4891. color: rgb(0, 0, 0); background-color: rgb(240, 240, 240);
  4892. }
  4893. #preftoc li {
  4894. border-width: 1px 1px 0px; border-style: solid solid none; =
  4895. border-color: rgb(255, 255, 255) rgb(113, 111, 100) currentColor =
  4896. rgb(255, 255, 255); margin: 1px -2px 1px 2px; padding: 2px 0px 3px; =
  4897. float: left; list-style-type: none; list-style-image: none; white-space: =
  4898. nowrap; position: relative; z-index: 3;
  4899. }
  4900. #preftoc li.selected {
  4901. border-width: 1px 1px medium; border-style: solid solid none; =
  4902. border-color: rgb(170, 170, 170) rgb(170, 170, 170) currentColor; top: =
  4903. 1px; padding-top: 2px; font-weight: bold; margin-right: -3px; cursor: =
  4904. default; background-color: rgb(249, 249, 249);
  4905. }
  4906. #preftoc > li.selected {
  4907. top: 2px;
  4908. }
  4909. #preftoc a {
  4910. padding: 0px 0.7em; color: rgb(0, 0, 0); text-decoration: none; =
  4911. display: block; position: relative;
  4912. }
  4913. #preftoc a:active {
  4914. padding: 0px 0.7em; color: rgb(0, 0, 0); text-decoration: none; =
  4915. display: block; position: relative;
  4916. }
  4917. #preftoc li.selected a {
  4918. text-decoration: none; cursor: default;
  4919. }
  4920. #preferences {
  4921. margin: 0px; padding: 1.5em; border: 1px solid rgb(170, 170, 170); =
  4922. clear: both; background-color: rgb(249, 249, 249);
  4923. }
  4924. .prefsection {
  4925. margin: 0px; padding: 0px; border: currentColor;
  4926. }
  4927. .prefsection legend {
  4928. font-weight: bold;
  4929. }
  4930. .prefsection table {
  4931. background-color: rgb(249, 249, 249);
  4932. }
  4933. .prefsection legend {
  4934. background-color: rgb(249, 249, 249);
  4935. }
  4936. .mainLegend {
  4937. display: none;
  4938. }
  4939. td.htmlform-tip {
  4940. padding: 0.2em 2em; color: rgb(102, 102, 102); font-size: x-small;
  4941. }
  4942. .preferences-login {
  4943. clear: both; margin-bottom: 1.5em;
  4944. }
  4945. .prefcache {
  4946. font-size: 90%; margin-top: 2em;
  4947. }
  4948. div#userloginForm form {
  4949. margin: 0px 3em 1em 0px; padding: 1.5em 2em; border: 1px solid rgb(170, =
  4950. 170, 170); clear: both; float: left; background-color: rgb(249, 249, =
  4951. 249);
  4952. }
  4953. div#userlogin form#userlogin2 {
  4954. margin: 0px 3em 1em 0px; padding: 1.5em 2em; border: 1px solid rgb(170, =
  4955. 170, 170); clear: both; float: left; background-color: rgb(249, 249, =
  4956. 249);
  4957. }
  4958. .rtl div#userloginForm form {
  4959. float: right;
  4960. }
  4961. .rtl div#userlogin form#userlogin2 {
  4962. float: right;
  4963. }
  4964. div#userloginForm table {
  4965. background-color: rgb(249, 249, 249);
  4966. }
  4967. div#userlogin form#userlogin2 table {
  4968. background-color: rgb(249, 249, 249);
  4969. }
  4970. div#userloginForm h2 {
  4971. padding-top: 0px;
  4972. }
  4973. div#userlogin form#userlogin2 h2 {
  4974. padding-top: 0px;
  4975. }
  4976. div#userlogin .captcha {
  4977. padding: 1.5em 2em; border: 1px solid rgb(187, 187, 187); =
  4978. background-color: white;
  4979. }
  4980. div#userloginForm .captcha {
  4981. padding: 1.5em 2em; border: 1px solid rgb(187, 187, 187); =
  4982. background-color: white;
  4983. }
  4984. #loginend {
  4985. clear: both;
  4986. }
  4987. #signupend {
  4988. clear: both;
  4989. }
  4990. #userloginprompt {
  4991. font-size: 85%;
  4992. }
  4993. #languagelinks {
  4994. font-size: 85%;
  4995. }
  4996. #login-sectiontip {
  4997. line-height: 1.2; padding-top: 2em; font-size: 85%;
  4998. }
  4999. #userlogin .loginText {
  5000. width: 12em;
  5001. }
  5002. #userlogin .loginPassword {
  5003. width: 12em;
  5004. }
  5005. #userloginlink a {
  5006. font-weight: bold;
  5007. }
  5008. #wpLoginattempt {
  5009. font-weight: bold;
  5010. }
  5011. #wpCreateaccount {
  5012. font-weight: bold;
  5013. }
  5014. * > html #p-cactions li {
  5015. border: currentColor;
  5016. }
  5017. * > html #p-cactions li a {
  5018. border-width: 1px 1px medium; border-style: solid solid none; =
  5019. border-color: rgb(170, 170, 170) rgb(170, 170, 170) currentColor;
  5020. }
  5021. * > html #p-cactions li.selected a {
  5022. border-color: rgb(250, 189, 35);
  5023. }
  5024. * > html #f-poweredbyico {
  5025. width: 88px;
  5026. }
  5027. * > html #f-copyrightico {
  5028. width: 88px;
  5029. }
  5030. * > html #bodyContent {
  5031. width: 100%; padding-bottom: 25px; overflow-x: auto;
  5032. }
  5033. * > html #bodyContent pre {
  5034. width: 100%; padding-bottom: 25px; overflow-x: auto;
  5035. }
  5036. * html #footer {
  5037. margin-top: 0px;
  5038. }
  5039. * html #column-content {
  5040. margin-bottom: 0px; display: inline;
  5041. }
  5042. * html div.editsection {
  5043. font-size: smaller;
  5044. }
  5045. #pagehistory li.selected {
  5046. position: relative;
  5047. }
  5048. * > html #column-content {
  5049. float: none;
  5050. }
  5051. * > html #column-one {
  5052. left: 0px; top: 0px; position: absolute;
  5053. }
  5054. * > html #footer {
  5055. margin-left: 13.2em;
  5056. }
  5057. .redirectText {
  5058. margin: 5px; font-size: 150%;
  5059. }
  5060. .printfooter {
  5061. display: none;
  5062. }
  5063. div.patrollink {
  5064. clear: both;
  5065. }
  5066. .sharedUploadNotice {
  5067. font-style: italic;
  5068. }
  5069. span.updatedmarker {
  5070. color: black; background-color: rgb(0, 255, 0);
  5071. }
  5072. .previewnote {
  5073. color: rgb(204, 0, 0); margin-bottom: 1em;
  5074. }
  5075. .previewnote p {
  5076. margin: 0.8em 0px; text-indent: 3em;
  5077. }
  5078. .editExternally {
  5079. padding: 3px; border: 1px solid gray; text-align: center; font-size: =
  5080. small; margin-top: 0.5em; float: left; background-color: rgb(255, 255, =
  5081. 255);
  5082. }
  5083. .editExternallyHelp {
  5084. color: gray; font-style: italic;
  5085. }
  5086. .toggle {
  5087. text-indent: -2em; margin-left: 2em;
  5088. }
  5089. input#wpSummary {
  5090. width: 80%;
  5091. }
  5092. input#wpSave {
  5093. margin-right: 0.33em;
  5094. }
  5095. input#wpDiff {
  5096. margin-right: 0.33em;
  5097. }
  5098. #wpSave {
  5099. font-weight: bold;
  5100. }
  5101. table.revisionform_default {
  5102. border: 1px solid rgb(0, 0, 0);
  5103. }
  5104. table.revisionform_focus {
  5105. border: 1px solid rgb(0, 0, 0); background-color: rgb(0, 187, 255);
  5106. }
  5107. tr.revision_tr_default {
  5108. background-color: rgb(238, 238, 238);
  5109. }
  5110. tr.revision_tr_first {
  5111. background-color: rgb(221, 221, 221);
  5112. }
  5113. p.revision_saved {
  5114. color: green; font-weight: bold;
  5115. }
  5116. div.noarticletext {
  5117. background: rgb(255, 255, 255); padding: 0.2em 1em; border: 1px solid =
  5118. rgb(204, 204, 204); color: rgb(0, 0, 0);
  5119. }
  5120. div#searchTargetContainer {
  5121. background: white; left: 10px; top: 10px; width: 90%;
  5122. }
  5123. div#searchTarget {
  5124. background: rgb(240, 240, 240); margin: 5px; padding: 3px; border: 1px =
  5125. solid blue;
  5126. }
  5127. div#searchTarget ul li {
  5128. list-style: none;
  5129. }
  5130. div#searchTarget ul li::before {
  5131. color: orange; content: "\00BB \0020";
  5132. }
  5133. div#searchTargetHide {
  5134. background: rgb(220, 220, 220); padding: 2px; border: 1px solid black; =
  5135. float: right;
  5136. }
  5137. #powersearch p {
  5138. margin-top: 0px;
  5139. }
  5140. div.multipageimagenavbox {
  5141. background: rgb(240, 240, 240); margin: 1em; padding: 4px; border: 1px =
  5142. solid silver;
  5143. }
  5144. div.multipageimagenavbox div.thumb {
  5145. border: currentColor; margin-right: 2em; margin-left: 2em;
  5146. }
  5147. div.multipageimagenavbox hr {
  5148. margin: 6px;
  5149. }
  5150. table.multipageimage td {
  5151. text-align: center;
  5152. }
  5153. .templatesUsed {
  5154. margin-top: 1.5em;
  5155. }
  5156. .mw-summary-preview {
  5157. margin: 0.1em 0px;
  5158. }
  5159. div.mw-lag-warn-normal {
  5160. margin: 3px auto; padding: 3px; text-align: center;
  5161. }
  5162. div.mw-lag-warn-high {
  5163. margin: 3px auto; padding: 3px; text-align: center;
  5164. }
  5165. div.mw-lag-warn-normal {
  5166. border: 1px solid rgb(255, 204, 102); background-color: rgb(255, 255, =
  5167. 204);
  5168. }
  5169. div.mw-lag-warn-high {
  5170. border: 2px solid rgb(255, 0, 51); font-weight: bold; background-color: =
  5171. rgb(255, 204, 204);
  5172. }
  5173. .MediaTransformError {
  5174. padding: 0.1em; background-color: rgb(204, 204, 204);
  5175. }
  5176. .MediaTransformError td {
  5177. text-align: center; font-size: 90%; vertical-align: middle;
  5178. }
  5179. .os-suggest {
  5180. font-size: 127%;
  5181. }
  5182. .no-text-transform {
  5183. text-transform: none;
  5184. }
  5185. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  5186. Content-Type: application/octet-stream
  5187. Content-Transfer-Encoding: 7bit
  5188. Content-Location: http://wiki.theory.org/index.php?title=-&action=raw&maxage=18000&gen=css
  5189. a.new {
  5190. color: rgb(204, 34, 0);
  5191. }
  5192. #quickbar a.new {
  5193. color: rgb(204, 34, 0);
  5194. }
  5195. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  5196. Content-Type: application/octet-stream
  5197. Content-Transfer-Encoding: quoted-printable
  5198. Content-Location: http://wiki.theory.org/skins/common/wikibits.js?270
  5199. // MediaWiki JavaScript support functions=0A=
  5200. =0A=
  5201. var clientPC =3D navigator.userAgent.toLowerCase(); // Get client info=0A=
  5202. var is_gecko =3D /gecko/.test( clientPC ) &&=0A=
  5203. !/khtml|spoofer|netscape\/7\.0/.test(clientPC);=0A=
  5204. var webkit_match =3D clientPC.match(/applewebkit\/(\d+)/);=0A=
  5205. if (webkit_match) {=0A=
  5206. var is_safari =3D clientPC.indexOf('applewebkit') !=3D -1 &&=0A=
  5207. clientPC.indexOf('spoofer') =3D=3D -1;=0A=
  5208. var is_safari_win =3D is_safari && clientPC.indexOf('windows') !=3D -1;=0A=
  5209. var webkit_version =3D parseInt(webkit_match[1]);=0A=
  5210. }=0A=
  5211. // For accesskeys; note that FF3+ is included here!=0A=
  5212. var is_ff2 =3D /firefox\/[2-9]|minefield\/3/.test( clientPC );=0A=
  5213. var ff2_bugs =3D /firefox\/2/.test( clientPC );=0A=
  5214. // These aren't used here, but some custom scripts rely on them=0A=
  5215. var is_ff2_win =3D is_ff2 && clientPC.indexOf('windows') !=3D -1;=0A=
  5216. var is_ff2_x11 =3D is_ff2 && clientPC.indexOf('x11') !=3D -1;=0A=
  5217. if (clientPC.indexOf('opera') !=3D -1) {=0A=
  5218. var is_opera =3D true;=0A=
  5219. var is_opera_preseven =3D window.opera && !document.childNodes;=0A=
  5220. var is_opera_seven =3D window.opera && document.childNodes;=0A=
  5221. var is_opera_95 =3D /opera\/(9\.[5-9]|[1-9][0-9])/.test( clientPC );=0A=
  5222. var opera6_bugs =3D is_opera_preseven;=0A=
  5223. var opera7_bugs =3D is_opera_seven && !is_opera_95;=0A=
  5224. var opera95_bugs =3D /opera\/(9\.5)/.test( clientPC );=0A=
  5225. }=0A=
  5226. // As recommended by =
  5227. <http://msdn.microsoft.com/en-us/library/ms537509.aspx>,=0A=
  5228. // avoiding false positives from moronic extensions that append to the =
  5229. IE UA=0A=
  5230. // string (bug 23171)=0A=
  5231. var ie6_bugs =3D false;=0A=
  5232. if ( /msie ([0-9]{1,}[\.0-9]{0,})/.exec( clientPC ) !=3D null=0A=
  5233. && parseFloat( RegExp.$1 ) <=3D 6.0 ) {=0A=
  5234. ie6_bugs =3D true;=0A=
  5235. }=0A=
  5236. =0A=
  5237. // Global external objects used by this script.=0A=
  5238. /*extern ta, stylepath, skin */=0A=
  5239. =0A=
  5240. // add any onload functions in this hook (please don't hard-code any =
  5241. events in the xhtml source)=0A=
  5242. var doneOnloadHook;=0A=
  5243. =0A=
  5244. if (!window.onloadFuncts) {=0A=
  5245. var onloadFuncts =3D [];=0A=
  5246. }=0A=
  5247. =0A=
  5248. function addOnloadHook( hookFunct ) {=0A=
  5249. // Allows add-on scripts to add onload functions=0A=
  5250. if( !doneOnloadHook ) {=0A=
  5251. onloadFuncts[onloadFuncts.length] =3D hookFunct;=0A=
  5252. } else {=0A=
  5253. hookFunct(); // bug in MSIE script loading=0A=
  5254. }=0A=
  5255. }=0A=
  5256. =0A=
  5257. function hookEvent( hookName, hookFunct ) {=0A=
  5258. addHandler( window, hookName, hookFunct );=0A=
  5259. }=0A=
  5260. =0A=
  5261. function importScript( page ) {=0A=
  5262. // TODO: might want to introduce a utility function to match =
  5263. wfUrlencode() in PHP=0A=
  5264. var uri =3D wgScript + '?title=3D' +=0A=
  5265. encodeURIComponent(page.replace(/ =
  5266. /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') +=0A=
  5267. '&action=3Draw&ctype=3Dtext/javascript';=0A=
  5268. return importScriptURI( uri );=0A=
  5269. }=0A=
  5270. =0A=
  5271. var loadedScripts =3D {}; // included-scripts tracker=0A=
  5272. function importScriptURI( url ) {=0A=
  5273. if ( loadedScripts[url] ) {=0A=
  5274. return null;=0A=
  5275. }=0A=
  5276. loadedScripts[url] =3D true;=0A=
  5277. var s =3D document.createElement( 'script' );=0A=
  5278. s.setAttribute( 'src', url );=0A=
  5279. s.setAttribute( 'type', 'text/javascript' );=0A=
  5280. document.getElementsByTagName('head')[0].appendChild( s );=0A=
  5281. return s;=0A=
  5282. }=0A=
  5283. =0A=
  5284. function importStylesheet( page ) {=0A=
  5285. return importStylesheetURI( wgScript + =
  5286. '?action=3Draw&ctype=3Dtext/css&title=3D' + encodeURIComponent( =
  5287. page.replace(/ /g,'_') ) );=0A=
  5288. }=0A=
  5289. =0A=
  5290. function importStylesheetURI( url, media ) {=0A=
  5291. var l =3D document.createElement( 'link' );=0A=
  5292. l.type =3D 'text/css';=0A=
  5293. l.rel =3D 'stylesheet';=0A=
  5294. l.href =3D url;=0A=
  5295. if( media ) {=0A=
  5296. l.media =3D media;=0A=
  5297. }=0A=
  5298. document.getElementsByTagName('head')[0].appendChild( l );=0A=
  5299. return l;=0A=
  5300. }=0A=
  5301. =0A=
  5302. function appendCSS( text ) {=0A=
  5303. var s =3D document.createElement( 'style' );=0A=
  5304. s.type =3D 'text/css';=0A=
  5305. s.rel =3D 'stylesheet';=0A=
  5306. if ( s.styleSheet ) {=0A=
  5307. s.styleSheet.cssText =3D text; // IE=0A=
  5308. } else {=0A=
  5309. s.appendChild( document.createTextNode( text + '' ) ); // Safari =
  5310. sometimes borks on null=0A=
  5311. }=0A=
  5312. document.getElementsByTagName('head')[0].appendChild( s );=0A=
  5313. return s;=0A=
  5314. }=0A=
  5315. =0A=
  5316. // Special stylesheet links for Monobook only (see bug 14717)=0A=
  5317. if ( typeof stylepath !=3D 'undefined' && skin =3D=3D 'monobook' ) {=0A=
  5318. if ( opera6_bugs ) {=0A=
  5319. importStylesheetURI( stylepath + '/' + skin + '/Opera6Fixes.css' );=0A=
  5320. } else if ( opera7_bugs ) {=0A=
  5321. importStylesheetURI( stylepath + '/' + skin + '/Opera7Fixes.css' );=0A=
  5322. } else if ( opera95_bugs ) {=0A=
  5323. importStylesheetURI( stylepath + '/' + skin + '/Opera9Fixes.css' );=0A=
  5324. } else if ( ff2_bugs ) {=0A=
  5325. importStylesheetURI( stylepath + '/' + skin + '/FF2Fixes.css' );=0A=
  5326. }=0A=
  5327. }=0A=
  5328. =0A=
  5329. =0A=
  5330. if ( wgBreakFrames ) {=0A=
  5331. // Un-trap us from framesets=0A=
  5332. if ( window.top !=3D window ) {=0A=
  5333. window.top.location =3D window.location;=0A=
  5334. }=0A=
  5335. }=0A=
  5336. =0A=
  5337. function showTocToggle() {=0A=
  5338. if ( document.createTextNode ) {=0A=
  5339. // Uses DOM calls to avoid document.write + XHTML issues=0A=
  5340. =0A=
  5341. var linkHolder =3D document.getElementById( 'toctitle' );=0A=
  5342. var existingLink =3D document.getElementById( 'togglelink' );=0A=
  5343. if ( !linkHolder || existingLink ) {=0A=
  5344. // Don't add the toggle link twice=0A=
  5345. return;=0A=
  5346. }=0A=
  5347. =0A=
  5348. var outerSpan =3D document.createElement( 'span' );=0A=
  5349. outerSpan.className =3D 'toctoggle';=0A=
  5350. =0A=
  5351. var toggleLink =3D document.createElement( 'a' );=0A=
  5352. toggleLink.id =3D 'togglelink';=0A=
  5353. toggleLink.className =3D 'internal';=0A=
  5354. toggleLink.href =3D 'javascript:toggleToc()';=0A=
  5355. toggleLink.appendChild( document.createTextNode( tocHideText ) );=0A=
  5356. =0A=
  5357. outerSpan.appendChild( document.createTextNode( '[' ) );=0A=
  5358. outerSpan.appendChild( toggleLink );=0A=
  5359. outerSpan.appendChild( document.createTextNode( ']' ) );=0A=
  5360. =0A=
  5361. linkHolder.appendChild( document.createTextNode( ' ' ) );=0A=
  5362. linkHolder.appendChild( outerSpan );=0A=
  5363. =0A=
  5364. var cookiePos =3D document.cookie.indexOf( "hidetoc=3D" );=0A=
  5365. if ( cookiePos > -1 && document.cookie.charAt( cookiePos + 8 ) =3D=3D =
  5366. 1 ) {=0A=
  5367. toggleToc();=0A=
  5368. }=0A=
  5369. }=0A=
  5370. }=0A=
  5371. =0A=
  5372. function changeText( el, newText ) {=0A=
  5373. // Safari work around=0A=
  5374. if ( el.innerText ) {=0A=
  5375. el.innerText =3D newText;=0A=
  5376. } else if ( el.firstChild && el.firstChild.nodeValue ) {=0A=
  5377. el.firstChild.nodeValue =3D newText;=0A=
  5378. }=0A=
  5379. }=0A=
  5380. =0A=
  5381. function toggleToc() {=0A=
  5382. var tocmain =3D document.getElementById( 'toc' );=0A=
  5383. var toc =3D =
  5384. document.getElementById('toc').getElementsByTagName('ul')[0];=0A=
  5385. var toggleLink =3D document.getElementById( 'togglelink' );=0A=
  5386. =0A=
  5387. if ( toc && toggleLink && toc.style.display =3D=3D 'none' ) {=0A=
  5388. changeText( toggleLink, tocHideText );=0A=
  5389. toc.style.display =3D 'block';=0A=
  5390. document.cookie =3D "hidetoc=3D0";=0A=
  5391. tocmain.className =3D 'toc';=0A=
  5392. } else {=0A=
  5393. changeText( toggleLink, tocShowText );=0A=
  5394. toc.style.display =3D 'none';=0A=
  5395. document.cookie =3D "hidetoc=3D1";=0A=
  5396. tocmain.className =3D 'toc tochidden';=0A=
  5397. }=0A=
  5398. }=0A=
  5399. =0A=
  5400. var mwEditButtons =3D [];=0A=
  5401. var mwCustomEditButtons =3D []; // eg to add in MediaWiki:Common.js=0A=
  5402. =0A=
  5403. function escapeQuotes( text ) {=0A=
  5404. var re =3D new RegExp( "'", "g" );=0A=
  5405. text =3D text.replace( re, "\\'" );=0A=
  5406. re =3D new RegExp( "\\n", "g" );=0A=
  5407. text =3D text.replace( re, "\\n" );=0A=
  5408. return escapeQuotesHTML( text );=0A=
  5409. }=0A=
  5410. =0A=
  5411. function escapeQuotesHTML( text ) {=0A=
  5412. var re =3D new RegExp( '&', "g" );=0A=
  5413. text =3D text.replace( re, "&amp;" );=0A=
  5414. re =3D new RegExp( '"', "g" );=0A=
  5415. text =3D text.replace( re, "&quot;" );=0A=
  5416. re =3D new RegExp( '<', "g" );=0A=
  5417. text =3D text.replace( re, "&lt;" );=0A=
  5418. re =3D new RegExp( '>', "g" );=0A=
  5419. text =3D text.replace( re, "&gt;" );=0A=
  5420. return text;=0A=
  5421. }=0A=
  5422. =0A=
  5423. /**=0A=
  5424. * Set the accesskey prefix based on browser detection.=0A=
  5425. */=0A=
  5426. var tooltipAccessKeyPrefix =3D 'alt-';=0A=
  5427. if ( is_opera ) {=0A=
  5428. tooltipAccessKeyPrefix =3D 'shift-esc-';=0A=
  5429. } else if ( !is_safari_win && is_safari && webkit_version > 526 ) {=0A=
  5430. tooltipAccessKeyPrefix =3D 'ctrl-alt-';=0A=
  5431. } else if ( !is_safari_win && ( is_safari=0A=
  5432. || clientPC.indexOf('mac') !=3D -1=0A=
  5433. || clientPC.indexOf('konqueror') !=3D -1 ) ) {=0A=
  5434. tooltipAccessKeyPrefix =3D 'ctrl-';=0A=
  5435. } else if ( is_ff2 ) {=0A=
  5436. tooltipAccessKeyPrefix =3D 'alt-shift-';=0A=
  5437. }=0A=
  5438. var tooltipAccessKeyRegexp =3D /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;=0A=
  5439. =0A=
  5440. /**=0A=
  5441. * Add the appropriate prefix to the accesskey shown in the tooltip.=0A=
  5442. * If the nodeList parameter is given, only those nodes are updated;=0A=
  5443. * otherwise, all the nodes that will probably have accesskeys by=0A=
  5444. * default are updated.=0A=
  5445. *=0A=
  5446. * @param Array nodeList -- list of elements to update=0A=
  5447. */=0A=
  5448. function updateTooltipAccessKeys( nodeList ) {=0A=
  5449. if ( !nodeList ) {=0A=
  5450. // Rather than scan all links on the whole page, we can just scan these=0A=
  5451. // containers which contain the relevant links. This is really just an=0A=
  5452. // optimization technique.=0A=
  5453. var linkContainers =3D [=0A=
  5454. 'column-one', // Monobook and Modern=0A=
  5455. 'mw-head', 'mw-panel', 'p-logo' // Vector=0A=
  5456. ];=0A=
  5457. for ( var i in linkContainers ) {=0A=
  5458. var linkContainer =3D document.getElementById( linkContainers[i] );=0A=
  5459. if ( linkContainer ) {=0A=
  5460. updateTooltipAccessKeys( linkContainer.getElementsByTagName( 'a' ) );=0A=
  5461. }=0A=
  5462. }=0A=
  5463. // these are rare enough that no such optimization is needed=0A=
  5464. updateTooltipAccessKeys( document.getElementsByTagName( 'input' ) );=0A=
  5465. updateTooltipAccessKeys( document.getElementsByTagName( 'label' ) );=0A=
  5466. return;=0A=
  5467. }=0A=
  5468. =0A=
  5469. for ( var i =3D 0; i < nodeList.length; i++ ) {=0A=
  5470. var element =3D nodeList[i];=0A=
  5471. var tip =3D element.getAttribute( 'title' );=0A=
  5472. if ( tip && tooltipAccessKeyRegexp.exec( tip ) ) {=0A=
  5473. tip =3D tip.replace(tooltipAccessKeyRegexp,=0A=
  5474. '[' + tooltipAccessKeyPrefix + "$5]");=0A=
  5475. element.setAttribute( 'title', tip );=0A=
  5476. }=0A=
  5477. }=0A=
  5478. }=0A=
  5479. =0A=
  5480. /**=0A=
  5481. * Add a link to one of the portlet menus on the page, including:=0A=
  5482. *=0A=
  5483. * p-cactions: Content actions (shown as tabs above the main content in =
  5484. Monobook)=0A=
  5485. * p-personal: Personal tools (shown at the top right of the page in =
  5486. Monobook)=0A=
  5487. * p-navigation: Navigation=0A=
  5488. * p-tb: Toolbox=0A=
  5489. *=0A=
  5490. * This function exists for the convenience of custom JS authors. All=0A=
  5491. * but the first three parameters are optional, though providing at=0A=
  5492. * least an id and a tooltip is recommended.=0A=
  5493. *=0A=
  5494. * By default the new link will be added to the end of the list. To=0A=
  5495. * add the link before a given existing item, pass the DOM node of=0A=
  5496. * that item (easily obtained with document.getElementById()) as the=0A=
  5497. * nextnode parameter; to add the link _after_ an existing item, pass=0A=
  5498. * the node's nextSibling instead.=0A=
  5499. *=0A=
  5500. * @param String portlet -- id of the target portlet ("p-cactions", =
  5501. "p-personal", "p-navigation" or "p-tb")=0A=
  5502. * @param String href -- link URL=0A=
  5503. * @param String text -- link text (will be automatically lowercased by =
  5504. CSS for p-cactions in Monobook)=0A=
  5505. * @param String id -- id of the new item, should be unique and =
  5506. preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-")=0A=
  5507. * @param String tooltip -- text to show when hovering over the link, =
  5508. without accesskey suffix=0A=
  5509. * @param String accesskey -- accesskey to activate this link (one =
  5510. character, try to avoid conflicts)=0A=
  5511. * @param Node nextnode -- the DOM node before which the new item should =
  5512. be added, should be another item in the same list=0A=
  5513. *=0A=
  5514. * @return Node -- the DOM node of the new item (an LI element) or null=0A=
  5515. */=0A=
  5516. function addPortletLink( portlet, href, text, id, tooltip, accesskey, =
  5517. nextnode ) {=0A=
  5518. var root =3D document.getElementById( portlet );=0A=
  5519. if ( !root ) {=0A=
  5520. return null;=0A=
  5521. }=0A=
  5522. var node =3D root.getElementsByTagName( 'ul' )[0];=0A=
  5523. if ( !node ) {=0A=
  5524. return null;=0A=
  5525. }=0A=
  5526. =0A=
  5527. // unhide portlet if it was hidden before=0A=
  5528. root.className =3D root.className.replace( /(^| )emptyPortlet( |$)/, =
  5529. "$2" );=0A=
  5530. =0A=
  5531. var span =3D document.createElement( 'span' );=0A=
  5532. span.appendChild( document.createTextNode( text ) );=0A=
  5533. =0A=
  5534. var link =3D document.createElement( 'a' );=0A=
  5535. link.appendChild( span );=0A=
  5536. link.href =3D href;=0A=
  5537. =0A=
  5538. var item =3D document.createElement( 'li' );=0A=
  5539. item.appendChild( link );=0A=
  5540. if ( id ) {=0A=
  5541. item.id =3D id;=0A=
  5542. }=0A=
  5543. =0A=
  5544. if ( accesskey ) {=0A=
  5545. link.setAttribute( 'accesskey', accesskey );=0A=
  5546. tooltip +=3D ' [' + accesskey + ']';=0A=
  5547. }=0A=
  5548. if ( tooltip ) {=0A=
  5549. link.setAttribute( 'title', tooltip );=0A=
  5550. }=0A=
  5551. if ( accesskey && tooltip ) {=0A=
  5552. updateTooltipAccessKeys( new Array( link ) );=0A=
  5553. }=0A=
  5554. =0A=
  5555. if ( nextnode && nextnode.parentNode =3D=3D node ) {=0A=
  5556. node.insertBefore( item, nextnode );=0A=
  5557. } else {=0A=
  5558. node.appendChild( item ); // IE compatibility (?)=0A=
  5559. }=0A=
  5560. =0A=
  5561. return item;=0A=
  5562. }=0A=
  5563. =0A=
  5564. function getInnerText( el ) {=0A=
  5565. if ( typeof el =3D=3D 'string' ) {=0A=
  5566. return el;=0A=
  5567. }=0A=
  5568. if ( typeof el =3D=3D 'undefined' ) {=0A=
  5569. return el;=0A=
  5570. }=0A=
  5571. if ( el.textContent ) {=0A=
  5572. return el.textContent; // not needed but it is faster=0A=
  5573. }=0A=
  5574. if ( el.innerText ) {=0A=
  5575. return el.innerText; // IE doesn't have textContent=0A=
  5576. }=0A=
  5577. var str =3D '';=0A=
  5578. =0A=
  5579. var cs =3D el.childNodes;=0A=
  5580. var l =3D cs.length;=0A=
  5581. for ( var i =3D 0; i < l; i++ ) {=0A=
  5582. switch ( cs[i].nodeType ) {=0A=
  5583. case 1: // ELEMENT_NODE=0A=
  5584. str +=3D ts_getInnerText( cs[i] );=0A=
  5585. break;=0A=
  5586. case 3: // TEXT_NODE=0A=
  5587. str +=3D cs[i].nodeValue;=0A=
  5588. break;=0A=
  5589. }=0A=
  5590. }=0A=
  5591. return str;=0A=
  5592. }=0A=
  5593. =0A=
  5594. /* Dummy for deprecated function */=0A=
  5595. window.ta =3D [];=0A=
  5596. function akeytt( doId ) {=0A=
  5597. }=0A=
  5598. =0A=
  5599. var checkboxes;=0A=
  5600. var lastCheckbox;=0A=
  5601. =0A=
  5602. function setupCheckboxShiftClick() {=0A=
  5603. checkboxes =3D [];=0A=
  5604. lastCheckbox =3D null;=0A=
  5605. var inputs =3D document.getElementsByTagName( 'input' );=0A=
  5606. addCheckboxClickHandlers( inputs );=0A=
  5607. }=0A=
  5608. =0A=
  5609. function addCheckboxClickHandlers( inputs, start ) {=0A=
  5610. if ( !start ) {=0A=
  5611. start =3D 0;=0A=
  5612. }=0A=
  5613. =0A=
  5614. var finish =3D start + 250;=0A=
  5615. if ( finish > inputs.length ) {=0A=
  5616. finish =3D inputs.length;=0A=
  5617. }=0A=
  5618. =0A=
  5619. for ( var i =3D start; i < finish; i++ ) {=0A=
  5620. var cb =3D inputs[i];=0A=
  5621. if ( !cb.type || cb.type.toLowerCase() !=3D 'checkbox' ) {=0A=
  5622. continue;=0A=
  5623. }=0A=
  5624. var end =3D checkboxes.length;=0A=
  5625. checkboxes[end] =3D cb;=0A=
  5626. cb.index =3D end;=0A=
  5627. cb.onclick =3D checkboxClickHandler;=0A=
  5628. }=0A=
  5629. =0A=
  5630. if ( finish < inputs.length ) {=0A=
  5631. setTimeout( function() {=0A=
  5632. addCheckboxClickHandlers( inputs, finish );=0A=
  5633. }, 200 );=0A=
  5634. }=0A=
  5635. }=0A=
  5636. =0A=
  5637. function checkboxClickHandler( e ) {=0A=
  5638. if ( typeof e =3D=3D 'undefined' ) {=0A=
  5639. e =3D window.event;=0A=
  5640. }=0A=
  5641. if ( !e.shiftKey || lastCheckbox =3D=3D=3D null ) {=0A=
  5642. lastCheckbox =3D this.index;=0A=
  5643. return true;=0A=
  5644. }=0A=
  5645. var endState =3D this.checked;=0A=
  5646. var start, finish;=0A=
  5647. if ( this.index < lastCheckbox ) {=0A=
  5648. start =3D this.index + 1;=0A=
  5649. finish =3D lastCheckbox;=0A=
  5650. } else {=0A=
  5651. start =3D lastCheckbox;=0A=
  5652. finish =3D this.index - 1;=0A=
  5653. }=0A=
  5654. for ( var i =3D start; i <=3D finish; ++i ) {=0A=
  5655. checkboxes[i].checked =3D endState;=0A=
  5656. if( i > start && typeof checkboxes[i].onchange =3D=3D 'function' ) {=0A=
  5657. checkboxes[i].onchange(); // fire triggers=0A=
  5658. }=0A=
  5659. }=0A=
  5660. lastCheckbox =3D this.index;=0A=
  5661. return true;=0A=
  5662. }=0A=
  5663. =0A=
  5664. =0A=
  5665. /*=0A=
  5666. Written by Jonathan Snook, http://www.snook.ca/jonathan=0A=
  5667. Add-ons by Robert Nyman, http://www.robertnyman.com=0A=
  5668. Author says "The credit comment is all it takes, no license. Go crazy =
  5669. with it!:-)"=0A=
  5670. From =
  5671. http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname=
  5672. /=0A=
  5673. */=0A=
  5674. function getElementsByClassName( oElm, strTagName, oClassNames ) {=0A=
  5675. var arrReturnElements =3D new Array();=0A=
  5676. if ( typeof( oElm.getElementsByClassName ) =3D=3D 'function' ) {=0A=
  5677. /* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */=0A=
  5678. var arrNativeReturn =3D oElm.getElementsByClassName( oClassNames );=0A=
  5679. if ( strTagName =3D=3D '*' ) {=0A=
  5680. return arrNativeReturn;=0A=
  5681. }=0A=
  5682. for ( var h =3D 0; h < arrNativeReturn.length; h++ ) {=0A=
  5683. if( arrNativeReturn[h].tagName.toLowerCase() =3D=3D =
  5684. strTagName.toLowerCase() ) {=0A=
  5685. arrReturnElements[arrReturnElements.length] =3D arrNativeReturn[h];=0A=
  5686. }=0A=
  5687. }=0A=
  5688. return arrReturnElements;=0A=
  5689. }=0A=
  5690. var arrElements =3D ( strTagName =3D=3D '*' && oElm.all ) ? oElm.all : =
  5691. oElm.getElementsByTagName( strTagName );=0A=
  5692. var arrRegExpClassNames =3D new Array();=0A=
  5693. if( typeof oClassNames =3D=3D 'object' ) {=0A=
  5694. for( var i =3D 0; i < oClassNames.length; i++ ) {=0A=
  5695. arrRegExpClassNames[arrRegExpClassNames.length] =3D=0A=
  5696. new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + =
  5697. "(\\s|$)");=0A=
  5698. }=0A=
  5699. } else {=0A=
  5700. arrRegExpClassNames[arrRegExpClassNames.length] =3D=0A=
  5701. new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)");=0A=
  5702. }=0A=
  5703. var oElement;=0A=
  5704. var bMatchesAll;=0A=
  5705. for( var j =3D 0; j < arrElements.length; j++ ) {=0A=
  5706. oElement =3D arrElements[j];=0A=
  5707. bMatchesAll =3D true;=0A=
  5708. for( var k =3D 0; k < arrRegExpClassNames.length; k++ ) {=0A=
  5709. if( !arrRegExpClassNames[k].test( oElement.className ) ) {=0A=
  5710. bMatchesAll =3D false;=0A=
  5711. break;=0A=
  5712. }=0A=
  5713. }=0A=
  5714. if( bMatchesAll ) {=0A=
  5715. arrReturnElements[arrReturnElements.length] =3D oElement;=0A=
  5716. }=0A=
  5717. }=0A=
  5718. return ( arrReturnElements );=0A=
  5719. }=0A=
  5720. =0A=
  5721. function redirectToFragment( fragment ) {=0A=
  5722. var match =3D navigator.userAgent.match(/AppleWebKit\/(\d+)/);=0A=
  5723. if ( match ) {=0A=
  5724. var webKitVersion =3D parseInt( match[1] );=0A=
  5725. if ( webKitVersion < 420 ) {=0A=
  5726. // Released Safari w/ WebKit 418.9.1 messes up horribly=0A=
  5727. // Nightlies of 420+ are ok=0A=
  5728. return;=0A=
  5729. }=0A=
  5730. }=0A=
  5731. if ( is_gecko ) {=0A=
  5732. // Mozilla needs to wait until after load, otherwise the window =
  5733. doesn't scroll=0A=
  5734. addOnloadHook(function() {=0A=
  5735. if ( window.location.hash =3D=3D '' ) {=0A=
  5736. window.location.hash =3D fragment;=0A=
  5737. }=0A=
  5738. });=0A=
  5739. } else {=0A=
  5740. if ( window.location.hash =3D=3D '' ) {=0A=
  5741. window.location.hash =3D fragment;=0A=
  5742. }=0A=
  5743. }=0A=
  5744. }=0A=
  5745. =0A=
  5746. /*=0A=
  5747. * Table sorting script based on one (c) 1997-2006 Stuart Langridge and =
  5748. Joost=0A=
  5749. * de Valk:=0A=
  5750. * http://www.joostdevalk.nl/code/sortable-table/=0A=
  5751. * http://www.kryogenix.org/code/browser/sorttable/=0A=
  5752. *=0A=
  5753. * @todo don't break on colspans/rowspans (bug 8028)=0A=
  5754. * @todo language-specific digit grouping/decimals (bug 8063)=0A=
  5755. * @todo support all accepted date formats (bug 8226)=0A=
  5756. */=0A=
  5757. =0A=
  5758. var ts_image_path =3D stylepath + '/common/images/';=0A=
  5759. var ts_image_up =3D 'sort_up.gif';=0A=
  5760. var ts_image_down =3D 'sort_down.gif';=0A=
  5761. var ts_image_none =3D 'sort_none.gif';=0A=
  5762. var ts_europeandate =3D wgContentLanguage !=3D 'en'; // The =
  5763. non-American-inclined can change to "true"=0A=
  5764. var ts_alternate_row_colors =3D false;=0A=
  5765. var ts_number_transform_table =3D null;=0A=
  5766. var ts_number_regex =3D null;=0A=
  5767. =0A=
  5768. function sortables_init() {=0A=
  5769. var idnum =3D 0;=0A=
  5770. // Find all tables with class sortable and make them sortable=0A=
  5771. var tables =3D getElementsByClassName( document, 'table', 'sortable' );=0A=
  5772. for ( var ti =3D 0; ti < tables.length ; ti++ ) {=0A=
  5773. if ( !tables[ti].id ) {=0A=
  5774. tables[ti].setAttribute( 'id', 'sortable_table_id_' + idnum );=0A=
  5775. ++idnum;=0A=
  5776. }=0A=
  5777. ts_makeSortable( tables[ti] );=0A=
  5778. }=0A=
  5779. }=0A=
  5780. =0A=
  5781. function ts_makeSortable( table ) {=0A=
  5782. var firstRow;=0A=
  5783. if ( table.rows && table.rows.length > 0 ) {=0A=
  5784. if ( table.tHead && table.tHead.rows.length > 0 ) {=0A=
  5785. firstRow =3D table.tHead.rows[table.tHead.rows.length-1];=0A=
  5786. } else {=0A=
  5787. firstRow =3D table.rows[0];=0A=
  5788. }=0A=
  5789. }=0A=
  5790. if ( !firstRow ) {=0A=
  5791. return;=0A=
  5792. }=0A=
  5793. =0A=
  5794. // We have a first row: assume it's the header, and make its contents =
  5795. clickable links=0A=
  5796. for ( var i =3D 0; i < firstRow.cells.length; i++ ) {=0A=
  5797. var cell =3D firstRow.cells[i];=0A=
  5798. if ( (' ' + cell.className + ' ').indexOf(' unsortable ') =3D=3D -1 ) {=0A=
  5799. cell.innerHTML +=3D '<a href=3D"#" class=3D"sortheader" '=0A=
  5800. + 'onclick=3D"ts_resortTable(this);return false;">'=0A=
  5801. + '<span class=3D"sortarrow">'=0A=
  5802. + '<img src=3D"'=0A=
  5803. + ts_image_path=0A=
  5804. + ts_image_none=0A=
  5805. + '" alt=3D"&darr;"/></span></a>';=0A=
  5806. }=0A=
  5807. }=0A=
  5808. if ( ts_alternate_row_colors ) {=0A=
  5809. ts_alternate( table );=0A=
  5810. }=0A=
  5811. }=0A=
  5812. =0A=
  5813. function ts_getInnerText( el ) {=0A=
  5814. return getInnerText( el );=0A=
  5815. }=0A=
  5816. =0A=
  5817. function ts_resortTable( lnk ) {=0A=
  5818. // get the span=0A=
  5819. var span =3D lnk.getElementsByTagName('span')[0];=0A=
  5820. =0A=
  5821. var td =3D lnk.parentNode;=0A=
  5822. var tr =3D td.parentNode;=0A=
  5823. var column =3D td.cellIndex;=0A=
  5824. =0A=
  5825. var table =3D tr.parentNode;=0A=
  5826. while ( table && !( table.tagName && table.tagName.toLowerCase() =3D=3D =
  5827. 'table' ) ) {=0A=
  5828. table =3D table.parentNode;=0A=
  5829. }=0A=
  5830. if ( !table ) {=0A=
  5831. return;=0A=
  5832. }=0A=
  5833. =0A=
  5834. if ( table.rows.length <=3D 1 ) {=0A=
  5835. return;=0A=
  5836. }=0A=
  5837. =0A=
  5838. // Generate the number transform table if it's not done already=0A=
  5839. if ( ts_number_transform_table =3D=3D=3D null ) {=0A=
  5840. ts_initTransformTable();=0A=
  5841. }=0A=
  5842. =0A=
  5843. // Work out a type for the column=0A=
  5844. // Skip the first row if that's where the headings are=0A=
  5845. var rowStart =3D ( table.tHead && table.tHead.rows.length > 0 ? 0 : 1 );=0A=
  5846. =0A=
  5847. var itm =3D '';=0A=
  5848. for ( var i =3D rowStart; i < table.rows.length; i++ ) {=0A=
  5849. if ( table.rows[i].cells.length > column ) {=0A=
  5850. itm =3D ts_getInnerText(table.rows[i].cells[column]);=0A=
  5851. itm =3D itm.replace(/^[\s\xa0]+/, '').replace(/[\s\xa0]+$/, '');=0A=
  5852. if ( itm !=3D '' ) {=0A=
  5853. break;=0A=
  5854. }=0A=
  5855. }=0A=
  5856. }=0A=
  5857. =0A=
  5858. // TODO: bug 8226, localised date formats=0A=
  5859. var sortfn =3D ts_sort_generic;=0A=
  5860. var preprocessor =3D ts_toLowerCase;=0A=
  5861. if ( /^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/.test( itm ) ) {=0A=
  5862. preprocessor =3D ts_dateToSortKey;=0A=
  5863. } else if ( /^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/.test( itm ) ) {=0A=
  5864. preprocessor =3D ts_dateToSortKey;=0A=
  5865. } else if ( /^\d\d[\/.-]\d\d[\/.-]\d\d$/.test( itm ) ) {=0A=
  5866. preprocessor =3D ts_dateToSortKey;=0A=
  5867. // (minus sign)([pound dollar euro yen currency]|cents)=0A=
  5868. } else if ( /(^([-\u2212] =
  5869. *)?[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/.test( itm ) ) {=0A=
  5870. preprocessor =3D ts_currencyToSortKey;=0A=
  5871. } else if ( ts_number_regex.test( itm ) ) {=0A=
  5872. preprocessor =3D ts_parseFloat;=0A=
  5873. }=0A=
  5874. =0A=
  5875. var reverse =3D ( span.getAttribute( 'sortdir' ) =3D=3D 'down' );=0A=
  5876. =0A=
  5877. var newRows =3D new Array();=0A=
  5878. var staticRows =3D new Array();=0A=
  5879. for ( var j =3D rowStart; j < table.rows.length; j++ ) {=0A=
  5880. var row =3D table.rows[j];=0A=
  5881. if( (' ' + row.className + ' ').indexOf(' unsortable ') < 0 ) {=0A=
  5882. var keyText =3D ts_getInnerText( row.cells[column] );=0A=
  5883. if( keyText =3D=3D=3D undefined ) {=0A=
  5884. keyText =3D ''; =0A=
  5885. }=0A=
  5886. var oldIndex =3D ( reverse ? -j : j );=0A=
  5887. var preprocessed =3D preprocessor( keyText.replace(/^[\s\xa0]+/, =
  5888. '').replace(/[\s\xa0]+$/, '') );=0A=
  5889. =0A=
  5890. newRows[newRows.length] =3D new Array( row, preprocessed, oldIndex );=0A=
  5891. } else {=0A=
  5892. staticRows[staticRows.length] =3D new Array( row, false, j-rowStart );=0A=
  5893. }=0A=
  5894. }=0A=
  5895. =0A=
  5896. newRows.sort( sortfn );=0A=
  5897. =0A=
  5898. var arrowHTML;=0A=
  5899. if ( reverse ) {=0A=
  5900. arrowHTML =3D '<img src=3D"' + ts_image_path + ts_image_down + '" =
  5901. alt=3D"&darr;"/>';=0A=
  5902. newRows.reverse();=0A=
  5903. span.setAttribute( 'sortdir', 'up' );=0A=
  5904. } else {=0A=
  5905. arrowHTML =3D '<img src=3D"' + ts_image_path + ts_image_up + '" =
  5906. alt=3D"&uarr;"/>';=0A=
  5907. span.setAttribute( 'sortdir', 'down' );=0A=
  5908. }=0A=
  5909. =0A=
  5910. for ( var i =3D 0; i < staticRows.length; i++ ) {=0A=
  5911. var row =3D staticRows[i];=0A=
  5912. newRows.splice( row[2], 0, row );=0A=
  5913. }=0A=
  5914. =0A=
  5915. // We appendChild rows that already exist to the tbody, so it moves =
  5916. them rather than creating new ones=0A=
  5917. // don't do sortbottom rows=0A=
  5918. for ( var i =3D 0; i < newRows.length; i++ ) {=0A=
  5919. if ( ( ' ' + newRows[i][0].className + ' ').indexOf(' sortbottom ') =
  5920. =3D=3D -1 ) {=0A=
  5921. table.tBodies[0].appendChild( newRows[i][0] );=0A=
  5922. }=0A=
  5923. }=0A=
  5924. // do sortbottom rows only=0A=
  5925. for ( var i =3D 0; i < newRows.length; i++ ) {=0A=
  5926. if ( ( ' ' + newRows[i][0].className + ' ').indexOf(' sortbottom ') =
  5927. !=3D -1 ) {=0A=
  5928. table.tBodies[0].appendChild( newRows[i][0] );=0A=
  5929. }=0A=
  5930. }=0A=
  5931. =0A=
  5932. // Delete any other arrows there may be showing=0A=
  5933. var spans =3D getElementsByClassName( tr, 'span', 'sortarrow' );=0A=
  5934. for ( var i =3D 0; i < spans.length; i++ ) {=0A=
  5935. spans[i].innerHTML =3D '<img src=3D"' + ts_image_path + ts_image_none =
  5936. + '" alt=3D"&darr;"/>';=0A=
  5937. }=0A=
  5938. span.innerHTML =3D arrowHTML;=0A=
  5939. =0A=
  5940. if ( ts_alternate_row_colors ) {=0A=
  5941. ts_alternate( table );=0A=
  5942. }=0A=
  5943. }=0A=
  5944. =0A=
  5945. function ts_initTransformTable() {=0A=
  5946. if ( typeof wgSeparatorTransformTable =3D=3D 'undefined'=0A=
  5947. || ( wgSeparatorTransformTable[0] =3D=3D '' && =
  5948. wgDigitTransformTable[2] =3D=3D '' ) )=0A=
  5949. {=0A=
  5950. digitClass =3D "[0-9,.]";=0A=
  5951. ts_number_transform_table =3D false;=0A=
  5952. } else {=0A=
  5953. ts_number_transform_table =3D {};=0A=
  5954. // Unpack the transform table=0A=
  5955. // Separators=0A=
  5956. ascii =3D wgSeparatorTransformTable[0].split("\t");=0A=
  5957. localised =3D wgSeparatorTransformTable[1].split("\t");=0A=
  5958. for ( var i =3D 0; i < ascii.length; i++ ) {=0A=
  5959. ts_number_transform_table[localised[i]] =3D ascii[i];=0A=
  5960. }=0A=
  5961. // Digits=0A=
  5962. ascii =3D wgDigitTransformTable[0].split("\t");=0A=
  5963. localised =3D wgDigitTransformTable[1].split("\t");=0A=
  5964. for ( var i =3D 0; i < ascii.length; i++ ) {=0A=
  5965. ts_number_transform_table[localised[i]] =3D ascii[i];=0A=
  5966. }=0A=
  5967. =0A=
  5968. // Construct regex for number identification=0A=
  5969. digits =3D ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ',', =
  5970. '\\.'];=0A=
  5971. maxDigitLength =3D 1;=0A=
  5972. for ( var digit in ts_number_transform_table ) {=0A=
  5973. // Escape regex metacharacters=0A=
  5974. digits.push(=0A=
  5975. digit.replace( /[\\\\$\*\+\?\.\(\)\|\{\}\[\]\-]/,=0A=
  5976. function( s ) { return '\\' + s; } )=0A=
  5977. );=0A=
  5978. if ( digit.length > maxDigitLength ) {=0A=
  5979. maxDigitLength =3D digit.length;=0A=
  5980. }=0A=
  5981. }=0A=
  5982. if ( maxDigitLength > 1 ) {=0A=
  5983. digitClass =3D '[' + digits.join( '', digits ) + ']';=0A=
  5984. } else {=0A=
  5985. digitClass =3D '(' + digits.join( '|', digits ) + ')';=0A=
  5986. }=0A=
  5987. }=0A=
  5988. =0A=
  5989. // We allow a trailing percent sign, which we just strip. This works =
  5990. fine=0A=
  5991. // if percents and regular numbers aren't being mixed.=0A=
  5992. ts_number_regex =3D new RegExp(=0A=
  5993. "^(" +=0A=
  5994. "[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + =
  5995. // Fortran-style scientific=0A=
  5996. "|" +=0A=
  5997. "[-+\u2212]?" + digitClass + "+%?" + // Generic localised=0A=
  5998. ")$", "i"=0A=
  5999. );=0A=
  6000. }=0A=
  6001. =0A=
  6002. function ts_toLowerCase( s ) {=0A=
  6003. return s.toLowerCase();=0A=
  6004. }=0A=
  6005. =0A=
  6006. function ts_dateToSortKey( date ) {=0A=
  6007. // y2k notes: two digit years less than 50 are treated as 20XX, greater =
  6008. than 50 are treated as 19XX=0A=
  6009. if ( date.length =3D=3D 11 ) {=0A=
  6010. switch ( date.substr( 3, 3 ).toLowerCase() ) {=0A=
  6011. case 'jan':=0A=
  6012. var month =3D '01';=0A=
  6013. break;=0A=
  6014. case 'feb':=0A=
  6015. var month =3D '02';=0A=
  6016. break;=0A=
  6017. case 'mar':=0A=
  6018. var month =3D '03';=0A=
  6019. break;=0A=
  6020. case 'apr':=0A=
  6021. var month =3D '04';=0A=
  6022. break;=0A=
  6023. case 'may':=0A=
  6024. var month =3D '05';=0A=
  6025. break;=0A=
  6026. case 'jun':=0A=
  6027. var month =3D '06';=0A=
  6028. break;=0A=
  6029. case 'jul':=0A=
  6030. var month =3D '07';=0A=
  6031. break;=0A=
  6032. case 'aug':=0A=
  6033. var month =3D '08';=0A=
  6034. break;=0A=
  6035. case 'sep':=0A=
  6036. var month =3D '09';=0A=
  6037. break;=0A=
  6038. case 'oct':=0A=
  6039. var month =3D '10';=0A=
  6040. break;=0A=
  6041. case 'nov':=0A=
  6042. var month =3D '11';=0A=
  6043. break;=0A=
  6044. case 'dec':=0A=
  6045. var month =3D '12';=0A=
  6046. break;=0A=
  6047. // default: var month =3D '00';=0A=
  6048. }=0A=
  6049. return date.substr( 7, 4 ) + month + date.substr( 0, 2 );=0A=
  6050. } else if ( date.length =3D=3D 10 ) {=0A=
  6051. if ( ts_europeandate =3D=3D false ) {=0A=
  6052. return date.substr( 6, 4 ) + date.substr( 0, 2 ) + date.substr( 3, 2 =
  6053. );=0A=
  6054. } else {=0A=
  6055. return date.substr( 6, 4 ) + date.substr( 3, 2 ) + date.substr( 0, 2 =
  6056. );=0A=
  6057. }=0A=
  6058. } else if ( date.length =3D=3D 8 ) {=0A=
  6059. yr =3D date.substr( 6, 2 );=0A=
  6060. if ( parseInt( yr ) < 50 ) {=0A=
  6061. yr =3D '20' + yr;=0A=
  6062. } else {=0A=
  6063. yr =3D '19' + yr;=0A=
  6064. }=0A=
  6065. if ( ts_europeandate =3D=3D true ) {=0A=
  6066. return yr + date.substr( 3, 2 ) + date.substr( 0, 2 );=0A=
  6067. } else {=0A=
  6068. return yr + date.substr( 0, 2 ) + date.substr( 3, 2 );=0A=
  6069. }=0A=
  6070. }=0A=
  6071. return '00000000';=0A=
  6072. }=0A=
  6073. =0A=
  6074. function ts_parseFloat( s ) {=0A=
  6075. if ( !s ) {=0A=
  6076. return 0;=0A=
  6077. }=0A=
  6078. if ( ts_number_transform_table !=3D false ) {=0A=
  6079. var newNum =3D '', c;=0A=
  6080. =0A=
  6081. for ( var p =3D 0; p < s.length; p++ ) {=0A=
  6082. c =3D s.charAt( p );=0A=
  6083. if ( c in ts_number_transform_table ) {=0A=
  6084. newNum +=3D ts_number_transform_table[c];=0A=
  6085. } else {=0A=
  6086. newNum +=3D c;=0A=
  6087. }=0A=
  6088. }=0A=
  6089. s =3D newNum;=0A=
  6090. }=0A=
  6091. num =3D parseFloat( s.replace(/[, ]/g, '').replace("\u2212", '-') );=0A=
  6092. return ( isNaN( num ) ? -Infinity : num );=0A=
  6093. }=0A=
  6094. =0A=
  6095. function ts_currencyToSortKey( s ) {=0A=
  6096. return ts_parseFloat(s.replace(/[^-\u22120-9.,]/g,''));=0A=
  6097. }=0A=
  6098. =0A=
  6099. function ts_sort_generic( a, b ) {=0A=
  6100. return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : a[2] - b[2];=0A=
  6101. }=0A=
  6102. =0A=
  6103. function ts_alternate( table ) {=0A=
  6104. // Take object table and get all it's tbodies.=0A=
  6105. var tableBodies =3D table.getElementsByTagName( 'tbody' );=0A=
  6106. // Loop through these tbodies=0A=
  6107. for ( var i =3D 0; i < tableBodies.length; i++ ) {=0A=
  6108. // Take the tbody, and get all it's rows=0A=
  6109. var tableRows =3D tableBodies[i].getElementsByTagName( 'tr' );=0A=
  6110. // Loop through these rows=0A=
  6111. // Start at 1 because we want to leave the heading row untouched=0A=
  6112. for ( var j =3D 0; j < tableRows.length; j++ ) {=0A=
  6113. // Check if j is even, and apply classes for both possible results=0A=
  6114. var oldClasses =3D tableRows[j].className.split(' ');=0A=
  6115. var newClassName =3D '';=0A=
  6116. for ( var k =3D 0; k < oldClasses.length; k++ ) {=0A=
  6117. if ( oldClasses[k] !=3D '' && oldClasses[k] !=3D 'even' && =
  6118. oldClasses[k] !=3D 'odd' ) {=0A=
  6119. newClassName +=3D oldClasses[k] + ' ';=0A=
  6120. }=0A=
  6121. }=0A=
  6122. tableRows[j].className =3D newClassName + ( j % 2 =3D=3D 0 ? 'even' : =
  6123. 'odd' );=0A=
  6124. }=0A=
  6125. }=0A=
  6126. }=0A=
  6127. =0A=
  6128. /*=0A=
  6129. * End of table sorting code=0A=
  6130. */=0A=
  6131. =0A=
  6132. =0A=
  6133. /**=0A=
  6134. * Add a cute little box at the top of the screen to inform the user of=0A=
  6135. * something, replacing any preexisting message.=0A=
  6136. *=0A=
  6137. * @param String -or- Dom Object message HTML to be put inside the right =
  6138. div=0A=
  6139. * @param String className Used in adding a class; should be different =
  6140. for each=0A=
  6141. * call to allow CSS/JS to hide different boxes. null =3D no class =
  6142. used.=0A=
  6143. * @return Boolean True on success, false on failure=0A=
  6144. */=0A=
  6145. function jsMsg( message, className ) {=0A=
  6146. if ( !document.getElementById ) {=0A=
  6147. return false;=0A=
  6148. }=0A=
  6149. // We special-case skin structures provided by the software. Skins that=0A=
  6150. // choose to abandon or significantly modify our formatting can just =
  6151. define=0A=
  6152. // an mw-js-message div to start with.=0A=
  6153. var messageDiv =3D document.getElementById( 'mw-js-message' );=0A=
  6154. if ( !messageDiv ) {=0A=
  6155. messageDiv =3D document.createElement( 'div' );=0A=
  6156. if ( document.getElementById( 'column-content' )=0A=
  6157. && document.getElementById( 'content' ) ) {=0A=
  6158. // MonoBook, presumably=0A=
  6159. document.getElementById( 'content' ).insertBefore(=0A=
  6160. messageDiv,=0A=
  6161. document.getElementById( 'content' ).firstChild=0A=
  6162. );=0A=
  6163. } else if ( document.getElementById( 'content' )=0A=
  6164. && document.getElementById( 'article' ) ) {=0A=
  6165. // Non-Monobook but still recognizable (old-style)=0A=
  6166. document.getElementById( 'article').insertBefore(=0A=
  6167. messageDiv,=0A=
  6168. document.getElementById( 'article' ).firstChild=0A=
  6169. );=0A=
  6170. } else {=0A=
  6171. return false;=0A=
  6172. }=0A=
  6173. }=0A=
  6174. =0A=
  6175. messageDiv.setAttribute( 'id', 'mw-js-message' );=0A=
  6176. messageDiv.style.display =3D 'block';=0A=
  6177. if( className ) {=0A=
  6178. messageDiv.setAttribute( 'class', 'mw-js-message-' + className );=0A=
  6179. }=0A=
  6180. =0A=
  6181. if ( typeof message =3D=3D=3D 'object' ) {=0A=
  6182. while ( messageDiv.hasChildNodes() ) { // Remove old content=0A=
  6183. messageDiv.removeChild( messageDiv.firstChild );=0A=
  6184. }=0A=
  6185. messageDiv.appendChild( message ); // Append new content=0A=
  6186. } else {=0A=
  6187. messageDiv.innerHTML =3D message;=0A=
  6188. }=0A=
  6189. return true;=0A=
  6190. }=0A=
  6191. =0A=
  6192. /**=0A=
  6193. * Inject a cute little progress spinner after the specified element=0A=
  6194. *=0A=
  6195. * @param element Element to inject after=0A=
  6196. * @param id Identifier string (for use with removeSpinner(), below)=0A=
  6197. */=0A=
  6198. function injectSpinner( element, id ) {=0A=
  6199. var spinner =3D document.createElement( 'img' );=0A=
  6200. spinner.id =3D 'mw-spinner-' + id;=0A=
  6201. spinner.src =3D stylepath + '/common/images/spinner.gif';=0A=
  6202. spinner.alt =3D spinner.title =3D '...';=0A=
  6203. if( element.nextSibling ) {=0A=
  6204. element.parentNode.insertBefore( spinner, element.nextSibling );=0A=
  6205. } else {=0A=
  6206. element.parentNode.appendChild( spinner );=0A=
  6207. }=0A=
  6208. }=0A=
  6209. =0A=
  6210. /**=0A=
  6211. * Remove a progress spinner added with injectSpinner()=0A=
  6212. *=0A=
  6213. * @param id Identifier string=0A=
  6214. */=0A=
  6215. function removeSpinner( id ) {=0A=
  6216. var spinner =3D document.getElementById( 'mw-spinner-' + id );=0A=
  6217. if( spinner ) {=0A=
  6218. spinner.parentNode.removeChild( spinner );=0A=
  6219. }=0A=
  6220. }=0A=
  6221. =0A=
  6222. function runOnloadHook() {=0A=
  6223. // don't run anything below this for non-dom browsers=0A=
  6224. if ( doneOnloadHook || !( document.getElementById && =
  6225. document.getElementsByTagName ) ) {=0A=
  6226. return;=0A=
  6227. }=0A=
  6228. =0A=
  6229. // set this before running any hooks, since any errors below=0A=
  6230. // might cause the function to terminate prematurely=0A=
  6231. doneOnloadHook =3D true;=0A=
  6232. =0A=
  6233. updateTooltipAccessKeys( null );=0A=
  6234. setupCheckboxShiftClick();=0A=
  6235. sortables_init();=0A=
  6236. =0A=
  6237. // Run any added-on functions=0A=
  6238. for ( var i =3D 0; i < onloadFuncts.length; i++ ) {=0A=
  6239. onloadFuncts[i]();=0A=
  6240. }=0A=
  6241. }=0A=
  6242. =0A=
  6243. /**=0A=
  6244. * Add an event handler to an element=0A=
  6245. *=0A=
  6246. * @param Element element Element to add handler to=0A=
  6247. * @param String attach Event to attach to=0A=
  6248. * @param callable handler Event handler callback=0A=
  6249. */=0A=
  6250. function addHandler( element, attach, handler ) {=0A=
  6251. if( window.addEventListener ) {=0A=
  6252. element.addEventListener( attach, handler, false );=0A=
  6253. } else if( window.attachEvent ) {=0A=
  6254. element.attachEvent( 'on' + attach, handler );=0A=
  6255. }=0A=
  6256. }=0A=
  6257. =0A=
  6258. /**=0A=
  6259. * Add a click event handler to an element=0A=
  6260. *=0A=
  6261. * @param Element element Element to add handler to=0A=
  6262. * @param callable handler Event handler callback=0A=
  6263. */=0A=
  6264. function addClickHandler( element, handler ) {=0A=
  6265. addHandler( element, 'click', handler );=0A=
  6266. }=0A=
  6267. =0A=
  6268. /**=0A=
  6269. * Removes an event handler from an element=0A=
  6270. *=0A=
  6271. * @param Element element Element to remove handler from=0A=
  6272. * @param String remove Event to remove=0A=
  6273. * @param callable handler Event handler callback to remove=0A=
  6274. */=0A=
  6275. function removeHandler( element, remove, handler ) {=0A=
  6276. if( window.removeEventListener ) {=0A=
  6277. element.removeEventListener( remove, handler, false );=0A=
  6278. } else if( window.detachEvent ) {=0A=
  6279. element.detachEvent( 'on' + remove, handler );=0A=
  6280. }=0A=
  6281. }=0A=
  6282. // note: all skins should call runOnloadHook() at the end of html output,=0A=
  6283. // so the below should be redundant. It's there just in case.=0A=
  6284. hookEvent( 'load', runOnloadHook );=0A=
  6285. =0A=
  6286. if ( ie6_bugs ) {=0A=
  6287. importScriptURI( stylepath + '/common/IEFixes.js' );=0A=
  6288. }=0A=
  6289. =0A=
  6290. // For future use.=0A=
  6291. mw =3D {};=0A=
  6292. =0A=
  6293. =0A=
  6294. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  6295. Content-Type: application/octet-stream
  6296. Content-Transfer-Encoding: quoted-printable
  6297. Content-Location: http://wiki.theory.org/skins/common/ajax.js?270
  6298. // remote scripting library=0A=
  6299. // (c) copyright 2005 modernmethod, inc=0A=
  6300. var sajax_debug_mode =3D false;=0A=
  6301. var sajax_request_type =3D "GET";=0A=
  6302. =0A=
  6303. /**=0A=
  6304. * if sajax_debug_mode is true, this function outputs given the message =
  6305. into =0A=
  6306. * the element with id =3D sajax_debug; if no such element exists in the =
  6307. document, =0A=
  6308. * it is injected.=0A=
  6309. */=0A=
  6310. function sajax_debug(text) {=0A=
  6311. if (!sajax_debug_mode) return false;=0A=
  6312. =0A=
  6313. var e=3D document.getElementById('sajax_debug');=0A=
  6314. =0A=
  6315. if (!e) {=0A=
  6316. e=3D document.createElement("p");=0A=
  6317. e.className=3D 'sajax_debug';=0A=
  6318. e.id=3D 'sajax_debug';=0A=
  6319. =0A=
  6320. var b=3D document.getElementsByTagName("body")[0];=0A=
  6321. =0A=
  6322. if (b.firstChild) b.insertBefore(e, b.firstChild);=0A=
  6323. else b.appendChild(e);=0A=
  6324. }=0A=
  6325. =0A=
  6326. var m=3D document.createElement("div");=0A=
  6327. m.appendChild( document.createTextNode( text ) );=0A=
  6328. =0A=
  6329. e.appendChild( m );=0A=
  6330. =0A=
  6331. return true;=0A=
  6332. }=0A=
  6333. =0A=
  6334. /**=0A=
  6335. * compatibility wrapper for creating a new XMLHttpRequest object.=0A=
  6336. */=0A=
  6337. function sajax_init_object() {=0A=
  6338. sajax_debug("sajax_init_object() called..")=0A=
  6339. var A;=0A=
  6340. try {=0A=
  6341. // Try the new style before ActiveX so we don't=0A=
  6342. // unnecessarily trigger warnings in IE 7 when=0A=
  6343. // set to prompt about ActiveX usage=0A=
  6344. A =3D new XMLHttpRequest();=0A=
  6345. } catch (e) {=0A=
  6346. try {=0A=
  6347. A=3Dnew ActiveXObject("Msxml2.XMLHTTP");=0A=
  6348. } catch (e) {=0A=
  6349. try {=0A=
  6350. A=3Dnew ActiveXObject("Microsoft.XMLHTTP");=0A=
  6351. } catch (oc) {=0A=
  6352. A=3Dnull;=0A=
  6353. }=0A=
  6354. }=0A=
  6355. }=0A=
  6356. if (!A)=0A=
  6357. sajax_debug("Could not create connection object.");=0A=
  6358. =0A=
  6359. return A;=0A=
  6360. }=0A=
  6361. =0A=
  6362. /**=0A=
  6363. * Perform an ajax call to mediawiki. Calls are handeled by =
  6364. AjaxDispatcher.php=0A=
  6365. * func_name - the name of the function to call. Must be registered in =
  6366. $wgAjaxExportList=0A=
  6367. * args - an array of arguments to that function=0A=
  6368. * target - the target that will handle the result of the call. If this =
  6369. is a function,=0A=
  6370. * if will be called with the XMLHttpRequest as a parameter; =
  6371. if it's an input=0A=
  6372. * element, its value will be set to the resultText; if it's =
  6373. another type of=0A=
  6374. * element, its innerHTML will be set to the resultText.=0A=
  6375. *=0A=
  6376. * Example:=0A=
  6377. * sajax_do_call('doFoo', [1, 2, 3], =
  6378. document.getElementById("showFoo"));=0A=
  6379. *=0A=
  6380. * This will call the doFoo function via MediaWiki's AjaxDispatcher, with=0A=
  6381. * (1, 2, 3) as the parameter list, and will show the result in the =
  6382. element=0A=
  6383. * with id =3D showFoo=0A=
  6384. */=0A=
  6385. function sajax_do_call(func_name, args, target) {=0A=
  6386. var i, x, n;=0A=
  6387. var uri;=0A=
  6388. var post_data;=0A=
  6389. uri =3D wgServer +=0A=
  6390. ((wgScript =3D=3D null) ? (wgScriptPath + "/index.php") : wgScript) +=0A=
  6391. "?action=3Dajax";=0A=
  6392. if (sajax_request_type =3D=3D "GET") {=0A=
  6393. if (uri.indexOf("?") =3D=3D -1)=0A=
  6394. uri =3D uri + "?rs=3D" + encodeURIComponent(func_name);=0A=
  6395. else=0A=
  6396. uri =3D uri + "&rs=3D" + encodeURIComponent(func_name);=0A=
  6397. for (i =3D 0; i < args.length; i++)=0A=
  6398. uri =3D uri + "&rsargs[]=3D" + encodeURIComponent(args[i]);=0A=
  6399. //uri =3D uri + "&rsrnd=3D" + new Date().getTime();=0A=
  6400. post_data =3D null;=0A=
  6401. } else {=0A=
  6402. post_data =3D "rs=3D" + encodeURIComponent(func_name);=0A=
  6403. for (i =3D 0; i < args.length; i++)=0A=
  6404. post_data =3D post_data + "&rsargs[]=3D" + =
  6405. encodeURIComponent(args[i]);=0A=
  6406. }=0A=
  6407. x =3D sajax_init_object();=0A=
  6408. if (!x) {=0A=
  6409. alert("AJAX not supported");=0A=
  6410. return false;=0A=
  6411. }=0A=
  6412. =0A=
  6413. try {=0A=
  6414. x.open(sajax_request_type, uri, true);=0A=
  6415. } catch (e) {=0A=
  6416. if (window.location.hostname =3D=3D "localhost") {=0A=
  6417. alert("Your browser blocks XMLHttpRequest to 'localhost', try using a =
  6418. real hostname for development/testing.");=0A=
  6419. }=0A=
  6420. throw e;=0A=
  6421. }=0A=
  6422. if (sajax_request_type =3D=3D "POST") {=0A=
  6423. x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");=0A=
  6424. x.setRequestHeader("Content-Type", =
  6425. "application/x-www-form-urlencoded");=0A=
  6426. }=0A=
  6427. x.setRequestHeader("Pragma", "cache=3Dyes");=0A=
  6428. x.setRequestHeader("Cache-Control", "no-transform");=0A=
  6429. x.onreadystatechange =3D function() {=0A=
  6430. if (x.readyState !=3D 4)=0A=
  6431. return;=0A=
  6432. =0A=
  6433. sajax_debug("received (" + x.status + " " + x.statusText + ") " + =
  6434. x.responseText);=0A=
  6435. =0A=
  6436. //if (x.status !=3D 200)=0A=
  6437. // alert("Error: " + x.status + " " + x.statusText + ": " + =
  6438. x.responseText);=0A=
  6439. //else=0A=
  6440. =0A=
  6441. if ( typeof( target ) =3D=3D 'function' ) {=0A=
  6442. target( x );=0A=
  6443. }=0A=
  6444. else if ( typeof( target ) =3D=3D 'object' ) {=0A=
  6445. if ( target.tagName =3D=3D 'INPUT' ) {=0A=
  6446. if (x.status =3D=3D 200) target.value=3D x.responseText;=0A=
  6447. //else alert("Error: " + x.status + " " + x.statusText + " (" + =
  6448. x.responseText + ")");=0A=
  6449. }=0A=
  6450. else {=0A=
  6451. if (x.status =3D=3D 200) target.innerHTML =3D x.responseText;=0A=
  6452. else target.innerHTML=3D "<div class=3D'error'>Error: " + x.status + =
  6453. " " + x.statusText + " (" + x.responseText + ")</div>";=0A=
  6454. }=0A=
  6455. }=0A=
  6456. else {=0A=
  6457. alert("bad target for sajax_do_call: not a function or object: " + =
  6458. target);=0A=
  6459. }=0A=
  6460. =0A=
  6461. return;=0A=
  6462. }=0A=
  6463. =0A=
  6464. sajax_debug(func_name + " uri =3D " + uri + " / post =3D " + post_data);=0A=
  6465. x.send(post_data);=0A=
  6466. sajax_debug(func_name + " waiting..");=0A=
  6467. delete x;=0A=
  6468. =0A=
  6469. return true;=0A=
  6470. }=0A=
  6471. =0A=
  6472. /**=0A=
  6473. * @return boolean whether the browser supports XMLHttpRequest=0A=
  6474. */=0A=
  6475. function wfSupportsAjax() {=0A=
  6476. var request =3D sajax_init_object();=0A=
  6477. var supportsAjax =3D request ? true : false;=0A=
  6478. delete request;=0A=
  6479. return supportsAjax;=0A=
  6480. }=0A=
  6481. =0A=
  6482. ------=_NextPart_000_0000_01CC6DEF.5A1D4220
  6483. Content-Type: application/octet-stream
  6484. Content-Transfer-Encoding: quoted-printable
  6485. Content-Location: http://wiki.theory.org/index.php?title=-&action=raw&gen=js&useskin=monobook&270
  6486. /* generated javascript */=0A=
  6487. var skin =3D 'monobook';=0A=
  6488. var stylepath =3D '/skins';=0A=
  6489. =0A=
  6490. /* MediaWiki:Common.js */=0A=
  6491. /* Any JavaScript here will be loaded for all users on every page load. =
  6492. */=0A=
  6493. =0A=
  6494. /* MediaWiki:Monobook.js */=0A=
  6495. /* Any JavaScript here will be loaded for users using the MonoBook skin =
  6496. */
  6497. ------=_NextPart_000_0000_01CC6DEF.5A1D4220--