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:
Michael Tremer
2024-03-20 17:19:50 +01:00
parent 85e004c2da
commit 737e9e1037

View File

@@ -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;