dnsruby 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (452) hide show
  1. data/README +3 -3
  2. data/lib/Dnsruby/Config.rb +3 -3
  3. data/lib/Dnsruby/DNS.rb +4 -2
  4. data/lib/Dnsruby/Resolver.rb +42 -38
  5. data/lib/Dnsruby/SingleResolver.rb +29 -21
  6. data/lib/Dnsruby/TheLog.rb +5 -21
  7. data/lib/Dnsruby/dnssec.rb +1 -1
  8. data/lib/Dnsruby/event_machine_interface.rb +23 -22
  9. data/lib/Dnsruby/message.rb +1 -1
  10. data/lib/Dnsruby/name.rb +1 -0
  11. data/lib/Dnsruby/resource/TKEY.rb +1 -1
  12. data/lib/Dnsruby/resource/TSIG.rb +8 -8
  13. data/lib/Dnsruby/select_thread.rb +19 -17
  14. data/lib/Dnsruby/zone_transfer.rb +6 -6
  15. data/lib/dnsruby.rb +10 -1
  16. data/test/tc_dns.rb +5 -1
  17. data/test/tc_event_machine_deferrable.rb +1 -1
  18. data/test/tc_event_machine_res.rb +1 -1
  19. data/test/tc_event_machine_single_res.rb +1 -1
  20. data/test/tc_event_machine_soak.rb +4 -4
  21. data/test/tc_res_opt.rb +4 -4
  22. data/test/tc_single_resolver.rb +1 -6
  23. data/test/tc_soak_base.rb +2 -2
  24. data/test/tc_tsig.rb +3 -3
  25. data/test/ts_offline.rb +1 -1
  26. data/test/ts_online.rb +1 -1
  27. metadata +2 -480
  28. data/doc/classes/Dnsruby/Algorithms.html +0 -171
  29. data/doc/classes/Dnsruby/Classes.html +0 -197
  30. data/doc/classes/Dnsruby/Classes.src/M000209.html +0 -23
  31. data/doc/classes/Dnsruby/Classes.src/M000210.html +0 -19
  32. data/doc/classes/Dnsruby/CodeMapper.html +0 -375
  33. data/doc/classes/Dnsruby/CodeMapper.src/M000186.html +0 -18
  34. data/doc/classes/Dnsruby/CodeMapper.src/M000187.html +0 -33
  35. data/doc/classes/Dnsruby/CodeMapper.src/M000188.html +0 -21
  36. data/doc/classes/Dnsruby/CodeMapper.src/M000189.html +0 -19
  37. data/doc/classes/Dnsruby/CodeMapper.src/M000190.html +0 -19
  38. data/doc/classes/Dnsruby/CodeMapper.src/M000191.html +0 -18
  39. data/doc/classes/Dnsruby/CodeMapper.src/M000192.html +0 -22
  40. data/doc/classes/Dnsruby/CodeMapper.src/M000193.html +0 -22
  41. data/doc/classes/Dnsruby/CodeMapper.src/M000194.html +0 -22
  42. data/doc/classes/Dnsruby/CodeMapper.src/M000195.html +0 -31
  43. data/doc/classes/Dnsruby/CodeMapper.src/M000196.html +0 -19
  44. data/doc/classes/Dnsruby/Config.html +0 -413
  45. data/doc/classes/Dnsruby/Config.src/M000148.html +0 -18
  46. data/doc/classes/Dnsruby/Config.src/M000149.html +0 -19
  47. data/doc/classes/Dnsruby/Config.src/M000150.html +0 -19
  48. data/doc/classes/Dnsruby/Config.src/M000151.html +0 -25
  49. data/doc/classes/Dnsruby/Config.src/M000152.html +0 -21
  50. data/doc/classes/Dnsruby/Config.src/M000153.html +0 -38
  51. data/doc/classes/Dnsruby/Config.src/M000154.html +0 -26
  52. data/doc/classes/Dnsruby/Config.src/M000155.html +0 -22
  53. data/doc/classes/Dnsruby/Config.src/M000156.html +0 -27
  54. data/doc/classes/Dnsruby/Config.src/M000157.html +0 -22
  55. data/doc/classes/Dnsruby/Config.src/M000158.html +0 -21
  56. data/doc/classes/Dnsruby/DNS.html +0 -571
  57. data/doc/classes/Dnsruby/DNS.src/M000258.html +0 -24
  58. data/doc/classes/Dnsruby/DNS.src/M000259.html +0 -18
  59. data/doc/classes/Dnsruby/DNS.src/M000260.html +0 -18
  60. data/doc/classes/Dnsruby/DNS.src/M000261.html +0 -20
  61. data/doc/classes/Dnsruby/DNS.src/M000262.html +0 -19
  62. data/doc/classes/Dnsruby/DNS.src/M000263.html +0 -20
  63. data/doc/classes/Dnsruby/DNS.src/M000264.html +0 -18
  64. data/doc/classes/Dnsruby/DNS.src/M000265.html +0 -19
  65. data/doc/classes/Dnsruby/DNS.src/M000266.html +0 -20
  66. data/doc/classes/Dnsruby/DNS.src/M000267.html +0 -28
  67. data/doc/classes/Dnsruby/DNS.src/M000268.html +0 -19
  68. data/doc/classes/Dnsruby/DNS.src/M000269.html +0 -20
  69. data/doc/classes/Dnsruby/DNS.src/M000270.html +0 -31
  70. data/doc/classes/Dnsruby/DecodeError.html +0 -120
  71. data/doc/classes/Dnsruby/Dnssec.html +0 -287
  72. data/doc/classes/Dnsruby/Dnssec.src/M000249.html +0 -23
  73. data/doc/classes/Dnsruby/Dnssec.src/M000250.html +0 -19
  74. data/doc/classes/Dnsruby/Dnssec.src/M000251.html +0 -90
  75. data/doc/classes/Dnsruby/Dnssec.src/M000252.html +0 -76
  76. data/doc/classes/Dnsruby/EncodeError.html +0 -120
  77. data/doc/classes/Dnsruby/FormErr.html +0 -119
  78. data/doc/classes/Dnsruby/Header.html +0 -501
  79. data/doc/classes/Dnsruby/Header.src/M000231.html +0 -35
  80. data/doc/classes/Dnsruby/Header.src/M000232.html +0 -18
  81. data/doc/classes/Dnsruby/Header.src/M000233.html +0 -18
  82. data/doc/classes/Dnsruby/Header.src/M000234.html +0 -21
  83. data/doc/classes/Dnsruby/Header.src/M000235.html +0 -20
  84. data/doc/classes/Dnsruby/Header.src/M000236.html +0 -32
  85. data/doc/classes/Dnsruby/Header.src/M000237.html +0 -27
  86. data/doc/classes/Dnsruby/Header.src/M000238.html +0 -26
  87. data/doc/classes/Dnsruby/Header.src/M000239.html +0 -47
  88. data/doc/classes/Dnsruby/Header.src/M000240.html +0 -28
  89. data/doc/classes/Dnsruby/Header.src/M000241.html +0 -30
  90. data/doc/classes/Dnsruby/Hosts.html +0 -316
  91. data/doc/classes/Dnsruby/Hosts.src/M000197.html +0 -20
  92. data/doc/classes/Dnsruby/Hosts.src/M000198.html +0 -19
  93. data/doc/classes/Dnsruby/Hosts.src/M000199.html +0 -20
  94. data/doc/classes/Dnsruby/Hosts.src/M000200.html +0 -21
  95. data/doc/classes/Dnsruby/Hosts.src/M000201.html +0 -19
  96. data/doc/classes/Dnsruby/Hosts.src/M000202.html +0 -20
  97. data/doc/classes/Dnsruby/Hosts.src/M000203.html +0 -21
  98. data/doc/classes/Dnsruby/IPv4.html +0 -233
  99. data/doc/classes/Dnsruby/IPv4.src/M000204.html +0 -32
  100. data/doc/classes/Dnsruby/IPv4.src/M000205.html +0 -19
  101. data/doc/classes/Dnsruby/IPv4.src/M000206.html +0 -18
  102. data/doc/classes/Dnsruby/IPv4.src/M000207.html +0 -18
  103. data/doc/classes/Dnsruby/IPv4.src/M000208.html +0 -18
  104. data/doc/classes/Dnsruby/IPv6.html +0 -281
  105. data/doc/classes/Dnsruby/IPv6.src/M000242.html +0 -60
  106. data/doc/classes/Dnsruby/IPv6.src/M000243.html +0 -22
  107. data/doc/classes/Dnsruby/IPv6.src/M000244.html +0 -20
  108. data/doc/classes/Dnsruby/IPv6.src/M000245.html +0 -18
  109. data/doc/classes/Dnsruby/Message/Section.html +0 -160
  110. data/doc/classes/Dnsruby/Message/Section.src/M000141.html +0 -29
  111. data/doc/classes/Dnsruby/Message/Section.src/M000142.html +0 -30
  112. data/doc/classes/Dnsruby/Message.html +0 -803
  113. data/doc/classes/Dnsruby/Message.src/M000119.html +0 -38
  114. data/doc/classes/Dnsruby/Message.src/M000120.html +0 -26
  115. data/doc/classes/Dnsruby/Message.src/M000121.html +0 -22
  116. data/doc/classes/Dnsruby/Message.src/M000122.html +0 -22
  117. data/doc/classes/Dnsruby/Message.src/M000123.html +0 -20
  118. data/doc/classes/Dnsruby/Message.src/M000124.html +0 -20
  119. data/doc/classes/Dnsruby/Message.src/M000125.html +0 -20
  120. data/doc/classes/Dnsruby/Message.src/M000126.html +0 -20
  121. data/doc/classes/Dnsruby/Message.src/M000127.html +0 -18
  122. data/doc/classes/Dnsruby/Message.src/M000128.html +0 -20
  123. data/doc/classes/Dnsruby/Message.src/M000129.html +0 -23
  124. data/doc/classes/Dnsruby/Message.src/M000130.html +0 -30
  125. data/doc/classes/Dnsruby/Message.src/M000131.html +0 -20
  126. data/doc/classes/Dnsruby/Message.src/M000132.html +0 -18
  127. data/doc/classes/Dnsruby/Message.src/M000133.html +0 -56
  128. data/doc/classes/Dnsruby/Message.src/M000134.html +0 -35
  129. data/doc/classes/Dnsruby/Message.src/M000135.html +0 -46
  130. data/doc/classes/Dnsruby/MetaTypes.html +0 -136
  131. data/doc/classes/Dnsruby/Modes.html +0 -171
  132. data/doc/classes/Dnsruby/NXDomain.html +0 -119
  133. data/doc/classes/Dnsruby/Name/Label.html +0 -300
  134. data/doc/classes/Dnsruby/Name/Label.src/M000110.html +0 -21
  135. data/doc/classes/Dnsruby/Name/Label.src/M000111.html +0 -18
  136. data/doc/classes/Dnsruby/Name/Label.src/M000112.html +0 -22
  137. data/doc/classes/Dnsruby/Name/Label.src/M000113.html +0 -18
  138. data/doc/classes/Dnsruby/Name/Label.src/M000114.html +0 -18
  139. data/doc/classes/Dnsruby/Name/Label.src/M000115.html +0 -18
  140. data/doc/classes/Dnsruby/Name/Label.src/M000116.html +0 -18
  141. data/doc/classes/Dnsruby/Name/Label.src/M000117.html +0 -18
  142. data/doc/classes/Dnsruby/Name/Label.src/M000118.html +0 -18
  143. data/doc/classes/Dnsruby/Name.html +0 -330
  144. data/doc/classes/Dnsruby/Name.src/M000104.html +0 -28
  145. data/doc/classes/Dnsruby/Name.src/M000105.html +0 -20
  146. data/doc/classes/Dnsruby/Name.src/M000106.html +0 -18
  147. data/doc/classes/Dnsruby/Name.src/M000107.html +0 -21
  148. data/doc/classes/Dnsruby/Name.src/M000108.html +0 -22
  149. data/doc/classes/Dnsruby/Name.src/M000109.html +0 -18
  150. data/doc/classes/Dnsruby/NotImp.html +0 -119
  151. data/doc/classes/Dnsruby/OpCode.html +0 -146
  152. data/doc/classes/Dnsruby/OtherResolvError.html +0 -119
  153. data/doc/classes/Dnsruby/QTypes.html +0 -146
  154. data/doc/classes/Dnsruby/Question.html +0 -301
  155. data/doc/classes/Dnsruby/Question.src/M000226.html +0 -47
  156. data/doc/classes/Dnsruby/Question.src/M000227.html +0 -18
  157. data/doc/classes/Dnsruby/Question.src/M000228.html +0 -18
  158. data/doc/classes/Dnsruby/Question.src/M000229.html +0 -32
  159. data/doc/classes/Dnsruby/Question.src/M000230.html +0 -18
  160. data/doc/classes/Dnsruby/RCode.html +0 -211
  161. data/doc/classes/Dnsruby/RR/ANY.html +0 -133
  162. data/doc/classes/Dnsruby/RR/CERT/CertificateTypes.html +0 -169
  163. data/doc/classes/Dnsruby/RR/CERT.html +0 -180
  164. data/doc/classes/Dnsruby/RR/CNAME.html +0 -151
  165. data/doc/classes/Dnsruby/RR/DNAME.html +0 -150
  166. data/doc/classes/Dnsruby/RR/DNSKEY.html +0 -422
  167. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000044.html +0 -20
  168. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000045.html +0 -21
  169. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000046.html +0 -28
  170. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000047.html +0 -22
  171. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000048.html +0 -18
  172. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000049.html +0 -22
  173. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000050.html +0 -18
  174. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000051.html +0 -26
  175. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000052.html +0 -38
  176. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000053.html +0 -45
  177. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000054.html +0 -21
  178. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000055.html +0 -24
  179. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000056.html +0 -32
  180. data/doc/classes/Dnsruby/RR/DNSKEY.src/M000057.html +0 -24
  181. data/doc/classes/Dnsruby/RR/DS.html +0 -286
  182. data/doc/classes/Dnsruby/RR/DS.src/M000039.html +0 -22
  183. data/doc/classes/Dnsruby/RR/DS.src/M000040.html +0 -28
  184. data/doc/classes/Dnsruby/RR/DS.src/M000041.html +0 -24
  185. data/doc/classes/Dnsruby/RR/DS.src/M000042.html +0 -28
  186. data/doc/classes/Dnsruby/RR/DS.src/M000043.html +0 -36
  187. data/doc/classes/Dnsruby/RR/DomainName.html +0 -175
  188. data/doc/classes/Dnsruby/RR/DomainName.src/M000083.html +0 -18
  189. data/doc/classes/Dnsruby/RR/Generic.html +0 -133
  190. data/doc/classes/Dnsruby/RR/HINFO.html +0 -155
  191. data/doc/classes/Dnsruby/RR/IN/A.html +0 -200
  192. data/doc/classes/Dnsruby/RR/IN/A.src/M000017.html +0 -18
  193. data/doc/classes/Dnsruby/RR/IN/A.src/M000018.html +0 -18
  194. data/doc/classes/Dnsruby/RR/IN/A.src/M000019.html +0 -18
  195. data/doc/classes/Dnsruby/RR/IN/AAAA.html +0 -139
  196. data/doc/classes/Dnsruby/RR/IN/AFSDB.html +0 -145
  197. data/doc/classes/Dnsruby/RR/IN/PX.html +0 -143
  198. data/doc/classes/Dnsruby/RR/IN/SRV.html +0 -238
  199. data/doc/classes/Dnsruby/RR/IN/SRV.src/M000014.html +0 -29
  200. data/doc/classes/Dnsruby/RR/IN/SRV.src/M000015.html +0 -26
  201. data/doc/classes/Dnsruby/RR/IN/SRV.src/M000016.html +0 -22
  202. data/doc/classes/Dnsruby/RR/IN/WKS.html +0 -166
  203. data/doc/classes/Dnsruby/RR/IN/WKS.src/M000020.html +0 -20
  204. data/doc/classes/Dnsruby/RR/IN.html +0 -155
  205. data/doc/classes/Dnsruby/RR/ISDN.html +0 -155
  206. data/doc/classes/Dnsruby/RR/LOC.html +0 -395
  207. data/doc/classes/Dnsruby/RR/LOC.src/M000025.html +0 -32
  208. data/doc/classes/Dnsruby/RR/LOC.src/M000026.html +0 -23
  209. data/doc/classes/Dnsruby/RR/LOC.src/M000027.html +0 -25
  210. data/doc/classes/Dnsruby/RR/LOC.src/M000028.html +0 -21
  211. data/doc/classes/Dnsruby/RR/LOC.src/M000029.html +0 -20
  212. data/doc/classes/Dnsruby/RR/LOC.src/M000030.html +0 -23
  213. data/doc/classes/Dnsruby/RR/MB.html +0 -150
  214. data/doc/classes/Dnsruby/RR/MG.html +0 -150
  215. data/doc/classes/Dnsruby/RR/MINFO.html +0 -156
  216. data/doc/classes/Dnsruby/RR/MR.html +0 -150
  217. data/doc/classes/Dnsruby/RR/MX.html +0 -155
  218. data/doc/classes/Dnsruby/RR/NAPTR.html +0 -190
  219. data/doc/classes/Dnsruby/RR/NS.html +0 -151
  220. data/doc/classes/Dnsruby/RR/NSAP.html +0 -293
  221. data/doc/classes/Dnsruby/RR/NSAP.src/M000093.html +0 -19
  222. data/doc/classes/Dnsruby/RR/NSAP.src/M000094.html +0 -19
  223. data/doc/classes/Dnsruby/RR/NSAP.src/M000095.html +0 -22
  224. data/doc/classes/Dnsruby/RR/NSAP.src/M000096.html +0 -31
  225. data/doc/classes/Dnsruby/RR/NSEC.html +0 -301
  226. data/doc/classes/Dnsruby/RR/NSEC.src/M000031.html +0 -19
  227. data/doc/classes/Dnsruby/RR/NSEC.src/M000032.html +0 -18
  228. data/doc/classes/Dnsruby/RR/NSEC.src/M000033.html +0 -34
  229. data/doc/classes/Dnsruby/RR/NSEC.src/M000034.html +0 -18
  230. data/doc/classes/Dnsruby/RR/NSEC.src/M000035.html +0 -71
  231. data/doc/classes/Dnsruby/RR/NSEC.src/M000036.html +0 -18
  232. data/doc/classes/Dnsruby/RR/NSEC.src/M000037.html +0 -80
  233. data/doc/classes/Dnsruby/RR/NSEC.src/M000038.html +0 -23
  234. data/doc/classes/Dnsruby/RR/NSEC3.html +0 -366
  235. data/doc/classes/Dnsruby/RR/NSEC3.src/M000085.html +0 -28
  236. data/doc/classes/Dnsruby/RR/NSEC3.src/M000086.html +0 -18
  237. data/doc/classes/Dnsruby/RR/NSEC3.src/M000087.html +0 -18
  238. data/doc/classes/Dnsruby/RR/NSEC3.src/M000088.html +0 -22
  239. data/doc/classes/Dnsruby/RR/NSEC3.src/M000089.html +0 -18
  240. data/doc/classes/Dnsruby/RR/NSEC3.src/M000090.html +0 -21
  241. data/doc/classes/Dnsruby/RR/NSEC3.src/M000091.html +0 -21
  242. data/doc/classes/Dnsruby/RR/NSEC3.src/M000092.html +0 -29
  243. data/doc/classes/Dnsruby/RR/NSEC3PARAM.html +0 -279
  244. data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000077.html +0 -28
  245. data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000078.html +0 -18
  246. data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000079.html +0 -22
  247. data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000080.html +0 -21
  248. data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000081.html +0 -25
  249. data/doc/classes/Dnsruby/RR/PTR.html +0 -132
  250. data/doc/classes/Dnsruby/RR/RP.html +0 -183
  251. data/doc/classes/Dnsruby/RR/RP.src/M000082.html +0 -19
  252. data/doc/classes/Dnsruby/RR/RRSIG.html +0 -357
  253. data/doc/classes/Dnsruby/RR/RRSIG.src/M000097.html +0 -26
  254. data/doc/classes/Dnsruby/RR/RRSIG.src/M000098.html +0 -28
  255. data/doc/classes/Dnsruby/RR/RRSIG.src/M000099.html +0 -23
  256. data/doc/classes/Dnsruby/RR/RRSIG.src/M000100.html +0 -23
  257. data/doc/classes/Dnsruby/RR/RRSIG.src/M000101.html +0 -46
  258. data/doc/classes/Dnsruby/RR/RRSIG.src/M000102.html +0 -50
  259. data/doc/classes/Dnsruby/RR/RRSIG.src/M000103.html +0 -27
  260. data/doc/classes/Dnsruby/RR/RT.html +0 -155
  261. data/doc/classes/Dnsruby/RR/SOA.html +0 -233
  262. data/doc/classes/Dnsruby/RR/SOA.src/M000066.html +0 -24
  263. data/doc/classes/Dnsruby/RR/SOA.src/M000067.html +0 -27
  264. data/doc/classes/Dnsruby/RR/SPF.html +0 -138
  265. data/doc/classes/Dnsruby/RR/TKEY.html +0 -313
  266. data/doc/classes/Dnsruby/RR/TKEY.src/M000021.html +0 -19
  267. data/doc/classes/Dnsruby/RR/TKEY.src/M000022.html +0 -29
  268. data/doc/classes/Dnsruby/RR/TKEY.src/M000023.html +0 -21
  269. data/doc/classes/Dnsruby/RR/TKEY.src/M000024.html +0 -29
  270. data/doc/classes/Dnsruby/RR/TSIG.html +0 -524
  271. data/doc/classes/Dnsruby/RR/TSIG.src/M000068.html +0 -24
  272. data/doc/classes/Dnsruby/RR/TSIG.src/M000069.html +0 -32
  273. data/doc/classes/Dnsruby/RR/TSIG.src/M000070.html +0 -54
  274. data/doc/classes/Dnsruby/RR/TSIG.src/M000071.html +0 -121
  275. data/doc/classes/Dnsruby/RR/TSIG.src/M000072.html +0 -33
  276. data/doc/classes/Dnsruby/RR/TSIG.src/M000073.html +0 -25
  277. data/doc/classes/Dnsruby/RR/TSIG.src/M000074.html +0 -36
  278. data/doc/classes/Dnsruby/RR/TSIG.src/M000075.html +0 -22
  279. data/doc/classes/Dnsruby/RR/TSIG.src/M000076.html +0 -29
  280. data/doc/classes/Dnsruby/RR/TXT.html +0 -233
  281. data/doc/classes/Dnsruby/RR/TXT.src/M000061.html +0 -18
  282. data/doc/classes/Dnsruby/RR/TXT.src/M000062.html +0 -18
  283. data/doc/classes/Dnsruby/RR/TXT.src/M000063.html +0 -20
  284. data/doc/classes/Dnsruby/RR/TXT.src/M000064.html +0 -27
  285. data/doc/classes/Dnsruby/RR/TXT.src/M000065.html +0 -25
  286. data/doc/classes/Dnsruby/RR/X25.html +0 -203
  287. data/doc/classes/Dnsruby/RR/X25.src/M000058.html +0 -18
  288. data/doc/classes/Dnsruby/RR/X25.src/M000059.html +0 -18
  289. data/doc/classes/Dnsruby/RR/X25.src/M000060.html +0 -22
  290. data/doc/classes/Dnsruby/RR.html +0 -648
  291. data/doc/classes/Dnsruby/RR.src/M000001.html +0 -18
  292. data/doc/classes/Dnsruby/RR.src/M000002.html +0 -22
  293. data/doc/classes/Dnsruby/RR.src/M000003.html +0 -18
  294. data/doc/classes/Dnsruby/RR.src/M000004.html +0 -18
  295. data/doc/classes/Dnsruby/RR.src/M000005.html +0 -26
  296. data/doc/classes/Dnsruby/RR.src/M000006.html +0 -18
  297. data/doc/classes/Dnsruby/RR.src/M000007.html +0 -36
  298. data/doc/classes/Dnsruby/RR.src/M000008.html +0 -100
  299. data/doc/classes/Dnsruby/RR.src/M000009.html +0 -18
  300. data/doc/classes/Dnsruby/RR.src/M000010.html +0 -18
  301. data/doc/classes/Dnsruby/RR.src/M000011.html +0 -22
  302. data/doc/classes/Dnsruby/RR.src/M000012.html +0 -29
  303. data/doc/classes/Dnsruby/RR.src/M000013.html +0 -24
  304. data/doc/classes/Dnsruby/RRSet.html +0 -404
  305. data/doc/classes/Dnsruby/RRSet.src/M000211.html +0 -23
  306. data/doc/classes/Dnsruby/RRSet.src/M000212.html +0 -18
  307. data/doc/classes/Dnsruby/RRSet.src/M000213.html +0 -18
  308. data/doc/classes/Dnsruby/RRSet.src/M000214.html +0 -47
  309. data/doc/classes/Dnsruby/RRSet.src/M000215.html +0 -42
  310. data/doc/classes/Dnsruby/RRSet.src/M000216.html +0 -18
  311. data/doc/classes/Dnsruby/RRSet.src/M000217.html +0 -20
  312. data/doc/classes/Dnsruby/RRSet.src/M000218.html +0 -18
  313. data/doc/classes/Dnsruby/RRSet.src/M000219.html +0 -18
  314. data/doc/classes/Dnsruby/RRSet.src/M000220.html +0 -18
  315. data/doc/classes/Dnsruby/RRSet.src/M000221.html +0 -18
  316. data/doc/classes/Dnsruby/RRSet.src/M000222.html +0 -22
  317. data/doc/classes/Dnsruby/RRSet.src/M000223.html +0 -18
  318. data/doc/classes/Dnsruby/RRSet.src/M000224.html +0 -22
  319. data/doc/classes/Dnsruby/RRSet.src/M000225.html +0 -18
  320. data/doc/classes/Dnsruby/Refused.html +0 -119
  321. data/doc/classes/Dnsruby/Resolv.html +0 -401
  322. data/doc/classes/Dnsruby/Resolv.src/M000159.html +0 -18
  323. data/doc/classes/Dnsruby/Resolv.src/M000160.html +0 -18
  324. data/doc/classes/Dnsruby/Resolv.src/M000161.html +0 -18
  325. data/doc/classes/Dnsruby/Resolv.src/M000162.html +0 -18
  326. data/doc/classes/Dnsruby/Resolv.src/M000163.html +0 -18
  327. data/doc/classes/Dnsruby/Resolv.src/M000164.html +0 -18
  328. data/doc/classes/Dnsruby/Resolv.src/M000165.html +0 -18
  329. data/doc/classes/Dnsruby/Resolv.src/M000166.html +0 -19
  330. data/doc/classes/Dnsruby/Resolv.src/M000167.html +0 -20
  331. data/doc/classes/Dnsruby/Resolv.src/M000168.html +0 -29
  332. data/doc/classes/Dnsruby/Resolv.src/M000169.html +0 -19
  333. data/doc/classes/Dnsruby/Resolv.src/M000170.html +0 -20
  334. data/doc/classes/Dnsruby/Resolv.src/M000171.html +0 -25
  335. data/doc/classes/Dnsruby/ResolvError.html +0 -117
  336. data/doc/classes/Dnsruby/ResolvTimeout.html +0 -117
  337. data/doc/classes/Dnsruby/Resolver.html +0 -1055
  338. data/doc/classes/Dnsruby/Resolver.src/M000271.html +0 -21
  339. data/doc/classes/Dnsruby/Resolver.src/M000272.html +0 -27
  340. data/doc/classes/Dnsruby/Resolver.src/M000273.html +0 -28
  341. data/doc/classes/Dnsruby/Resolver.src/M000274.html +0 -18
  342. data/doc/classes/Dnsruby/Resolver.src/M000275.html +0 -51
  343. data/doc/classes/Dnsruby/Resolver.src/M000276.html +0 -21
  344. data/doc/classes/Dnsruby/Resolver.src/M000277.html +0 -22
  345. data/doc/classes/Dnsruby/Resolver.src/M000278.html +0 -18
  346. data/doc/classes/Dnsruby/Resolver.src/M000279.html +0 -20
  347. data/doc/classes/Dnsruby/Resolver.src/M000280.html +0 -19
  348. data/doc/classes/Dnsruby/Resolver.src/M000281.html +0 -19
  349. data/doc/classes/Dnsruby/Resolver.src/M000282.html +0 -19
  350. data/doc/classes/Dnsruby/Resolver.src/M000283.html +0 -19
  351. data/doc/classes/Dnsruby/Resolver.src/M000284.html +0 -19
  352. data/doc/classes/Dnsruby/Resolver.src/M000285.html +0 -19
  353. data/doc/classes/Dnsruby/Resolver.src/M000286.html +0 -19
  354. data/doc/classes/Dnsruby/Resolver.src/M000287.html +0 -19
  355. data/doc/classes/Dnsruby/Resolver.src/M000288.html +0 -19
  356. data/doc/classes/Dnsruby/Resolver.src/M000289.html +0 -19
  357. data/doc/classes/Dnsruby/Resolver.src/M000290.html +0 -19
  358. data/doc/classes/Dnsruby/Resolver.src/M000291.html +0 -19
  359. data/doc/classes/Dnsruby/Resolver.src/M000292.html +0 -26
  360. data/doc/classes/Dnsruby/Resolver.src/M000293.html +0 -18
  361. data/doc/classes/Dnsruby/Resolver.src/M000294.html +0 -23
  362. data/doc/classes/Dnsruby/Resolver.src/M000295.html +0 -18
  363. data/doc/classes/Dnsruby/ServFail.html +0 -119
  364. data/doc/classes/Dnsruby/SingleResolver.html +0 -674
  365. data/doc/classes/Dnsruby/SingleResolver.src/M000172.html +0 -18
  366. data/doc/classes/Dnsruby/SingleResolver.src/M000173.html +0 -24
  367. data/doc/classes/Dnsruby/SingleResolver.src/M000174.html +0 -36
  368. data/doc/classes/Dnsruby/SingleResolver.src/M000175.html +0 -18
  369. data/doc/classes/Dnsruby/SingleResolver.src/M000176.html +0 -19
  370. data/doc/classes/Dnsruby/SingleResolver.src/M000177.html +0 -50
  371. data/doc/classes/Dnsruby/SingleResolver.src/M000178.html +0 -19
  372. data/doc/classes/Dnsruby/SingleResolver.src/M000179.html +0 -21
  373. data/doc/classes/Dnsruby/SingleResolver.src/M000180.html +0 -25
  374. data/doc/classes/Dnsruby/SingleResolver.src/M000181.html +0 -54
  375. data/doc/classes/Dnsruby/SingleResolver.src/M000182.html +0 -27
  376. data/doc/classes/Dnsruby/SingleResolver.src/M000183.html +0 -27
  377. data/doc/classes/Dnsruby/SingleResolver.src/M000184.html +0 -35
  378. data/doc/classes/Dnsruby/SingleResolver.src/M000185.html +0 -21
  379. data/doc/classes/Dnsruby/TheLog.html +0 -196
  380. data/doc/classes/Dnsruby/TheLog.src/M000246.html +0 -20
  381. data/doc/classes/Dnsruby/TheLog.src/M000247.html +0 -20
  382. data/doc/classes/Dnsruby/TheLog.src/M000248.html +0 -20
  383. data/doc/classes/Dnsruby/Types.html +0 -436
  384. data/doc/classes/Dnsruby/Update.html +0 -368
  385. data/doc/classes/Dnsruby/Update.src/M000253.html +0 -32
  386. data/doc/classes/Dnsruby/Update.src/M000254.html +0 -36
  387. data/doc/classes/Dnsruby/Update.src/M000255.html +0 -32
  388. data/doc/classes/Dnsruby/Update.src/M000256.html +0 -41
  389. data/doc/classes/Dnsruby/Update.src/M000257.html +0 -34
  390. data/doc/classes/Dnsruby/VerifyError.html +0 -119
  391. data/doc/classes/Dnsruby/ZoneTransfer/Delta.html +0 -200
  392. data/doc/classes/Dnsruby/ZoneTransfer/Delta.src/M000146.html +0 -19
  393. data/doc/classes/Dnsruby/ZoneTransfer/Delta.src/M000147.html +0 -19
  394. data/doc/classes/Dnsruby/ZoneTransfer.html +0 -300
  395. data/doc/classes/Dnsruby/ZoneTransfer.src/M000143.html +0 -18
  396. data/doc/classes/Dnsruby/ZoneTransfer.src/M000144.html +0 -24
  397. data/doc/classes/Dnsruby/ZoneTransfer.src/M000145.html +0 -35
  398. data/doc/classes/Dnsruby.html +0 -463
  399. data/doc/created.rid +0 -1
  400. data/doc/files/lib/Dnsruby/Config_rb.html +0 -101
  401. data/doc/files/lib/Dnsruby/DNS_rb.html +0 -110
  402. data/doc/files/lib/Dnsruby/Hosts_rb.html +0 -108
  403. data/doc/files/lib/Dnsruby/Resolver_rb.html +0 -109
  404. data/doc/files/lib/Dnsruby/SingleResolver_rb.html +0 -108
  405. data/doc/files/lib/Dnsruby/TheLog_rb.html +0 -110
  406. data/doc/files/lib/Dnsruby/code_mapper_rb.html +0 -101
  407. data/doc/files/lib/Dnsruby/dnssec_rb.html +0 -107
  408. data/doc/files/lib/Dnsruby/event_machine_interface_rb.html +0 -108
  409. data/doc/files/lib/Dnsruby/ipv4_rb.html +0 -101
  410. data/doc/files/lib/Dnsruby/ipv6_rb.html +0 -101
  411. data/doc/files/lib/Dnsruby/message_rb.html +0 -109
  412. data/doc/files/lib/Dnsruby/name_rb.html +0 -101
  413. data/doc/files/lib/Dnsruby/resource/AAAA_rb.html +0 -101
  414. data/doc/files/lib/Dnsruby/resource/AFSDB_rb.html +0 -101
  415. data/doc/files/lib/Dnsruby/resource/A_rb.html +0 -101
  416. data/doc/files/lib/Dnsruby/resource/CERT_rb.html +0 -101
  417. data/doc/files/lib/Dnsruby/resource/DNSKEY_rb.html +0 -101
  418. data/doc/files/lib/Dnsruby/resource/DS_rb.html +0 -101
  419. data/doc/files/lib/Dnsruby/resource/HINFO_rb.html +0 -101
  420. data/doc/files/lib/Dnsruby/resource/IN_rb.html +0 -112
  421. data/doc/files/lib/Dnsruby/resource/ISDN_rb.html +0 -101
  422. data/doc/files/lib/Dnsruby/resource/LOC_rb.html +0 -101
  423. data/doc/files/lib/Dnsruby/resource/MINFO_rb.html +0 -101
  424. data/doc/files/lib/Dnsruby/resource/MX_rb.html +0 -101
  425. data/doc/files/lib/Dnsruby/resource/NAPTR_rb.html +0 -101
  426. data/doc/files/lib/Dnsruby/resource/NSAP_rb.html +0 -101
  427. data/doc/files/lib/Dnsruby/resource/NSEC3PARAM_rb.html +0 -101
  428. data/doc/files/lib/Dnsruby/resource/NSEC3_rb.html +0 -101
  429. data/doc/files/lib/Dnsruby/resource/NSEC_rb.html +0 -101
  430. data/doc/files/lib/Dnsruby/resource/OPT_rb.html +0 -101
  431. data/doc/files/lib/Dnsruby/resource/PX_rb.html +0 -101
  432. data/doc/files/lib/Dnsruby/resource/RP_rb.html +0 -101
  433. data/doc/files/lib/Dnsruby/resource/RRSIG_rb.html +0 -101
  434. data/doc/files/lib/Dnsruby/resource/RT_rb.html +0 -101
  435. data/doc/files/lib/Dnsruby/resource/SOA_rb.html +0 -101
  436. data/doc/files/lib/Dnsruby/resource/SPF_rb.html +0 -101
  437. data/doc/files/lib/Dnsruby/resource/SRV_rb.html +0 -101
  438. data/doc/files/lib/Dnsruby/resource/TKEY_rb.html +0 -101
  439. data/doc/files/lib/Dnsruby/resource/TSIG_rb.html +0 -114
  440. data/doc/files/lib/Dnsruby/resource/TXT_rb.html +0 -108
  441. data/doc/files/lib/Dnsruby/resource/X25_rb.html +0 -101
  442. data/doc/files/lib/Dnsruby/resource/domain_name_rb.html +0 -101
  443. data/doc/files/lib/Dnsruby/resource/generic_rb.html +0 -131
  444. data/doc/files/lib/Dnsruby/resource/resource_rb.html +0 -110
  445. data/doc/files/lib/Dnsruby/select_thread_rb.html +0 -111
  446. data/doc/files/lib/Dnsruby/update_rb.html +0 -101
  447. data/doc/files/lib/Dnsruby/zone_transfer_rb.html +0 -101
  448. data/doc/files/lib/dnsruby_rb.html +0 -118
  449. data/doc/fr_class_index.html +0 -108
  450. data/doc/fr_file_index.html +0 -75
  451. data/doc/fr_method_index.html +0 -321
  452. data/doc/index.html +0 -24
