summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/parse.y
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2009-11-25 12:55:35 +0000
committerdlg <dlg@openbsd.org>2009-11-25 12:55:35 +0000
commit4fd4397d18762f3a352104c3ee1829d9884e575c (patch)
treef92476bc9df3ff1b1fac9fe0014228cb77b979fa /usr.sbin/ospfd/parse.y
parentConsider any tx buffer that is freed in vr_stop() to be an unsent (diff)
downloadwireguard-openbsd-4fd4397d18762f3a352104c3ee1829d9884e575c.tar.xz
wireguard-openbsd-4fd4397d18762f3a352104c3ee1829d9884e575c.zip
add support for include
ok claudio@
Diffstat (limited to 'usr.sbin/ospfd/parse.y')
-rw-r--r--usr.sbin/ospfd/parse.y20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y
index 9d97031d35c..004f4fef401 100644
--- a/usr.sbin/ospfd/parse.y
+++ b/usr.sbin/ospfd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.67 2009/06/05 04:12:52 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.68 2009/11/25 12:55:35 dlg Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -124,6 +124,7 @@ typedef struct {
%token SET TYPE
%token YES NO
%token DEMOTE
+%token INCLUDE
%token ERROR
%token <v.string> STRING
%token <v.number> NUMBER
@@ -134,6 +135,7 @@ typedef struct {
%%
grammar : /* empty */
+ | grammar include '\n'
| grammar '\n'
| grammar conf_main '\n'
| grammar varset '\n'
@@ -141,6 +143,21 @@ grammar : /* empty */
| grammar error '\n' { file->errors++; }
;
+include : INCLUDE STRING {
+ struct file *nfile;
+
+ if ((nfile = pushfile($2, 1)) == NULL) {
+ yyerror("failed to include file %s", $2);
+ free($2);
+ YYERROR;
+ }
+ free($2);
+
+ file = nfile;
+ lungetc('\n');
+ }
+ ;
+
string : string STRING {
if (asprintf(&$$, "%s %s", $1, $2) == -1) {
free($1);
@@ -674,6 +691,7 @@ lookup(char *s)
{"external-tag", EXTTAG},
{"fib-update", FIBUPDATE},
{"hello-interval", HELLOINTERVAL},
+ {"include", INCLUDE},
{"interface", INTERFACE},
{"metric", METRIC},
{"no", NO},