.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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" '' . ds C` . ds C' '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 >0, 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. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Zonemaster::Engine::Net::IP 3pm" .TH Zonemaster::Engine::Net::IP 3pm "2023-10-01" "perl v5.36.0" "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" Zonemaster::Engine::Net::IP \- Net::IP::XS Wrapper .SH "SYNOPSIS" .IX Header "SYNOPSIS" Deprecated module. This module will be removed in v2023.2. Use Net::IP::XS instead. .PP .Vb 1 \& my $ip = Zonemaster::Engine::Net::IP\->new( q{0.0.0.0/8} ); .Ve .SH "PROCEDURAL INTERFACE" .IX Header "PROCEDURAL INTERFACE" .IP "ip_is_ipv4" 4 .IX Item "ip_is_ipv4" Check if an \s-1IP\s0 address is of type 4. .RS 4 .IP "Params" 4 .IX Item "Params" \&\s-1IP\s0 address .IP "Returns" 4 .IX Item "Returns" 1 (yes) or 0 (no) .RE .RS 4 .Sp .Vb 1 \& ip_is_ipv4($ip) and print "$ip is IPv4"; .Ve .RE .IP "ip_is_ipv6" 4 .IX Item "ip_is_ipv6" Check if an \s-1IP\s0 address is of type 6. .RS 4 .IP "Params" 4 .IX Item "Params" \&\s-1IP\s0 address .IP "Returns" 4 .IX Item "Returns" 1 (yes) or 0 (no) .RE .RS 4 .Sp .Vb 1 \& ip_is_ipv6($ip) and print "$ip is IPv6"; .Ve .RE .IP "Error" 4 .IX Item "Error" Returns the error string corresponding to the last error generated in the module. This is also useful for the \s-1OO\s0 interface, as if the \fBnew()\fR function fails, we cannot call \f(CW$ip\fR\->\fBerror()\fR and so we have to use \fBError()\fR. .Sp .Vb 1 \& warn Error(); .Ve .SH "METHODS" .IX Header "METHODS" .IP "new" 4 .IX Item "new" Constructor of object. .IP "ip" 4 .IX Item "ip" Return the \s-1IP\s0 address (or first \s-1IP\s0 of the prefix or range) in quad format, as a string. .Sp .Vb 1 \& print ($ip\->ip()); .Ve .IP "overlaps" 4 .IX Item "overlaps" Check if two \s-1IP\s0 ranges/prefixes overlap each other. The value returned by the function should be one of: \f(CW$IP_PARTIAL_OVERLAP\fR (ranges overlap) \f(CW$IP_NO_OVERLAP\fR (no overlap) \f(CW$IP_A_IN_B_OVERLAP\fR (range2 contains range1) \f(CW$IP_B_IN_A_OVERLAP\fR (range1 contains range2) \f(CW$IP_IDENTICAL\fR (ranges are identical) undef (problem) .Sp .Vb 1 \& if ($ip\->overlaps($ip2)==$IP_A_IN_B_OVERLAP) {...}; .Ve .IP "prefix" 4 .IX Item "prefix" Return the full prefix (ip+prefix length) in quad (standard) format. .Sp .Vb 1 \& print ($ip\->prefix()); .Ve .IP "prefixlen" 4 .IX Item "prefixlen" Return the length in bits of the current prefix. .Sp .Vb 1 \& print ($ip\->prefixlen()); .Ve .IP "print" 4 .IX Item "print" Print the \s-1IP\s0 object (IP/Prefix or First \- Last) .Sp .Vb 1 \& print ($ip\->print()); .Ve .IP "reverse_ip" 4 .IX Item "reverse_ip" Return the reverse \s-1IP\s0 for a given \s-1IP\s0 address (in.addr. format). .Sp .Vb 1 \& print ($ip\->reserve_ip()); .Ve .IP "short" 4 .IX Item "short" Return the \s-1IP\s0 in short format: IPv4 addresses: 194.5/16 IPv6 addresses: ab32:f000:: .Sp print ($ip\->\fBshort()\fR); .IP "version" 4 .IX Item "version" Return the version of the current \s-1IP\s0 object (4 or 6). .Sp .Vb 1 \& print ($ip\->version()); .Ve