class SimplePie_Net_IPv6


Located at : UKNOWVA_ROOT/libraries/simplepie/simplepie.php

Class to validate and to work with IPv6 addresses.

Methods

string
removeNetmaskSpec(string $ip)

Removes a possible existing netmask specification of an IP address.

string
Uncompress(string $ip)

Uncompresses an IPv6 address

array
SplitV64(string $ip)

Splits an IPv6 address into the IPv6 and a possible IPv4 part

bool
checkIPv6(string $ip)

Checks an IPv6 address

Details

at line 12332
string removeNetmaskSpec(string $ip)

Removes a possible existing netmask specification of an IP address.

Parameters

string $ip the (compressed) IP as Hex representation

Return Value

string the IP the without netmask

at line 12360
string Uncompress(string $ip)

Uncompresses an IPv6 address

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

Parameters

string $ip a valid IPv6-address (hex format)

Return Value

string the uncompressed IPv6-address (hex format)

at line 12446
array SplitV64(string $ip)

Splits an IPv6 address into the IPv6 and a possible IPv4 part

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

Parameters

string $ip a valid IPv6-address (hex format)

Return Value

array [0] contains the IPv6 part, [1] the IPv4 part (hex format)

at line 12472
bool checkIPv6(string $ip)

Checks an IPv6 address

Checks if the given IP is IPv6-compatible

Parameters

string $ip a valid IPv6-address

Return Value

bool true if $ip is an IPv6 address