yast2 |
modules/IP.ycp |
IP manipulation routines | |
|
|
This module has an unstable interface. |
Global Functions |
global
Valid4 ()
->
string
Describe a valid IPv4 address
- Return value:
-
describtion a valid IPv4 address
global
Check4 (string ip)
->
boolean
Check syntax of IPv4 address
- Parameters:
-
ip IPv4 address
- Return value:
-
true if correct
global
Check6 (string ip)
->
boolean
Check syntax of IPv6 address
- Parameters:
-
ip IPv6 address
- Return value:
-
true if correct
global
Check (string ip)
->
boolean
Check syntax of IP address
- Parameters:
-
ip IP address
- Return value:
-
true if correct
global
ToInteger (string ip)
->
integer
Convert IPv4 address from string to integer
- Parameters:
-
ip IPv4 address
- Return value:
-
ip address as integer
global
ToString (integer ip)
->
string
Convert IPv4 address from integer to string
- Parameters:
-
ip IPv4 address
- Return value:
-
ip address as string
global
ToHex (string ip)
->
string
Converts IPv4 address from string to hex format
- Parameters:
-
ip IPv4 address as string in "ipv4" format
- Return value:
-
representing IP in Hex
- Example
-
IP::ToHex("192.168.1.1") -> "0xC0A80101" IP::ToHex("10.10.0.1") -> "0x0A0A0001"
global
ComputeNetwork (string ip, string mask)
->
string
Compute IPv4 network address from ip4 address and network mask.
- Parameters:
-
ip IPv4 address mask netmask
- Return value:
-
computed subnet
global
ComputeBroadcast (string ip, string mask)
->
string
Compute IPv4 broadcast address from ip4 address and network mask.
- Parameters:
-
ip IPv4 address mask netmask
- Return value:
-
computed broadcast
global
IPv4ToBits (string ipv4)
->
string
Converts IPv4 into its 32 bit binary representation.
- Parameters:
-
ipv4
- Return value:
-
binary
- Example
-
IPv4ToBits("80.25.135.2") -> "01010000000110011000011100000010" IPv4ToBits("172.24.233.211") -> "10101100000110001110100111010011"
- See
-
BitsToIPv4()
global
BitsToIPv4 (string bits)
->
string
Converts 32 bit binary number to its IPv4 repserentation.
- Parameters:
-
bits
- Return value:
-
ipv4
- Example
-
BitsToIPv4("10111100000110001110001100000101") -> "188.24.227.5" BitsToIPv4("00110101000110001110001001100101") -> "53.24.226.101"
- See
-
IPv4ToBits()