Mercurial > hg > freeDiameter
annotate extensions/app_radgw/rgwx_echodrop.y @ 511:17435072de36
Search extensions conf files in the main configuration folder also
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 20 Aug 2010 15:18:58 +0900 |
parents | 26aafbbc1640 |
children | 4a9f08d6b6ba |
rev | line source |
---|---|
269
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
1 /********************************************************************************************************* |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
2 * Software License Agreement (BSD License) * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
3 * Author: Sebastien Decugis <sdecugis@nict.go.jp> * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
4 * * |
270
47fff7a7af06
Updated copyright information
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
269
diff
changeset
|
5 * Copyright (c) 2010, WIDE Project and NICT * |
269
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
6 * All rights reserved. * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
7 * * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
8 * Redistribution and use of this software in source and binary forms, with or without modification, are * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
9 * permitted provided that the following conditions are met: * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
10 * * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
11 * * Redistributions of source code must retain the above * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
12 * copyright notice, this list of conditions and the * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
13 * following disclaimer. * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
14 * * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
15 * * Redistributions in binary form must reproduce the above * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
16 * copyright notice, this list of conditions and the * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
17 * following disclaimer in the documentation and/or other * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
18 * materials provided with the distribution. * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
19 * * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
20 * * Neither the name of the WIDE Project or NICT nor the * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
21 * names of its contributors may be used to endorse or * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
22 * promote products derived from this software without * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
23 * specific prior written permission of WIDE Project and * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
24 * NICT. * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
25 * * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
32 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
34 *********************************************************************************************************/ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
35 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
36 /* Yacc parser for echo/drop plugin. |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
37 See doc/echodrop.rgwx.conf.sample for description of the parsed format. */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
38 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
39 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
40 /* For development only : */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
41 %debug |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
42 %error-verbose |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
43 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
44 /* The parser receives the configuration file filename and the conf structure as parameter */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
45 %parse-param {char * conffile} |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
46 %parse-param {struct rgwp_config *cs} |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
47 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
48 /* Keep track of location */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
49 %locations |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
50 %pure-parser |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
51 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
52 %{ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
53 #include "rgwx_echodrop.h" |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
54 #include "rgwx_echodrop.tab.h" /* bison is not smart enough to define the YYLTYPE before including this code, so... */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
55 |
403
26aafbbc1640
Cleanup all compilation warnings in base code for 32 bit arch
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
270
diff
changeset
|
56 |
26aafbbc1640
Cleanup all compilation warnings in base code for 32 bit arch
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
270
diff
changeset
|
57 /* Forward declaration */ |
26aafbbc1640
Cleanup all compilation warnings in base code for 32 bit arch
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
270
diff
changeset
|
58 int yyparse(char * conffile, struct rgwp_config *cs); |
26aafbbc1640
Cleanup all compilation warnings in base code for 32 bit arch
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
270
diff
changeset
|
59 |
26aafbbc1640
Cleanup all compilation warnings in base code for 32 bit arch
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
270
diff
changeset
|
60 /* The Lex parser prototype */ |
26aafbbc1640
Cleanup all compilation warnings in base code for 32 bit arch
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
270
diff
changeset
|
61 int rgwx_echodroplex(YYSTYPE *lvalp, YYLTYPE *llocp); |
26aafbbc1640
Cleanup all compilation warnings in base code for 32 bit arch
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
270
diff
changeset
|
62 |
26aafbbc1640
Cleanup all compilation warnings in base code for 32 bit arch
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
270
diff
changeset
|
63 |
269
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
64 /* Parse the configuration file */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
65 int ed_conffile_parse(char * conffile, struct rgwp_config *cs) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
66 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
67 extern FILE * rgwx_echodropin; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
68 int ret; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
69 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
70 rgwx_echodropin = fopen(conffile, "r"); |
511
17435072de36
Search extensions conf files in the main configuration folder also
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
403
diff
changeset
|
71 if ((rgwx_echodropin == NULL) && (*conffile != '/')) { /* We received a relative path, try adding DEFAULT_CONF_PATH prefix */ |
17435072de36
Search extensions conf files in the main configuration folder also
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
403
diff
changeset
|
72 char * fullpath; |
17435072de36
Search extensions conf files in the main configuration folder also
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
403
diff
changeset
|
73 CHECK_MALLOC( fullpath = malloc( strlen(conffile) + strlen(DEFAULT_CONF_PATH) + 2 ) ); |
17435072de36
Search extensions conf files in the main configuration folder also
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
403
diff
changeset
|
74 sprintf( fullpath, DEFAULT_CONF_PATH "/%s", conffile ); |
17435072de36
Search extensions conf files in the main configuration folder also
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
403
diff
changeset
|
75 rgwx_echodropin = fopen(fullpath, "r"); |
17435072de36
Search extensions conf files in the main configuration folder also
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
403
diff
changeset
|
76 free(fullpath); |
17435072de36
Search extensions conf files in the main configuration folder also
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
403
diff
changeset
|
77 } |
269
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
78 if (rgwx_echodropin == NULL) { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
79 ret = errno; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
80 fd_log_debug("[echodrop.rgwx] Unable to open plugin configuration file %s for reading: %s\n", conffile, strerror(ret)); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
81 return ret; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
82 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
83 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
84 ret = rgwx_echodropparse(conffile, cs); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
85 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
86 fclose(rgwx_echodropin); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
87 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
88 if (ret != 0) { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
89 return EINVAL; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
90 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
91 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
92 return 0; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
93 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
94 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
95 /* Function to report the errors */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
96 void yyerror (YYLTYPE *ploc, char * conffile, struct rgwp_config *cs, char const *s) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
97 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
98 if (ploc->first_line != ploc->last_line) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
99 fd_log_debug("%s:%d.%d-%d.%d : %s\n", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
100 else if (ploc->first_column != ploc->last_column) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
101 fd_log_debug("%s:%d.%d-%d : %s\n", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
102 else |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
103 fd_log_debug("%s:%d.%d : %s\n", conffile, ploc->first_line, ploc->first_column, s); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
104 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
105 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
106 static struct { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
107 struct { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
108 unsigned vendor :1; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
109 unsigned tlv :1; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
110 unsigned ext :1; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
111 }; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
112 uint8_t type; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
113 uint16_t extype; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
114 uint32_t vendor_id; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
115 } attrinfo; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
116 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
117 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
118 %} |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
119 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
120 /* Values returned by lex for tokens */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
121 %union { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
122 unsigned integer; /* Value */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
123 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
124 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
125 /* typed data */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
126 %token <integer> INTEGER |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
127 %type <integer> action |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
128 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
129 /* simple tokens */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
130 %token TOK_ECHO |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
131 %token TOK_DROP |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
132 %token TOK_CODE |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
133 %token TOK_VENDOR |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
134 %token TOK_TLV |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
135 %token TOK_EXT |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
136 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
137 /* In case of error in the lexical analysis */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
138 %token LEX_ERROR |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
139 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
140 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
141 /* -------------------------------------- */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
142 %% |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
143 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
144 /* The grammar definition */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
145 conffile: /* empty grammar is OK */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
146 | conffile attrdef |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
147 ; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
148 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
149 /* An attribute line */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
150 attrdef: { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
151 memset(&attrinfo, 0, sizeof(attrinfo)); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
152 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
153 action TOK_CODE INTEGER vendordef ';' |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
154 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
155 struct ed_conf_attribute * new; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
156 struct fd_list * li; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
157 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
158 if ($4 >= 256) { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
159 yyerror (&yylloc, conffile, cs, "Too big value for attribute CODE"); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
160 YYERROR; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
161 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
162 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
163 /* Create a new list item */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
164 CHECK_MALLOC_DO( new = malloc(sizeof(struct ed_conf_attribute)), |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
165 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
166 yyerror (&yylloc, conffile, cs, "Memory allocation error"); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
167 YYERROR; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
168 } ); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
169 memset(new, 0, sizeof(struct ed_conf_attribute)); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
170 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
171 fd_list_init(&new->chain, NULL); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
172 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
173 new->action = $2; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
174 new->vsa = attrinfo.vendor; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
175 new->tlv = attrinfo.tlv; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
176 new->ext = attrinfo.ext; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
177 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
178 if (new->vsa) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
179 new->vendor_id = attrinfo.vendor_id; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
180 if (new->tlv) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
181 new->type = attrinfo.type; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
182 if (new->ext) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
183 new->extype = attrinfo.extype; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
184 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
185 new->code = $4; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
186 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
187 /* Now place this attribute in the list */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
188 for (li = cs->attributes.next; li != &cs->attributes; li = li->next) { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
189 struct ed_conf_attribute *eca = (struct ed_conf_attribute *)li; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
190 /* Order first by attribute code */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
191 if (eca->code > new->code) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
192 break; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
193 if (eca->code < new->code) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
194 continue; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
195 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
196 /* Then by VSA flag */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
197 if (! new->vsa) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
198 break; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
199 if (! eca->vsa) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
200 continue; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
201 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
202 /* Then by vendor value */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
203 if (eca->vendor_id >= new->vendor_id) |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
204 break; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
205 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
206 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
207 fd_list_insert_before(li, &new->chain); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
208 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
209 ; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
210 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
211 /* What to do with the specified attribute */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
212 action: TOK_ECHO |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
213 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
214 $$ = ACT_ECHO; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
215 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
216 | |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
217 TOK_DROP |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
218 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
219 $$ = ACT_DROP; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
220 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
221 ; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
222 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
223 /* Vendor specifics, if any */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
224 vendordef: /* empty OK */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
225 | TOK_VENDOR INTEGER specif |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
226 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
227 attrinfo.vendor_id = $2; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
228 attrinfo.vendor = 1; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
229 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
230 ; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
231 |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
232 /* Any additional specification ? */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
233 specif: /* empty OK */ |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
234 | TOK_TLV INTEGER |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
235 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
236 if ($2 >= (1 << 8)) { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
237 yyerror (&yylloc, conffile, cs, "Too big value for TLV type"); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
238 YYERROR; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
239 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
240 attrinfo.type = $2; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
241 attrinfo.tlv = 1; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
242 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
243 | TOK_EXT INTEGER |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
244 { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
245 if ($2 >= (1 << 16)) { |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
246 yyerror (&yylloc, conffile, cs, "Too big value for Ext-Type"); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
247 YYERROR; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
248 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
249 attrinfo.extype = $2; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
250 attrinfo.ext = 1; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
251 yyerror (&yylloc, conffile, cs, "The EXT option is not supported in this version."); |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
252 YYERROR; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
253 } |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
254 ; |
c78f623c702d
Ported the Echo/Drop plugin from waaad (missing files)
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
255 |