Archivi per 25 Marzo 2009



Today I used commons-net to verify when an IP address is in a subnet specified in CIDR notation. So, I got a bug.
This code:
SubnetUtils utils = new SubnetUtils("77.24.0.0/16");
System.out.println("lower address: " + utils.getInfo().getLowAddress());
System.out.println("higher address: " + utils.getInfo().getHighAddress());
System.out.println("77.23.255.254 is in range? :" + utils.getInfo().isInRange( "77.23.255.254" ));

gives this output:

lower address: 77.24.0.1
higher address: 77.24.255.254
77.23.255.254 is in range? :true

Obviously the [...]




Info

Stai navigando negli archivi del sito NewInstance per il giorno 25 Marzo 2009.

Gli articoli lunghi sono troncati. Clicca sul titolo dell'articolo per leggerlo interamente.

Calendario

Marzo 2009
L M M G V S D
« Feb   Apr »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categorie