Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
IPv6 Class Reference

Class to validate and to work with IPv6 addresses. More...

Static Public Member Functions

static check_ipv6 ($ip)
 Checks an IPv6 address.
 
static checkIPv6 ($ip)
 Checks if the given IP is a valid IPv6 address.
 
static compress ($ip)
 Compresses an IPv6 address.
 
static uncompress ($ip)
 Uncompresses an IPv6 address.
 

Detailed Description

Class to validate and to work with IPv6 addresses.

@subpackage HTTP

License
http://www.opensource.org/licenses/bsd-license.php @externalurl http://pear.php.net/package/Net_IPv6
Author
Alexander Merz alexa.nosp@m.nder.nosp@m..merz.nosp@m.@web.nosp@m..de
elfrink at introweb dot nl
Josh Peck <jmp at joshpeck dot org>
Sam Sneddon geoff.nosp@m.ers@.nosp@m.gmail.nosp@m..com

Member Function Documentation

◆ check_ipv6()

static IPv6::check_ipv6 ( $ip)
static

Checks an IPv6 address.

Checks if the given IP is a valid IPv6 address

Parameters
string$ipAn IPv6 address
Return values
booltrue if $ip is a valid IPv6 address

◆ checkIPv6()

static IPv6::checkIPv6 ( $ip)
static

Checks if the given IP is a valid IPv6 address.

@codeCoverageIgnore

Deprecated
Use {
See also
IPv6\check_ipv6()} instead
check_ipv6
Parameters
string$ipAn IPv6 address
Return values
booltrue if $ip is a valid IPv6 address

◆ compress()

static IPv6::compress ( $ip)
static

Compresses an IPv6 address.

RFC 4291 allows you to compress concecutive zero pieces in an address to '::'. This method expects a valid IPv6 address and compresses consecutive zero pieces to '::'.

Example: FF01:0:0:0:0:0:0:101 -> FF01::101 0:0:0:0:0:0:0:1 -> ::1

See also
uncompress()
Parameters
string$ipAn IPv6 address
Return values
stringThe compressed IPv6 address

◆ uncompress()

static IPv6::uncompress ( $ip)
static

Uncompresses an IPv6 address.

RFC 4291 allows you to compress concecutive zero pieces in an address to '::'. This method expects a valid IPv6 address and expands the '::' to the required number of zero pieces.

Example: FF01::101 -> FF01:0:0:0:0:0:0:101 ::1 -> 0:0:0:0:0:0:0:1

Author
Alexander Merz alexa.nosp@m.nder.nosp@m..merz.nosp@m.@web.nosp@m..de
elfrink at introweb dot nl
Josh Peck <jmp at joshpeck dot org>
License
http://www.opensource.org/licenses/bsd-license.php
Parameters
string$ipAn IPv6 address
Return values
stringThe uncompressed IPv6 address

The documentation for this class was generated from the following file: