4 * ===================================
5 * HARP | Host ATM Research Platform
6 * ===================================
9 * This Host ATM Research Platform ("HARP") file (the "Software") is
10 * made available by Network Computing Services, Inc. ("NetworkCS")
11 * "AS IS". NetworkCS does not provide maintenance, improvements or
12 * support of any kind.
14 * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
15 * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
16 * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
17 * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
18 * In no event shall NetworkCS be responsible for any damages, including
19 * but not limited to consequential damages, arising from or relating to
20 * any use of the Software or related support.
22 * Copyright 1994-1998 Network Computing Services, Inc.
24 * Copies of this Software may be made, however, the above copyright
25 * notice must be reproduced on all copies.
27 * @(#) $FreeBSD: src/usr.sbin/atm/scspd/scsp_config_parse.y,v 1.3 1999/08/28 01:15:32 peter Exp $
28 * @(#) $DragonFly: src/usr.sbin/atm/scspd/scsp_config_parse.y,v 1.3 2003/11/03 19:31:35 eirikn Exp $
33 * Server Cache Synchronization Protocol (SCSP) Support
34 * ----------------------------------------------------
36 * YACC input for configuration file processing
40 #include <sys/types.h>
41 #include <sys/param.h>
42 #include <sys/socket.h>
44 #include <netinet/in.h>
45 #include <netatm/port.h>
46 #include <netatm/queue.h>
47 #include <netatm/atm.h>
48 #include <netatm/atm_if.h>
49 #include <netatm/atm_sap.h>
50 #include <netatm/atm_sys.h>
51 #include <netatm/atm_ioctl.h>
73 * Token value definition
83 * Token types returned by scanner
85 %token <tv_alpha> TOK_NAME
86 %token <tv_int> TOK_INTEGER
87 %token <tv_hex> TOK_HEX
95 %token TOK_DCS_CA_REXMIT_INT
96 %token TOK_DCS_CSUS_REXMIT_INT
97 %token TOK_DCS_CSU_REXMIT_INT
98 %token TOK_DCS_CSU_REXMIT_MAX
99 %token TOK_DCS_HELLO_DF
100 %token TOK_DCS_HELLO_INT
101 %token TOK_DCS_HOP_CNT
118 cfg_file: /* Empty */
125 stmt: server_stmt ';'
130 * SCSP server definition statements
132 server_stmt: TOK_SERVER TOK_NAME
136 rc = start_server($2);
145 rc = finish_server();
151 server_def: server_spec ';'
152 | server_def server_spec ';'
155 server_spec: /* Nothing */
162 * Configure the network interface
169 | TOK_PROTOCOL TOK_ATMARP
174 * Configure the protocol
176 rc = set_protocol(SCSP_PROTO_ATMARP);
180 | TOK_PROTOCOL TOK_DHCP | TOK_LNNI | TOK_MARS | TOK_NHRP
182 yyerror("Protocol not implemented");
185 | TOK_SRVGRP TOK_INTEGER
190 * Configure the SCSP server group ID
192 rc = set_server_group($2);
199 * SCSP DCS definition statements
219 dcs_def: dcs_spec ';'
220 | dcs_def dcs_spec ';'
223 dcs_spec: /* Nothing */
224 | TOK_DCS_ADDR TOK_HEX
231 rc = set_dcs_addr($2, (char *)0);
236 | TOK_DCS_ADDR TOK_HEX TOK_HEX
241 * Set DCS address and subaddress
243 rc = set_dcs_addr($2, $3);
249 | TOK_DCS_CA_REXMIT_INT TOK_INTEGER
254 * Configure the CA retransmit interval
256 rc = set_dcs_ca_rexmit($2);
260 | TOK_DCS_CSUS_REXMIT_INT TOK_INTEGER
265 * Configure the CSUS retransmit interval
267 rc = set_dcs_csus_rexmit($2);
271 | TOK_DCS_CSU_REXMIT_INT TOK_INTEGER
276 * Configure the CSU retransmit interval
278 rc = set_dcs_csu_rexmit($2);
282 | TOK_DCS_CSU_REXMIT_MAX TOK_INTEGER
287 * Configure the CSU retransmit limit
289 rc = set_dcs_csu_rexmit_max($2);
293 | TOK_DCS_HELLO_DF TOK_INTEGER
298 * Configure the Hello dead factor
300 rc = set_dcs_hello_df($2);
304 | TOK_DCS_HELLO_INT TOK_INTEGER
309 * Configure the Hello interval
311 rc = set_dcs_hello_int($2);
315 | TOK_DCS_HOP_CNT TOK_INTEGER
320 * Configure the hop count
322 rc = set_dcs_hops($2);
326 | TOK_DCS_ID TOK_NAME
331 * Configure the DCS ID
342 * Logging option statements
348 log_spec: /* Nothing */
349 | TOK_LFN TOK_NAME ';'
352 * Configure the log file name
356 rc = set_log_file($2);
365 * Configure logging to syslog
375 parse_error(const char *fmt, ...)
377 parse_error(fmt, va_alist)
391 vsprintf(buff, fmt, ap);
392 scsp_log(LOG_ERR, "%s: Config file error at line %d: %s\n",
393 prog, parse_line, buff);
395 fprintf(stderr, "%s: Config file error at line %d: %s\n",
396 prog, parse_line, buff);