|
NAMENet::DHCPClient - A DHCP Client API SYNOPSISuse Net::DHCPClient; my $dhcp = new Net::DHCPClient( maccaddr => '0a:0a:0a:0a:0a:0a', interface => 'eth0' ); $dhcp->discover( 61 => '0a 0a 0a 0a 0a 0a' ); DESCRIPTIONThis module provides methods for implementing a DHCP client. It allows perl scripts to interacts with DHCP servers.This module is used by constructing a new DHCPClient object via the constructor method, providing it (minimally) with the machine address and the network interface that is to be used for the DHCP transaction with the DHCP server. Information after each DHCP call is stored in the instance variables of the object. Refer to RFC2131 for the designations of the named fields. Options (sometimes called vendor extensions) are stored in an instance variable in the object called options as a references to a hash. The options themselves are keys by the decimal designation of the option, and the values of the hash are string representations of the hex values that should be passed to the DHCP server with the options. Please refer to RFC2132 for a complete listing. Some common option fields are available through methods in this object for convenience. They are listed in this document. This document is not a replacement for RFC2131 or RFC2132, and you will probably need a copy of them handy if you are coding DHCP clients. Class MethodsThe constructor is the only class method that should be invoked. It takes as its parameters minimally the machine address and the interface for which the DHCP transaction should take place.Object MethodsObject methods must be invoked against objects created via the new method.There are two kinds of object methods -- those that invoke DHCP transactions and those that interpret the results of a DHCP transaction. I am grouping them separately for this reason. DHCPClient transaction object methods All of the DHCPClient transaction methods take named parameters as their arguments, where paramters are named for the decimal representation of the options that can be set in the DHCP packet, and set to a string representation of the hex values that should be set for the named parameter in the DHCP packet. Whew. Fear not, examples are below.
DHCPClient result object methods These methods are built as conveniences to get the data that is contained in the result of a DHCP transaction returned in a usable form. All of the data can be had by going through the object instance variables by hand, but I would not recommend it. These methods will not return anything useful until a DHCP transaction has taken place. Note -- unless otherwise noted, an IP address returned by an object method listed in this documentation should be considered to be a string containing the address is dotted notation.
Change logRevision 1.0 2001/04/19 Initial release AUTHORJoshua Walgenbach Indiana Unversity jwalgenb@indiana.edu COPYRIGHTCopyright 2000, Joshua Walgenbach All rights reserved This program is free software; you can redistribute it and/or modify it under the terms of either:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details.
Visit the GSP FreeBSD Man Page Interface. |