.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" 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 "IPv6Addr 3pm" .TH IPv6Addr 3pm "2011-08-28" "perl v5.12.4" "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" Net::IPv6Addr \-\- check validity of IPv6 addresses .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::IPv6Addr; \& \& Net::IPv6Addr::ipv6_parse($addr); \& $x = new Net::IPv6Addr("dead:beef:cafe:babe::f0ad"); \& print $x\->to_string_preferred(), "\en"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Net::IPv6Addr\*(C'\fR checks strings for valid IPv6 addresses, as specified in \s-1RFC1884\s0. You throw possible addresses at it, it either accepts them or throws an exception. .PP If \f(CW\*(C`Math::Base85\*(C'\fR is installed, then this module is able to process addresses formatted in the style referenced by \s-1RFC1924\s0. .PP The public interface of this module is rather small. .SH "new" .IX Header "new" .SS "Parameters" .IX Subsection "Parameters" A string to be interpreted as an IPv6 address. .SS "Returns" .IX Subsection "Returns" A \f(CW\*(C`Net::IPv6Addr\*(C'\fR object if successful. .SS "Notes" .IX Subsection "Notes" Throws an exception if the string isn't a valid address. .SH "ipv6_parse" .IX Header "ipv6_parse" .SS "Parameters" .IX Subsection "Parameters" A string containing an IPv6 address string. Optionally, it may also include a \f(CW\*(C`/\*(C'\fR character, and a numeric prefix length, in that order. .PP .Vb 1 \& \-or\- .Ve .PP An IPv6 address string. Optionally, a numeric prefix length. .SS "Returns" .IX Subsection "Returns" What you gave it, more or less, if it does parse out correctly. .SS "Notes" .IX Subsection "Notes" Throws an exception on malformed input. This is not an object method or class method; it's just a subroutine. .SH "is_ipv6" .IX Header "is_ipv6" .SS "Parameters" .IX Subsection "Parameters" A string containing an IPv6 address string. Optionally, it may also include a \f(CW\*(C`/\*(C'\fR character, and a numeric prefix length, in that order. .PP .Vb 1 \& \-or\- .Ve .PP An IPv6 address string. Optionally, a numeric prefix length. .SS "Returns" .IX Subsection "Returns" What you gave it, more or less, if it does parse out correctly, otherwise returns undef. .SS "Notes" .IX Subsection "Notes" This is not an object method or class method; it is just a subroutine. .SH "ipv6_chkip" .IX Header "ipv6_chkip" .SS "Parameters" .IX Subsection "Parameters" An IPv6 address string. .SS "Returns" .IX Subsection "Returns" Something true if it's a valid address; something false otherwise. .SH "to_string_preferred" .IX Header "to_string_preferred" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" The IPv6 address, formatted in the \*(L"preferred\*(R" way (as detailed by \&\s-1RFC1884\s0). .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "to_string_compressed" .IX Header "to_string_compressed" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" The IPv6 address in \*(L"compresed\*(R" format (as detailed by \s-1RFC1884\s0). .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "to_string_ipv4" .IX Header "to_string_ipv4" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" The IPv6 address in IPv4 format (as detailed by \s-1RFC1884\s0). .SS "Notes" .IX Subsection "Notes" Invalid input (such as an address that was not originally IPv4) will generate an exception. .SH "to_string_ipv4_compressed" .IX Header "to_string_ipv4_compressed" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" The IPv6 address in compressed IPv4 format (as detailed by \s-1RFC1884\s0). .SS "Notes" .IX Subsection "Notes" Invalid input (such as an address that was not originally IPv4) will generate an exception. .SH "to_string_base85" .IX Header "to_string_base85" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" The IPv6 address in the style detailed by \s-1RFC1924\s0. .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "to_bigint" .IX Header "to_bigint" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" The BigInt representation of IPv6 address. .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "to_array" .IX Header "to_array" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" An array [0..7] of 16 bit hexadecimal numbers. .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "to_intarray" .IX Header "to_intarray" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" An array [0..7] of decimal numbers. .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "to_string_ip6_int" .IX Header "to_string_ip6_int" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, none; if used as a plain old subroutine, an IPv6 address string in any format. .SS "Returns" .IX Subsection "Returns" The reverse-address pointer as defined by \s-1RFC1886\s0. .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "in_network_of_size" .IX Header "in_network_of_size" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, network size in bits .PP If used as a plain old subroutine, an IPv6 address string in any format and network size in bits. Network size may be given with / notation. .SS "Returns" .IX Subsection "Returns" Network IPv6Addr of given size. .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "in_network" .IX Header "in_network" .SS "Parameters" .IX Subsection "Parameters" If used as an object method, network and its size in bits .PP If used as a plain old subroutine, an IPv6 address string in any format network address string and size in bits. Network size may be given with / notation. .SS "Returns" .IX Subsection "Returns" Something true, if address is member of the network, false otherwise. .SS "Notes" .IX Subsection "Notes" Invalid input will generate an exception. .SH "BUGS" .IX Header "BUGS" probably exist in this module. Please report them. .SH "AUTHOR" .IX Header "AUTHOR" Tony Monroe . .PP The module's interface probably looks like it vaguely resembles Net::IPv4Addr by Francis J. Lacoste . .PP Some fixes and subroutines from Jyrki Soini . .SH "HISTORY" .IX Header "HISTORY" This was originally written to simplify the task of maintaining \&\s-1DNS\s0 records after I set myself up with Freenet6. Interesting that there's really only one DNS-related subroutine in here. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1RFC1884\s0, \s-1RFC1886\s0, \s-1RFC1924\s0, perl, Net::IPv4Addr, Math::Base85, Math::BigInt