[sr-dev] git:andrei/blst_send_flags: core: cfg script support for blacklist ignore masks
Andrei Pelinescu-Onciul
andrei at iptel.org
Wed Feb 17 10:02:27 CET 2010
Module: sip-router
Branch: andrei/blst_send_flags
Commit: 0e055147442c58c2d029702fa618e448da9cf98f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0e055147442c58c2d029702fa618e448da9cf98f
Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date: Wed Feb 17 09:58:21 2010 +0100
core: cfg script support for blacklist ignore masks
The blacklist ignore mask can now be set from the script (not only
at runtime):
dst_blacklist_udp_imask
dst_blacklist_tcp_imask
dst_blacklist_tls_imask
dst_blacklist_sctp_imask
E.g. dst_blacklist_udp_imask=16
Possible values:
0 -disabled
2 - send error
4 - connect error
8 - icmp (reserverd for future use)
16 - transaction timeout
32 - administratively prohibited (manually set)
---
cfg.lex | 13 +++++++++++++
cfg.y | 33 ++++++++++++++++++++++++++++++---
2 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/cfg.lex b/cfg.lex
index 61e694e..799b606 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -80,6 +80,7 @@
* 2009-03-10 added SET_USERPHONE action (Miklos)
* 2009-04-24 add strlen, strempty and defined operators (andrei)
* 2009-03-07 RETCODE, it's now a core pvar (andrei)
+ * 2010-02-17 added DST_BLST_{UDP,TCP,TLS,SCTP}_IMASK (andrei)
*/
@@ -343,6 +344,10 @@ USE_DST_BLST use_dst_blacklist
DST_BLST_MEM dst_blacklist_mem
DST_BLST_TTL dst_blacklist_expire|dst_blacklist_ttl
DST_BLST_GC_INT dst_blacklist_gc_interval
+DST_BLST_UDP_IMASK dst_blacklist_udp_imask
+DST_BLST_TCP_IMASK dst_blacklist_tcp_imask
+DST_BLST_TLS_IMASK dst_blacklist_tls_imask
+DST_BLST_SCTP_IMASK dst_blacklist_sctp_imask
PORT port
@@ -680,6 +685,14 @@ EAT_ABLE [\ \t\b\r]
return DST_BLST_TTL; }
<INITIAL>{DST_BLST_GC_INT} { count(); yylval.strval=yytext;
return DST_BLST_GC_INT; }
+<INITIAL>{DST_BLST_UDP_IMASK} { count(); yylval.strval=yytext;
+ return DST_BLST_UDP_IMASK; }
+<INITIAL>{DST_BLST_TCP_IMASK} { count(); yylval.strval=yytext;
+ return DST_BLST_TCP_IMASK; }
+<INITIAL>{DST_BLST_TLS_IMASK} { count(); yylval.strval=yytext;
+ return DST_BLST_TLS_IMASK; }
+<INITIAL>{DST_BLST_SCTP_IMASK} { count(); yylval.strval=yytext;
+ return DST_BLST_SCTP_IMASK; }
<INITIAL>{PORT} { count(); yylval.strval=yytext; return PORT; }
<INITIAL>{STAT} { count(); yylval.strval=yytext; return STAT; }
<INITIAL>{MAXBUFFER} { count(); yylval.strval=yytext; return MAXBUFFER; }
diff --git a/cfg.y b/cfg.y
index 234b2d0..22c6dd4 100644
--- a/cfg.y
+++ b/cfg.y
@@ -96,6 +96,7 @@
* 2009-01-26 case/switch() support (andrei)
* 2009-03-10 added SET_USERPHONE action (Miklos)
* 2009-05-04 switched if to rval_expr (andrei)
+ * 2010-02-17 added blacklist imask (DST_BLST_*_IMASK) support (andrei)
*/
%{
@@ -398,6 +399,10 @@ extern char *finame;
%token DST_BLST_MEM
%token DST_BLST_TTL
%token DST_BLST_GC_INT
+%token DST_BLST_UDP_IMASK
+%token DST_BLST_TCP_IMASK
+%token DST_BLST_TLS_IMASK
+%token DST_BLST_SCTP_IMASK
%token PORT
%token STAT
@@ -834,14 +839,36 @@ assign_stm:
| DNS_CACHE_DEL_NONEXP error { yyerror("boolean value expected"); }
| DST_BLST_INIT EQUAL NUMBER { IF_DST_BLACKLIST(dst_blacklist_init=$3); }
| DST_BLST_INIT error { yyerror("boolean value expected"); }
- | USE_DST_BLST EQUAL NUMBER { IF_DST_BLACKLIST(default_core_cfg.use_dst_blacklist=$3); }
+ | USE_DST_BLST EQUAL NUMBER {
+ IF_DST_BLACKLIST(default_core_cfg.use_dst_blacklist=$3);
+ }
| USE_DST_BLST error { yyerror("boolean value expected"); }
- | DST_BLST_MEM EQUAL NUMBER { IF_DST_BLACKLIST(default_core_cfg.blst_max_mem=$3); }
+ | DST_BLST_MEM EQUAL NUMBER {
+ IF_DST_BLACKLIST(default_core_cfg.blst_max_mem=$3);
+ }
| DST_BLST_MEM error { yyerror("boolean value expected"); }
- | DST_BLST_TTL EQUAL NUMBER { IF_DST_BLACKLIST(default_core_cfg.blst_timeout=$3); }
+ | DST_BLST_TTL EQUAL NUMBER {
+ IF_DST_BLACKLIST(default_core_cfg.blst_timeout=$3);
+ }
| DST_BLST_TTL error { yyerror("boolean value expected"); }
| DST_BLST_GC_INT EQUAL NUMBER { IF_DST_BLACKLIST(blst_timer_interval=$3);}
| DST_BLST_GC_INT error { yyerror("boolean value expected"); }
+ | DST_BLST_UDP_IMASK EQUAL NUMBER {
+ IF_DST_BLACKLIST(default_core_cfg.blst_udp_imask=$3);
+ }
+ | DST_BLST_UDP_IMASK error { yyerror("number(flags) expected"); }
+ | DST_BLST_TCP_IMASK EQUAL NUMBER {
+ IF_DST_BLACKLIST(default_core_cfg.blst_tcp_imask=$3);
+ }
+ | DST_BLST_TCP_IMASK error { yyerror("number(flags) expected"); }
+ | DST_BLST_TLS_IMASK EQUAL NUMBER {
+ IF_DST_BLACKLIST(default_core_cfg.blst_tls_imask=$3);
+ }
+ | DST_BLST_TLS_IMASK error { yyerror("number(flags) expected"); }
+ | DST_BLST_SCTP_IMASK EQUAL NUMBER {
+ IF_DST_BLACKLIST(default_core_cfg.blst_sctp_imask=$3);
+ }
+ | DST_BLST_SCTP_IMASK error { yyerror("number(flags) expected"); }
| PORT EQUAL NUMBER { port_no=$3; }
| STAT EQUAL STRING {
#ifdef STATS
More information about the sr-dev
mailing list