mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 03:33:25 +02:00
network-functions.pl: Add function to get netmask in dotted format
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -318,6 +318,16 @@ sub get_prefix($) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub get_netmask($) {
|
||||
my $network = shift;
|
||||
|
||||
# Fetch the prefix
|
||||
my $prefix = &get_prefix($network);
|
||||
|
||||
# Convert to netmask
|
||||
return &convert_prefix2netmask($prefix);
|
||||
}
|
||||
|
||||
# Returns True if $address is in $network.
|
||||
sub ip_address_in_network($$) {
|
||||
my $address = shift;
|
||||
|
||||
Reference in New Issue
Block a user