瀏覽代碼

sctp: sctp_assoc_tracking support from the script

Andrei Pelinescu-Onciul 16 年之前
父節點
當前提交
42e3dc75f4
共有 3 個文件被更改,包括 42 次插入0 次删除
  1. 24 0
      NEWS
  2. 3 0
      cfg.lex
  3. 15 0
      cfg.y

+ 24 - 0
NEWS

@@ -288,6 +288,30 @@ new config variables:
                       1-3) to avoid "multiplying" traffic to unresponding 
                       hosts (default: 0).
                       Can be changed at runtime.
+  sctp_assoc_tracking = yes/no - controls whether or not sctp associations
+     are tracked inside ser/sip-router. Turning it off would result in
+     less memory being used and slightly better performance, but it will also
+     disable some other features that depend on it (e.g. sctp_assoc_reuse).
+     Default: yes.
+     Can be changed at runtime (sercmd sctp assoc_tracking 0), but changes
+     will be allowed only if all the other features that depend on it are
+     turned off (for example it can be turned off only if first
+     sctp_assoc_reuse was turned off).
+     Note: turning sctp_assoc_tracking on/off will delete all the tracking
+     information for all the currently tracked associations and might introduce
+     a small temporary delay in the sctp processing if lots of associations
+     were tracked.
+     Config options depending on sctp_assoc_tracking being on:
+      sctp_assoc_reuse.
+  sctp_assoc_reuse = yes/no - controls sctp association reuse. For now only
+     association reuse for replies is affected by it. Default: yes.
+     Depends on sctp_assoc_tracking being on.
+     Note that even if turned off, if the port in via corresponds to the
+     source port of the association the request was sent on or if rport is
+     turned on (force_rport() or via containing a rport option), the
+     association will be automatically reused by the sctp stack.
+     Can be changed at runtime (sctp assoc_reuse), but it can be turned on
+     only if sctp_assoc_tracking is on.
   sctp_srto_initial = milliseconds - initial value of the retr. timeout, used
      in RTO calculations (default: OS specific).
      Can be changed at runtime (sctp srto_initial) but it will affect only new

+ 3 - 0
cfg.lex

@@ -338,6 +338,7 @@ SCTP_SOCKET_SNDBUF	"sctp_socket_sndbuf"|"sctp_socket_send_buffer"
 SCTP_AUTOCLOSE	"sctp_autoclose"
 SCTP_SEND_TTL	"sctp_send_ttl"
 SCTP_SEND_RETRIES	"sctp_send_retries"
+SCTP_ASSOC_TRACKING	"sctp_assoc_tracking"
 SCTP_ASSOC_REUSE	"sctp_assoc_reuse"
 SCTP_SRTO_INITIAL	"sctp_srto_initial"
 SCTP_SRTO_MAX		"sctp_srto_max"
@@ -680,6 +681,8 @@ EAT_ABLE	[\ \t\b\r]
 										return SCTP_SEND_TTL; }
 <INITIAL>{SCTP_SEND_RETRIES}	{ count(); yylval.strval=yytext;
 										return SCTP_SEND_RETRIES; }
+<INITIAL>{SCTP_ASSOC_TRACKING}	{ count(); yylval.strval=yytext;
+										return SCTP_ASSOC_TRACKING; }
 <INITIAL>{SCTP_ASSOC_REUSE}		{ count(); yylval.strval=yytext;
 										return SCTP_ASSOC_REUSE; }
 <INITIAL>{SCTP_SRTO_INITIAL}	{ count(); yylval.strval=yytext;

+ 15 - 0
cfg.y

@@ -402,6 +402,7 @@ static void free_socket_id_lst(struct socket_id* i);
 %token SCTP_AUTOCLOSE
 %token SCTP_SEND_TTL
 %token SCTP_SEND_RETRIES
+%token SCTP_ASSOC_TRACKING
 %token SCTP_ASSOC_REUSE
 %token SCTP_SRTO_INITIAL
 %token SCTP_SRTO_MAX
@@ -1205,6 +1206,20 @@ assign_stm:
 		#endif
 	}
 	| SCTP_SEND_RETRIES EQUAL error { yyerror("number expected"); }
+	| SCTP_ASSOC_TRACKING EQUAL NUMBER {
+		#ifdef USE_SCTP
+			#ifdef SCTP_CONN_REUSE
+				sctp_default_cfg.assoc_tracking=$3;
+			#else
+				if ($3)
+					warn("sctp association tracking/reuse (SCTP_CONN_REUSE) "
+							"support not compiled in");
+			#endif /* SCTP_CONN_REUSE */
+		#else
+			warn("sctp support not compiled in");
+		#endif /* USE_SCTP */
+	}
+	| SCTP_ASSOC_TRACKING EQUAL error { yyerror("number expected"); }
 	| SCTP_ASSOC_REUSE EQUAL NUMBER {
 		#ifdef USE_SCTP
 			#ifdef SCTP_CONN_REUSE