changeset 130:641999eb7a1d

Added support for sctp_streams
author Sebastien Decugis <sdecugis@nict.go.jp>
date Tue, 19 Aug 2008 11:14:09 +0900
parents f185f65e213f
children 5875067526ff
files doc/waaad.conf.sample include/waaad/conf-api.h waaad/conf-gram.y waaad/conf-token.l waaad/conf.c
diffstat 5 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/waaad.conf.sample	Mon Aug 18 18:28:22 2008 +0900
+++ b/doc/waaad.conf.sample	Tue Aug 19 11:14:09 2008 +0900
@@ -35,6 +35,14 @@
 # The default is to use both IP and IPv6, allow TCP, and let the system select the addresses.
 # In that case, the address used in CER/CEA will be the first value returned by DNS for the diameter-id resolution.
 
+# Number of SCTP streams for each association.
+#  This value is a default to use with each remote peer.
+# It is then negociated during association setup with the remote peer, and can be lowered.
+# It therefore represents a maximum value to use.
+# It can be overwriten on a per-peer basis.
+# Default: 30
+# sctp_streams = 30;
+
 # Where the messages are sent?
 # Valid values: console, syslog.
 # Multiple values are allowed. Separator is ','. Example:
--- a/include/waaad/conf-api.h	Mon Aug 18 18:28:22 2008 +0900
+++ b/include/waaad/conf-api.h	Tue Aug 19 11:14:09 2008 +0900
@@ -59,6 +59,7 @@
 
 	char		*diameter_identity;	/* The Diameter Identity of the local peer */
 	uint16_t	 local_port;		/* The port on which to listen for incoming connexions. */
+	uint16_t	 sctp_streams;		/* The default maximum number of SCTP streams to use. */
 	
 	sSS		 local_addr_diamid[2];	/* The first address resolved from the Diameter Id (IP and IPv6),
 						   to use in Host-IP-Address if following list is empty. */
--- a/waaad/conf-gram.y	Mon Aug 18 18:28:22 2008 +0900
+++ b/waaad/conf-gram.y	Tue Aug 19 11:14:09 2008 +0900
@@ -273,6 +273,8 @@
 %token		GEN_DISABLEIP6
 %token		GEN_PRIMARY
 %token		GEN_SECONDARY
+%token		GEN_SCTP_STREAMS
+%type	<u16>	gen_sctp_streams_val
 
 /* In the "extension" section */
 %token 		SECTION_EXTENSION
@@ -343,6 +345,7 @@
 			| general_content gen_log 
 			| general_content gen_diamid
 			| general_content gen_port
+			| general_content gen_sctp_streams
 			| general_content gen_tctimer
 			| general_content gen_twtimer
 			| general_content gen_disablerelay
@@ -416,6 +419,22 @@
 			}
 			;
 
+gen_sctp_streams:	GEN_SCTP_STREAMS '=' gen_sctp_streams_val ';'
+			{
+				pconfig->pub.sctp_streams = $3;
+			}
+			;
+			
+gen_sctp_streams_val:	INTEGER
+			{
+				if (( $1 <= 0) || ($1 > 65535)) {
+					log_error("The sctp_streams value (%d) is invalid. Exiting...\n", $1);
+					YYERROR;
+				}
+				$$ = (uint16_t) $1 ;
+			}
+			;
+
 gen_tctimer:		GEN_TCTIMER '=' INTEGER ';'
 			{
 				pconfig->pub.tctimer = $3;
--- a/waaad/conf-token.l	Mon Aug 18 18:28:22 2008 +0900
+++ b/waaad/conf-token.l	Tue Aug 19 11:14:09 2008 +0900
@@ -125,6 +125,7 @@
 
 (?i:"Diameter-Id")	{ return GEN_DIAMID;				} /* How to specify the Diameter Identity of the local peer */
 (?i:"LocalPort")	{ return GEN_PORT;				} /* The port the local peer is listening on */
+(?i:"sctp_streams")	{ return GEN_SCTP_STREAMS;			} /* The maximum number of SCTP streams per assoc */
 (?i:"no_tcp")		{ return GEN_DISABLETCP;			} /* Is TCP disabled? */
 (?i:"no_ip4")		{ return GEN_DISABLEIP4;			} /* Is IP disabled? */
 (?i:"no_ip6")		{ return GEN_DISABLEIP6;			} /* Is IPv6 disabled? */
--- a/waaad/conf.c	Mon Aug 18 18:28:22 2008 +0900
+++ b/waaad/conf.c	Tue Aug 19 11:14:09 2008 +0900
@@ -145,6 +145,7 @@
 	TRACE_DEBUG( INFO, "--- Parsed configuration : ---");
 	TRACE_DEBUG( INFO, "  Diameter-Id : %s ( %s / %s )", g_pconf->diameter_identity, str4, str6);
 	TRACE_DEBUG( INFO, "  Local port  : %hd",g_pconf->local_port);
+	TRACE_DEBUG( INFO, "  SCTP streams: %hd",g_pconf->sctp_streams);
 	TRACE_DEBUG( INFO, "  Tc timer    : %d", g_pconf->tctimer);
 	TRACE_DEBUG( INFO, "  Tw timer    : %d", g_pconf->twtimer);
 	TRACE_DEBUG( INFO, "  Relaying    : %s", g_pconf->disable_relay ? "Disabled" : "Enabled");
"Welcome to our mercurial repository"