Developer's API Reference guide
Functions
Total number of functions: 4. Functions supported are:set_error
($msg)get_string_from_xpath
($xml, $xpath, $val, $retVal)dec_to_bin
($decimal, $binary)get_subnet_bits
($ip)
set_error
set_error($msg)
This private function is used to set the error string to the library. This string can be obtained by libvirt_get_last_error() from the PHP application..
@msg [string]: | error message string |
Returns: | None |
get_string_from_xpath
get_string_from_xpath($xml, $xpath, $val, $retVal)
Function is used to get the XML xPath expression from the XML document. This can be added to val array if not NULL..
@xml [string]: | input XML document |
@xpath [string]: | xPath expression to find nodes in the XML document |
@val [array]: | Zend array resource to put data to |
@retVal [int]: | return value of the parsing |
Returns: | string containing data of last match found |
dec_to_bin
dec_to_bin($decimal, $binary)
Function dec_to_bin() converts the unsigned long long decimal (used e.g. for IPv4 address) to it's binary representation.
@decimal [int]: | decimal value to be converted to binary interpretation |
@binary [string]: | output binary string with the binary interpretation |
Returns: | None |
get_subnet_bits
get_subnet_bits($ip)
Function is used to get number of bits used by subnet determined by IP. Useful to get the CIDR IPv4 address representation.
@ip [string]: | IP address to calculate subnet bits from |
Returns: | number of bits used by subnet mask |