You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2005/01/08 08:00:52 UTC

svn commit: r124648 - incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp

Author: erodriguez
Date: Fri Jan  7 23:00:50 2005
New Revision: 124648

URL: http://svn.apache.org/viewcvs?view=rev&rev=124648
Log:
DHCP options that affect the operation of the TCP layer on a per-interface basis.
Added:
   incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpDefaultTimeToLive.java
   incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpKeepaliveGarbage.java
   incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpKeepaliveInterval.java

Added: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpDefaultTimeToLive.java
Url: http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpDefaultTimeToLive.java?view=auto&rev=124648
==============================================================================
--- (empty file)
+++ incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpDefaultTimeToLive.java	Fri Jan  7 23:00:50 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.
+ *
+ */
+
+package org.apache.dhcp.options.tcp;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+/**
+ * This option specifies the default TTL that the client should use when
+ * sending TCP segments.  The value is represented as an 8-bit unsigned
+ * integer.  The minimum value is 1.
+ * 
+ * The code for this option is 37, and its length is 1.
+ */
+public class TcpDefaultTimeToLive extends DhcpOption
+{
+	private byte[] tcpDefaultTimeToLive;
+	
+	public TcpDefaultTimeToLive( byte[] tcpDefaultTimeToLive )
+	{
+		super( 37, 1 );
+		this.tcpDefaultTimeToLive = tcpDefaultTimeToLive;
+	}
+	
+	protected void valueToByteBuffer( ByteBuffer out )
+	{
+		out.put( tcpDefaultTimeToLive );
+	}
+}
+

Added: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpKeepaliveGarbage.java
Url: http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpKeepaliveGarbage.java?view=auto&rev=124648
==============================================================================
--- (empty file)
+++ incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpKeepaliveGarbage.java	Fri Jan  7 23:00:50 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.tcp;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+/**
+ * This option specifies the interval (in seconds) that the client TCP
+ * should wait before sending a keepalive message on a TCP connection.
+ * The time is specified as a 32-bit unsigned integer.  A value of zero
+ * indicates that the client should not generate keepalive messages on
+ * connections unless specifically requested by an application.
+ * 
+ * The code for this option is 38, and its length is 4.
+ */
+public class TcpKeepaliveGarbage extends DhcpOption
+{
+	private byte[] tcpKeepaliveGarbage;
+	
+	public TcpKeepaliveGarbage( byte[] tcpKeepaliveGarbage )
+	{
+		super( 38, 4 );
+		this.tcpKeepaliveGarbage = tcpKeepaliveGarbage;
+	}
+	
+	protected void valueToByteBuffer( ByteBuffer out )
+	{
+		out.put( tcpKeepaliveGarbage );
+	}
+}
+

Added: incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpKeepaliveInterval.java
Url: http://svn.apache.org/viewcvs/incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpKeepaliveInterval.java?view=auto&rev=124648
==============================================================================
--- (empty file)
+++ incubator/directory/dhcp/trunk/core/src/java/org/apache/dhcp/options/tcp/TcpKeepaliveInterval.java	Fri Jan  7 23:00:50 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.tcp;
+
+import java.nio.ByteBuffer;
+
+import org.apache.dhcp.options.DhcpOption;
+
+/**
+ * This option specifies the whether or not the client should send TCP
+ * keepalive messages with a octet of garbage for compatibility with
+ * older implementations.  A value of 0 indicates that a garbage octet
+ * should not be sent. A value of 1 indicates that a garbage octet
+ * should be sent.
+ * 
+ * The code for this option is 39, and its length is 1.
+ */
+public class TcpKeepaliveInterval extends DhcpOption
+{
+	private byte[] tcpKeepaliveInterval;
+	
+	public TcpKeepaliveInterval( byte[] tcpKeepaliveInterval )
+	{
+		super( 39, 1 );
+		this.tcpKeepaliveInterval = tcpKeepaliveInterval;
+	}
+	
+	protected void valueToByteBuffer( ByteBuffer out )
+	{
+		out.put( tcpKeepaliveInterval );
+	}
+}
+