org.opennms.netmgt.config.dhcpd
Class DhcpdConfiguration

java.lang.Object
  extended by org.opennms.netmgt.config.dhcpd.DhcpdConfiguration
All Implemented Interfaces:
java.io.Serializable

public class DhcpdConfiguration
extends java.lang.Object
implements java.io.Serializable

Top-level element for the dhcpd-configuration.xml configuration file.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
DhcpdConfiguration()
           
 
Method Summary
 void deletePort()
          Method deletePort
 java.lang.String getExtendedMode()
          Returns the value of field 'extendedMode'.
 java.lang.String getMacAddress()
          Returns the value of field 'macAddress'.
 java.lang.String getMyIpAddress()
          Returns the value of field 'myIpAddress'.
 int getPort()
          Returns the value of field 'port'.
 java.lang.String getRequestIpAddress()
          Returns the value of field 'requestIpAddress'.
 boolean hasPort()
          Method hasPort
 boolean isValid()
          Method isValid
 void marshal(org.xml.sax.ContentHandler handler)
          Method marshal
 void marshal(java.io.Writer out)
          Method marshal
 void setExtendedMode(java.lang.String extendedMode)
          Sets the value of field 'extendedMode'.
 void setMacAddress(java.lang.String macAddress)
          Sets the value of field 'macAddress'.
 void setMyIpAddress(java.lang.String myIpAddress)
          Sets the value of field 'myIpAddress'.
 void setPort(int port)
          Sets the value of field 'port'.
 void setRequestIpAddress(java.lang.String requestIpAddress)
          Sets the value of field 'requestIpAddress'.
static java.lang.Object unmarshal(java.io.Reader reader)
          Method unmarshal
 void validate()
          Method validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DhcpdConfiguration

public DhcpdConfiguration()
Method Detail

deletePort

public void deletePort()
Method deletePort


getExtendedMode

public java.lang.String getExtendedMode()
Returns the value of field 'extendedMode'. The field 'extendedMode' has the following description: Set extended DHCP polling mode. When extendedMode is false (the default), the DHCP poller will send a DISCOVER and expect an OFFER in return. When extendedMode is true, the DHCP poller will first send a DISCOVER. If no valid response is received it will send an INFORM. If no valid response is received it will then send a REQUEST. OFFER, ACK, and NAK are all considered valid responses in extendedMode. Caution on usage: If in extended mode, the time required to complete the poll for an unresponsive node is increased by a factor of 3. Thus it is a good idea to limit the number of retries to a small number.

Returns:
String

getMacAddress

public java.lang.String getMacAddress()
Returns the value of field 'macAddress'. The field 'macAddress' has the following description: Ethernet MAC address used as the client MAC address in DHCP DISCOVER packets sent by OpenNMS. The MAC address is set to 00:06:0D:BE:9C:B2 in the default configuration file.

Returns:
String

getMyIpAddress

public java.lang.String getMyIpAddress()
Returns the value of field 'myIpAddress'. The field 'myIpAddress' has the following description: IP address used as the relay IP address in DHCP DISCOVER packets sent by OpenNMS. Setting this attribute to "broadcast" places the DHCP poller Setting this attribute places the DHCP poller in "relay" mode instead of the default "broadcast" mode. In "relay" mode, the DHCP server being polled will unicast its responses directly back to the specified ip address rather than broadcasting its responses. This allows DHCP servers to be polled even though they are not on the same subnet as the OpenNMS server, and without the aid of an external relay. This is usually set to the IP address of the OpenNMS server.

Returns:
String

getPort

public int getPort()
Returns the value of field 'port'. The field 'port' has the following description: TCP port number used for internal communication within OpenNMS between the DHCP poller and other OpenNMS daemons. The port is set to 5818 in the default configuration file.

Returns:
int

getRequestIpAddress

