Author: erodriguez
Date: Sat Jan  8 22:56:49 2005
New Revision: 124711

URL: http://svn.apache.org/viewcvs?view=rev&rev=124711
Log:
IP layer parameters per host, per RFC 2132.
Added:
   
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/DefaultIpTimeToLive.java
   
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/IpForwarding.java
   
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/MaximumDatagramSize.java
   
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/NonLocalSourceRouting.java
   
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PathMtuAgingTimeout.java
   
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PathMtuPlateauTable.java
   
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PolicyFilter.java

Added: 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/DefaultIpTimeToLive.java
Url: 
http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/DefaultIpTimeToLive.java?view=auto&rev=124711
==============================================================================
--- (empty file)
+++ 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/DefaultIpTimeToLive.java
       Sat Jan  8 22:56:49 2005
@@ -0,0 +1,46 @@
+/*
+ *   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.
+ *
+ */
+
+/**
+ * This option specifies the default time-to-live that the client should
+ * use on outgoing datagrams.  The TTL is specified as an octet with a
+ * value between 1 and 255.
+ * 
+ * The code for this option is 23, and its length is 1.
+ */
+package org.apache.dhcp.options.perhost;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+public class DefaultIpTimeToLive extends DhcpOption
+{
+       private byte[] defaultIpTimeToLive;
+       
+       public DefaultIpTimeToLive( byte[] defaultIpTimeToLive )
+       {
+               super( 23, 1 );
+               this.defaultIpTimeToLive = defaultIpTimeToLive;
+       }
+       
+       protected void valueToByteBuffer( ByteBuffer out )
+       {
+               out.put( defaultIpTimeToLive );
+       }
+}
+

Added: 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/IpForwarding.java
Url: 
http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/IpForwarding.java?view=auto&rev=124711
==============================================================================
--- (empty file)
+++ 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/IpForwarding.java
      Sat Jan  8 22:56:49 2005
@@ -0,0 +1,46 @@
+/*
+ *   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.
+ *
+ */
+
+/**
+ * This option specifies whether the client should configure its IP
+ * layer for packet forwarding.  A value of 0 means disable IP
+ * forwarding, and a value of 1 means enable IP forwarding.
+ * 
+ * The code for this option is 19, and its length is 1.
+ */
+package org.apache.dhcp.options.perhost;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+public class IpForwarding extends DhcpOption
+{
+       private byte[] ipForwarding;
+       
+       public IpForwarding( byte[] ipForwarding )
+       {
+               super( 19, 1 );
+               this.ipForwarding = ipForwarding;
+       }
+       
+       protected void valueToByteBuffer( ByteBuffer out )
+       {
+               out.put( ipForwarding );
+       }
+}
+

Added: 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/MaximumDatagramSize.java
Url: 
http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/MaximumDatagramSize.java?view=auto&rev=124711
==============================================================================
--- (empty file)
+++ 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/MaximumDatagramSize.java
       Sat Jan  8 22:56:49 2005
@@ -0,0 +1,46 @@
+/*
+ *   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.
+ *
+ */
+
+/**
+ * This option specifies the maximum size datagram that the client
+ * should be prepared to reassemble.  The size is specified as a 16-bit
+ * unsigned integer.  The minimum value legal value is 576.
+ * 
+ * The code for this option is 22, and its length is 2.
+ */
+package org.apache.dhcp.options.perhost;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+public class MaximumDatagramSize extends DhcpOption
+{
+       private byte[] maximumDatagramSize;
+       
+       public MaximumDatagramSize( byte[] maximumDatagramSize )
+       {
+               super( 22, 2 );
+               this.maximumDatagramSize = maximumDatagramSize;
+       }
+       
+       protected void valueToByteBuffer( ByteBuffer out )
+       {
+               out.put( maximumDatagramSize );
+       }
+}
+

Added: 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/NonLocalSourceRouting.java
Url: 
http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/NonLocalSourceRouting.java?view=auto&rev=124711
==============================================================================
--- (empty file)
+++ 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/NonLocalSourceRouting.java
     Sat Jan  8 22:56:49 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.
