145. Netmask

Netmask manipulation routines

145.1. Summary of Module Globals

List of Global Functions

  • Check - Check the netmask

  • Check4 - Check the IPv4 netmask Note that 0.0.0.0 is not a correct netmask.

  • Check6 - Check the IPv6 netmask

  • FromBits - Convert netmask in bits form (20) to netmask string (255.255.240.0)

  • ToBits - Convert IPv4 netmask as string (255.255.240.0) to bits form (20)

List of Global Variables

    145.2. Global Functions

    145.2.1. Check

    Check the netmask

    Function parameters

    • string netmask

    Return value

    • boolean - true if correct

    145.2.2. Check4

    Check the IPv4 netmask Note that 0.0.0.0 is not a correct netmask.

    Function parameters

    • string netmask

    Return value

    • boolean - true if correct

    145.2.3. Check6

    Check the IPv6 netmask

    Function parameters

    • string netmask

    Return value

    • boolean - true if correct

    145.2.4. FromBits

    Convert netmask in bits form (20) to netmask string (255.255.240.0)

    Function parameters

    • integer bits

    Return value

    • string - netmask string

    145.2.5. ToBits

    Convert IPv4 netmask as string (255.255.240.0) to bits form (20)

    Function parameters

    • string netmask

    Return value

    • integer - number of bits in netmask; 32 for empty string

    145.3. Global Variables

    145.4. Module Requirements

    none