Révision 17f78427
Whitespace cleanup
- remove trailing whitespace
- remove empty lines at the end of files
| plugins/dhcp/dhcp-pool | ||
|---|---|---|
| 51 | 51 |
|
| 52 | 52 |
# Determine the available IP pools |
| 53 | 53 |
%pools = determine_pools(); |
| 54 |
|
|
| 54 |
|
|
| 55 | 55 |
# Print a label for each pool |
| 56 | 56 |
foreach $start (keys %pools) {
|
| 57 | 57 |
$label = ip2string($start); |
| ... | ... | |
| 63 | 63 |
} |
| 64 | 64 |
else {
|
| 65 | 65 |
my (@activeleases, %pools, $start, $end, $size, $free, $label, $lease); |
| 66 |
|
|
| 67 |
# Determine all leased IP addresses
|
|
| 66 |
|
|
| 67 |
# Determine all leased IP addresses |
|
| 68 | 68 |
@activeleases = determine_active_leases(); |
| 69 |
|
|
| 69 |
|
|
| 70 | 70 |
# Determine the available IP pools |
| 71 | 71 |
%pools = determine_pools(); |
| 72 | 72 |
|
| ... | ... | |
| 109 | 109 |
|
| 110 | 110 |
# The range statement gives the lowest and highest IP addresses in a range. |
| 111 | 111 |
$size = $end - $start + 1; |
| 112 |
|
|
| 112 |
|
|
| 113 | 113 |
$pools{$start} = $size;
|
| 114 | 114 |
} |
| 115 | 115 |
} |
| 116 | 116 |
return %pools; |
| 117 | 117 |
} |
| 118 | 118 |
|
| 119 |
# Very simple parser for dhcpd.leases. This will break very easily if dhcpd decides to
|
|
| 119 |
# Very simple parser for dhcpd.leases. This will break very easily if dhcpd decides to |
|
| 120 | 120 |
# format the file differently. Ideally a simple recursive-descent parser should be used. |
| 121 | 121 |
# |
| 122 | 122 |
# Returns an array with currently leased IP's |
| ... | ... | |
| 155 | 155 |
} |
| 156 | 156 |
|
| 157 | 157 |
} |
| 158 |
|
|
| 158 |
|
|
| 159 | 159 |
# Set TZ back to its original setting |
| 160 | 160 |
if (defined($mytz)) {
|
| 161 | 161 |
$ENV{'TZ'} = $mytz;
|
| ... | ... | |
| 186 | 186 |
} |
| 187 | 187 |
return undef; |
| 188 | 188 |
} |
| 189 |
|
|
| 189 |
|
|
| 190 | 190 |
# |
| 191 |
# Returns a dotted quad notation of an
|
|
| 191 |
# Returns a dotted quad notation of an |
|
| 192 | 192 |
# |
| 193 | 193 |
sub ip2string {
|
| 194 | 194 |
my $ip = shift; |
Formats disponibles : Unified diff