All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 23/25] Include ccid-4 to be visible for the DCCP feature negotiation mechanism
@ 2007-11-01  0:32 Leandro
  2007-11-06 17:20 ` Ian McDonald
  2007-11-08 10:35 ` Gerrit Renker
  0 siblings, 2 replies; 3+ messages in thread
From: Leandro @ 2007-11-01  0:32 UTC (permalink / raw)
  To: dccp

[CCID-4] Include ccid-4 to be visible for the DCCP feature negotiation mechanism

This patch follow instructions announced by Gerrit and explained in http://www.mail-archive.com/dccp@vger.kernel.org/msg02613.html

Signed-off-by: Leandro Melo de Sales <leandro@embedded.ufcg.edu.br>

Index: leandro.new/include/linux/dccp.h
=================================--- leandro.new.orig/include/linux/dccp.h
+++ leandro.new/include/linux/dccp.h
@@ -173,6 +173,7 @@ enum {
 enum {
 	DCCPC_CCID2 = 2,
 	DCCPC_CCID3 = 3,
+	DCCPC_CCID4 = 4,
 };
 
 /* DCCP features (RFC 4340 section 6.4) */
Index: leandro.new/net/dccp/ccid.c
=================================--- leandro.new.orig/net/dccp/ccid.c
+++ leandro.new/net/dccp/ccid.c
@@ -18,6 +18,9 @@ static u8 builtin_ccids[] = {
 #if defined(CONFIG_IP_DCCP_CCID3) || defined(CONFIG_IP_DCCP_CCID3_MODULE)
 	DCCPC_CCID3,
 #endif
+#if defined(CONFIG_IP_DCCP_CCID4) || defined(CONFIG_IP_DCCP_CCID4_MODULE)
+	DCCPC_CCID4,
+#endif
 };
 
 static struct ccid_operations *ccids[CCID_MAX];
Index: leandro.new/net/dccp/feat.c
=================================--- leandro.new.orig/net/dccp/feat.c
+++ leandro.new/net/dccp/feat.c
@@ -483,7 +483,8 @@ static u8 dccp_feat_is_valid_sp_val(u8 f
 {
 	switch (feat_num) {
 	case DCCPF_CCID:
-		return (val = DCCPC_CCID2 || val = DCCPC_CCID3);
+		return (val = DCCPC_CCID2 || val = DCCPC_CCID3 ||
+                        val = DCCPC_CCID4);
 	/* Type-check Boolean feature values: */
 	case DCCPF_SHORT_SEQNOS:
 	case DCCPF_ECN_INCAPABLE:
@@ -787,9 +788,65 @@ static const struct ccid_dependency *dcc
 			{ 0, 0, 0, 0 }
 		}
 	};
+	static const struct ccid_dependency ccid4_dependencies[2][5] = {
+		{	/*
+			 * Dependencies of the receiver-side CCID4
+			 */
+			{	/* locally disable Ack Vectors */
+				.dependent_feat	= DCCPF_SEND_ACK_VECTOR,
+				.is_local	= true,
+				.is_mandatory	= false,
+				.val		= 0
+			},
+			{	/* see below why Send Loss Event Rate is on */
+				.dependent_feat	= DCCPF_SEND_LEV_RATE,
+				.is_local	= true,
+				.is_mandatory	= true,
+				.val		= 1
+			},
+			{	/* NDP Count is needed as per RFC 4342, 6.1.1 */
+				.dependent_feat	= DCCPF_SEND_NDP_COUNT,
+				.is_local	= false,
+				.is_mandatory	= true,
+				.val		= 1
+			},
+			{ 0, 0, 0, 0 },
+		},
+		{
+                        /*
+                         * Dependencies of the transmiter-side CCID4
+                         */
+			{
+				.dependent_feat	= DCCPF_SEND_ACK_VECTOR,
+				.is_local	= false,
+				.is_mandatory	= false,
+				.val		= 0
+			},
+			{
+				.dependent_feat	= DCCPF_SEND_LEV_RATE,
+				.is_local	= false,
+				.is_mandatory	= true,
+				.val		= 1
+			},
+			{	/* this CCID does not support Ack Ratio */
+				.dependent_feat	= DCCPF_ACK_RATIO,
+				.is_local	= true,
+				.is_mandatory	= false,
+				.val		= 0
+			},
+			{	/* tell receiver we are sending NDP counts */
+				.dependent_feat	= DCCPF_SEND_NDP_COUNT,
+				.is_local	= true,
+				.is_mandatory	= false,
+				.val		= 1
+			},
+			{ 0, 0, 0, 0 }
+		}
+	};
 	switch (ccid) {
 	case DCCPC_CCID2: return ccid2_dependencies[is_local];
 	case DCCPC_CCID3: return ccid3_dependencies[is_local];
+	case DCCPC_CCID4: return ccid4_dependencies[is_local];
 	default:	  return NULL;	/* other CCIDs: no specifics yet */
 	}
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 23/25] Include ccid-4 to be visible for the DCCP feature negotiation mechanism
  2007-11-01  0:32 [PATCH 23/25] Include ccid-4 to be visible for the DCCP feature negotiation mechanism Leandro
@ 2007-11-06 17:20 ` Ian McDonald
  2007-11-08 10:35 ` Gerrit Renker
  1 sibling, 0 replies; 3+ messages in thread
From: Ian McDonald @ 2007-11-06 17:20 UTC (permalink / raw)
  To: dccp

On 11/1/07, Leandro <leandroal@gmail.com> wrote:
> [CCID-4] Include ccid-4 to be visible for the DCCP feature negotiation mechanism
>
> This patch follow instructions announced by Gerrit and explained in http://www.mail-archive.com/dccp@vger.kernel.org/msg02613.html
>
> Signed-off-by: Leandro Melo de Sales <leandro@embedded.ufcg.edu.br>
>

Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 23/25] Include ccid-4 to be visible for the DCCP feature negotiation mechanism
  2007-11-01  0:32 [PATCH 23/25] Include ccid-4 to be visible for the DCCP feature negotiation mechanism Leandro
  2007-11-06 17:20 ` Ian McDonald
@ 2007-11-08 10:35 ` Gerrit Renker
  1 sibling, 0 replies; 3+ messages in thread
