%doc> Specific page for DhcpScope objects %doc> <%args> $id => undef $user => $ui->get_current_user($r) $view => undef $edit => undef $submit => undef $bulk_import_data => undef $import_overwrite => undef @scope_type_box => () #used for narrowing down types of scopes you're intrested in in contained_scopes $scope_text_filter => undef #used to filter scope types based on a keyword. %args> <%attr> title => 'View Object' %attr> <%init> my $table = 'DhcpScope'; my $DEBUG = 0; my($o, $prevobj ); my %ftables; if(! $id){ return; } my %explanation_hash = ( 'templates' => 'When using a template, the scope will inherit all attributes of the template', 'contained_scopes' => 'Scopes that inherit attributes from this scope.' ); #@exclude is used to exclude certian fields from forms based on scope type. #i.e Enable fallover only needs to be displayed if this is a global scope my @exclude = (); #@alias is used to specific different names for fields depending on some circumstance #for example, we want to display "subnet" if we're a subnet scope, and "ip address" if we're a host scope #never match anything my @alias = (""); #we add one entry to both of these lists because perl was complaining when passing these lists into #the form.mhtml component even when that entry was a "" or " "... so "nothing" should never match anything unless ( $o = $table->retrieve($id) ){ $m->comp('error.mhtml', error => "Nonexistent record: $id"); } # Check if user can view this object my $manager = $ui->get_permission_manager($r); unless ( $manager && $manager->can($user, "view", $o) ){ $m->comp('/generic/error.mhtml', error=>"You don't have permission to view this object"); } my $labelstr = $o->get_label; my $type = $o->type->name; my %linksfrom = $table->meta_data->get_links_from; my %order = $table->meta_data->get_column_order; unless($type eq 'global'){ push(@exclude, "enable_failover"); push(@exclude, "failover_peer"); push(@exclude, "export_file"); } unless($type eq 'host'){ push(@exclude, "physaddr"); } #due to the implementation, aliases use the #short formatted names if that option is on (it is here) if($type eq 'subnet'){ push(@alias, "IP block:Subnet"); } if($type eq 'host'){ push(@alias, "IP block:IP Address"); } if ( $DEBUG ){ print '%ARGS is
', Dumper(%ARGS), '
', Dumper(%linksfrom), '
', Dumper(%order), '
% } % %args = ( table=>$dtbl, object=>\@robjs ); % if ( $edit eq $i ){ % $args{withedit} = 1; % } % else{ % # If data came ordered from the db, tell sortresults not to bother sorting % $args{sort} = 0 if ( $ffield_order ); % } % if ($num){ % $args{return_args} = "?id=$id&view=$view"; % $m->comp('/generic/sortresults.mhtml', %args); % } %
At this time, only host scopes can be imported, which can only be contained in global or group scopes % }else{
Create fixed-address host scopes in bulk by adding lines containing ethernet and IP address, separated by spaces.
For example:
00:23:45:67:89:AB 192.168.0.1
00:23:45:67:89:CD 192.168.0.2