Mercurial > hg > freeDiameter
annotate extensions/rt_busypeers/rtbusy_conf.y @ 1293:17e6e6d72c9b
Added tag 1.2.1-rc2 for changeset 13948c684c35
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Thu, 18 Jun 2015 22:58:01 +0800 |
parents | 8110a781116a |
children |
rev | line source |
---|---|
1020
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
1 /********************************************************************************************************* |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
2 * Software License Agreement (BSD License) * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
3 * Author: Sebastien Decugis <sdecugis@freediameter.net> * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
4 * * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
5 * Copyright (c) 2013, WIDE Project and NICT * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
6 * All rights reserved. * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
7 * * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
8 * Redistribution and use of this software in source and binary forms, with or without modification, are * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
9 * permitted provided that the following conditions are met: * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
10 * * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
11 * * Redistributions of source code must retain the above * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
12 * copyright notice, this list of conditions and the * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
13 * following disclaimer. * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
14 * * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
15 * * Redistributions in binary form must reproduce the above * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
16 * copyright notice, this list of conditions and the * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
17 * following disclaimer in the documentation and/or other * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
18 * materials provided with the distribution. * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
19 * * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
20 * * Neither the name of the WIDE Project or NICT nor the * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
21 * names of its contributors may be used to endorse or * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
22 * promote products derived from this software without * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
23 * specific prior written permission of WIDE Project and * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
24 * NICT. * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
25 * * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
32 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
34 *********************************************************************************************************/ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
35 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
36 /* Yacc extension's configuration parser. |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
37 */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
38 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
39 /* For development only : */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
40 %debug |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
41 %error-verbose |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
42 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
43 /* The parser receives the configuration file filename as parameter */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
44 %parse-param {char * conffile} |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
45 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
46 /* Keep track of location */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
47 %locations |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
48 %pure-parser |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
49 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
50 %{ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
51 #include "rtbusy.h" |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
52 #include "rtbusy_conf.tab.h" |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
53 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
54 /* Forward declaration */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
55 int yyparse(char * conffile); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
56 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
57 /* Parse the configuration file */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
58 int rtbusy_conf_handle(char * conffile) |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
59 { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
60 extern FILE * rtbusy_confin; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
61 int ret; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
62 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
63 TRACE_ENTRY("%p", conffile); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
64 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
65 TRACE_DEBUG (FULL, "Parsing configuration file: %s...", conffile); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
66 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
67 rtbusy_confin = fopen(conffile, "r"); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
68 if (rtbusy_confin == NULL) { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
69 ret = errno; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
70 TRACE_ERROR("Unable to open extension configuration file %s for reading: %s", conffile, strerror(ret)); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
71 return ret; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
72 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
73 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
74 ret = yyparse(conffile); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
75 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
76 fclose(rtbusy_confin); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
77 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
78 if (ret != 0) { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
79 TRACE_ERROR( "Unable to parse the configuration file."); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
80 return EINVAL; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
81 } else { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
82 TRACE_DEBUG(FULL, "[rt_busypeers] Configuration: %d-%d-%d-%d.", rtbusy_conf.SkipTooBusyErrors, rtbusy_conf.RetryDistantPeers, rtbusy_conf.RetryMaxPeers, rtbusy_conf.RelayTimeout); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
83 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
84 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
85 return 0; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
86 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
87 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
88 /* The Lex parser prototype */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
89 int rtbusy_conflex(YYSTYPE *lvalp, YYLTYPE *llocp); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
90 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
91 /* Function to report the errors */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
92 void yyerror (YYLTYPE *ploc, char * conffile, char const *s) |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
93 { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
94 TRACE_DEBUG(INFO, "Error in configuration parsing"); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
95 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
96 if (ploc->first_line != ploc->last_line) |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
97 fd_log_error("%s:%d.%d-%d.%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
98 else if (ploc->first_column != ploc->last_column) |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
99 fd_log_error("%s:%d.%d-%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
100 else |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
101 fd_log_error("%s:%d.%d : %s", conffile, ploc->first_line, ploc->first_column, s); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
102 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
103 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
104 %} |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
105 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
106 /* Values returned by lex for token */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
107 %union { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
108 int integer; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
109 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
110 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
111 /* In case of error in the lexical analysis */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
112 %token LEX_ERROR |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
113 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
114 /* A (de)quoted string (malloc'd in lex parser; it must be freed after use) */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
115 %token <integer> INTEGER |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
116 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
117 /* Tokens */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
118 %token SKIPTOOBUSYERRORS |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
119 %token RETRYDISTANTPEERS |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
120 %token RETRYMAXPEERS |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
121 %token RELAYTIMEOUT |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
122 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
123 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
124 /* -------------------------------------- */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
125 %% |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
126 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
127 /* The grammar definition */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
128 conffile: /* empty is OK */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
129 | conffile toobusy |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
130 | conffile distant |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
131 | conffile maxretry |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
132 | conffile timeout |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
133 | conffile errors |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
134 { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
135 yyerror(&yylloc, conffile, "An error occurred while parsing the configuration file"); |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
136 return EINVAL; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
137 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
138 ; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
139 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
140 /* Lexical or syntax error */ |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
141 errors: LEX_ERROR |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
142 | error |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
143 ; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
144 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
145 toobusy: SKIPTOOBUSYERRORS ';' |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
146 { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
147 rtbusy_conf.SkipTooBusyErrors=1; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
148 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
149 ; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
150 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
151 distant: RETRYDISTANTPEERS ';' |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
152 { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
153 rtbusy_conf.RetryDistantPeers=1; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
154 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
155 ; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
156 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
157 maxretry: RETRYMAXPEERS '=' INTEGER ';' |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
158 { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
159 rtbusy_conf.RetryMaxPeers=$3; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
160 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
161 ; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
162 |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
163 timeout: RELAYTIMEOUT '=' INTEGER ';' |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
164 { |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
165 rtbusy_conf.RelayTimeout=$3; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
166 } |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
167 ; |
8110a781116a
New extension rt_busypeers. See doc/rt_busypeers.conf.sample for more information. This code is not tested yet
Sebastien Decugis <sdecugis@freediameter.net>
parents:
diff
changeset
|
168 |