@@ -23,9 +23,9 @@ module Dnsruby
23
23
  break
24
24
  end
25
25
  c, proc = @@timer_procs[timeout]
26
- proc.call
27
26
  @@timer_procs.delete(timeout)
28
27
  @@timer_keys_sorted.delete(timeout)
28
+ proc.call
29
29
  end
30
30
 
31
31
  if (!@@outstanding_sends.empty?)
@@ -71,21 +71,22 @@ module Dnsruby
71
71
  def EventMachineInterface::start_eventmachine
72
72
  if (!eventmachine_running?)
73
73
  if Resolver.start_eventmachine_loop?
74
- TheLog.debug("Starting EventMachine")
74
+ Dnsruby.log.debug("Starting EventMachine")
75
75
  @@started_em_here = true
76
76
  @@em_thread = Thread.new {
77
77
  EM.run {
78
- EventMachine::add_periodic_timer(0.1) {EventMachineInterface::process_timers}
78
+ # EventMachine::add_periodic_timer(0.1) {EventMachineInterface::process_timers}
79
+ EventMachine::add_timer(0.1) {EventMachineInterface::process_timers}
79
80
  @@df = EventMachine::DefaultDeferrable.new
80
81
  @@df.callback{
81
- TheLog.debug("Stopping EventMachine")
82
+ Dnsruby.log.debug("Stopping EventMachine")
82
83
  EM.stop
83
84
  @@em_thread=nil
84
85
  }
85
86
  }
86
87
  }
