Browse code

sctp: sctp_assoc_tracking support from the script

Andrei Pelinescu-Onciul authored on 26/06/2009 17:56:25
Showing 3 changed files
... ...
@@ -288,6 +288,30 @@ new config variables:
288 288
                       1-3) to avoid "multiplying" traffic to unresponding 
289 289
                       hosts (default: 0).
290 290
                       Can be changed at runtime.
291
+  sctp_assoc_tracking = yes/no - controls whether or not sctp associations
292
+     are tracked inside ser/sip-router. Turning it off would result in
293
+     less memory being used and slightly better performance, but it will also
294
+     disable some other features that depend on it (e.g. sctp_assoc_reuse).
295
+     Default: yes.
296
+     Can be changed at runtime (sercmd sctp assoc_tracking 0), but changes
297
+     will be allowed only if all the other features that depend on it are
298
+     turned off (for example it can be turned off only if first
299
+     sctp_assoc_reuse was turned off).
300
+     Note: turning sctp_assoc_tracking on/off will delete all the tracking
301
+     information for all the currently tracked associations and might introduce
302
+     a small temporary delay in the sctp processing if lots of associations
303
+     were tracked.
304
+     Config options depending on sctp_assoc_tracking being on:
305
+      sctp_assoc_reuse.
306
+  sctp_assoc_reuse = yes/no - controls sctp association reuse. For now only
307
+     association reuse for replies is affected by it. Default: yes.
308
+     Depends on sctp_assoc_tracking being on.
309
+     Note that even if turned off, if the port in via corresponds to the
310
+     source port of the association the request was sent on or if rport is
311
+     turned on (force_rport() or via containing a rport option), the
312
+     association will be automatically reused by the sctp stack.
313
+     Can be changed at runtime (sctp assoc_reuse), but it can be turned on
314
+     only if sctp_assoc_tracking is on.
291 315
   sctp_srto_initial = milliseconds - initial value of the retr. timeout, used
292 316
      in RTO calculations (default: OS specific).
293 317
      Can be changed at runtime (sctp srto_initial) but it will affect only new
... ...
@@ -338,6 +338,7 @@ SCTP_SOCKET_SNDBUF	"sctp_socket_sndbuf"|"sctp_socket_send_buffer"
338 338
 SCTP_AUTOCLOSE	"sctp_autoclose"
339 339
 SCTP_SEND_TTL	"sctp_send_ttl"
340 340
 SCTP_SEND_RETRIES	"sctp_send_retries"
341
+SCTP_ASSOC_TRACKING	"sctp_assoc_tracking"
341 342
 SCTP_ASSOC_REUSE	"sctp_assoc_reuse"
342 343
 SCTP_SRTO_INITIAL	"sctp_srto_initial"
343 344
 SCTP_SRTO_MAX		"sctp_srto_max"
... ...
@@ -680,6 +681,8 @@ EAT_ABLE	[\ \t\b\r]
680 680
 										return SCTP_SEND_TTL; }
681 681
 <INITIAL>{SCTP_SEND_RETRIES}	{ count(); yylval.strval=yytext;
682 682
 										return SCTP_SEND_RETRIES; }
683
+<INITIAL>{SCTP_ASSOC_TRACKING}	{ count(); yylval.strval=yytext;
684
+										return SCTP_ASSOC_TRACKING; }
683 685
 <INITIAL>{SCTP_ASSOC_REUSE}		{ count(); yylval.strval=yytext;
684 686
 										return SCTP_ASSOC_REUSE; }
685 687
 <INITIAL>{SCTP_SRTO_INITIAL}	{ count(); yylval.strval=yytext;
... ...
@@ -402,6 +402,7 @@ static void free_socket_id_lst(struct socket_id* i);
402 402
 %token SCTP_AUTOCLOSE
403 403
 %token SCTP_SEND_TTL
404 404
 %token SCTP_SEND_RETRIES
405
+%token SCTP_ASSOC_TRACKING
405 406
 %token SCTP_ASSOC_REUSE
406 407
 %token SCTP_SRTO_INITIAL
407 408
 %token SCTP_SRTO_MAX
... ...
@@ -1205,6 +1206,20 @@ assign_stm:
1205 1205
 		#endif
1206 1206
 	}
1207 1207
 	| SCTP_SEND_RETRIES EQUAL error { yyerror("number expected"); }
1208
+	| SCTP_ASSOC_TRACKING EQUAL NUMBER {
1209
+		#ifdef USE_SCTP
1210
+			#ifdef SCTP_CONN_REUSE
1211
+				sctp_default_cfg.assoc_tracking=$3;
1212
+			#else
1213
+				if ($3)
1214
+					warn("sctp association tracking/reuse (SCTP_CONN_REUSE) "
1215
+							"support not compiled in");
1216
+			#endif /* SCTP_CONN_REUSE */
1217
+		#else
1218
+			warn("sctp support not compiled in");
1219
+		#endif /* USE_SCTP */
1220
+	}
1221
+	| SCTP_ASSOC_TRACKING EQUAL error { yyerror("number expected"); }
1208 1222
 	| SCTP_ASSOC_REUSE EQUAL NUMBER {
1209 1223
 		#ifdef USE_SCTP
1210 1224
 			#ifdef SCTP_CONN_REUSE