-/* $OpenBSD: parse.y,v 1.348 2018/09/09 15:04:36 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.349 2018/09/09 20:39:09 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
} as_set_l optnl '}' {
done_as_set();
}
+ | ASSET STRING '{' optnl '}' {
+ if (new_as_set($2) != 0)
+ YYERROR;
+ free($2);
+ }
as_set_l : as4number_any { add_as_set($1); }
| as_set_l comma as4number_any { add_as_set($3); }
SIMPLEQ_INSERT_TAIL(conf->prefixsets, curpset, entry);
curpset = NULL;
}
+ | PREFIXSET STRING '{' optnl '}' {
+ if (find_prefixset($2, conf->prefixsets) != NULL) {
+ yyerror("duplicate prefixset %s", $2);
+ free($2);
+ YYERROR;
+ }
+ if ((curpset = calloc(1, sizeof(*curpset))) == NULL)
+ fatal("prefixset");
+ if (strlcpy(curpset->name, $2, sizeof(curpset->name)) >=
+ sizeof(curpset->name)) {
+ yyerror("prefix-set \"%s\" too long: max %zu",
+ $2, sizeof(curpset->name) - 1);
+ free($2);
+ YYERROR;
+ }
+ SIMPLEQ_INIT(&curpset->psitems);
+ SIMPLEQ_INSERT_TAIL(conf->prefixsets, curpset, entry);
+ curpset = NULL;
+ }
prefixset_l : prefixset_item {
SIMPLEQ_INSERT_TAIL(&curpset->psitems, $1, entry);