87
88
  else
88
- TheLog.debug("Not trying to start event loop")
89
+ Dnsruby.log.debug("Not trying to start event loop")
89
90
  end
90
91
  end
91
92
  end
@@ -130,12 +131,12 @@ module Dnsruby
130
131
  end
131
132
  rescue Exception
132
133
  #@TODO@ EM::reactor_running? only introduced in EM v0.9.0 - if it's not there, we simply don't know what to do...
133
- TheLog.error("EventMachine::reactor_running? not available.")
134
+ Dnsruby.log.error("EventMachine::reactor_running? not available.")
134
135
  # if Resolver.start_eventmachine_loop?
135
- # TheLog.debug("Trying to start event loop - may prove fatal...")
136
+ # Dnsruby.log.debug("Trying to start event loop - may prove fatal...")
136
137
  start_eventmachine
137
138
  # else
138
- # TheLog.debug("Not trying to start event loop.")
139
+ # Dnsruby.log.debug("Not trying to start event loop.")
139
140
  # end
140
141
  end
141
142
  df = nil
@@ -157,8 +158,8 @@ module Dnsruby
157
158
  lenmsg = [args[:msg].length].pack('n')
158
159
  c.send_data(lenmsg)
159
160
  c.send_data args[:msg] # , args[:server], args[:port]