From: Gerrit Renker @ 2007-11-08 10:35 UTC (permalink / raw)
  To: dccp

| @@ -483,7 +483,8 @@ static u8 dccp_feat_is_valid_sp_val(u8 f
|  {
|  	switch (feat_num) {
|  	case DCCPF_CCID:
| -		return (val = DCCPC_CCID2 || val = DCCPC_CCID3);
| +		return (val = DCCPC_CCID2 || val = DCCPC_CCID3 ||
| +                        val = DCCPC_CCID4);
Whitespace :(blanks instead of tabs, not indented/intended?)


| @@ -787,9 +788,65 @@ static const struct ccid_dependency *dcc
|  			{ 0, 0, 0, 0 }
|  		}
|  	};
| +	static const struct ccid_dependency ccid4_dependencies[2][5] = {
Since the table is the same as for ccid3, you could opt to just use the
ccid3 table to avoid copying, like:

|  	switch (ccid) {
|  	case DCCPC_CCID2: return ccid2_dependencies[is_local];
|  	case DCCPC_CCID3: /* fall through */
| +	case DCCPC_CCID4: return ccid3_dependencies[is_local];
|  	default:	  return NULL;	/* other CCIDs: no specifics yet */
|  	}
|  }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-08 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01  0:32 [PATCH 23/25] Include ccid-4 to be visible for the DCCP feature negotiation mechanism Leandro
2007-11-06 17:20 ` Ian McDonald
2007-11-08 10:35 ` Gerrit Renker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.