%PDF- %PDF-
Direktori : /proc/self/root/usr/local/share/man/man3/ |
Current File : //proc/self/root/usr/local/share/man/man3/Data::Validate::IP.3pm |
.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.13) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Data::Validate::IP 3" .TH Data::Validate::IP 3 "2013-07-13" "perl v5.10.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Data::Validate::IP \- ipv4 and ipv6 validation methods .SH "VERSION" .IX Header "VERSION" version 0.20 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Data::Validate::IP qw(is_ipv4 is_ipv6); \& \& if (is_ipv4($suspect)) { \& print "Looks like an ipv4 address"; \& } \& else { \& print "Not an ipv4 address\en"; \& } \& \& if (is_ipv6($suspect)) { \& print "Looks like an ipv6 address"; \& } \& else { \& print "Not an ipv6 address\en"; \& } \& \& # or as an object \& my $v = Data::Validate::IP\->new(); \& \& die "not an ipv4 ip" unless ($v\->is_ipv4(\*(Aqdomain.com\*(Aq)); \& \& die "not an ipv6 ip" unless ($v\->is_ipv6(\*(Aqdomain.com\*(Aq)); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module collects ip validation routines to make input validation, and untainting easier and more readable. .PP All functions return an untainted value if the test passes, and undef if it fails. This means that you should always check for a defined status explicitly. Don't assume the return will be true. (e.g. is_username('0')) .PP The value to test is always the first (and often only) argument. .PP All of the functions below are exported by default. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .IP "\fBnew\fR \- constructor for \s-1OO\s0 usage" 4 .IX Item "new - constructor for OO usage" .Vb 1 \& $obj = Data::Validate::IP\->new(); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns a Data::Validator::IP object. This lets you access all the validator function calls as methods without importing them into your namespace or using the clumsy \&\fIData::Validate::IP::function_name()\fR format. .IP "\fIArguments\fR" 4 .IX Item "Arguments" None .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns a Data::Validate::IP object .RE .RS 4 .RE .IP "\fBis_ipv4\fR \- does the value look like an ip v4 address?" 4 .IX Item "is_ipv4 - does the value look like an ip v4 address?" .Vb 3 \& is_ipv4($value); \& or \& $obj\->is_ipv4($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. It only looks to see that the format is appropriate. .RE .RS 4 .RE .IP "\fBis_ipv6\fR \- does the value look like an ip v6 address?" 4 .IX Item "is_ipv6 - does the value look like an ip v6 address?" .Vb 1 \& is_ipv6($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. It only looks to see that the format is appropriate. .RE .RS 4 .RE .IP "\fBis_innet_ipv4\fR \- is it a valid ipv4 address in the network specified" 4 .IX Item "is_innet_ipv4 - is it a valid ipv4 address in the network specified" .Vb 3 \& is_innet_ipv4($value,$network); \& or \& $obj\->is_innet_ipv4($value,$network); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed ip address inside of the network specified .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .ie n .IP "$network" 4 .el .IP "\f(CW$network\fR" 4 .IX Item "$network" The potential network the \s-1IP\s0 must be a part of. This should be specified in \&\s-1CIDR\s0 notation, for example \*(L"15.0.15.0/24\*(R". .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .RE .RS 4 .RE .IP "\fBis_private_ipv4\fR \- is it a valid private ipv4 address" 4 .IX Item "is_private_ipv4 - is it a valid private ipv4 address" .Vb 3 \& is_private_ipv4($value); \& or \& $obj\->is_private_ipv4($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed private ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 5735\fR" 4 .IX Item "From RFC 5735" .Vb 3 \& 10.0.0.0/8 \- This block is set aside for use in private networks. \& Its intended use is documented in [RFC1918]. Addresses within this \& block should not appear on the public Internet. \& \& 172.16.0.0/12 \- This block is set aside for use in private networks. \& Its intended use is documented in [RFC1918]. Addresses within this \& block should not appear on the public Internet. \& \& 192.168.0.0/16 \- This block is set aside for use in private networks. \& Its intended use is documented in [RFC1918]. Addresses within this \& block should not appear on the public Internet. .Ve .RE .RS 4 .RE .IP "\fBis_loopback_ipv4\fR \- is it a valid loopback ipv4 address" 4 .IX Item "is_loopback_ipv4 - is it a valid loopback ipv4 address" .Vb 3 \& is_loopback_ipv4($value); \& or \& $obj\->is_loopback_ipv4($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed loopback ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 5735\fR" 4 .IX Item "From RFC 5735" .Vb 6 \& 127.0.0.0/8 \- This block is assigned for use as the Internet host \& loopback address. A datagram sent by a higher level protocol to an \& address anywhere within this block should loop back inside the host. \& This is ordinarily implemented using only 127.0.0.1/32 for loopback, \& but no addresses within this block should ever appear on any network \& anywhere [RFC1700, page 5]. .Ve .RE .RS 4 .RE .IP "\fBis_testnet_ipv4\fR \- is it a valid testnet ipv4 address" 4 .IX Item "is_testnet_ipv4 - is it a valid testnet ipv4 address" .Vb 3 \& is_testnet_ipv4($value); \& or \& $obj\->is_testnet_ipv4($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed testnet ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 5735\fR" 4 .IX Item "From RFC 5735" .Vb 5 \& 192.0.2.0/24 \- This block is assigned as "TEST\-NET" for use in \& documentation and example code. It is often used in conjunction with \& domain names example.com or example.net in vendor and protocol \& documentation. Addresses within this block should not appear on the \& public Internet. .Ve .RE .RS 4 .RE .IP "\fBis_multicast_ipv4\fR \- is it a valid multicast ipv4 address" 4 .IX Item "is_multicast_ipv4 - is it a valid multicast ipv4 address" .Vb 3 \& is_multicast_ipv4($value); \& or \& $obj\->is_multicast_ipv4($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed multicast ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 5735\fR" 4 .IX Item "From RFC 5735" .Vb 4 \& 224.0.0.0/4 \- This block, formerly known as the Class D address \& space, is allocated for use in IPv4 multicast address assignments. \& The IANA guidelines for assignments from this space are described in \& [RFC3171]. .Ve .RE .RS 4 .RE .IP "\fBis_linklocal_ipv4\fR \- is it a valid link-local ipv4 address" 4 .IX Item "is_linklocal_ipv4 - is it a valid link-local ipv4 address" .Vb 3 \& is_linklocal_ipv4($value); \& or \& $obj\->is_linklocal_ipv4($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed link-local ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 5735\fR" 4 .IX Item "From RFC 5735" .Vb 4 \& 169.254.0.0/16 \- This is the "link local" block. It is allocated for \& communication between hosts on a single link. Hosts obtain these \& addresses by auto\-configuration, such as when a DHCP server may not \& be found. .Ve .RE .RS 4 .RE .IP "\fBis_unroutable_ipv4\fR \- is it a valid unroutable ipv4 address" 4 .IX Item "is_unroutable_ipv4 - is it a valid unroutable ipv4 address" .Vb 3 \& is_unroutable_ipv4($value); \& or \& $obj\->is_unroutable_ipv4($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed unroutable ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 5375\fR" 4 .IX Item "From RFC 5375" .Vb 5 \& 0.0.0.0/8 \- Addresses in this block refer to source hosts on "this" \& network. Address 0.0.0.0/32 may be used as a source address for this \& host on this network; other addresses within 0.0.0.0/8 may be used to \& refer to specified hosts on this network ([RFC1122], Section \& 3.2.1.3). \& \& 192.0.0.0/24 \- This block is reserved for IETF protocol assignments. \& At the time of writing this document, there are no current \& assignments. Allocation policy for future assignments is given in \& [RFC5736]. \& \& 198.18.0.0/15 \- This block has been allocated for use in benchmark \& tests of network interconnect devices. [RFC2544] explains that this \& range was assigned to minimize the chance of conflict in case a \& testing device were to be accidentally connected to part of the \& Internet. Packets with source addresses from this range are not \& meant to be forwarded across the Internet. \& \& 198.51.100.0/24 \- This block is assigned as "TEST\-NET\-2" for use in \& documentation and example code. It is often used in conjunction with \& domain names example.com or example.net in vendor and protocol \& documentation. As described in [RFC5737], addresses within this \& block do not legitimately appear on the public Internet and can be \& used without any coordination with IANA or an Internet registry. \& \& 203.0.113.0/24 \- This block is assigned as "TEST\-NET\-3" for use in \& documentation and example code. It is often used in conjunction with \& domain names example.com or example.net in vendor and protocol \& documentation. As described in [RFC5737], addresses within this \& block do not legitimately appear on the public Internet and can be \& used without any coordination with IANA or an Internet registry. \& \& 240.0.0.0/4 \- This block, formerly known as the Class E address \& space, is reserved for future use; see [RFC1112], Section 4. .Ve .RE .RS 4 .RE .IP "\fBis_public_ipv4\fR \- is it a valid public ipv4 address" 4 .IX Item "is_public_ipv4 - is it a valid public ipv4 address" .Vb 3 \& is_public_ipv4($value); \& or \& $obj\->is_public_ipv4($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed public ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists or could truly route. This is true for any non\- private/testnet/loopback ip. .RE .RS 4 .RE .IP "\fBis_private_ipv6\fR \- is it a valid private ipv6 address" 4 .IX Item "is_private_ipv6 - is it a valid private ipv6 address" .Vb 3 \& is_private_ipv6($value); \& or \& $obj\->is_private_ipv6($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed private ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 4193\fR" 4 .IX Item "From RFC 4193" .Vb 5 \& The default behavior of exterior routing protocol sessions between \& administrative routing regions must be to ignore receipt of and not \& advertise prefixes in the FC00::/7 block. A network operator may \& specifically configure prefixes longer than FC00::/7 for inter\-site \& communication. .Ve .RE .RS 4 .RE .IP "\fBis_loopback_ipv6\fR \- is it a valid loopback ipv6 address" 4 .IX Item "is_loopback_ipv6 - is it a valid loopback ipv6 address" .Vb 3 \& is_loopback_ipv6($value); \& or \& $obj\->is_loopback_ipv6($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed loopback ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 4291\fR" 4 .IX Item "From RFC 4291" .Vb 6 \& The unicast address 0:0:0:0:0:0:0:1 is called the loopback address. \& It may be used by a node to send an IPv6 packet to itself. It must \& not be assigned to any physical interface. It is treated as having \& Link\-Local scope, and may be thought of as the Link\-Local unicast \& address of a virtual interface (typically called the "loopback \& interface") to an imaginary link that goes nowhere. .Ve .RE .RS 4 .RE .IP "\fBis_multicast_ipv6\fR \- is it a valid multicast ipv6 address" 4 .IX Item "is_multicast_ipv6 - is it a valid multicast ipv6 address" .Vb 3 \& is_multicast_ipv6($value); \& or \& $obj\->is_multicast_ipv6($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed multicast ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 4291\fR" 4 .IX Item "From RFC 4291" .Vb 4 \& An IPv6 multicast address is an identifier for a group of interfaces \& (typically on different nodes). An interface may belong to any \& number of multicast groups. Multicast addresses have the following \& format: \& \& | 8 | 4 | 4 | 112 bits | \& +\-\-\-\-\-\- \-+\-\-\-\-+\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& |11111111|flgs|scop| group ID | \& +\-\-\-\-\-\-\-\-+\-\-\-\-+\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ .Ve .RE .RS 4 .RE .IP "\fBis_linklocal_ipv6\fR \- is it a valid link-local ipv6 address" 4 .IX Item "is_linklocal_ipv6 - is it a valid link-local ipv6 address" .Vb 3 \& is_linklocal_ipv6($value); \& or \& $obj\->is_linklocal_ipv6($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed link-local ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 4291\fR" 4 .IX Item "From RFC 4291" .Vb 2 \& Link\-Local addresses are for use on a single link. Link\-Local \& addresses have the following format: \& \& | 10 | \& | bits | 54 bits | 64 bits | \& +\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& |1111111010| 0 | interface ID | \& +\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& \& Link\-Local addresses are designed to be used for addressing on a \& single link for purposes such as automatic address configuration, \& neighbor discovery, or when no routers are present. .Ve .RE .RS 4 .RE .IP "\fBis_special_ipv6\fR \- is it a valid special purpose ipv6 address" 4 .IX Item "is_special_ipv6 - is it a valid special purpose ipv6 address" .Vb 3 \& is_special_ipv6($value); \& or \& $obj\->is_special_ipv6($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed special purpose ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 2928\fR" 4 .IX Item "From RFC 2928" .Vb 4 \& The block of Sub\-TLA IDs assigned to the IANA (i.e., 2001:0000::/29 \- \& 2001:01F8::/29) is for assignment for testing and experimental usage \& to support activities such as the 6bone, and for new approaches like \& exchanges. .Ve .RE .RS 4 .Sp The whole block of special IPv6 addresses can be written simple as 2001::/23. .RE .IP "\fBis_public_ipv6\fR \- is it a valid public ipv6 address" 4 .IX Item "is_public_ipv6 - is it a valid public ipv6 address" .Vb 3 \& is_public_ipv6($value); \& or \& $obj\->is_public_ipv6($value); .Ve .RS 4 .IP "\fIDescription\fR" 4 .IX Item "Description" Returns the untainted ip address if the test value appears to be a well-formed public ip address. .IP "\fIArguments\fR" 4 .IX Item "Arguments" .RS 4 .PD 0 .ie n .IP "$value" 4 .el .IP "\f(CW$value\fR" 4 .IX Item "$value" .PD The potential ip to test. .RE .RS 4 .RE .IP "\fIReturns\fR" 4 .IX Item "Returns" Returns the untainted ip on success, undef on failure. .IP "\fINotes, Exceptions, & Bugs\fR" 4 .IX Item "Notes, Exceptions, & Bugs" The function does not make any attempt to check whether an ip actually exists. .IP "\fIFrom \s-1RFC\s0 4193\fR" 4 .IX Item "From RFC 4193" .Vb 5 \& The default behavior of exterior routing protocol sessions between \& administrative routing regions must be to ignore receipt of and not \& advertise prefixes in the FC00::/7 block. A network operator may \& specifically configure prefixes longer than FC00::/7 for inter\-site \& communication. .Ve .RE .RS 4 .RE .SH "SEE ALSO" .IX Header "SEE ALSO" IPv4 .PP \&\fB[\s-1RFC\s0 5735] [\s-1RFC\s0 1918]\fR .PP IPv6 .PP \&\fB[\s-1RFC\s0 2460] [\s-1RFC\s0 4193] [\s-1RFC\s0 4291] [\s-1RFC\s0 6434]\fR .SH "IPv6" .IX Header "IPv6" IPv6 Support is new, please test it thoroughly and report any bugs. .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \&\f(CW\*(C`bug\-data\-validate\-ip@rt.cpan.org\*(C'\fR, or through the web interface at <http://rt.cpan.org>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Thanks to Richard Sonnen <\fIsonnen@richardsonnen.com\fR> for writing the Data::Validate module. .PP Thanks to Matt Dainty <\fImatt@bodgit\-n\-scarper.com\fR> for adding the is_multicast_ipv4 and is_linklocal_ipv4 code. .SH "AUTHORS" .IX Header "AUTHORS" .IP "\(bu" 4 Neil Neely <neil@neely.cx> .IP "\(bu" 4 Dave Rolsky <autarch@urth.org> .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2013 by Neil Neely. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.