160
- TheLog.debug"EventMachine : Sent TCP packet to #{args[:server]}:#{args[:port]}" + # from #{args[:src_addr]}:#{args[:src_port]}, timeout=#{args[:timeout]}"
161
- ", timeout=#{args[:timeout]}"
161
+ Dnsruby.log.debug {"EventMachine : Sent TCP packet to #{args[:server]}:#{args[:port]}" + # from #{args[:src_addr]}:#{args[:src_port]}, timeout=#{args[:timeout]}"
162
+ ", timeout=#{args[:timeout]}"}
162
163
  }
163
164
  return connection # allows clients to set callback, errback, etc., if desired
164
165
  end
@@ -168,7 +169,7 @@ module Dnsruby
168
169
  c.timeout_time=Time.now + args[:timeout]
169
170
  c.instance_eval {@args = args}
170
171
  c.send_datagram args[:msg], args[:server], args[:port]
171
- TheLog.debug"EventMachine : Sent datagram to #{args[:server]}:#{args[:port]} from #{args[:src_addr]}:#{args[:src_port]}, timeout=#{args[:timeout]}"
172
+ Dnsruby.log.debug{"EventMachine : Sent datagram to #{args[:server]}:#{args[:port]} from #{args[:src_addr]}:#{args[:src_port]}, timeout=#{args[:timeout]}"}
172
173
  }
