Net::ISC::DHCPd - Interacts with ISC DHCPd
0.02_0004
my $dhcpd = Net::ISC::DHCPd->new( config => { file => "path/to/config" }, leases => { file => "path/to/leases" }, omapi => { ... }, );
See tests for more documentation.
$config_obj = $self->config $bool = $self->has_config;
Instance of Net::ISC::DHCPd::Config class.
$leases_obj = $self->leases $bool = $self->has_leases;
Instance of Net::ISC::DHCPd::Leases class.
$omapi_obj = $self->omapi; $bool = $self->has_omapi;
Instance of Net::ISC::DHCPd::OMAPI class.
$path_to_binary = $self->binary;
Default: "dhcpd3"
$path_to_pidfile = $self->pidfile;
Default: /var/run/dhcp3-server/dhcpd.pid
$proc_obj = $self->process; $self->process($proc_obj); $self->process(\%args); $self->has_process; $self->clear_process;
The object holding the dhcpd process.
$string = $self->errstr;
Holds the last know error.
$bool = $self->start($args);
Will start the dhcpd server, as long as there is no existing process.
$args:
$args
{ user || getpwuid $< group || getgrgid $< interfaces || "" }
Returns:
1 => OK 0 => Already running undef => Failed. Check errstr()
TODO: Enable it to start the server as a differnet user/group.
$bool = $self->stop;
Return:
1: OK undef: Failed. Check errstr()
$bool = $self->restart;
1 => OK undef => Failed. Check errstr()
$string = $self->status;
Returns the status of the DHCPd server:
stopped running
$bool = $self->test("config"); $bool = $self->test("leases");
Will test either config or leases file.
Please report any bugs or feature requests to bug-net-isc-dhcpd at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-ISC-DHCPd. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-isc-dhcpd at rt.cpan.org
Copyright 2007 Jan Henning Thorsen, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Jan Henning Thorsen, <jhthorsen at cpan.org>
<jhthorsen at cpan.org>
To install Net::ISC::DHCPd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::ISC::DHCPd
CPAN shell
perl -MCPAN -e shell install Net::ISC::DHCPd
For more information on module installation, please visit the detailed CPAN module installation guide.