diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-11-21 20:24:29 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-11-21 20:24:29 +0000 |
commit | 87b816799b817d1ee87d68c2650e2f9ba477f88b (patch) | |
tree | 6fe8153d0a0c156a23d0ed77a6334393a38d0868 /usr.sbin/hoststated/parse.y | |
parent | 4f6f111953d49f763adfc382ca85d496fa69bf61 (diff) |
extend action grammar with "filter value" and "expect value" as a
short form for "filter * from value" or "expect * from value".
Diffstat (limited to 'usr.sbin/hoststated/parse.y')
-rw-r--r-- | usr.sbin/hoststated/parse.y | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/hoststated/parse.y b/usr.sbin/hoststated/parse.y index c3233753fd7..9f14563acb3 100644 --- a/usr.sbin/hoststated/parse.y +++ b/usr.sbin/hoststated/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.90 2007/11/21 20:13:20 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.91 2007/11/21 20:24:28 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -896,6 +896,15 @@ protonode : nodetype APPEND STRING TO STRING marked { free($3); proto->lateconnect++; } + | nodetype EXPECT STRING mark { + node.action = NODE_ACTION_EXPECT; + node.key = strdup($3); + node.value = strdup("*"); + if (node.key == NULL || node.value == NULL) + fatal("out of memory"); + free($3); + proto->lateconnect++; + } | nodetype FILTER STRING FROM STRING mark { node.action = NODE_ACTION_FILTER; node.key = strdup($5); @@ -906,6 +915,15 @@ protonode : nodetype APPEND STRING TO STRING marked { free($3); proto->lateconnect++; } + | nodetype FILTER STRING mark { + node.action = NODE_ACTION_FILTER; + node.key = strdup($3); + node.value = strdup("*"); + if (node.key == NULL || node.value == NULL) + fatal("out of memory"); + free($3); + proto->lateconnect++; + } | nodetype HASH STRING marked { node.action = NODE_ACTION_HASH; node.key = strdup($3); |