From 68cb6142751da64bac56dce8d7b1fc0951f58000 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Sun, 13 Apr 2003 21:51:11 +0000 Subject: say bye bye to hfscflags_list and hfscflags_item welcome hfscopts_list and hfscopts_item, returning a full struct node_hfsc_opt instead of just an int for the flags. needed because of all the opts hfsc knows --- sbin/pfctl/parse.y | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'sbin/pfctl') diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 9619257e19d..d74e51bcc04 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.360 2003/04/13 20:41:37 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.361 2003/04/13 21:51:10 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -315,6 +315,7 @@ typedef struct { struct queue_opts queue_opts; struct scrub_opts scrub_opts; struct table_opts table_opts; + struct node_hfsc_opts hfsc_opts; } v; int lineno; } YYSTYPE; @@ -380,7 +381,7 @@ typedef struct { %type scheduler %type cbqflags_list cbqflags_item %type priqflags_list priqflags_item -%type hfscflags_list hfscflags_item +%type hfscopts_list hfscopts_item %type bandwidth %type filter_opts filter_opt filter_opts_l %type queue_opts queue_opt queue_opts_l @@ -985,9 +986,10 @@ scheduler : CBQ { bzero(&$$.data.hfsc_opts, sizeof(struct node_hfsc_opts)); } - | HFSC '(' hfscflags_list ')' { + | HFSC '(' hfscopts_list ')' { $$.qtype = ALTQT_HFSC; - $$.data.hfsc_opts.flags = $3; + memcpy(&$$.data.hfsc_opts, &$3, + sizeof(struct node_hfsc_opts)); } ; @@ -1033,19 +1035,22 @@ priqflags_item : STRING { } ; -hfscflags_list : hfscflags_item { $$ |= $1; } - | hfscflags_list comma hfscflags_item { $$ |= $3; } +hfscopts_list : hfscopts_item { + $$.flags |= $1.flags; + } + | hfscopts_list comma hfscopts_item { + $$.flags |= $3.flags; ; -hfscflags_item : STRING { +hfscopts_item : STRING { if (!strcmp($1, "default")) - $$ = HFCF_DEFAULTCLASS; + $$.flags = HFCF_DEFAULTCLASS; else if (!strcmp($1, "red")) - $$ = HFCF_RED; + $$.flags = HFCF_RED; else if (!strcmp($1, "ecn")) - $$ = HFCF_RED|HFCF_ECN; + $$.flags = HFCF_RED|HFCF_ECN; else if (!strcmp($1, "rio")) - $$ = HFCF_RIO; + $$.flags = HFCF_RIO; else { yyerror("unknown hfsc flag \"%s\"", $1); YYERROR; -- cgit v1.2.3