diff options
Diffstat (limited to 'libfdcore/fdd.y')
| -rw-r--r-- | libfdcore/fdd.y | 112 |
1 files changed, 111 insertions, 1 deletions
diff --git a/libfdcore/fdd.y b/libfdcore/fdd.y index 07707c9..9b36887 100644 --- a/libfdcore/fdd.y +++ b/libfdcore/fdd.y @@ -2,7 +2,7 @@ * Software License Agreement (BSD License) * * Author: Sebastien Decugis <sdecugis@freediameter.net> * * * -* Copyright (c) 2015, WIDE Project and NICT * +* Copyright (c) 2019, WIDE Project and NICT * * All rights reserved. * * * * Redistribution and use of this software in source and binary forms, with or without modification, are * @@ -107,8 +107,15 @@ struct peer_info fddpi; %token NOTLS %token SCTPSTREAMS %token APPSERVTHREADS +%token ROUTINGINTHREADS +%token ROUTINGOUTTHREADS +%token QINLIMIT +%token QOUTLIMIT +%token QLOCALLIMIT %token LISTENON %token THRPERSRV +%token PROCESSINGPEERSPATTERN +%token PROCESSINGPEERSMINIMUM %token TCTIMER %token TWTIMER %token NORELAY @@ -121,6 +128,9 @@ struct peer_info fddpi; %token TLS_PRIO %token TLS_DH_BITS %token TLS_DH_FILE +%token RR_IN_ANSWERS +%token ALWAYS +%token NEVER /* -------------------------------------- */ @@ -138,8 +148,15 @@ conffile: /* Empty is OK -- for simplicity here, we reject in daemon later */ | conffile sctpstreams | conffile listenon | conffile thrpersrv + | conffile processingpeerspattern + | conffile processingpeersminimum | conffile norelay | conffile appservthreads + | conffile routinginthreads + | conffile routingoutthreads + | conffile qinlimit + | conffile qoutlimit + | conffile qlocallimit | conffile noip | conffile noip6 | conffile notcp @@ -153,6 +170,7 @@ conffile: /* Empty is OK -- for simplicity here, we reject in daemon later */ | conffile tls_crl | conffile tls_prio | conffile tls_dh + | conffile rr_in_answers | conffile errors { yyerror(&yylloc, conf, "An error occurred while parsing the configuration file"); @@ -248,6 +266,45 @@ thrpersrv: THRPERSRV '=' INTEGER ';' } ; +processingpeerspattern: PROCESSINGPEERSPATTERN '=' QSTRING ';' + { + char *pattern = $3; + int err; + CHECK_FCT_DO( err=regcomp(&conf->cnf_processing_peers_pattern_regex, pattern, REG_EXTENDED | REG_NOSUB), + { + char * buf; + size_t bl; + + /* Error while compiling the regex */ + TRACE_DEBUG(INFO, "error while compiling the regular expression '%s':", pattern); + + /* Get the error message size */ + bl = regerror(err, &conf->cnf_processing_peers_pattern_regex, NULL, 0); + + /* Alloc the buffer for error message */ + CHECK_MALLOC( buf = malloc(bl) ); + + /* Get the error message content */ + regerror(err, &conf->cnf_processing_peers_pattern_regex, buf, bl); + TRACE_DEBUG(INFO, "\t%s", buf); + + /* Free the buffer, return the error */ + free(buf); + + yyerror (&yylloc, conf, "Invalid regular expression in ProcessingPeersPattern"); + YYERROR; + } ); + } + ; + +processingpeersminimum: PROCESSINGPEERSMINIMUM '=' INTEGER ';' + { + CHECK_PARAMS_DO( ($3 >= 0), + { yyerror (&yylloc, conf, "Invalid value"); YYERROR; } ); + conf->cnf_processing_peers_minimum = $3; + } + ; + norelay: NORELAY ';' { conf->cnf_flags.no_fwd = 1; @@ -262,6 +319,46 @@ appservthreads: APPSERVTHREADS '=' INTEGER ';' } ; +routinginthreads: ROUTINGINTHREADS '=' INTEGER ';' + { + CHECK_PARAMS_DO( ($3 > 0) && ($3 < 256), + { yyerror (&yylloc, conf, "Invalid value"); YYERROR; } ); + conf->cnf_rtinthr = (uint16_t)$3; + } + ; + +routingoutthreads: ROUTINGOUTTHREADS '=' INTEGER ';' + { + CHECK_PARAMS_DO( ($3 > 0) && ($3 < 256), + { yyerror (&yylloc, conf, "Invalid value"); YYERROR; } ); + conf->cnf_rtoutthr = (uint16_t)$3; + } + ; + +qinlimit: QINLIMIT '=' INTEGER ';' + { + CHECK_PARAMS_DO( ($3 >= 0), + { yyerror (&yylloc, conf, "Invalid value"); YYERROR; } ); + conf->cnf_qin_limit = $3; + } + ; + +qoutlimit: QOUTLIMIT '=' INTEGER ';' + { + CHECK_PARAMS_DO( ($3 >= 0), + { yyerror (&yylloc, conf, "Invalid value"); YYERROR; } ); + conf->cnf_qout_limit = $3; + } + ; + +qlocallimit: QLOCALLIMIT '=' INTEGER ';' + { + CHECK_PARAMS_DO( ($3 >= 0), + { yyerror (&yylloc, conf, "Invalid value"); YYERROR; } ); + conf->cnf_qlocal_limit = $3; + } + ; + noip: NOIP ';' { if (got_peer_noipv6) { @@ -665,3 +762,16 @@ tls_dh: TLS_DH_BITS '=' INTEGER ';' fclose(fd); } ; + +rr_values: ALWAYS + { + conf->cnf_rr_in_answers = 1; + } + | NEVER + { + conf->cnf_rr_in_answers = 0; + } + ; + +rr_in_answers: RR_IN_ANSWERS '=' rr_values ';' + ; |
