PHP Class SimplePie_Net_IPv6, ojs

Author: Alexander Merz ([email protected])
Author: elfrink at introweb dot nl
Author: Geoffrey Sneddon ([email protected])
显示文件 Open project: pkp/ojs Class Usage Examples

Public Methods

Method Description
SplitV64 ( string $ip ) : array Splits an IPv6 address into the IPv6 and a possible IPv4 part
Uncompress ( string $ip ) : string Uncompresses an IPv6 address
checkIPv6 ( string $ip ) : boolean Checks an IPv6 address
removeNetmaskSpec ( string $ip ) : string Removes a possible existing netmask specification of an IP address.

Method Details

SplitV64() public method

RFC 2373 allows you to note the last two parts of an IPv6 address as an IPv4 compatible address Example: 0:0:0:0:0:0:13.1.68.3 0:0:0:0:0:FFFF:129.144.52.38
public SplitV64 ( string $ip ) : array
$ip string a valid IPv6-address (hex format)
return array [0] contains the IPv6 part, [1] the IPv4 part (hex format)

Uncompress() public method

RFC 2373 allows you to compress zeros in an address to '::'. This function expects an valid IPv6 address and expands the '::' to the required zeros. Example: FF01::101 -> FF01:0:0:0:0:0:0:101 ::1 -> 0:0:0:0:0:0:0:1
public Uncompress ( string $ip ) : string
$ip string a valid IPv6-address (hex format)
return string the uncompressed IPv6-address (hex format)

checkIPv6() public method

Checks if the given IP is IPv6-compatible
public checkIPv6 ( string $ip ) : boolean
$ip string a valid IPv6-address
return boolean true if $ip is an IPv6 address

removeNetmaskSpec() public method

Removes a possible existing netmask specification of an IP address.
Since: 1.1.0
public removeNetmaskSpec ( string $ip ) : string
$ip string the (compressed) IP as Hex representation
return string the IP the without netmask