NAME

Net::ISC::DHCPd::OMAPI - Talk to a dhcp server

DESCRIPTION

This module provides an API to query and possible change the ISC DHCPd server. The module use OMAPI (Object Management API) which does not require the server to be restarted for changes to apply.

OMAPI is simply a communications mechanism that allows you to manipulate objects, which is stored in the dhcpd.leases file.

See subclasses for more information about the different objects you can manipulate: Net::ISC::DHCPd::OMAPI::Failover, Net::ISC::DHCPd::OMAPI::Group, Net::ISC::DHCPd::OMAPI::Host, and Net::ISC::DHCPd::OMAPI::Lease.

NOTE

To enable debug output, execute this chunk of code before loading the module:

BEGIN { Net::ISC::DHCPd::OMAPI::_DEBUG = sub { 1 } }

ATTRIBUTES

server

$str = $self->server;

Returns the server address. Default is 127.0.0.1.

port

$int = $self->port;

Returns the server port. Default is 7911.

key

$str = $self->key;

Returns the server key: "$name $secret".

errstr

$str = $self->errstr;

Returns the last known error.

METHODS

connect

$bool = $self->connect;

Will open a connection to the dhcp server. Check $@ on failure.

disconnect

$bool = $self->disconnect;

Will disconnect from the server.

new_object

$object = $self->new_object($type => %constructor_args);

$type can be "group", "host", or "lease". Will return a new config object.

Example, with $type="host":

Net::ISC::DHCPd::Config::Host->new(%constructor_args);

COPYRIGHT & LICENSE

AUTHOR

See Net::ISC::DHCPd.