Zonema...Net::IP(3pm)
π Zonema...Net::IP(3pm) π
okay bestie, welcome to Zonemaster::Engine::Net::IP β literally just a wrapper around Net::IP::XS π and yes it's from the User Contributed Perl Documentation corner of the internet, iykyk.
β¨ NAME β¨
Zonemaster::Engine::Net::IP β Net::IP::XS Wrapper π¦
πΈ SYNOPSIS πΈ
β οΈ Deprecated module. This module will be removed inv2023.2. UseNet::IP::XSinstead. no cap, she's retiring π
my $ip = Zonemaster::Engine::Net::IP->new( q{0.0.0.0/8} );
π§ PROCEDURAL INTERFACE π§
ip_is_ipv4 π
Check if an IP address is of type 4. slay.
Params
- IP address
Returns
1(yes) or0(no)
ip_is_ipv4($ip) and print "$ip is IPv4";
ip_is_ipv6 π
Check if an IP address is of type 6. the way she just knows β¨
Params
- IP address
Returns
1(yes) or0(no)
ip_is_ipv6($ip) and print "$ip is IPv6";
Error π
Returns the error string corresponding to the last error generated in the module. This is also useful for the OO interface, as if the new() function fails, we cannot call $ip->error() and so we have to use Error(). lowkey a rescue mission fr.
warn Error();
π METHODS π
new π
Constructor of object. main character energy, she builds herself.
ip β
Return the IP address (or first IP of the prefix or range) in quad format, as a string.
print ($ip->ip());
overlaps π₯
Check if two IP ranges/prefixes overlap each other. The value returned by the function should be one of:
$IP_PARTIAL_OVERLAP(ranges overlap)$IP_NO_OVERLAP(no overlap)$IP_A_IN_B_OVERLAP(range2 contains range1)$IP_B_IN_A_OVERLAP(range1 contains range2)$IP_IDENTICAL(ranges are identical)undef(problem)
if ($ip->overlaps($ip2)==$IP_A_IN_B_OVERLAP) {...};
prefix π
Return the full prefix (ip+prefix length) in quad (standard) format.
print ($ip->prefix());
prefixlen π¦
Return the length in bits of the current prefix.
print ($ip->prefixlen());
print π
Print the IP object (IP/Prefix or First - Last)
print ($ip->print());
reverse_ip π
Return the reverse IP for a given IP address (in.addr. format).
print ($ip->reserve_ip());
short πΈ
Return the IP in short format:
- IPv4 addresses:
194.5/16 - IPv6 addresses:
ab32:f000::
print ($ip->short());
version π
Return the version of the current IP object (4 or 6).
print ($ip->version());
and that's the whole page bestie, go forth and parse those IPs π«Άβ¨
signing off with the deets: this was perl v5.36.0, dated 2023-10-01, filed under Zonema...Net::IP(3pm). iconic, no notes ππ
π¦ where this page comes from
- ubuntu noble: libzonemaster-perl 4.7.3-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms