NAME
    Net::ISC::DHCPd - Interacts with ISC DHCPd

VERSION
    0.02

SYNOPSIS
     my $dhcpd = Net::ISC::DHCPd->new(
                     -config => { file => "path/to/config" },
                     -leases => { file => "path/to/leases" },
                 );

    See tests for more documentation.

VARIABLES
  $PROCESS_CLASS
    The class that should spawn the process object. Needs to support the
    minimum api of Net::ISC::DHCPd::Process.

OBJECT ATTRIBUTES
  config
     $config_obj = $self->config

    Default: Net::ISC::DHCPd::Config.

  leases
     $leases_obj = $self->leases

    Default: Net::ISC::DHCPd::Leases.

  binary
     $path_to_binary = $self->binary;

    Default: "dhcpd3"

  pidfile
     $path_to_pidfile = $self->pidfile;

    Default: /var/run/dhcp3-server/dhcpd.pid

  process
     $proc_obj = $self->process;
     $self->process($proc_obj);
     $self->process(\%args); # will use $PROCESS_CLASS to create object
     $self->has_process;
     $self->clear_process;

    The object holding the dhcpd process.

  errstr
     $string = $self->errstr;

    Holds the last know error.

METHODS
  BUILD
    Takes extra '-foo' arguments to "new()" and appends the values to the
    appropriate attribute.

    Example:

     $self = $class->new(
       -config => {
         file => "/foo/bar.conf",
       },
     );

    Will result in:

     $self = $class->new;
     $self->config->file("/foo/bar.conf");

  start
     $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.

  stop
     $bool = $self->stop;

    Return:

     1:     OK
     undef: Failed. Check errstr()

  restart
     $bool = $self->restart;

    Return:

     1     => OK
     undef => Failed. Check errstr()

  status
     $string = $self->status;

    Returns the status of the DHCPd server:

     stopped
     running

  test
     $bool = $self->test("config");
     $bool = $self->test("leases");

    Will test either config or leases file.

     1:     OK
     undef: Failed. Check errstr()

BUGS
    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.

COPYRIGHT & LICENSE
    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.

AUTHOR
    Jan Henning Thorsen, "<jhthorsen at cpan.org>"

