sctp: new config option: sctp_send_retries
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Fri, 7 Nov 2008 14:53:35 +0000 (14:53 +0000)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Fri, 7 Nov 2008 14:53:35 +0000 (14:53 +0000)
- new ser.cfg option sctp_send_retries + doc

NEWS
cfg.lex
cfg.y

diff --git a/NEWS b/NEWS
index 6320b01..0b0d031 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -230,6 +230,14 @@ new config variables:
      assocation (default: 180 s).
   sctp_send_ttl = milliseconds - number of milliseconds before an unsent
      message/chunk is dropped (default: 32000 ms or 32 s).
+  sctp_send_retries - how many times to attempt re-sending a message on a
+                      re-opened association, if the sctp stack did give up
+                      sending it (it's not related to sctp protocol level
+                      retransmission). Useful to improve reliability with
+                      peers that reboot/restart or fail over to another 
+                      machine. WARNING: use with care and low values (e.g.
+                      1-3) to avoid "multiplying" traffic to unresponding 
+                      hosts (default: 0).
   server_id = number - A configurable unique server id that can be used to
                        discriminate server instances within a cluster of
                        servers when all other information, such as IP adddresses
diff --git a/cfg.lex b/cfg.lex
index 62abe43..5af02db 100644 (file)
--- a/cfg.lex
+++ b/cfg.lex
@@ -330,6 +330,7 @@ SCTP_SOCKET_RCVBUF  "sctp_socket_rcvbuf"|"sctp_socket_receive_buffer"
 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"
 ADVERTISED_ADDRESS     "advertised_address"
 ADVERTISED_PORT                "advertised_port"
 DISABLE_CORE           "disable_core_dump"
@@ -646,6 +647,8 @@ EAT_ABLE    [\ \t\b\r]
                                                                                return SCTP_AUTOCLOSE; }
 <INITIAL>{SCTP_SEND_TTL}       { count(); yylval.strval=yytext;
                                                                                return SCTP_SEND_TTL; }
+<INITIAL>{SCTP_SEND_RETRIES}   { count(); yylval.strval=yytext;
+                                                                               return SCTP_SEND_RETRIES; }
 <INITIAL>{SERVER_SIGNATURE}    { count(); yylval.strval=yytext; return SERVER_SIGNATURE; }
 <INITIAL>{REPLY_TO_VIA}        { count(); yylval.strval=yytext; return REPLY_TO_VIA; }
 <INITIAL>{ADVERTISED_ADDRESS}  {       count(); yylval.strval=yytext;
diff --git a/cfg.y b/cfg.y
index 757bbc8..8925c63 100644 (file)
--- a/cfg.y
+++ b/cfg.y
@@ -386,6 +386,7 @@ static void free_socket_id_lst(struct socket_id* i);
 %token SCTP_SOCKET_SNDBUF
 %token SCTP_AUTOCLOSE
 %token SCTP_SEND_TTL
+%token SCTP_SEND_RETRIES
 %token ADVERTISED_ADDRESS
 %token ADVERTISED_PORT
 %token DISABLE_CORE
@@ -1142,6 +1143,14 @@ assign_stm:
                #endif
        }
        | SCTP_SEND_TTL EQUAL error { yyerror("number expected"); }
+       | SCTP_SEND_RETRIES EQUAL NUMBER {
+               #ifdef USE_SCTP
+                       sctp_options.sctp_send_retries=$3;
+               #else
+                       warn("sctp support not compiled in");
+               #endif
+       }
+       | SCTP_SEND_RETRIES EQUAL error { yyerror("number expected"); }
        | SERVER_SIGNATURE EQUAL NUMBER { server_signature=$3; }
        | SERVER_SIGNATURE EQUAL error { yyerror("boolean value expected"); }
        | REPLY_TO_VIA EQUAL NUMBER { reply_to_via=$3; }