--- /dev/null	2012-08-08 12:42:08.000000000 +0000
+++ new/usr/src/uts/common/inet/dccp.h	2012-08-08 12:42:08.749529542 +0000
@@ -0,0 +1,218 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2012 David Hoeppner. All rights reserved.
+ */
+
+#ifndef	_INET_DCCP_H
+#define	_INET_DCCP_H
+
+#include <sys/inttypes.h>
+#include <sys/socket.h>
+#include <sys/socket_proto.h>
+
+#include <netinet/in.h>
+#include <netinet/ip6.h>
+#include <netinet/dccp.h>
+
+#include <inet/common.h>
+#include <inet/dccp_stack.h>
+#include <inet/ip.h>
+#include <inet/ip6.h>
+#include <inet/optcom.h>
+#include <inet/tunables.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/*
+ * DCCP states
+ */
+#define	DCCPS_CLOSED		1
+#define	DCCPS_BOUND		2
+#define	DCCPS_REQUEST		3
+#define	DCCPS_LISTEN		4
+#define	DCCPS_PARTOPEN		5
+#define	DCCPS_RESPOND		6
+#define	DCCPS_OPEN		7
+#define	DCCPS_CLOSING		8
+#define	DCCPS_CLOSEREQ		9
+#define	DCCPS_TIMEWAIT		10
+
+/*
+ * DCCP header structures.
+ */
+
+/* Generic protocol header (RFC 4340, Section 5.1.) */
+typedef struct dccphdr_s {
+	uint8_t		dh_lport[2];
+	uint8_t		dh_fport[2];
+	uint8_t		dh_offset;
+	uint8_t		dh_ccval:4,
+			dh_cscov:4;
+	uint8_t		db_sum[2];
+	uint8_t		dh_reserved:3,
+			dh_type:4,
+			dh_x:1;
+	uint8_t		dh_res_seq;
+	uint8_t		dh_seq[2];
+} dccph_t;
+
+#define	DCCP_HDR_LENGTH(dccph)	\
+	(((dccph_t *)dccph)->dh_offset * 4) /* XXX >> 2 */
+#define	DCCP_MAX_HDR_LENGTH		1020
+#define	DCCP_MIN_HEADER_LENGTH		12
+
+/* Generic protocol header aligned (RFC 4340, Section 5.1.) */
+typedef struct dccphdra_s {
+	in_port_t	dha_lport;		/* Source port */
+	in_port_t	dha_fport;		/* Destination port */
+	uint8_t		dha_offset;		/* Data offset */
+	uint8_t		dha_ccval:4,		/* */
+			dha_cscov:4;		/* */
+	uint16_t	dha_sum;		/* Checksum */
+	uint8_t		dha_x:1,		/* Reserved */
+			dha_type:4,		/* Packet type */
+			dha_reserved:3;		/* Header type */
+	uint8_t		dha_res_seq;
+	uint16_t	dha_seq;		/* Partial sequence number */
+} dccpha_t;
+
+typedef struct dccphdra_ext_s {
+	uint32_t	dha_ext_seq;
+} dccpha_ext_t;
+
+/* Acknowledgement number */
+typedef struct dccphdra_ack {
+	uint16_t	dha_ack_reserved;
+	uint16_t	dha_ack_high;
+	uint32_t	dha_ack_low;
+} dccpha_ack_t;
+
+/* Service number */
+typedef	struct dccphdra_srv {
+	uint32_t	dha_srv_code;
+} dccpha_srv_t;
+
+/* Reset data */
+typedef struct dccphdra_reset {
+	uint8_t		dha_reset_code;
+	uint8_t		dha_reset_data[3];
+} dccpha_reset_t;
+
+/*
+ * Control structure for each open TCP stream,
+ * defined only within the kernel or for a kmem user.
+ * NOTE: tcp_reinit_values MUST have a line for each field in this structure!
+ */
+#if (defined(_KERNEL) || defined(_KMEMUSER))
+
+/* Internal DCCP structure */
+typedef struct dccp_s {
+
+	conn_t		*dccp_connp;	/* Backpointer to conn_t */
+	dccp_stack_t	*dccp_dccps;	/* Backpointer to dccp_stack_t */
+
+	int32_t		dccp_state;
+
+	uint64_t	dccp_last_rcv_lbolt;
+
+	uint32_t	dccp_ibsegs;	/* Inbound segments on this stream */
+	uint32_t	dccp_obsegs;	/* Outbound segments on this stream */
+
+	uint32_t
+		dccp_loopback: 1,	/* Src and dst are the same machine */
+		dccp_localnet: 1,	/* Src and dst are on the same subnet */
+		dccp_active_open: 1,	/* This is a active open */
+		dccp_detached : 1,	/* If we're detached from a stream */
+		dccp_dummy: 1;
+
+	uint32_t
+		dccp_allow_short_seqnos: 1,
+		dccp_ecn_incapable: 1;
+	/*
+	 * Timers and timestamps.
+	 */
+	mblk_t		*dccp_timercache;	/* Timer cache */
+	timeout_id_t	dccp_timer_tid;		/* Timer service id */
+
+	clock_t		dccp_timestamp_init;	/* Time reference */
+	int32_t		dccp_timestamp_echo;	/* Timestamp found in options */
+	clock_t		dccp_timestamp;
+
+	/*
+	 * Bind related.
+	 */
+	struct dccp_s	*dccp_bind_hash;	/* Bind hash chain */
+	struct dccp_s	*dccp_bind_hash_port;	/* Bound to the same port */
+	struct dccp_s	**dccp_ptpbhn;
+
+	struct dccphdra_s *dccp_dccpha;		/* Template header */
+
+	mblk_t		*dccp_xmit_head;
+
+	/*
+	 * Pointers into the header template.
+	 */
+	ipha_t		*dccp_ipha;
+	ip6_t		*dccp_ip6h;
+
+	t_uscalar_t	dccp_acceptor_id;	/* ACCEPTOR_id */
+
+	sock_connid_t	dccp_connid;
+
+	/* Incrementing pending conn req ID */
+	t_scalar_t	dccp_conn_req_seqnum;
+
+	boolean_t	dccp_issocket;		/* This is a socket dccp */
+
+	/* List of features being negotiated */
+	list_t		dccp_features;
+
+	struct dccp_s	*dccp_listener;		/* Our listener */
+	struct dccp_s	*dccp_saved_listener;	/* Saved listener */
+
+	/*
+	 * Sequence numbers (Section 7.1.)
+	 */
+	uint64_t	dccp_swl;	/* Sequence number window low */
+	uint64_t	dccp_swh;	/* Sequence number window high */
+	uint64_t	dccp_awl;	/* Ack number window low */
+	uint64_t	dccp_awh;	/* Ack number window high */
+	uint64_t	dccp_iss;	/* Initial sequence number sent */
+	uint64_t	dccp_isr;	/* Initial sequence number received */
+	uint64_t	dccp_osr;	/* First OPEN sequence number */
+	uint64_t	dccp_gss;	/* Greatest sequence number sent */
+	uint64_t	dccp_gsr;	/* Greatest sequence */
+					/* number received */
+	uint64_t	dccp_gar;	/* Greatest acknowledgement */
+					/* number received */
+
+	uint8_t		dccp_reset_code;
+	uint8_t		dccp_reset_data[3];
+} dccp_t;
+
+typedef struct dccp_df_s {
+	struct dccp_s	*df_dccp;
+	kmutex_t	df_lock;
+	uchar_t		df_pad[TF_CACHEL_PAD - (sizeof (dccp_t *) +
+			    sizeof (kmutex_t))];
+} dccp_df_t;
+
+#endif	/* _KERNEL */
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* _INET_DCCP_H */
