79. IP

IP manipulation routines

79.1. Summary of Module Globals

List of Global Functions

  • Check - Check syntax of IP address

  • Check4 - Check syntax of IPv4 address

  • Check6 - Check syntax of IPv6 address

  • ComputeBroadcast - Compute IPv4 broadcast address from ip4 address and network mask.

  • ComputeNetwork - Compute IPv4 network address from ip4 address and network mask.

  • ToHex - Converts IPv4 address from string to hex format

  • ToInteger - Convert IPv4 address from string to integer

  • ToString - Convert IPv4 address from integer to string

  • Valid4 - Describe a valid IPv4 address

List of Global Variables

    79.2. Global Functions

    79.2.1. Check

    Check syntax of IP address

    Function parameters

    • string ip

    Return value

    • boolean - true if correct

    79.2.2. Check4

    Check syntax of IPv4 address

    Function parameters

    • string ip

    Return value

    • boolean - true if correct

    79.2.3. Check6

    Check syntax of IPv6 address

    Function parameters

    • string ip

    Return value

    • boolean - true if correct

    79.2.4. ComputeBroadcast

    Compute IPv4 broadcast address from ip4 address and network mask.

    Function parameters

    • string ip

    • string mask

    Return value

    • string - computed broadcast

    79.2.5. ComputeNetwork

    Compute IPv4 network address from ip4 address and network mask.

    Function parameters

    • string ip

    • string mask

    Return value

    • string - computed subnet

    79.2.6. ToHex

    Converts IPv4 address from string to hex format

    Function parameters

    • string ip

    Return value

    • string - representing IP in Hex

    Example 4. 

     IP::ToHex("192.168.1.1") -> "0xC0A80101"
     IP::ToHex("10.10.0.1") -> "0x0A0A0001"

    79.2.7. ToInteger

    Convert IPv4 address from string to integer

    Function parameters

    • string ip

    Return value

    • integer - ip address as integer

    79.2.8. ToString

    Convert IPv4 address from integer to string

    Function parameters

    • integer ip

    Return value

    • string - ip address as string

    79.2.9. Valid4

    Describe a valid IPv4 address

    Return value

    • string - describtion a valid IPv4 address

    79.3. Global Variables

    79.4. Module Requirements

    none