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 $
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>
69 __RCSID("@(#) $FreeBSD: src/usr.sbin/atm/scspd/scsp_config_parse.y,v 1.3 1999/08/28 01:15:32 peter Exp $");
73 void yyerror __P((char *));
78 * Token value definition
88 * Token types returned by scanner
90 %token <tv_alpha> TOK_NAME
91 %token <tv_int> TOK_INTEGER
92 %token <tv_hex> TOK_HEX
100 %token TOK_DCS_CA_REXMIT_INT
101 %token TOK_DCS_CSUS_REXMIT_INT
102 %token TOK_DCS_CSU_REXMIT_INT
103 %token TOK_DCS_CSU_REXMIT_MAX
104 %token TOK_DCS_HELLO_DF
105 %token TOK_DCS_HELLO_INT
106 %token TOK_DCS_HOP_CNT
123 cfg_file: /* Empty */
130 stmt: server_stmt ';'
135 * SCSP server definition statements
137 server_stmt: TOK_SERVER TOK_NAME
141 rc = start_server($2);
150 rc = finish_server();
156 server_def: server_spec ';'
157 | server_def server_spec ';'
160 server_spec: /* Nothing */
167 * Configure the network interface
174 | TOK_PROTOCOL TOK_ATMARP
179 * Configure the protocol
181 rc = set_protocol(SCSP_PROTO_ATMARP);
185 | TOK_PROTOCOL TOK_DHCP | TOK_LNNI | TOK_MARS | TOK_NHRP
187 yyerror("Protocol not implemented");
190 | TOK_SRVGRP TOK_INTEGER
195 * Configure the SCSP server group ID
197 rc = set_server_group($2);
204 * SCSP DCS definition statements
224 dcs_def: dcs_spec ';'
225 | dcs_def dcs_spec ';'
228 dcs_spec: /* Nothing */
229 | TOK_DCS_ADDR TOK_HEX
236 rc = set_dcs_addr($2, (char *)0);
241 | TOK_DCS_ADDR TOK_HEX TOK_HEX
246 * Set DCS address and subaddress
248 rc = set_dcs_addr($2, $3);
254 | TOK_DCS_CA_REXMIT_INT TOK_INTEGER
259 * Configure the CA retransmit interval
261 rc = set_dcs_ca_rexmit($2);
265 | TOK_DCS_CSUS_REXMIT_INT TOK_INTEGER
270 * Configure the CSUS retransmit interval
272 rc = set_dcs_csus_rexmit($2);
276 | TOK_DCS_CSU_REXMIT_INT TOK_INTEGER
281 * Configure the CSU retransmit interval
283 rc = set_dcs_csu_rexmit($2);
287 | TOK_DCS_CSU_REXMIT_MAX TOK_INTEGER
292 * Configure the CSU retransmit limit
294 rc = set_dcs_csu_rexmit_max($2);
298 | TOK_DCS_HELLO_DF TOK_INTEGER
303 * Configure the Hello dead factor
305 rc = set_dcs_hello_df($2);
309 | TOK_DCS_HELLO_INT TOK_INTEGER
314 * Configure the Hello interval
316 rc = set_dcs_hello_int($2);
320 | TOK_DCS_HOP_CNT TOK_INTEGER
325 * Configure the hop count
327 rc = set_dcs_hops($2);
331 | TOK_DCS_ID TOK_NAME
336 * Configure the DCS ID
347 * Logging option statements
353 log_spec: /* Nothing */
354 | TOK_LFN TOK_NAME ';'
357 * Configure the log file name
361 rc = set_log_file($2);
370 * Configure logging to syslog
380 parse_error(const char *fmt, ...)
382 parse_error(fmt, va_alist)
396 vsprintf(buff, fmt, ap);
397 scsp_log(LOG_ERR, "%s: Config file error at line %d: %s\n",
398 prog, parse_line, buff);
400 fprintf(stderr, "%s: Config file error at line %d: %s\n",
401 prog, parse_line, buff);