# Copyright (c) 2010 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: CIDRNotation2.bunit,v 2.4 2011/10/14 23:13:34 nagler Exp $ Unit(); options({ create_object => sub { my(undef, $params) = @_; return class()->from_literal_or_die($params->[0]); }, }); [ '235.236.237.4/30' => [ map_host_addresses => [ [sub {@_ }] => [[map("235.236.237.$_", 4..7)]], ], address_to_host_num => [ '235.236.237.5' => 5, ], get_net_mask => '255.255.255.252', ], '1.2.4.0/23' => [ map_host_addresses => [ [sub {@_}] => [[map( { my($x) = $_; map("1.2.$x.$_", 0 .. 255); } 4 .. 5, )]], ], address_to_host_num => [ '1.2.4.5' => '4.5', '1.2.5.5' => '5.5', ], get_net_mask => '255.255.254.0', ], '235.236.237.4/32' => [ address_to_host_num => [ '235.236.237.4' => 4, ], get_net_mask => '255.255.255.255', assert_host_address => [ '235.236.237.4' => '235.236.237.4', '235.236.237.5' => DIE(), ], ], ];