This is automatically generated documentation. Edit after the "COMMENTS" heading; changes to the main body will be lost.

DHCPClient Element Documentation


DHCPClient -- Click element; The core of the DHCP Client. The state machine resides in this element.


DHCPClient(ETH [, keywords])

Ports: 1 input, 2-3 outputs
Processing: push
Package: dhcp


DHCPClient has at least 2 outgoing ports. Port 0 is designated for all broadcast packets. Port 1 is designated for all unicast packets. Invalid packets are output on port 2, if it exists; otherwise they are dropped. Keyword arguments are:

The client's current IP address, if any.
A write handler to be called when the client gets a new lease, or loses its current lease. The write handler is called with additional arguments consisting of the new lease description (see the 'lease' handler below).


addr (read-only)
Returns the client's current IP address.
server (read-only)
Returns the server's current IP address.
lease (read/write)
The read handler returns information about the currently active DHCP lease. If a lease is active, the format is "true MYIP SRVIP START END", where MYIP is the client's current IP address, SRVIP is the server's current IP address, and START and END are times in seconds. If no lease is active, the format is "false MYIP", where MYIP is the client's most recently active IP address. The write handler expects a string in the same format, and sets the current lease accordingly.
release (write-only)
When written, releases the currently active DHCP lease, if any.


  dhcpc :: DHCPClient(00:11:22:33:44, LEASE_CALL
        -> UDPIPEncap(, bootpc,, bootps)
        -> ...;
  dhcpc[1] -> dhcp_udp :: UDPIPEncap(, bootpc,, bootps)
        -> ...;
  newlease :: Script(TYPE PASSIVE,
        goto end $(not $1),
        write dhcp_udp.src $2,
        write dhcp_udp.dst $3);

Generated by 'click-elem2man' from 'package/dhcpclient.hh:11' on 17/Jan/2012.


elements/dhcpclient.txt · Last modified: 2012/01/17 10:22 (external edit)
Recent changes RSS feed Driven by DokuWiki