173
174
  return connection # allows clients to set callback, errback, etc., if desired
174
175
  end
@@ -181,23 +182,23 @@ module Dnsruby
181
182
  @closing=false
182
183
  end
183
184
  def receive_data(dgm)
184
- TheLog.debug("UDP receive_data called")
185
+ Dnsruby.log.debug{"UDP receive_data called"}
185
186
  process_incoming_message(dgm)
186
187
  end
187
188
 
188
189
  def process_incoming_message(data)
189
- TheLog.debug("Processing incoming message, #{data.length} bytes")
190
+ Dnsruby.log.debug{"Processing incoming message, #{data.length} bytes"}
190
191
  ans=nil
191
192
  begin
192
193
  ans = Message.decode(data)
193
194
  rescue Exception => e
194
- TheLog.error("Decode error! #{e.class}, #{e}\nfor msg (length=#{data.length}) : #{data}")
195
+ Dnsruby.log.error{"Decode error! #{e.class}, #{e}\nfor msg (length=#{data.length}) : #{data}"}
195
196
  @closing=true
196
197
  close_connection
197
198
  send_to_client(nil, nil, e)
198
199
  return
199
200
  end
200
- TheLog.debug("#{ans}")
201
+ Dnsruby.log.debug{"#{ans}"}
201
202
  ans.answerfrom=(@args[:server])
202
203
  ans.answersize=(data.length)
203
204
  exception = ans.header.get_exception
@@ -207,12 +208,12 @@ module Dnsruby
207
208
  end
208
209
 
209
210
  def unbind
210
- TheLog.debug("Unbind called")
211
+ Dnsruby.log.debug{"Unbind called"}
211
212
  if (!@closing)
212
213
  if (@timeout_time <= Time.now + 1)
213
214
  send_timeout
214
215
  else
215
- TheLog.debug("Sending IOError to client")
216
+ Dnsruby.log.debug{"Sending IOError to client"}
216
217
  send_to_client(nil, nil, IOError.new("Network error"))
217
218
  end
218
219
  end
@@ -221,7 +222,7 @@ module Dnsruby
221
222
  EventMachineInterface.remove_from_outstanding(self)
222
223
  end
223
224
  def send_timeout
224
- TheLog.debug("Sending timeout to client")
225
+ Dnsruby.log.debug{"Sending timeout to client"}
225
226
  send_to_client(nil, nil, ResolvTimeout.new("Query timed out"))
226
227
  end
227
228
  def send_to_client(msg, bytes, err)
@@ -242,19 +243,19 @@ module Dnsruby
242
243
  @answersize = 0
243
244
  end
244
245
  def receive_data(data)
