Unknown YCP Module |
This module has an unstable interface. |
Global Functions |
File: modules/IP.ycp
Module: yast2
Summary: IP manipulation routines
Authors: Michal Svec
Describe a valid IPv4 address
- Return value:
-
describtion a valid IPv4 address
Check syntax of IPv4 address
- Parameters:
-
ip IPv4 address
- Return value:
-
true if correct
Describe a valid IPv6 address
- Return value:
-
describtion a valid IPv4 address
Check syntax of IPv6 address
- Parameters:
-
ip IPv6 address
- Return value:
-
true if correct
If param contains IPv6 in one of its various forms, extracts it.
if ip is closed in [ ] or contain % then it can be special case of IPv6 syntax, so extract ipv6 (see description later) and continue with check.
IPv6 syntax: - pure ipv6 blob (e.g. f008::1) - ipv6 blob with link local suffix (e.g. f008::1%eth0) - dtto in square brackets (e.g. [f008::1%eth0] )
- Parameters:
-
ip a buffer with address
- Return value:
-
IPv6 part of ip param, unchanged ip param otherwise
Check syntax of IP address
- Parameters:
-
ip IP address
- Return value:
-
true if correct
Convert IPv4 address from string to integer
- Parameters:
-
ip IPv4 address
- Return value:
-
ip address as integer
Convert IPv4 address from integer to string
- Parameters:
-
ip IPv4 address
- Return value:
-
ip address as 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"
Compute IPv4 network address from ip4 address and network mask.
- Parameters:
-
ip IPv4 address mask netmask
- Return value:
-
computed subnet
Compute IPv4 broadcast address from ip4 address and network mask.
- Parameters:
-
ip IPv4 address mask netmask
- Return value:
-
computed broadcast
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()
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()