firescan 0.07 → 0.08
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.txt +2 -1
- data/doc/Example.html +0 -2
- data/doc/Firebind.html +0 -40
- data/doc/Firebind/Client.html +23 -23
- data/doc/Firebind/Portspec.html +3 -5
- data/doc/Firebind/Scan.html +32 -12
- data/doc/Firebind/ScanError.html +2 -4
- data/doc/Firebind/ScanState.html +19 -21
- data/doc/Firebind/SimpleProtocol.html +4 -6
- data/doc/Firebind/TcpTransport.html +7 -9
- data/doc/Firebind/Transport.html +2 -4
- data/doc/Firebind/UdpTransport.html +4 -6
- data/doc/LICENSE_txt.html +0 -2
- data/doc/README_txt.html +0 -2
- data/doc/Runner.html +0 -2
- data/doc/TestPortspec.html +0 -2
- data/doc/Tools.html +4 -6
- data/doc/USAGE_txt.html +0 -2
- data/doc/VERSION_txt.html +2 -3
- data/doc/created.rid +22 -22
- data/doc/doc/created_rid.html +0 -2
- data/doc/firescan_gemspec.html +1 -3
- data/doc/index.html +0 -2
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +0 -3
- data/firescan.gemspec +1 -1
- data/lib/firebind/client.rb +20 -16
- data/lib/firebind/portspec.rb +2 -0
- data/lib/firebind/scan.rb +22 -10
- data/lib/firebind/scan_error.rb +2 -0
- data/lib/firebind/scan_state.rb +5 -3
- data/lib/firebind/simple_protocol.rb +3 -1
- data/lib/firebind/tcp_transport.rb +5 -3
- data/lib/firebind/tools.rb +2 -0
- data/lib/firebind/transport.rb +2 -0
- data/lib/firebind/udp_transport.rb +2 -0
- metadata +2 -4
- data/build +0 -7
- data/doc/build.html +0 -125
data/VERSION.txt
CHANGED
data/doc/Example.html
CHANGED
@@ -94,8 +94,6 @@
|
|
94
94
|
|
95
95
|
<li class="file"><a href="./VERSION_txt.html">VERSION</a>
|
96
96
|
|
97
|
-
<li class="file"><a href="./build.html">build</a>
|
98
|
-
|
99
97
|
<li class="file"><a href="./doc/created_rid.html">created.rid</a>
|
100
98
|
|
101
99
|
<li class="file"><a href="./firescan_gemspec.html">firescan.gemspec</a>
|
data/doc/Firebind.html
CHANGED
@@ -90,8 +90,6 @@
|
|
90
90
|
|
91
91
|
<li class="file"><a href="./VERSION_txt.html">VERSION</a>
|
92
92
|
|
93
|
-
<li class="file"><a href="./build.html">build</a>
|
94
|
-
|
95
93
|
<li class="file"><a href="./doc/created_rid.html">created.rid</a>
|
96
94
|
|
97
95
|
<li class="file"><a href="./firescan_gemspec.html">firescan.gemspec</a>
|
@@ -143,47 +141,9 @@
|
|
143
141
|
|
144
142
|
<div id="description" class="description">
|
145
143
|
|
146
|
-
<p><a href="Firebind.html">Firebind</a> -- Path <a
|
147
|
-
href="Firebind/Scan.html">Scan</a> <a
|
148
|
-
href="Firebind/Client.html">Client</a> Software Copyright (C) 2013 <a
|
149
|
-
href="Firebind.html">Firebind</a> Inc. All rights reserved. Authors - Jay
|
150
|
-
Houghton</p>
|
151
|
-
|
152
|
-
<p>Licensed under the Apache License, Version 2.0 (the “License”); you may not
|
153
|
-
use this file except in compliance with the License. You may obtain a copy
|
154
|
-
of the License at</p>
|
155
|
-
|
156
|
-
<p><a
|
157
|
-
href="http://www.apache.org/licenses/LICENSE-2.0">www.apache.org/licenses/LICENSE-2.0</a></p>
|
158
|
-
|
159
|
-
<p>Unless required by applicable law or agreed to in writing, software
|
160
|
-
distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
|
161
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
162
|
-
License for the specific language governing permissions and limitations
|
163
|
-
under the License.</p>
|
164
|
-
|
165
144
|
<p>This module encapsulates client-side path scanning functionality for use
|
166
145
|
with an associated <a href="Firebind.html">Firebind</a> server.</p>
|
167
146
|
|
168
|
-
<p><a href="Firebind.html">Firebind</a> -- Path <a
|
169
|
-
href="Firebind/Scan.html">Scan</a> <a
|
170
|
-
href="Firebind/Client.html">Client</a> Software Copyright (C) 2013 <a
|
171
|
-
href="Firebind.html">Firebind</a> Inc. All rights reserved. Authors - Jay
|
172
|
-
Houghton</p>
|
173
|
-
|
174
|
-
<p>Licensed under the Apache License, Version 2.0 (the “License”); you may not
|
175
|
-
use this file except in compliance with the License. You may obtain a copy
|
176
|
-
of the License at</p>
|
177
|
-
|
178
|
-
<p><a
|
179
|
-
href="http://www.apache.org/licenses/LICENSE-2.0">www.apache.org/licenses/LICENSE-2.0</a></p>
|
180
|
-
|
181
|
-
<p>Unless required by applicable law or agreed to in writing, software
|
182
|
-
distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
|
183
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
184
|
-
License for the specific language governing permissions and limitations
|
185
|
-
under the License.</p>
|
186
|
-
|
187
147
|
</div><!-- description -->
|
188
148
|
|
189
149
|
|
data/doc/Firebind/Client.html
CHANGED
@@ -120,8 +120,6 @@
|
|
120
120
|
|
121
121
|
<li class="file"><a href="../VERSION_txt.html">VERSION</a>
|
122
122
|
|
123
|
-
<li class="file"><a href="../build.html">build</a>
|
124
|
-
|
125
123
|
<li class="file"><a href="../doc/created_rid.html">created.rid</a>
|
126
124
|
|
127
125
|
<li class="file"><a href="../firescan_gemspec.html">firescan.gemspec</a>
|
@@ -248,23 +246,23 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
248
246
|
|
249
247
|
|
250
248
|
<div class="method-source-code" id="new-source">
|
251
|
-
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line
|
249
|
+
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line 35</span>
|
252
250
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">arguments</span>)
|
253
251
|
<span class="ruby-ivar">@arguments</span> = <span class="ruby-identifier">arguments</span>
|
254
252
|
|
255
|
-
<span class="ruby-ivar">@opts</span> = <span class="ruby-
|
253
|
+
<span class="ruby-ivar">@opts</span> = <span class="ruby-keyword">nil</span>
|
256
254
|
<span class="ruby-comment"># Set defaults</span>
|
257
255
|
<span class="ruby-ivar">@options</span> = <span class="ruby-constant">OpenStruct</span>.<span class="ruby-identifier">new</span>
|
258
|
-
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">username</span> = <span class="ruby-
|
259
|
-
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">password</span> = <span class="ruby-
|
256
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">username</span> = <span class="ruby-keyword">nil</span>
|
257
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">password</span> = <span class="ruby-keyword">nil</span>
|
260
258
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">command_server</span> = <span class="ruby-string">'scanme.firebind.com'</span>
|
261
259
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">protocol</span> = <span class="ruby-value">:Simple</span>
|
262
260
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">transport</span> = <span class="ruby-value">:TCP</span>
|
263
261
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">timeout</span> = <span class="ruby-value">5000</span>
|
264
|
-
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">tcp_port_list</span> = <span class="ruby-
|
265
|
-
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">udp_port_list</span> = <span class="ruby-
|
266
|
-
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">local_address</span> = <span class="ruby-
|
267
|
-
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">tag</span> = <span class="ruby-
|
262
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">tcp_port_list</span> = <span class="ruby-keyword">nil</span>
|
263
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">udp_port_list</span> = <span class="ruby-keyword">nil</span>
|
264
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">local_address</span> = <span class="ruby-keyword">nil</span>
|
265
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">tag</span> = <span class="ruby-keyword">nil</span>
|
268
266
|
<span class="ruby-keyword">end</span></pre>
|
269
267
|
</div><!-- new-source -->
|
270
268
|
|
@@ -301,7 +299,7 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
301
299
|
|
302
300
|
|
303
301
|
<div class="method-source-code" id="do_output-source">
|
304
|
-
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line
|
302
|
+
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line 160</span>
|
305
303
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">do_output</span>
|
306
304
|
|
307
305
|
<span class="ruby-identifier">tcp</span> = <span class="ruby-ivar">@tcp_scan</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@tcp_scan</span>.<span class="ruby-identifier">current_state</span> <span class="ruby-operator">==</span> <span class="ruby-value">:SCAN_COMPLETE</span>
|
@@ -361,7 +359,7 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
361
359
|
|
362
360
|
|
363
361
|
<div class="method-source-code" id="do_scan_output-source">
|
364
|
-
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line
|
362
|
+
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line 129</span>
|
365
363
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">do_scan_output</span>(<span class="ruby-identifier">state</span>)
|
366
364
|
<span class="ruby-identifier">open_ports</span> = <span class="ruby-identifier">state</span>.<span class="ruby-identifier">open_ports</span>
|
367
365
|
<span class="ruby-identifier">closed_ports</span> = <span class="ruby-identifier">state</span>.<span class="ruby-identifier">closed_ports</span>
|
@@ -419,13 +417,13 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
419
417
|
|
420
418
|
|
421
419
|
<div class="method-source-code" id="run-source">
|
422
|
-
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line
|
420
|
+
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line 54</span>
|
423
421
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">run</span>
|
424
|
-
<span class="ruby-identifier">scan</span> = <span class="ruby-
|
422
|
+
<span class="ruby-identifier">scan</span> = <span class="ruby-keyword">nil</span>
|
425
423
|
<span class="ruby-keyword">begin</span>
|
426
424
|
|
427
425
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">parsed_options?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">arguments_valid?</span>
|
428
|
-
<span class="ruby-identifier">puts</span>
|
426
|
+
<span class="ruby-identifier">puts</span>
|
429
427
|
<span class="ruby-identifier">verbose</span> <span class="ruby-node">"Start at #{DateTime.now}"</span>
|
430
428
|
<span class="ruby-identifier">puts</span> <span class="ruby-node">"Firescan Ruby client version #{VERSION} ( http://www.firebind.com )"</span>
|
431
429
|
<span class="ruby-comment">#############</span>
|
@@ -441,7 +439,8 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
441
439
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">timeout</span>,
|
442
440
|
<span class="ruby-value">:SimpleProtocol</span>,
|
443
441
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">username</span>,
|
444
|
-
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">password</span
|
442
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">password</span>,
|
443
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">tag</span>)
|
445
444
|
|
446
445
|
<span class="ruby-identifier">scan</span>.<span class="ruby-identifier">add_observer</span> <span class="ruby-keyword">self</span>
|
447
446
|
<span class="ruby-keyword">begin</span>
|
@@ -466,10 +465,11 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
466
465
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">timeout</span>,
|
467
466
|
<span class="ruby-value">:SimpleProtocol</span>,
|
468
467
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">username</span>,
|
469
|
-
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">password</span
|
468
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">password</span>,
|
469
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">tag</span>)
|
470
470
|
|
471
471
|
<span class="ruby-identifier">scan</span>.<span class="ruby-identifier">add_observer</span> <span class="ruby-keyword">self</span>
|
472
|
-
<span class="ruby-identifier">puts</span>
|
472
|
+
<span class="ruby-identifier">puts</span>
|
473
473
|
<span class="ruby-keyword">begin</span>
|
474
474
|
<span class="ruby-ivar">@udp_scan</span> = <span class="ruby-identifier">scan</span>.<span class="ruby-identifier">scan</span>
|
475
475
|
|
@@ -519,7 +519,7 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
519
519
|
|
520
520
|
|
521
521
|
<div class="method-source-code" id="update-source">
|
522
|
-
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line
|
522
|
+
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line 193</span>
|
523
523
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">state</span>)
|
524
524
|
<span class="ruby-identifier">debug</span> <span class="ruby-node">"callback #{state.to_s}"</span>
|
525
525
|
|
@@ -594,9 +594,9 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
594
594
|
|
595
595
|
|
596
596
|
<div class="method-source-code" id="arguments_valid-3F-source">
|
597
|
-
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line
|
597
|
+
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line 306</span>
|
598
598
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">arguments_valid?</span>
|
599
|
-
<span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">udp_port_list</span> <span class="ruby-operator">!=</span> <span class="ruby-
|
599
|
+
<span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">udp_port_list</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">tcp_port_list</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
600
600
|
<span class="ruby-keyword">end</span></pre>
|
601
601
|
</div><!-- arguments_valid-3F-source -->
|
602
602
|
|
@@ -627,7 +627,7 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
627
627
|
|
628
628
|
|
629
629
|
<div class="method-source-code" id="output_options-source">
|
630
|
-
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line
|
630
|
+
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line 298</span>
|
631
631
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">output_options</span>
|
632
632
|
<span class="ruby-identifier">puts</span> <span class="ruby-string">"Options:\ "</span>
|
633
633
|
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">marshal_dump</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
@@ -663,7 +663,7 @@ href="../Firebind.html">Firebind</a> server</p>
|
|
663
663
|
|
664
664
|
|
665
665
|
<div class="method-source-code" id="parsed_options-3F-source">
|
666
|
-
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line
|
666
|
+
<pre><span class="ruby-comment"># File lib/firebind/client.rb, line 236</span>
|
667
667
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parsed_options?</span>
|
668
668
|
|
669
669
|
<span class="ruby-ivar">@opts</span> = <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opt</span><span class="ruby-operator">|</span>
|
data/doc/Firebind/Portspec.html
CHANGED
@@ -98,8 +98,6 @@
|
|
98
98
|
|
99
99
|
<li class="file"><a href="../VERSION_txt.html">VERSION</a>
|
100
100
|
|
101
|
-
<li class="file"><a href="../build.html">build</a>
|
102
|
-
|
103
101
|
<li class="file"><a href="../doc/created_rid.html">created.rid</a>
|
104
102
|
|
105
103
|
<li class="file"><a href="../firescan_gemspec.html">firescan.gemspec</a>
|
@@ -229,7 +227,7 @@ the full complement of set arithmetic</p>
|
|
229
227
|
|
230
228
|
|
231
229
|
<div class="method-source-code" id="new-source">
|
232
|
-
<pre><span class="ruby-comment"># File lib/firebind/portspec.rb, line
|
230
|
+
<pre><span class="ruby-comment"># File lib/firebind/portspec.rb, line 30</span>
|
233
231
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">port_list</span>)
|
234
232
|
|
235
233
|
<span class="ruby-identifier">port_map</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
@@ -328,7 +326,7 @@ the full complement of set arithmetic</p>
|
|
328
326
|
|
329
327
|
|
330
328
|
<div class="method-source-code" id="size-source">
|
331
|
-
<pre><span class="ruby-comment"># File lib/firebind/portspec.rb, line
|
329
|
+
<pre><span class="ruby-comment"># File lib/firebind/portspec.rb, line 98</span>
|
332
330
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">size</span>
|
333
331
|
<span class="ruby-ivar">@ports</span>.<span class="ruby-identifier">length</span>
|
334
332
|
<span class="ruby-keyword">end</span></pre>
|
@@ -361,7 +359,7 @@ the full complement of set arithmetic</p>
|
|
361
359
|
|
362
360
|
|
363
361
|
<div class="method-source-code" id="to_s-source">
|
364
|
-
<pre><span class="ruby-comment"># File lib/firebind/portspec.rb, line
|
362
|
+
<pre><span class="ruby-comment"># File lib/firebind/portspec.rb, line 94</span>
|
365
363
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
366
364
|
<span class="ruby-ivar">@compiled_list</span>
|
367
365
|
<span class="ruby-keyword">end</span></pre>
|
data/doc/Firebind/Scan.html
CHANGED
@@ -114,8 +114,6 @@
|
|
114
114
|
|
115
115
|
<li class="file"><a href="../VERSION_txt.html">VERSION</a>
|
116
116
|
|
117
|
-
<li class="file"><a href="../build.html">build</a>
|
118
|
-
|
119
117
|
<li class="file"><a href="../doc/created_rid.html">created.rid</a>
|
120
118
|
|
121
119
|
<li class="file"><a href="../firescan_gemspec.html">firescan.gemspec</a>
|
@@ -184,6 +182,26 @@ scan() method</p>
|
|
184
182
|
|
185
183
|
|
186
184
|
|
185
|
+
<!-- Attributes -->
|
186
|
+
<section id="attribute-method-details" class="method-section section">
|
187
|
+
<h3 class="section-header">Attributes</h3>
|
188
|
+
|
189
|
+
|
190
|
+
<div id="attribute-i-tag" class="method-detail">
|
191
|
+
<div class="method-heading attribute-method-heading">
|
192
|
+
<span class="method-name">tag</span><span
|
193
|
+
class="attribute-access-type">[RW]</span>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
<div class="method-description">
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
</section><!-- attribute-method-details -->
|
204
|
+
|
187
205
|
|
188
206
|
<!-- Methods -->
|
189
207
|
|
@@ -195,7 +213,7 @@ scan() method</p>
|
|
195
213
|
|
196
214
|
<div class="method-heading">
|
197
215
|
<span class="method-name">new</span><span
|
198
|
-
class="method-args">(command_server, ports, transport, timeout=5000, protocol=:SimpleProtocol, username=
|
216
|
+
class="method-args">(command_server, ports, transport, timeout=5000, protocol=:SimpleProtocol, username=nil, password=nil, tag=nil)</span>
|
199
217
|
|
200
218
|
<span class="method-click-advice">click to toggle source</span>
|
201
219
|
|
@@ -210,8 +228,8 @@ scan() method</p>
|
|
210
228
|
|
211
229
|
|
212
230
|
<div class="method-source-code" id="new-source">
|
213
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan.rb, line
|
214
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">command_server</span>, <span class="ruby-identifier">ports</span>, <span class="ruby-identifier">transport</span>, <span class="ruby-identifier">timeout</span>=<span class="ruby-value">5000</span>, <span class="ruby-identifier">protocol</span>=<span class="ruby-value">:SimpleProtocol</span>, <span class="ruby-identifier">username</span>=<span class="ruby-
|
231
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan.rb, line 47</span>
|
232
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">command_server</span>, <span class="ruby-identifier">ports</span>, <span class="ruby-identifier">transport</span>, <span class="ruby-identifier">timeout</span>=<span class="ruby-value">5000</span>, <span class="ruby-identifier">protocol</span>=<span class="ruby-value">:SimpleProtocol</span>, <span class="ruby-identifier">username</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">password</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">tag</span>=<span class="ruby-keyword">nil</span>)
|
215
233
|
<span class="ruby-ivar">@command_server</span> = <span class="ruby-identifier">command_server</span>
|
216
234
|
<span class="ruby-ivar">@portspec</span> = <span class="ruby-constant">Firebind</span><span class="ruby-operator">::</span><span class="ruby-constant">Portspec</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ports</span>)
|
217
235
|
<span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">timeout</span>
|
@@ -219,6 +237,7 @@ scan() method</p>
|
|
219
237
|
<span class="ruby-ivar">@username</span> = <span class="ruby-identifier">username</span>
|
220
238
|
<span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
|
221
239
|
<span class="ruby-ivar">@transport</span> = <span class="ruby-identifier">transport</span>
|
240
|
+
<span class="ruby-ivar">@tag</span> = <span class="ruby-identifier">tag</span>
|
222
241
|
<span class="ruby-ivar">@done</span> = <span class="ruby-keyword">false</span>
|
223
242
|
<span class="ruby-ivar">@state</span> = <span class="ruby-constant">ScanState</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">command_server</span>,<span class="ruby-identifier">protocol</span>,<span class="ruby-identifier">transport</span>,<span class="ruby-ivar">@portspec</span>,<span class="ruby-identifier">timeout</span>)
|
224
243
|
|
@@ -262,7 +281,7 @@ scan() method</p>
|
|
262
281
|
|
263
282
|
|
264
283
|
<div class="method-source-code" id="scan-source">
|
265
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan.rb, line
|
284
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan.rb, line 67</span>
|
266
285
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">scan</span>
|
267
286
|
|
268
287
|
<span class="ruby-identifier">api_start</span>
|
@@ -340,13 +359,14 @@ scan() method</p>
|
|
340
359
|
|
341
360
|
<span class="ruby-keyword">end</span>
|
342
361
|
|
362
|
+
<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">on_scan_complete</span>(<span class="ruby-identifier">$client_scan_completed</span>)
|
363
|
+
|
343
364
|
<span class="ruby-identifier">api_update</span>
|
344
365
|
|
345
|
-
<span class="ruby-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
<span class="ruby-keyword">end</span>
|
366
|
+
<span class="ruby-comment">#if @portspec.size == @state.ports_scanned</span>
|
367
|
+
<span class="ruby-identifier">changed</span>
|
368
|
+
<span class="ruby-identifier">notify_observers</span>(<span class="ruby-ivar">@state</span>)
|
369
|
+
|
350
370
|
|
351
371
|
<span class="ruby-comment">#update</span>
|
352
372
|
<span class="ruby-ivar">@state</span>
|
@@ -380,7 +400,7 @@ scan() method</p>
|
|
380
400
|
|
381
401
|
|
382
402
|
<div class="method-source-code" id="stop-source">
|
383
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan.rb, line
|
403
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan.rb, line 157</span>
|
384
404
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">stop</span>
|
385
405
|
<span class="ruby-identifier">puts</span> <span class="ruby-string">'setting flags'</span>
|
386
406
|
<span class="ruby-ivar">@stop_requested</span> = <span class="ruby-keyword">true</span>
|
data/doc/Firebind/ScanError.html
CHANGED
@@ -96,8 +96,6 @@
|
|
96
96
|
|
97
97
|
<li class="file"><a href="../VERSION_txt.html">VERSION</a>
|
98
98
|
|
99
|
-
<li class="file"><a href="../build.html">build</a>
|
100
|
-
|
101
99
|
<li class="file"><a href="../doc/created_rid.html">created.rid</a>
|
102
100
|
|
103
101
|
<li class="file"><a href="../firescan_gemspec.html">firescan.gemspec</a>
|
@@ -208,7 +206,7 @@
|
|
208
206
|
|
209
207
|
|
210
208
|
<div class="method-source-code" id="new-source">
|
211
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_error.rb, line
|
209
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_error.rb, line 24</span>
|
212
210
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">status_code</span>, <span class="ruby-identifier">error</span>=<span class="ruby-keyword">nil</span>)
|
213
211
|
<span class="ruby-ivar">@status_code</span> = <span class="ruby-identifier">status_code</span>
|
214
212
|
<span class="ruby-ivar">@error</span> = <span class="ruby-identifier">error</span>
|
@@ -248,7 +246,7 @@
|
|
248
246
|
|
249
247
|
|
250
248
|
<div class="method-source-code" id="to_s-source">
|
251
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_error.rb, line
|
249
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_error.rb, line 29</span>
|
252
250
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
253
251
|
<span class="ruby-node">"ScanError status_code:#{@status_code} cause:#{@error.to_s}"</span>
|
254
252
|
<span class="ruby-keyword">end</span></pre>
|
data/doc/Firebind/ScanState.html
CHANGED
@@ -136,8 +136,6 @@
|
|
136
136
|
|
137
137
|
<li class="file"><a href="../VERSION_txt.html">VERSION</a>
|
138
138
|
|
139
|
-
<li class="file"><a href="../build.html">build</a>
|
140
|
-
|
141
139
|
<li class="file"><a href="../doc/created_rid.html">created.rid</a>
|
142
140
|
|
143
141
|
<li class="file"><a href="../firescan_gemspec.html">firescan.gemspec</a>
|
@@ -454,7 +452,7 @@
|
|
454
452
|
|
455
453
|
|
456
454
|
<div class="method-source-code" id="new-source">
|
457
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
455
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 41</span>
|
458
456
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">command_server</span>,<span class="ruby-identifier">protocol</span>,<span class="ruby-identifier">transport</span>,<span class="ruby-identifier">portspec</span>,<span class="ruby-identifier">timeout</span>)
|
459
457
|
<span class="ruby-ivar">@command_server</span> = <span class="ruby-identifier">command_server</span>
|
460
458
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:SCAN_SETUP</span>
|
@@ -462,13 +460,13 @@
|
|
462
460
|
<span class="ruby-ivar">@transport</span> = <span class="ruby-identifier">transport</span>
|
463
461
|
<span class="ruby-ivar">@portspec</span> = <span class="ruby-identifier">portspec</span>
|
464
462
|
<span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">timeout</span>
|
465
|
-
<span class="ruby-ivar">@guid</span> = <span class="ruby-
|
466
|
-
<span class="ruby-ivar">@echo_server</span> = <span class="ruby-
|
463
|
+
<span class="ruby-ivar">@guid</span> = <span class="ruby-keyword">nil</span>
|
464
|
+
<span class="ruby-ivar">@echo_server</span> = <span class="ruby-keyword">nil</span>
|
467
465
|
<span class="ruby-ivar">@port</span> = <span class="ruby-value">0</span>
|
468
466
|
<span class="ruby-ivar">@last_duration</span> = <span class="ruby-value">0</span>
|
469
467
|
<span class="ruby-ivar">@ports_scanned</span> = <span class="ruby-value">0</span>
|
470
468
|
<span class="ruby-ivar">@result_map</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">hash</span>,<span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>]=[]} <span class="ruby-comment"># block form</span>
|
471
|
-
<span class="ruby-ivar">@message</span> = <span class="ruby-
|
469
|
+
<span class="ruby-ivar">@message</span> = <span class="ruby-keyword">nil</span>
|
472
470
|
<span class="ruby-keyword">end</span></pre>
|
473
471
|
</div><!-- new-source -->
|
474
472
|
|
@@ -506,7 +504,7 @@ scan</p>
|
|
506
504
|
|
507
505
|
|
508
506
|
<div class="method-source-code" id="closed_ports-source">
|
509
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
507
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 123</span>
|
510
508
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">closed_ports</span>
|
511
509
|
<span class="ruby-identifier">closed</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
512
510
|
<span class="ruby-ivar">@result_map</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">code</span>,<span class="ruby-identifier">ports</span><span class="ruby-operator">|</span>
|
@@ -543,7 +541,7 @@ scan</p>
|
|
543
541
|
|
544
542
|
|
545
543
|
<div class="method-source-code" id="description-source">
|
546
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
544
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 135</span>
|
547
545
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">description</span>(<span class="ruby-identifier">port_result_code</span>)
|
548
546
|
<span class="ruby-identifier">$result_code_messages</span>[<span class="ruby-identifier">port_result_code</span>]
|
549
547
|
<span class="ruby-keyword">end</span></pre>
|
@@ -576,7 +574,7 @@ scan</p>
|
|
576
574
|
|
577
575
|
|
578
576
|
<div class="method-source-code" id="on_error-source">
|
579
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
577
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 103</span>
|
580
578
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_error</span>(<span class="ruby-identifier">status_code</span>)
|
581
579
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:ERROR</span>
|
582
580
|
<span class="ruby-ivar">@status_code</span> = <span class="ruby-identifier">status_code</span>
|
@@ -610,7 +608,7 @@ scan</p>
|
|
610
608
|
|
611
609
|
|
612
610
|
<div class="method-source-code" id="on_port_complete-source">
|
613
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
611
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 85</span>
|
614
612
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_port_complete</span>(<span class="ruby-identifier">port</span>,<span class="ruby-identifier">port_result_code</span>)
|
615
613
|
<span class="ruby-ivar">@port_end_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
616
614
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:PORT_COMPLETE</span>
|
@@ -648,7 +646,7 @@ scan</p>
|
|
648
646
|
|
649
647
|
|
650
648
|
<div class="method-source-code" id="on_port_start-source">
|
651
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
649
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 74</span>
|
652
650
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_port_start</span>(<span class="ruby-identifier">port</span>)
|
653
651
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:PORT_START</span>
|
654
652
|
<span class="ruby-ivar">@port</span> = <span class="ruby-identifier">port</span>
|
@@ -683,7 +681,7 @@ scan</p>
|
|
683
681
|
|
684
682
|
|
685
683
|
<div class="method-source-code" id="on_port_tick-source">
|
686
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
684
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 80</span>
|
687
685
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_port_tick</span>
|
688
686
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:PORT_TICK</span>
|
689
687
|
<span class="ruby-keyword">end</span></pre>
|
@@ -716,7 +714,7 @@ scan</p>
|
|
716
714
|
|
717
715
|
|
718
716
|
<div class="method-source-code" id="on_scan_complete-source">
|
719
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
717
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 94</span>
|
720
718
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_scan_complete</span>(<span class="ruby-identifier">status_code</span>)
|
721
719
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:SCAN_COMPLETE</span>
|
722
720
|
<span class="ruby-ivar">@status_code</span> = <span class="ruby-identifier">status_code</span>
|
@@ -750,7 +748,7 @@ scan</p>
|
|
750
748
|
|
751
749
|
|
752
750
|
<div class="method-source-code" id="on_scan_start-source">
|
753
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
751
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 62</span>
|
754
752
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_scan_start</span>(<span class="ruby-identifier">guid</span>,<span class="ruby-identifier">echo_server</span>,<span class="ruby-identifier">port_delay</span>)
|
755
753
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:SCAN_START</span>
|
756
754
|
<span class="ruby-ivar">@guid</span> = <span class="ruby-identifier">guid</span>
|
@@ -786,7 +784,7 @@ scan</p>
|
|
786
784
|
|
787
785
|
|
788
786
|
<div class="method-source-code" id="on_scan_stop-source">
|
789
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
787
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 99</span>
|
790
788
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_scan_stop</span>
|
791
789
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:SCAN_STOPPED</span>
|
792
790
|
<span class="ruby-keyword">end</span></pre>
|
@@ -819,7 +817,7 @@ scan</p>
|
|
819
817
|
|
820
818
|
|
821
819
|
<div class="method-source-code" id="on_start_failure-source">
|
822
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
820
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 69</span>
|
823
821
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_start_failure</span>(<span class="ruby-identifier">status_code</span>)
|
824
822
|
<span class="ruby-ivar">@current_state</span> = <span class="ruby-value">:START_FAILURE</span>
|
825
823
|
<span class="ruby-ivar">@status_code</span> = <span class="ruby-identifier">status_code</span>
|
@@ -854,7 +852,7 @@ scan</p>
|
|
854
852
|
|
855
853
|
|
856
854
|
<div class="method-source-code" id="open_ports-source">
|
857
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
855
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 118</span>
|
858
856
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">open_ports</span>
|
859
857
|
<span class="ruby-constant">Portspec</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@result_map</span>[<span class="ruby-identifier">$success</span>])
|
860
858
|
<span class="ruby-keyword">end</span></pre>
|
@@ -887,7 +885,7 @@ scan</p>
|
|
887
885
|
|
888
886
|
|
889
887
|
<div class="method-source-code" id="percent_complete-source">
|
890
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
888
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 113</span>
|
891
889
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">percent_complete</span>
|
892
890
|
((<span class="ruby-ivar">@ports_scanned</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-ivar">@portspec</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_f</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100</span>).<span class="ruby-identifier">to_i</span>
|
893
891
|
<span class="ruby-keyword">end</span></pre>
|
@@ -920,7 +918,7 @@ scan</p>
|
|
920
918
|
|
921
919
|
|
922
920
|
<div class="method-source-code" id="port_delay_seconds-source">
|
923
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
921
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 131</span>
|
924
922
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">port_delay_seconds</span>
|
925
923
|
<span class="ruby-ivar">@port_delay</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-value">1000</span>
|
926
924
|
<span class="ruby-keyword">end</span></pre>
|
@@ -953,7 +951,7 @@ scan</p>
|
|
953
951
|
|
954
952
|
|
955
953
|
<div class="method-source-code" id="port_duration-source">
|
956
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
954
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 109</span>
|
957
955
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">port_duration</span>
|
958
956
|
(((<span class="ruby-ivar">@port_end_time</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@port_start_time</span>) <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>)<span class="ruby-operator">+</span><span class="ruby-value">0.5</span>).<span class="ruby-identifier">to_i</span>
|
959
957
|
<span class="ruby-keyword">end</span></pre>
|
@@ -986,7 +984,7 @@ scan</p>
|
|
986
984
|
|
987
985
|
|
988
986
|
<div class="method-source-code" id="to_s-source">
|
989
|
-
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line
|
987
|
+
<pre><span class="ruby-comment"># File lib/firebind/scan_state.rb, line 57</span>
|
990
988
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
991
989
|
<span class="ruby-node">"#{@current_state.to_s} port #{@port} results #{@result_map}"</span>
|
992
990
|
<span class="ruby-keyword">end</span></pre>
|