245
- TheLog.debug("TCP receive_data called")
246
+ Dnsruby.log.debug{"TCP receive_data called"}
246
247
  #Buffer up the incoming data until we have a complete packet
247
248
  @data << data
248
249
  if (@data.length >= 2)
249
250
  if (@answersize == 0)
250
251
  @answersize = @data[0..1].unpack('n')[0]
251
- TheLog.debug("TCP - expecting #{@answersize} bytes")
252
+ Dnsruby.log.debug{"TCP - expecting #{@answersize} bytes"}
252
253
  end
253
254
  if (@answersize == @data.length - 2)
254
- TheLog.debug("TCP - got all #{@answersize} bytes ")
255
+ Dnsruby.log.debug{"TCP - got all #{@answersize} bytes "}
255
256
  process_incoming_message(@data[2..@data.length])
256
257
  else
257
- TheLog.debug("TCP - got #{@data.length-2} message bytes")
258
+ Dnsruby.log.debug{"TCP - got #{@data.length-2} message bytes"}
258
259
  end
259
260
  end
260
261
  end
@@ -411,7 +411,7 @@ module Dnsruby
411
411
  rr = msg.get_rr
412
412
  if (rr.type == Types.TSIG)
413
413
  if (count!=o.header.arcount-1)
414
- TheLog.Error("Incoming message has TSIG record before last record")
414
+ Dnsruby.log.Error("Incoming message has TSIG record before last record")
415
415
  raise DecodeError.new("TSIG record present before last record")
416
416
  end
417
417
  o.tsigstart = start # needed for TSIG verification
data/lib/Dnsruby/name.rb CHANGED
@@ -46,6 +46,7 @@ module Dnsruby
46
46
  when String
47
47
  # arg.gsub!(/\.$/o, "")
48
48
  return Name.new(split_escaped(arg), /\.\z/ =~ arg ? true : false)
49
+ # return Name.new(Label.split(arg), /\.\z/ =~ arg ? true : false)
49
50
  when Array
50
51
  return Name.new(arg, /\.\z/ =~ ((arg.last.kind_of?String)?arg.last : arg.last.string) ? true : false)
51
52
  else
@@ -122,7 +122,7 @@ module Dnsruby
122
122
 
123
123
  # Create the RR from a standard string
124
124
  def from_string(string) #:nodoc: all
125
- TheLog.error("Dnsruby::RR::TKEY#from_string called, but no text format defined for TKEY")
125
+ Dnsruby.log.error("Dnsruby::RR::TKEY#from_string called, but no text format defined for TKEY")
126
126
  end
127
127
 
128
128
  def rdata_to_string
@@ -238,7 +238,7 @@ module Dnsruby
238
238
  end
239
239
 
240
240
  if ((tsig_rr.name != @name) || (tsig_rr.algorithm.downcase != @algorithm.downcase))
241
- TheLog.error("BADKEY failure")
241
+ Dnsruby.log.error("BADKEY failure")
242
242
  response.tsigstate = :Failed
243
243
  response.tsigerror = RCode.BADKEY
244
244
  return false
@@ -247,7 +247,7 @@ module Dnsruby
247
247
  # Check time_signed (RFC2845, 4.5.2) - only really necessary for server
248
248
  if (Time.now.to_i > tsig_rr.time_signed + tsig_rr.fudge ||
249
249
  Time.now.to_i < tsig_rr.time_signed - tsig_rr.fudge)
250
- TheLog.error("TSIG failed with BADTIME")
250
+ Dnsruby.log.error("TSIG failed with BADTIME")
251
251
  response.tsigstate = :Failed
252
252
  response.tsigerror = RCode.BADTIME
253
253
  return false
@@ -307,14 +307,14 @@ module Dnsruby
307
307
  @num_envelopes += 1
308
308
  if (!response.tsig)
309
309
  if ((@num_envelopes > 1) && (@num_envelopes - @last_signed < 100))
310
- TheLog.debug("Receiving intermediate envelope in TSIG TCP session")
310
+ Dnsruby.log.debug("Receiving intermediate envelope in TSIG TCP session")
311
311
  response.tsigstate = :Intermediate
312
312
  response.tsigerror = RCode.NOERROR
313
313
  @buf = @buf + response_bytes
314
314
  return
315
315
  else
316
316
  response.tsigstate = :Failed
317
- TheLog.error("Expecting signed packet")
317
+ Dnsruby.log.error("Expecting signed packet")
318
318
  return false
319
319
  end
320
320
  end
@@ -323,7 +323,7 @@ module Dnsruby
323
323
  # We have a TSIG - process it!
324
324
  tsig = response.tsig
325
325
  if (@num_envelopes == 1)
326
- TheLog.debug("First response in TSIG TCP session - verifying normally")
326
+ Dnsruby.log.debug("First response in TSIG TCP session - verifying normally")
327
327
  # Process it as a standard answer
328
328
  ok = verify(@query, response, response_bytes)
329
329
  if (ok)
@@ -336,7 +336,7 @@ module Dnsruby
336
336
  end
337
337
  return ok
338
338
  end
339
- TheLog.debug("Processing TSIG on TSIG TCP session")
339
+ Dnsruby.log.debug("Processing TSIG on TSIG TCP session")
340
340
 
341
341
  if (!verify_common(response))
342
342
  return false
@@ -358,7 +358,7 @@ module Dnsruby
358
358
  mac = calculate_mac(tsig.algorithm, @buf)
359
359
 
360
360
  if (mac != tsig.mac)
361
- TheLog.error("TSIG Verify error on TSIG TCP session")
361
+ Dnsruby.log.error("TSIG Verify error on TSIG TCP session")
362
362
  response.tsigstate = :Failed
363
363
  return false
364
364
  end
@@ -525,7 +525,7 @@ module Dnsruby
525
525
  else
526
526
  raise ArgumentError.new("#{alg.class} not valid type for Dnsruby::RR::TSIG#algorithm= - use String or Name")
527
527
  end
528
- TheLog.debug("Using #{@algorithm.to_s} algorithm")
528
+ Dnsruby.log.debug{"Using #{@algorithm.to_s} algorithm"}
529
529
  end
530
530
 
531
531
  def fudge=(f)
@@ -100,7 +100,7 @@ module Dnsruby
100
100
 
101
101
  def check_select_thread_synchronized
102
102
  if (!@@select_thread.alive?)
103
- TheLog.debug("Restarting select thread")
103
+ Dnsruby.log.debug{"Restarting select thread"}
104
104
  @@select_thread = Thread.new {
105
105
  do_select
106
106
  }
@@ -120,7 +120,7 @@ module Dnsruby
120
120
  while true do
121
121
  send_tick_to_observers
122
122
  send_queued_exceptions
123
- timeout = tick_time = (Time.now+0.1) - Time.now # We provide a timer service to various Dnsruby classes
123
+ timeout = tick_time = 0.1 # We provide a timer service to various Dnsruby classes
124
124
  sockets=[]
125
125
  timeouts=[]
126
126
  has_observer = false
@@ -160,7 +160,7 @@ module Dnsruby
160
160
  end
161
161
  @@mutex.synchronize{
162
162
  if (unused_loop_count > 10 && @@query_hash.empty? && @@observers.empty?)
163
- TheLog.debug("Stopping select loop")
163
+ Dnsruby.log.debug{"Stopping select loop"}
164
164
  return
165
165
  end
166
166
  }
@@ -169,7 +169,7 @@ module Dnsruby
169
169
  end
170
170
 
171
171
  def process_error(errors)
172
- TheLog.debug("Error! #{errors.inspect}")
172
+ Dnsruby.log.debug{"Error! #{errors.inspect}"}
173
173
  # @todo@ Process errors [can we do this in single socket environment?]
174
174
  end
175
175
 
@@ -220,7 +220,7 @@ module Dnsruby
220
220
  if (res.check_response(msg, bytes, query, client_queue, id, tcp))
221
221
  remove_id(id)
222
222
  exception = msg.header.get_exception
223
- TheLog.debug("Pushing response to client queue")
223
+ Dnsruby.log.debug{"Pushing response to client queue"}
224
224
  client_queue.push([id, msg, exception])
225
225
  notify_queue_observers(client_queue, id)
226
226
  else
@@ -230,7 +230,7 @@ module Dnsruby
230
230
  end
231
231
  end
232
232
  # If not, then we have an error
233
- TheLog.error("Stray packet - " + msg.inspect + "\n from " + socket.inspect)
233
+ Dnsruby.log.error{"Stray packet - " + msg.inspect + "\n from " + socket.inspect}
234
234
  end
235
235
 
236
236
  def remove_id(id)
@@ -238,10 +238,11 @@ module Dnsruby
238
238
  @@mutex.synchronize{
239
239
  socket = @@query_hash[id].socket
240
240
  @@timeouts.delete(id)
241
- @@query_hash.delete(id)
241
+ @@query_hash.delete(id)
242
+ @@socket_hash.delete(socket)
242
243
  @@sockets.delete(socket) # @TODO@ Not if persistent!
243
244
  }
