CIDR
NAME
Net::BGP::CIDR - IPv4/IPv6 CIDR Handling Functionality
SYNOPSIS
use Net::BGP::CIDR;
my $ip1 = IP::BGP::CIDR->from-str('192.0.2.0/24');
my $ip2 = IP::BGP::CIDR->from-int(0, 0);
my $ip3 = IP::BGP::CIDR->from-str('2001:db8:3333:1::/48');
my $ip4 = IP::BGP::CIDR->from-int(0, 0, ipv6);
say $ip1;
ATTRIBUTES
prefix-int
The integer value of the prefix address.
prefix-length
The integer value of the prefix length.
method packed-to-array
Takes a "packed" buffer of length + prefix and converts it into an array of
Net::BGP::CIDR
objects. These "packed" buffers are common in BGP structures.
=method to-packed
Takes a Net::BGP::CIDR
object and produces a packed representation.
METHODS
from-int
Converts an integer prefix and integer length into a CIDR object. This will
take an optional third parameter, either ipv4
or ipv6
. This parameter
defaults to ipv4
.
from-str
Converts a CIDR in format 0.1.2.3/4
into a CIDR object.
contains
Returns true if this CIDR object contains another CIDR (passed as the first argument).
Str
Returns a string representation of a CIDR object.
AUTHOR
Joelle Maslak <[email protected]>
COPYRIGHT AND LICENSE
Copyright © 2018-2019 Joelle Maslak
This library is free software; you can redistribute it and/or modify it under the Artisitc License 2.0.