public java.lang.String getRequestIpAddress()
Returns the value of field 'requestIpAddress'. The field 'requestIpAddress' has the following description: Set the IP address to be requested in DHCP REQUEST queries. This attribute is only used when the extendedMode attribute is set to "true". If an IP address is specified, it will be requested in the query. If the string "targetHost" is specified, the DHCP server's own ip address will be requested. Since a well-managed server will probably not respond to a request for its own IP address, this parameter can also be set to the string "targetSubnet". This is similar to "targetHost", except the last octet of the DHCP server's IP address is incremented or decremented by 1 to obtain an IP address that is on the same subnet. The resulting address will not be on the same subnet if the DHCP server's subnet length is 31 or 32. Otherwise, the algorithm used should be reliable.

Returns:
String

hasPort

public boolean hasPort()
Method hasPort

Returns:
boolean

isValid

public boolean isValid()
Method isValid

Returns:
boolean

marshal

public void marshal(java.io.Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Method marshal

Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

marshal

public void marshal(org.xml.sax.ContentHandler handler)
             throws java.io.IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Method marshal

Parameters:
handler -
Throws:
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

setExtendedMode

public void setExtendedMode(java.lang.String extendedMode)
Sets the value of field 'extendedMode'. The field 'extendedMode' has the following description: Set extended DHCP polling mode. When extendedMode is false (the default), the DHCP poller will send a DISCOVER and expect an OFFER in return. When extendedMode is true, the DHCP poller will first send a DISCOVER. If no valid response is received it will send an INFORM. If no valid response is received it will then send a REQUEST. OFFER, ACK, and NAK are all considered valid responses in extendedMode. Caution on usage: If in extended mode, the time required to complete the poll for an unresponsive node is increased by a factor of 3. Thus it is a good idea to limit the number of retries to a small number.

Parameters:
extendedMode - the value of field 'extendedMode'.

setMacAddress

public void setMacAddress(java.lang.String macAddress)
Sets the value of field 'macAddress'. The field 'macAddress' has the following description: Ethernet MAC address used as the client MAC address in DHCP DISCOVER packets sent by OpenNMS. The MAC address is set to 00:06:0D:BE:9C:B2 in the default configuration file.

Parameters:
macAddress - the value of field 'macAddress'.

setMyIpAddress

public void setMyIpAddress(java.lang.String myIpAddress)
Sets the value of field 'myIpAddress'. The field 'myIpAddress' has the following description: IP address used as the relay IP address in DHCP DISCOVER packets sent by OpenNMS. Setting this attribute to "broadcast" places the DHCP poller Setting this attribute places the DHCP poller in "relay" mode instead of the default "broadcast" mode. In "relay" mode, the DHCP server being polled will unicast its responses directly back to the specified ip address rather than broadcasting its responses. This allows DHCP servers to be polled even though they are not on the same subnet as the OpenNMS server, and without the aid of an external relay. This is usually set to the IP address of the OpenNMS server.

Parameters:
myIpAddress - the value of field 'myIpAddress'.

setPort

public void setPort(int port)
Sets the value of field 'port'. The field 'port' has the following description: TCP port number used for internal communication within OpenNMS between the DHCP poller and other OpenNMS daemons. The port is set to 5818 in the default configuration file.

Parameters:
port - the value of field 'port'.

setRequestIpAddress

public void setRequestIpAddress(java.lang.String requestIpAddress)
Sets the value of field 'requestIpAddress'. The field 'requestIpAddress' has the following description: Set the IP address to be requested in DHCP REQUEST queries. This attribute is only used when the extendedMode attribute is set to "true". If an IP address is specified, it will be requested in the query. If the string "targetHost" is specified, the DHCP server's own ip address will be requested. Since a well-managed server will probably not respond to a request for its own IP address, this parameter can also be set to the string "targetSubnet". This is similar to "targetHost", except the last octet of the DHCP server's IP address is incremented or decremented by 1 to obtain an IP address that is on the same subnet. The resulting address will not be on the same subnet if the DHCP server's subnet length is 31 or 32. Otherwise, the algorithm used should be reliable.

Parameters:
requestIpAddress - the value of field 'requestIpAddress'

unmarshal

public static java.lang.Object unmarshal(java.io.Reader reader)
                                  throws org.exolab.castor.xml.MarshalException,
                                         org.exolab.castor.xml.ValidationException
Method unmarshal

Parameters:
reader -
Returns:
Object
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Method validate

Throws:
org.exolab.castor.xml.ValidationException


Copyright © 2007. All Rights Reserved.