244
- TheLog.debug("Closing socket #{socket}")
245
+ Dnsruby.log.debug{"Closing socket #{socket}"}
245
246
  socket.close # @TODO@ Not if persistent!
246
247
  end
247
248
 
@@ -295,33 +296,33 @@ module Dnsruby
295
296
  answersize=(buf.length)
296
297
  else
297
298
  # recvfrom failed - why?
298
- TheLog.error("Error - recvfrom failed from #{socket}")
299
+ Dnsruby.log.error{"Error - recvfrom failed from #{socket}"}
299
300
  handle_recvfrom_failure(socket)
300
301
  return
301
302
  end
302
303
  end
303
304
  rescue Exception => e
304
- TheLog.error("Error - recvfrom failed from #{socket}, exception : #{e}")
305
+ Dnsruby.log.error{"Error - recvfrom failed from #{socket}, exception : #{e}"}
305
306
  handle_recvfrom_failure(socket)
306
307
  return
307
308
  end
308
- TheLog.debug(";; answer from #{answerfrom} : #{answersize} bytes\n")
309
+ Dnsruby.log.debug{";; answer from #{answerfrom} : #{answersize} bytes\n"}
309
310
 
310
311
  begin
311
312
  ans = Message.decode(buf)
312
313
  rescue Exception => e
313
- TheLog.error("Decode error! #{e.class}, #{e}\nfor msg (length=#{buf.length}) : #{buf}")
314
+ Dnsruby.log.error{"Decode error! #{e.class}, #{e}\nfor msg (length=#{buf.length}) : #{buf}"}
314
315
  client_id=get_client_id_from_answerfrom(socket, answerip, answerport)
315
316
  if (client_id != nil)
316
317
  send_exception_to_client(e, socket, client_id)
317
318
  else
318
- TheLog.error("Decode error from #{answerfrom} but can't determine packet id")
319
+ Dnsruby.log.error{"Decode error from #{answerfrom} but can't determine packet id"}
319
320
  end
320
321
  return
321
322
  end
322
323
 
323
324
  if (ans!= nil)
324
- TheLog.debug("#{ans}")
325
+ Dnsruby.log.debug{"#{ans}"}
325
326
  ans.answerfrom=(answerfrom)
326
327
  ans.answersize=(answersize)
327
328
  end
@@ -342,7 +343,7 @@ module Dnsruby
342
343
  }
343
344
  send_exception_to_client(OtherResolvError.new("recvfrom failed from #{answerfrom}"), socket, ids_for_socket[0])
344
345
  else
345
- TheLog.fatal("Recvfrom failed from #{socket}, no way to tell query id")
346
+ Dnsruby.log.fatal{"Recvfrom failed from #{socket}, no way to tell query id"}
346
347
  end
347
348
  end
348
349
 
@@ -413,9 +414,10 @@ module Dnsruby
413
414
  def remove_observer(client_queue, observer)