+ *
+ */
+
+/**
+ * This option specifies whether the client should configure its IP
+ * layer to allow forwarding of datagrams with non-local source routes.
+ * A value of 0 means disallow forwarding of such datagrams, and a value
+ * of 1 means allow forwarding.
+ * 
+ * The code for this option is 20, and its length is 1.
+ */
+package org.apache.dhcp.options.perhost;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+public class NonLocalSourceRouting extends DhcpOption
+{
+       private byte[] nonLocalSourceRouting;
+       
+       public NonLocalSourceRouting( byte[] nonLocalSourceRouting )
+       {
+               super( 20, 1 );
+               this.nonLocalSourceRouting = nonLocalSourceRouting;
+       }
+       
+       protected void valueToByteBuffer( ByteBuffer out )
+       {
+               out.put( nonLocalSourceRouting );
+       }
+}
+

Added: 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PathMtuAgingTimeout.java
Url: 
http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PathMtuAgingTimeout.java?view=auto&rev=124711
==============================================================================
--- (empty file)
+++ 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PathMtuAgingTimeout.java
       Sat Jan  8 22:56:49 2005
@@ -0,0 +1,46 @@
+/*
+ *   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.
+ *
+ */
+
+/**
+ * This option specifies the timeout (in seconds) to use when aging Path
+ * MTU values discovered by the mechanism defined in RFC 1191.  The
+ * timeout is specified as a 32-bit unsigned integer.
+ * 
+ * The code for this option is 24, and its length is 4.
+ */
+package org.apache.dhcp.options.perhost;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+public class PathMtuAgingTimeout extends DhcpOption
+{
+       private byte[] pathMtuAgingTimeout;
+       
+       public PathMtuAgingTimeout( byte[] pathMtuAgingTimeout )
+       {
+               super( 24, 4 );
+               this.pathMtuAgingTimeout = pathMtuAgingTimeout;
+       }
+       
+       protected void valueToByteBuffer( ByteBuffer out )
+       {
+               out.put( pathMtuAgingTimeout );
+       }
+}
+

Added: 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PathMtuPlateauTable.java
Url: 
http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PathMtuPlateauTable.java?view=auto&rev=124711
==============================================================================
--- (empty file)
+++ 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PathMtuPlateauTable.java
       Sat Jan  8 22:56:49 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.
+ *
+ */
+
+/**
+ * This option specifies a table of MTU sizes to use when performing
+ * Path MTU Discovery as defined in RFC 1191.  The table is formatted as
+ * a list of 16-bit unsigned integers, ordered from smallest to largest.
+ * The minimum MTU value cannot be smaller than 68.
+ * 
+ * The code for this option is 25.  Its minimum length is 2, and the
+ * length MUST be a multiple of 2.
+ */
+package org.apache.dhcp.options.perhost;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+public class PathMtuPlateauTable extends DhcpOption
+{
+       private byte[] pathMtuPlateauTable;
+       
+       public PathMtuPlateauTable( byte[] pathMtuPlateauTable )
+       {
+               super( 25, 2 );
+               this.pathMtuPlateauTable = pathMtuPlateauTable;
+       }
+       
+       protected void valueToByteBuffer( ByteBuffer out )
+       {
+               out.put( pathMtuPlateauTable );
+       }
+}
+

Added: 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PolicyFilter.java
Url: 
http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PolicyFilter.java?view=auto&rev=124711
==============================================================================
--- (empty file)
+++ 
incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/perhost/PolicyFilter.java
      Sat Jan  8 22:56:49 2005
@@ -0,0 +1,50 @@
+/*
+ *   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.
+ *
+ */
+
+/**
+ * This option specifies policy filters for non-local source routing.
+ * The filters consist of a list of IP addresses and masks which specify
+ * destination/mask pairs with which to filter incoming source routes.
+ * 
+ * Any source routed datagram whose next-hop address does not match one
+ * of the filters should be discarded by the client.
+ * 
+ * The code for this option is 21.  The minimum length of this option is
+ * 8, and the length MUST be a multiple of 8.
+ */
+package org.apache.dhcp.options.perhost;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+public class PolicyFilter extends DhcpOption
+{
+       private byte[] policyFilter;
+       
+       public PolicyFilter( byte[] policyFilter )
+       {
+               super( 21, 8 );
+               this.policyFilter = policyFilter;
+       }
+       
+       protected void valueToByteBuffer( ByteBuffer out )
+       {
+               out.put( policyFilter );
+       }
+}
+

Reply via email to