From 2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff Mon Sep 17 00:00:00 2001 From: Arnaud Desmons Date: Tue, 3 Sep 2002 13:28:28 +0000 Subject: some fillfunc --- dhcp_wizard/dhcp.wiz | 4 ++-- dhcp_wizard/scripts/Dhcpconf.pm | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'dhcp_wizard') diff --git a/dhcp_wizard/dhcp.wiz b/dhcp_wizard/dhcp.wiz index 7eee4efe..8a2d9ac3 100644 --- a/dhcp_wizard/dhcp.wiz +++ b/dhcp_wizard/dhcp.wiz @@ -90,7 +90,7 @@ @@ -99,7 +99,7 @@ diff --git a/dhcp_wizard/scripts/Dhcpconf.pm b/dhcp_wizard/scripts/Dhcpconf.pm index ad34c59a..8fd15aef 100644 --- a/dhcp_wizard/scripts/Dhcpconf.pm +++ b/dhcp_wizard/scripts/Dhcpconf.pm @@ -26,9 +26,27 @@ use strict; use standalone; my $o = DrakconnectConf->new(); +my $wiz_ip_server = $o->get_from_known_dev("IP"); +my $d = "$4" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; +my $s = "$1.$2.$3" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; + +sub compute_range { + my $n; + if ($d <= 64) { $n = "65" } + elsif ($d <= 128) { $n = "129" } + else { $n = "1"} + "$s.$n"; +} + +sub compute_range2 { + my $n; + if ($d <= 128) { $n = "254" } + elsif ($d > 192) { $n = "192" } + else { $n = "128"} + "$s.$n"; +} sub do_it { - my $wiz_ip_server = $o->get_from_known_dev("IP"); my $wiz_domain_name = $o->get("DomainName"); my $wiz_host_name = $o->get("SystemName"); my $wiz_ip_net = "$1.$2.$3.0" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; -- cgit v1.2.1