#!/usr/bin/perl

use File::Basename;
use lib dirname($0) . '/../lib/perl';
use LVPnet;
use strict;

my $program = basename($0);

{
	scalar(@ARGV) || die "usage: $program netmask1 .. netmaskN\n";
	for(my $i=0; $i<scalar(@ARGV); $i++)
	{
		print "   input = $ARGV[$i]\n";
		my $netmask = LVPnet->new($ARGV[$i]);
		if($netmask)
		{
			print " decimal = " . $netmask->get_decimal . "\n";
			print "     hex = " . $netmask->get_hex . "\n";
			print "bitcount = " . $netmask->get_bitcount . "\n";
			print "   count = " . $netmask->hostcount . "\n";
		}
		print "\n" if($i<scalar(@ARGV)-1);
	}
	exit(0);
}