Net::ISC::DHCPd - Interacts with ISC DHCPd
0.08
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 the Net::ISC::DHCPd::Config manpage class.
$leases_obj = $self->leases $bool = $self->has_leases;
Instance of the Net::ISC::DHCPd::Leases manpage class.
$omapi_obj = $self->omapi; $bool = $self->has_omapi;
Instance of the Net::ISC::DHCPd::OMAPI manpage class.
$path_to_binary = $self->binary;
Default: "dhcpd3"
$path_class_object = $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
:
{ 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;
Return:
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.
1: OK undef: Failed. Check errstr()
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.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
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>
Nito Martinez
Alexey Illarionov
Patrick
napetrov