Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ipcalc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ my $opt_print_only_class = 0;
my $opt_split = 0;
my $opt_deaggregate = 0;
my $opt_version = 0;
my $opt_aws = 0;
my $opt_help = 0;
my @opt_split_sizes;
my @arguments;
Expand Down Expand Up @@ -353,7 +354,7 @@ sub printnet {

my $broadcast = $network | ((~$mask1) & $thirtytwobits);

$hmin = $network + 1;
$hmin = $network + 1 + $opt_aws * 3;
$hmax = $broadcast - 1;
$hostn = $hmax - $hmin + 1;
$mask = ntobitcountmask($mask1);
Expand Down Expand Up @@ -728,6 +729,7 @@ sub getopts
# -s --split
# -b --nobinary
# -d --deaggregate
# -a --aws
{
my @arguments;
my $arg;
Expand Down Expand Up @@ -836,6 +838,9 @@ sub getopts
elsif ($opt eq 'r' || $opt eq 'range') {
$opt_deaggregate = 1;
}
elsif ($opt eq 'a' || $opt eq 'aws') {
$opt_aws = 1;
}
elsif ($opt eq 's' || $opt eq 'split') {
$opt_split = 1;
while (defined $ARGV[0] && $ARGV[0] =~ /^\d+$/) {
Expand Down Expand Up @@ -1310,6 +1315,7 @@ easy-to-understand binary values.
-s --split n1 n2 n3
Split into networks of size n1, n2, n3.
-r --range Deaggregate address range.
-a --aws Consider AWS address reservations
--help Longer help text.

Examples:
Expand Down