From: Wolfgang Bumiller Date: Thu, 9 Jul 2015 06:47:08 +0000 (+0200) Subject: PVE::Network: add some common constants X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=61aa94e472dbf1333870ce965ffbbf351f9a7b52 PVE::Network: add some common constants added ipv4_reverse_mask and ipv4_mask_hash_localnet as they are used in several places. --- diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm index 23206c1..e51099e 100644 --- a/src/PVE/Network.pm +++ b/src/PVE/Network.pm @@ -9,6 +9,60 @@ use File::Basename; # host network related utility functions +our $ipv4_reverse_mask = [ + '0.0.0.0', + '128.0.0.0', + '192.0.0.0', + '224.0.0.0', + '240.0.0.0', + '248.0.0.0', + '252.0.0.0', + '254.0.0.0', + '255.0.0.0', + '255.128.0.0', + '255.192.0.0', + '255.224.0.0', + '255.240.0.0', + '255.248.0.0', + '255.252.0.0', + '255.254.0.0', + '255.255.0.0', + '255.255.128.0', + '255.255.192.0', + '255.255.224.0', + '255.255.240.0', + '255.255.248.0', + '255.255.252.0', + '255.255.254.0', + '255.255.255.0', + '255.255.255.128', + '255.255.255.192', + '255.255.255.224', + '255.255.255.240', + '255.255.255.248', + '255.255.255.252', + '255.255.255.254', + '255.255.255.255', +]; + +our $ipv4_mask_hash_localnet = { + '255.255.0.0' => 16, + '255.255.128.0' => 17, + '255.255.192.0' => 18, + '255.255.224.0' => 19, + '255.255.240.0' => 20, + '255.255.248.0' => 21, + '255.255.252.0' => 22, + '255.255.254.0' => 23, + '255.255.255.0' => 24, + '255.255.255.128' => 25, + '255.255.255.192' => 26, + '255.255.255.224' => 27, + '255.255.255.240' => 28, + '255.255.255.248' => 29, + '255.255.255.252' => 30, +}; + sub setup_tc_rate_limit { my ($iface, $rate, $burst, $debug) = @_;