@@ -149,12 +149,12 @@ var sonar = {
149
149
150
150
for ( var tmp = 0 ; tmp < 4 ; tmp ++ ) {
151
151
152
- // Calculate the number of bits that change of the current part
153
- if ( range > 8 + 8 * tmp ) {
154
- r = 0 ;
155
- } else {
156
- r = 8 - ( range - tmp * 8 ) ;
157
- }
152
+ // Calculate the number of bits that change of the current part
153
+ if ( range > 8 + 8 * tmp ) {
154
+ r = 0 ;
155
+ } else {
156
+ r = 8 - ( range - tmp * 8 ) ;
157
+ }
158
158
159
159
// Calculate minimum and maximum of IP range for the current part
160
160
ip_min [ tmp ] = ip_parts [ tmp ] & ( 255 << r ) ;
@@ -169,26 +169,26 @@ var sonar = {
169
169
// Queue IP address range
170
170
ip_parts [ 3 ] = ip_min [ 3 ] + 1 ;
171
171
for ( ip_parts [ 0 ] = ip_min [ 0 ] ; ip_parts [ 0 ] <= ip_max [ 0 ] ; ip_parts [ 0 ] ++ ) {
172
- if ( ip_parts [ 0 ] == ip_max [ 0 ] ) { // Check if we are approaching the end of the subnet
173
- var ae = 1 ;
174
- }
175
- for ( ip_parts [ 1 ] = ip_min [ 1 ] ; ip_parts [ 1 ] <= ip_max [ 1 ] ; ip_parts [ 1 ] ++ ) {
176
- if ( ae == 1 && ip_parts [ 1 ] == ip_max [ 1 ] ) {
177
- var be = 1 ;
178
- }
179
- for ( ip_parts [ 2 ] = ip_min [ 2 ] ; ip_parts [ 2 ] <= ip_max [ 2 ] ; ip_parts [ 2 ] ++ ) {
180
- if ( be == 1 && ip_parts [ 2 ] == ip_max [ 2 ] ) {
181
- ip_max [ 3 ] -- ; // Prevent the broadcast address from getting queued
182
- }
183
- while ( ip_parts [ 3 ] <= ip_max [ 3 ] ) {
184
- var tmp_ip = ip_parts [ 0 ] + '.' + ip_parts [ 1 ] + '.' + ip_parts [ 2 ] + '.' + ip_parts [ 3 ] ;
185
- sonar . ip_queue . push ( tmp_ip ) ;
186
- ip_parts [ 3 ] ++ ;
187
- }
188
- ip_parts [ 3 ] = ip_min [ 3 ] ;
189
- }
190
- }
191
- }
172
+ if ( ip_parts [ 0 ] == ip_max [ 0 ] ) { // Check if we are approaching the end of the subnet
173
+ var ae = 1 ;
174
+ }
175
+ for ( ip_parts [ 1 ] = ip_min [ 1 ] ; ip_parts [ 1 ] <= ip_max [ 1 ] ; ip_parts [ 1 ] ++ ) {
176
+ if ( ae == 1 && ip_parts [ 1 ] == ip_max [ 1 ] ) {
177
+ var be = 1 ;
178
+ }
179
+ for ( ip_parts [ 2 ] = ip_min [ 2 ] ; ip_parts [ 2 ] <= ip_max [ 2 ] ; ip_parts [ 2 ] ++ ) {
180
+ if ( be == 1 && ip_parts [ 2 ] == ip_max [ 2 ] ) {
181
+ ip_max [ 3 ] -- ; // Prevent the broadcast address from getting queued
182
+ }
183
+ while ( ip_parts [ 3 ] <= ip_max [ 3 ] ) {
184
+ var tmp_ip = ip_parts [ 0 ] + '.' + ip_parts [ 1 ] + '.' + ip_parts [ 2 ] + '.' + ip_parts [ 3 ] ;
185
+ sonar . ip_queue . push ( tmp_ip ) ;
186
+ ip_parts [ 3 ] ++ ;
187
+ }
188
+ ip_parts [ 3 ] = ip_min [ 3 ] ;
189
+ }
190
+ }
191
+ }
192
192
} ,
193
193
194
194
/*
0 commit comments