BSFL  0.1.0
Bash Shell Function Library
 All Files Functions Variables Groups
Functions
Network

Functions

 cidr2mask (netmask)
 Converts CIDR notation into IPv4 decimal netmask. More...
 
 get_ipv4_broadcast (address, netmask)
 Computes the broadcast address of an IPv4 subnet. More...
 
 get_ipv4_network (address, netmask)
 Computes the network address of an IPv4 subnet. More...
 
 is_fqdn (fqdn)
 Tests a FQDN. More...
 
 is_ipv4 (address)
 Tests an IPv4 address. More...
 
 is_ipv4_cidr (netmask)
 Tests an IPv4 CIDR netmask. More...
 
 is_ipv4_netmask (netmask)
 Tests if an IPv4 decimal netmask is valid. More...
 
 is_ipv4_subnet (subnet)
 Tests an IPv4 subnet. More...
 
 mask2cidr (netmask)
 Converts IPv4 decimal netmask notation into CIDR. More...
 

Detailed Description

Function Documentation

cidr2mask ( netmask  )

Converts CIDR notation into IPv4 decimal netmask.

Parameters
netmaskCIDR to convert.
Return values
0if the input parameters are valid.
1in others cases.
Returns
Decimal notation of the given CIDR.
get_ipv4_broadcast ( address  ,
netmask   
)

Computes the broadcast address of an IPv4 subnet.

Parameters
addressIPv4 address.
netmaskIPv4 netmask.
Return values
0if the input parameters are valid.
1in others cases.
Returns
Broadcast address.
get_ipv4_network ( address  ,
netmask   
)

Computes the network address of an IPv4 subnet.

Parameters
addressIPv4 address.
netmaskIPv4 netmask.
Return values
0if the input parameters are valid.
1in others cases.
Returns
Network address.
is_fqdn ( fqdn  )

Tests a FQDN.

Parameters
fqdnFQDN to test.
Return values
0if the FQDN is valid.
1in others cases.
is_ipv4 ( address  )

Tests an IPv4 address.

Parameters
addressAddress to test.
Return values
0if the address is an IPv4.
1in others cases.
is_ipv4_cidr ( netmask  )

Tests an IPv4 CIDR netmask.

Parameters
netmaskCIDR netmask to test.
Return values
0if the IPv4 CIDR netmask is valid.
1in others cases.
is_ipv4_netmask ( netmask  )

Tests if an IPv4 decimal netmask is valid.

Parameters
netmaskIPv4 decimal netmask to test.
Return values
0if the IPv4 decimal netmask is valid.
1in others cases.
is_ipv4_subnet ( subnet  )

Tests an IPv4 subnet.

Parameters
subnetSubnet to test with /CIDR.
Return values
0if the IPv4 subnet is valid.
1in others cases.
mask2cidr ( netmask  )

Converts IPv4 decimal netmask notation into CIDR.

Parameters
netmaskDecimal netmask to convert.
Return values
0if the input parameters are valid.
1in others cases.
Returns
CIDR notation of the given decimal netmask.