summaryrefslogtreecommitdiff
path: root/nest/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-04-24 23:39:57 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2012-04-24 23:39:57 +0200
commitd9b77cc28115e5c1ef64c69722c9d1fd1392dcd1 (patch)
tree5dae59203a8455874fdcdabc0b74ff69d9e67f6e /nest/config.Y
parent3589546af4baa4d349409a318f8c9658dd11b3cc (diff)
Implements generalized export limits.
And also fixes some minor bugs in limits.
Diffstat (limited to 'nest/config.Y')
-rw-r--r--nest/config.Y14
1 files changed, 8 insertions, 6 deletions
diff --git a/nest/config.Y b/nest/config.Y
index 60b03278..c59319cb 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -179,6 +179,7 @@ proto_item:
| IMPORT imexport { this_proto->in_filter = $2; }
| EXPORT imexport { this_proto->out_filter = $2; }
| IMPORT LIMIT limit_spec { this_proto->in_limit = $3; }
+ | EXPORT LIMIT limit_spec { this_proto->out_limit = $3; }
| TABLE rtable { this_proto->table = $2; }
| ROUTER ID idval { this_proto->router_id = $3; }
| DESCRIPTION TEXT { this_proto->dsc = $2; }
@@ -192,17 +193,18 @@ imexport:
;
limit_action:
- WARN { $$ = PLA_WARN; }
- | BLOCK { $$ = PLA_BLOCK; }
- | RESTART { $$ = PLA_RESTART; }
- | DISABLE { $$ = PLA_DISABLE; }
+ /* default */ { $$ = PLA_DISABLE; }
+ | EXCEED WARN { $$ = PLA_WARN; }
+ | EXCEED BLOCK { $$ = PLA_BLOCK; }
+ | EXCEED RESTART { $$ = PLA_RESTART; }
+ | EXCEED DISABLE { $$ = PLA_DISABLE; }
;
limit_spec:
- expr EXCEED limit_action {
+ expr limit_action {
struct proto_limit *l = cfg_allocz(sizeof(struct proto_limit));
l->limit = $1;
- l->action = $3;
+ l->action = $2;
$$ = l;
}
;