% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::addr_range - Object methods for addr_range records
use FS::addr_range;
$record = new FS::addr_range \%hash;
$record = new FS::addr_range { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::addr_range object represents a contiguous range of IP addresses assigned to a certain purpose. Unlike FS::addr_block, this isn't a routing block; the range doesn't have to be aligned on a subnet boundary, and doesn't have a gateway or broadcast address. It's just a range.
Creates a new range. To add the example to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Delete this record from the database.
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
Checks all fields to make sure this is a valid example. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Get/set the end IP address in the range. This isn't actually part of the record but it's convenient.
Checks whether IPADDR (a dotted-quad IPv4 address) is within the range.
Returns a readable string showing the address range.
Returns a semi-friendly description of the block status.
Returns true if addresses in this range can be used by services, etc.
Returns all address ranges that contain IPADDR.
NetAddr::IP objects have netmasks. They also have overloaded operators for addition and subtraction, but those have range limitations when comparing addresses. (An IPv4 address is effectively a uint32; the difference between two IPv4 addresses is the same range, but signed.) In later versions of the library the bigint method can be used as a workaround, but otherwise it's not safe to subtract two addresses that might differ in the first bit of the first octet.
FS::svc_IP_Mixin, FS::Record, schema.html from the base documentation.
Hey! The above document had some coding errors, which are explained below:
Unknown directive: =sub