projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fdccb39
)
excludeaddr option for svc_broadband
author
khoff
<khoff>
Mon, 21 Apr 2003 20:27:10 +0000
(20:27 +0000)
committer
khoff
<khoff>
Mon, 21 Apr 2003 20:27:10 +0000
(20:27 +0000)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/addr_block.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
b00e782
..
cb404ff
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-374,6
+374,13
@@
httemplate/docs/config.html
},
{
},
{
+ 'key' => 'excludeaddr',
+ 'section' => 'deprecated',
+ 'description' => 'Addresses to exclude from assignment, one per line.',
+ 'type' => 'textarea',
+ },
+
+ {
'key' => 'erpcdmachines',
'section' => '',
'description' => 'Your ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
'key' => 'erpcdmachines',
'section' => '',
'description' => 'Your ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
diff --git
a/FS/FS/addr_block.pm
b/FS/FS/addr_block.pm
index
b671723
..
c9305f6
100755
(executable)
--- a/
FS/FS/addr_block.pm
+++ b/
FS/FS/addr_block.pm
@@
-5,6
+5,7
@@
use vars qw( @ISA );
use FS::Record qw( qsearchs qsearch dbh );
use FS::router;
use FS::svc_broadband;
use FS::Record qw( qsearchs qsearch dbh );
use FS::router;
use FS::svc_broadband;
+use FS::Conf;
use NetAddr::IP;
@ISA = qw( FS::Record );
use NetAddr::IP;
@ISA = qw( FS::Record );
@@
-172,9
+173,14
@@
there are no free addresses, returns false.
sub next_free_addr {
my $self = shift;
sub next_free_addr {
my $self = shift;
- my @used = map { $_->NetAddr->addr }
+ my $conf = new FS::Conf;
+ my @excludeaddr = $conf->config('excludeaddr');
+
+ my @used = (
+ map { $_->NetAddr->addr }
($self,
($self,
- qsearch('svc_broadband', { blocknum => $self->blocknum }) );
+ qsearch('svc_broadband', { blocknum => $self->blocknum }) ),
+ @excludeaddr );
my @free = $self->NetAddr->hostenum;
while (my $ip = shift @free) {
my @free = $self->NetAddr->hostenum;
while (my $ip = shift @free) {