File tree 2 files changed +4
-4
lines changed
org/apache/commons/net/util 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 30
30
public class SubnetUtilsExample {
31
31
32
32
public static void main (String [] args ) {
33
- String subnet = "192.168.0.1/29 " ;
33
+ String subnet = "192.168.0.3/31 " ;
34
34
SubnetUtils utils = new SubnetUtils (subnet );
35
35
SubnetInfo info = utils .getInfo ();
36
36
@@ -48,9 +48,9 @@ public static void main(String[] args) {
48
48
Integer .toBinaryString (info .asInteger (info .getNetworkAddress ())));
49
49
System .out .printf ("Broadcast Address:\t \t %s\t [%s]\n " , info .getBroadcastAddress (),
50
50
Integer .toBinaryString (info .asInteger (info .getBroadcastAddress ())));
51
- System .out .printf ("First Usable Address:\t \t %s\t [%s]\n " , info .getLowAddress (),
51
+ System .out .printf ("Low Address:\t \t \t %s\t [%s]\n " , info .getLowAddress (),
52
52
Integer .toBinaryString (info .asInteger (info .getLowAddress ())));
53
- System .out .printf ("Last Usable Address:\t \t %s\t [%s]\n " , info .getHighAddress (),
53
+ System .out .printf ("High Address:\t \t \t %s\t [%s]\n " , info .getHighAddress (),
54
54
Integer .toBinaryString (info .asInteger (info .getHighAddress ())));
55
55
56
56
System .out .printf ("Total usable addresses: \t %d\n " , info .getAddressCount ());
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ private String format(int[] octets) {
199
199
* Convenience function to check integer boundaries
200
200
*/
201
201
private int rangeCheck (int value , int begin , int end ) {
202
- if (value >= begin && value <= end )
202
+ if (value > begin && value <= end ) // (0,nbits]
203
203
return value ;
204
204
205
205
throw new IllegalArgumentException ("Value out of range: [" + value + "]" );
You can’t perform that action at this time.
0 commit comments