Author: erodriguez Date: Fri Jan 7 22:54:06 2005 New Revision: 124644 URL: http://svn.apache.org/viewcvs?view=rev&rev=124644 Log: DHCP options that affect the operation of the data link layer on a per-interface basis. Added: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/ArpCacheTimeout.java incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/EthernetEncapsulation.java incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/TrailerEncapsulation.java Modified: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/io/DhcpOptionsDecoder.java
Modified: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/io/DhcpOptionsDecoder.java Url: http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/io/DhcpOptionsDecoder.java?view=diff&rev=124644&p1=incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/io/DhcpOptionsDecoder.java&r1=124643&p2=incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/io/DhcpOptionsDecoder.java&r2=124644 ============================================================================== --- incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/io/DhcpOptionsDecoder.java (original) +++ incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/io/DhcpOptionsDecoder.java Fri Jan 7 22:54:06 2005 @@ -29,7 +29,7 @@ import org.apache.dhcp.options.dhcp.RequestedIpAddress; import org.apache.dhcp.options.dhcp.ServerIdentifier; import org.apache.dhcp.options.vendor.DomainName; -import org.apache.dhcp.options.vendor.DomainNameServerOption; +import org.apache.dhcp.options.vendor.DomainNameServer; import org.apache.dhcp.options.vendor.EndOption; import org.apache.dhcp.options.vendor.PadOption; import org.apache.dhcp.options.vendor.SubnetMask; @@ -84,7 +84,7 @@ case 3: return new TimeOffset( value ); case 6: - return new DomainNameServerOption( value ); + return new DomainNameServer( value ); case 15: return new DomainName( value ); case 50: Added: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/ArpCacheTimeout.java Url: http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/ArpCacheTimeout.java?view=auto&rev=124644 ============================================================================== --- (empty file) +++ incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/ArpCacheTimeout.java Fri Jan 7 22:54:06 2005 @@ -0,0 +1,45 @@ +/* + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.dhcp.options.linklayer; + +import java.nio.ByteBuffer; + +import org.apache.dhcp.options.DhcpOption; + +/** + * This option specifies the timeout in seconds for ARP cache entries. + * The time is specified as a 32-bit unsigned integer. + * + * The code for this option is 35, and its length is 4. + */ +public class ArpCacheTimeout extends DhcpOption +{ + private byte[] arpCacheTimeout; + + public ArpCacheTimeout( byte[] arpCacheTimeout ) + { + super( 35, 4 ); + this.arpCacheTimeout = arpCacheTimeout; + } + + protected void valueToByteBuffer( ByteBuffer out ) + { + out.put( arpCacheTimeout ); + } +} + Added: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/EthernetEncapsulation.java Url: http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/EthernetEncapsulation.java?view=auto&rev=124644 ============================================================================== --- (empty file) +++ incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/EthernetEncapsulation.java Fri Jan 7 22:54:06 2005 @@ -0,0 +1,48 @@ +/* + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.dhcp.options.linklayer; + +import java.nio.ByteBuffer; + +import org.apache.dhcp.options.DhcpOption; + +/** + * This option specifies whether or not the client should use Ethernet + * Version 2 (RFC 894) or IEEE 802.3 (RFC 1042) encapsulation + * if the interface is an Ethernet. A value of 0 indicates that the + * client should use RFC 894 encapsulation. A value of 1 means that the + * client should use RFC 1042 encapsulation. + * + * The code for this option is 36, and its length is 1. + */ +public class EthernetEncapsulation extends DhcpOption +{ + private byte[] ethernetEncapsulation; + + public EthernetEncapsulation( byte[] ethernetEncapsulation ) + { + super( 36, 1 ); + this.ethernetEncapsulation = ethernetEncapsulation; + } + + protected void valueToByteBuffer( ByteBuffer out ) + { + out.put( ethernetEncapsulation ); + } +} + Added: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/TrailerEncapsulation.java Url: http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/TrailerEncapsulation.java?view=auto&rev=124644 ============================================================================== --- (empty file) +++ incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/linklayer/TrailerEncapsulation.java Fri Jan 7 22:54:06 2005 @@ -0,0 +1,47 @@ +/* + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.dhcp.options.linklayer; + +import java.nio.ByteBuffer; + +import org.apache.dhcp.options.DhcpOption; + +/** + * This option specifies whether or not the client should negotiate the + * use of trailers (RFC 893) when using the ARP protocol. A value + * of 0 indicates that the client should not attempt to use trailers. A + * value of 1 means that the client should attempt to use trailers. + * + * The code for this option is 34, and its length is 1. + */ +public class TrailerEncapsulation extends DhcpOption +{ + private byte[] trailerEncapsulation; + + public TrailerEncapsulation( byte[] trailerEncapsulation ) + { + super( 34, 1 ); + this.trailerEncapsulation = trailerEncapsulation; + } + + protected void valueToByteBuffer( ByteBuffer out ) + { + out.put( trailerEncapsulation ); + } +} +