414
415
  @@mutex.synchronize {
415
416
  if (@@observers[client_queue]==observer)
416
- @@observers.delete(observer)
417
+ # @@observers.delete(observer)
418
+ @@observers.delete(client_queue)
417
419
  else
418
- TheLog.error("remove_observer called with wrong observer for queue")
420
+ Dnsruby.log.error{"remove_observer called with wrong observer for queue"}
419
421
  raise ArgumentError.new("remove_observer called with wrong observer for queue")
420
422
  end
421
423
  if (!@@observers.values.include?observer)
@@ -106,7 +106,7 @@ module Dnsruby
106
106
  if (@transfer_type == Types.IXFR &&
107
107
  rcode == RCode.NOTIMP)
108
108
  # IXFR didn't work - let's try AXFR
109
- TheLog.debug("IXFR DID NOT WORK (rcode = NOTIMP) - TRYING AXFR!!")
109
+ Dnsruby.log.debug("IXFR DID NOT WORK (rcode = NOTIMP) - TRYING AXFR!!")
110
110
  @state = :InitialSoa
111
111
  @transfer_type=Types.AXFR
112
112
  # Send an initial AXFR query
@@ -122,7 +122,7 @@ module Dnsruby
122
122
  end
123
123
 
124
124
  if (response.header.ancount == 0 && @transfer_type == Types.IXFR)
125
- TheLog.debug("IXFR DID NOT WORK (ancount = 0) - TRYING AXFR!!")
125
+ Dnsruby.log.debug("IXFR DID NOT WORK (ancount = 0) - TRYING AXFR!!")
126
126
  # IXFR didn't work - let's try AXFR
127
127
  @transfer_type=Types.AXFR
128
128
  # Send an initial AXFR query
@@ -213,7 +213,7 @@ module Dnsruby
213
213
  # to recognize the end of an IXFR.
214
214
  @end_serial = rec.serial
215
215
  if (@transfer_type == Types.IXFR && @end_serial <= @serial)
216
- TheLog.debug("zone up to date")
216
+ Dnsruby.log.debug("zone up to date")
217
217
  @state = :End
218
218
  else
219
219
  @state = :FirstData
@@ -223,12 +223,12 @@ module Dnsruby
223
223
  # If it begins with 2 SOAs, it's an IXFR.
224
224
  if (@transfer_type == Types.IXFR && type == Types.SOA &&
225
225
  rec.serial == @serial)
226
- TheLog.debug("IXFR response - using IXFR")
226
+ Dnsruby.log.debug("IXFR response - using IXFR")
227
227
  @rtype = Types.IXFR
228
228
  @ixfr = []
229
229
  @state = :Ixfr_DelSoa
230
230
  else
231
- TheLog.debug("AXFR response - using AXFR")
231
+ Dnsruby.log.debug("AXFR response - using AXFR")
232
232
  @rtype = Types.AXFR
233
233
  @axfr = []
234
234
  @axfr << @initialsoa
@@ -322,7 +322,7 @@ module Dnsruby
322
322
  msg = Message.decode(buf)
323
323
  if (@tsig)
324
324
  if !@tsig.verify_envelope(msg, buf)
325
- TheLog.error("Bad signature on zone transfer - closing connection")
325
+ Dnsruby.log.error("Bad signature on zone transfer - closing connection")
326
326
  raise ResolvError.new("Bad signature on zone transfer")
327
327
  end
328
328
  end
data/lib/dnsruby.rb CHANGED
@@ -13,11 +13,11 @@
13
13
  #See the License for the specific language governing permissions and
14
14
  #limitations under the License.
15
15
  #++
16
- require 'Dnsruby/TheLog'
17
16
  require 'Dnsruby/code_mapper'
18
17
  require 'Dnsruby/ipv4'
19
18
  require 'Dnsruby/ipv6'
20
19
  require 'timeout'
20
+ require 'Dnsruby/TheLog'
21
21
  #= Dnsruby library
22
22
  #Dnsruby is a thread-aware DNS stub resolver library written in Ruby.
23
23
  #
@@ -90,6 +90,15 @@ require 'timeout'
90
90
  #* /etc/nsswitch.conf is not supported.
91
91
  #* IPv6 is not supported.
92
92
  module Dnsruby
93
+
94
+ @@logger = Logger.new(STDOUT)
95
+ @@logger.level = Logger::FATAL
96
+ #Get the log for Dnsruby
97
+ #Use this to set the log level
98
+ #e.g. Dnsruby.log.level = Logger::INFO
99
+ def Dnsruby.log
100
+ @@logger
101
+ end
93
102
  class OpCode < CodeMapper
94
103
  Query = 0 # RFC 1035
95
104
  IQuery = 1 # RFC 1035
data/test/tc_dns.rb CHANGED
@@ -22,6 +22,10 @@ class TestDNS < Test::Unit::TestCase
22
22
  Dnsruby::Config.reset
23
23
  end
24
24
 
25
+ def test_ipv4_address
26
+ Dnsruby::DNS.open { |dns| dns.getnames(Dnsruby::IPv4.create("221.186.184.68")) }
27
+ end
28
+
25
29
  def test_resolv_rb_api
26
30
  DNS.open {|dns|
27
31
  dns.getresources("www.ruby-lang.org", Types.A).each {|r| assert_equal(r.address.to_s, "221.186.184.68")}
@@ -74,7 +78,7 @@ class TestDNS < Test::Unit::TestCase
74
78
  #
75
79
  # Check that new() is vetting things properly.
76
80
  #
77
- Dnsruby::TheLog.level=Logger::FATAL
81
+ Dnsruby.log.level=Logger::FATAL
78
82
  [:nameserver].each do |test|
79
83
  [{}, 'string',1,'\1',nil].each do |input|
80
84
  res=nil
@@ -8,7 +8,7 @@ require 'dnsruby'
8
8
  class EventMachineTestDeferrable < Test::Unit::TestCase
9
9
  Dnsruby::Resolver.use_eventmachine(true)
10
10
  def setup
11
- # Dnsruby::TheLog.level=Logger::DEBUG
11
+ # Dnsruby.log.level=Logger::DEBUG
12
12
  Dnsruby::Resolver.use_eventmachine(true)
13
13
  Dnsruby::Resolver.start_eventmachine_loop(true)
14
14
  end
@@ -11,7 +11,7 @@ class EventMachineTestResolver < Test::Unit::TestCase
11
11
  Thread::abort_on_exception = true
12
12
  def setup
13
13
  Dnsruby::Config.reset
14
- # Dnsruby::TheLog.level=Logger::DEBUG
14
+ # Dnsruby.log.level=Logger::DEBUG
15
15
  Dnsruby::Resolver.use_eventmachine(true)
16
16
  Dnsruby::Resolver.start_eventmachine_loop(true)
17
17
  end
@@ -8,7 +8,7 @@ require 'dnsruby'
8
8
  class EventMachineTestSingleResolver < Test::Unit::TestCase
9
9
  Dnsruby::Resolver.use_eventmachine(true)
10
10
  def setup
11
- # Dnsruby::TheLog.level=Logger::DEBUG
11
+ # Dnsruby.log.level=Logger::DEBUG
12
12
  Dnsruby::Resolver.use_eventmachine(true)
13
13
  Dnsruby::Resolver.start_eventmachine_loop(true)
14
14
  sleep(0.01)
@@ -10,7 +10,7 @@ end
10
10
 
11
11
  class TestEventMachineSoak < Test::Unit::TestCase
12
12
  def setup
13
- # Dnsruby::TheLog.level=Logger::DEBUG
13
+ # Dnsruby.log.level=Logger::DEBUG
14
14
  Dnsruby::Resolver.use_eventmachine(true)
15
15
  end
16
16
  def teardown
@@ -23,7 +23,7 @@ class TestEventMachineSoak < Test::Unit::TestCase
23
23
  sleep(0.1)
24
24
  @@dfs = {}
25
25
  @@num_sent = 0
26
- #Dnsruby::TheLog.level=Logger::DEBUG
26
+ #Dnsruby.log.level=Logger::DEBUG
27
27
  res = Dnsruby::SingleResolver.new
28
28
  Dnsruby::Resolver.use_eventmachine
29
29
  Dnsruby::Resolver.start_eventmachine_loop(false)
@@ -39,7 +39,7 @@ class TestEventMachineSoak < Test::Unit::TestCase
39
39
  end
40
40
 
41
41
  def test_sequential
42
- #Dnsruby::TheLog.level=Logger::DEBUG
42
+ #Dnsruby.log.level=Logger::DEBUG
43
43
  Dnsruby::Resolver.use_eventmachine(true)
44
44
  Dnsruby::Resolver.start_eventmachine_loop(true)
45
45
  res = Dnsruby::SingleResolver.new
@@ -62,7 +62,7 @@ class TestEventMachineSoak < Test::Unit::TestCase
62
62
  sleep(0.1)
63
63
  @@dfs = {}
64
64
  @@num_sent = 0
65
- #Dnsruby::TheLog.level=Logger::DEBUG
65
+ #Dnsruby.log.level=Logger::DEBUG
66
66
  res = Dnsruby::Resolver.new
67
67
  Dnsruby::Resolver.use_eventmachine
68
68
  Dnsruby::Resolver.start_eventmachine_loop(false)
data/test/tc_res_opt.rb CHANGED
@@ -47,7 +47,7 @@ class TestResOpt < Test::Unit::TestCase
47
47
  end
48
48
 
49
49
  def test_no_file
50
- Dnsruby::TheLog.level=Logger::FATAL
50
+ Dnsruby.log.level=Logger::FATAL
51
51
  res=nil
52
52
  begin
53
53
  res = DNS.new('nosuch.txt')
@@ -59,7 +59,7 @@ class TestResOpt < Test::Unit::TestCase
59
59
  assert_equal(["0.0.0.0"], res.nameserver,"No nameservers should be set for #{test} = #{input}")
60
60
  rescue Exception
61
61
  end
62
- # Dnsruby::TheLog.level=Logger::ERROR
62
+ # Dnsruby.log.level=Logger::ERROR
63
63
  end
64
64
 
65
65
  def test_config_hash_singleresolver
@@ -141,7 +141,7 @@ class TestResOpt < Test::Unit::TestCase
141
141
 
142
142
  def test_bad_config
143
143
  res=nil
144
- Dnsruby::TheLog.level=Logger::FATAL
144
+ Dnsruby.log.level=Logger::FATAL
145
145
 
146
146
  bad_input = {
147
147
  :tsig_rr => 'set',
@@ -181,7 +181,7 @@ class TestResOpt < Test::Unit::TestCase
181
181
  rescue Exception
182
182
  end
183
183
  end
184
- # Dnsruby::TheLog.level=Logger::ERROR
184
+ # Dnsruby.log.level=Logger::ERROR
185
185
  end
186
186
  end
187
187
  end
@@ -19,7 +19,7 @@ require 'dnsruby'
19
19
  include Dnsruby
20
20
  class TestSingleResolver < Test::Unit::TestCase
21
21
  Thread::abort_on_exception = true
22
- # Dnsruby::TheLog.level=Logger::DEBUG
22
+ # Dnsruby.log.level=Logger::DEBUG
23
23
 
24
24
  def setup
25
25
  Dnsruby::Config.reset
@@ -141,11 +141,6 @@ class TestSingleResolver < Test::Unit::TestCase
141
141
  # assert(Dnsruby::SelectThread.instance.select_thread_alive?)
142
142
  # end
143
143
 
144
- def test_persistent_socket
145
- #@TODO@ Really need a test server for this one!
146
- p "Implement persistent sockets!"
147
- end
148
-
149
144
  def test_res_config
150
145
  res = Dnsruby::SingleResolver.new
151
146
 
data/test/tc_soak_base.rb CHANGED
@@ -69,7 +69,7 @@ class TestSoakBase # < Test::Unit::TestCase
69
69
  timed_out+=1
70
70
  # p "Number #{i} timed out!"
71
71
  elsif (ret.class != Message)
72
- TheLog.debug("tc_single_resolver : Query #{i} ERROR RETURNED : #{error.class}, #{error}")
72
+ Dnsruby.log.debug("tc_single_resolver : Query #{i} ERROR RETURNED : #{error.class}, #{error}")
73
73
  end
74
74
  end
75
75
  }
@@ -120,7 +120,7 @@ class TestSoakBase # < Test::Unit::TestCase
120
120
  # p "Number #{i} timed out!"
121
121
  elsif (ret.class != Message)
122
122
  error_count+=1
123
- TheLog.error("tc_single_resolver : Query #{i} ERROR RETURNED : #{error.class}, #{error}")
123
+ Dnsruby.log.error("tc_single_resolver : Query #{i} ERROR RETURNED : #{error.class}, #{error}")
124
124
  end
125
125
  end
126
126
  }
data/test/tc_tsig.rb CHANGED
@@ -32,7 +32,7 @@ class TestTSig < Test::Unit::TestCase
32
32
  begin
33
33
  Dnsruby::Resolver::use_eventmachine(true)
34
34
  rescue RuntimeError
35
- Dnsruby::TheLog.error("EventMachine not installed - not running tsig EM tests")
35
+ Dnsruby.log.error("EventMachine not installed - not running tsig EM tests")
36
36
  return
37
37
  end
38
38
  run_test_client_signs
@@ -67,7 +67,7 @@ class TestTSig < Test::Unit::TestCase
67
67
  res.udp_size=512 # Or else we needed to add OPT record already
68
68
  res.dnssec=false
69
69
  res.recurse=false
70
- res.query_timeout = 10
70
+ res.query_timeout = 20
71
71
  response = res.send_message(update)
72
72
 
73
73
  assert_equal( Dnsruby::RCode.NOERROR, response.header.rcode)
@@ -105,7 +105,7 @@ class TestTSig < Test::Unit::TestCase
105
105
 
106
106
  def run_test_resolver_signs
107
107
  res = Dnsruby::Resolver.new("ns0.validation-test-servers.nominet.org.uk")
108
- res.query_timeout=10
108
+ res.query_timeout=20
109
109
  res.tsig=KEY_NAME, KEY
110
110
 
111
111
  update = Dnsruby::Update.new("validation-test-servers.nominet.org.uk")
data/test/ts_offline.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  #++
16
16
  require 'rubygems'
17
17
  require 'dnsruby'
18
- Dnsruby::TheLog.level = Logger::FATAL
18
+ Dnsruby.log.level = Logger::FATAL
19
19
  require "test/unit"
20
20
  require "test/tc_header.rb"
21
21
  require "test/tc_name.rb"
data/test/ts_online.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  #++
16
16
  require 'rubygems'
17
17
  require 'dnsruby'
18
- Dnsruby::TheLog.level = Logger::FATAL
18
+ Dnsruby.log.level = Logger::FATAL
19
19
  require "test/unit"
20
20
  # Disable these tests if we're not online
21
21
  require 'socket'