Filter: Remove quitbird command

No need for this debug filter command and it can be abused from CLI.
This commit is contained in:
Ondrej Zajicek (work) 2020-04-29 15:07:33 +02:00
parent b12442c985
commit 82bfee76f0
5 changed files with 2 additions and 11 deletions

View file

@ -1698,9 +1698,6 @@ protocol sections.
<tag><label id="print">print|printn <m/expr/ [<m/, expr.../]</tag> <tag><label id="print">print|printn <m/expr/ [<m/, expr.../]</tag>
Prints given expressions; useful mainly while debugging filters. The Prints given expressions; useful mainly while debugging filters. The
<cf/printn/ variant does not terminate the line. <cf/printn/ variant does not terminate the line.
<tag><label id="quitbird">quitbird</tag>
Terminates BIRD. Useful when debugging the filter interpreter.
</descrip> </descrip>

View file

@ -273,7 +273,7 @@ assert_assign(struct f_lval *lval, struct f_inst *expr, const char *start, const
CF_DECLS CF_DECLS
CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN, CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN,
ACCEPT, REJECT, ERROR, QUITBIRD, ACCEPT, REJECT, ERROR,
INT, BOOL, IP, TYPE, PREFIX, RD, PAIR, QUAD, EC, LC, INT, BOOL, IP, TYPE, PREFIX, RD, PAIR, QUAD, EC, LC,
SET, STRING, BGPMASK, BGPPATH, CLIST, ECLIST, LCLIST, SET, STRING, BGPMASK, BGPPATH, CLIST, ECLIST, LCLIST,
IF, THEN, ELSE, CASE, IF, THEN, ELSE, CASE,
@ -822,8 +822,7 @@ term:
; ;
break_command: break_command:
QUITBIRD { $$ = F_QUITBIRD; } ACCEPT { $$ = F_ACCEPT; }
| ACCEPT { $$ = F_ACCEPT; }
| REJECT { $$ = F_REJECT; } | REJECT { $$ = F_REJECT; }
| ERROR { $$ = F_ERROR; } | ERROR { $$ = F_ERROR; }
; ;

View file

@ -479,8 +479,6 @@
FID_MEMBER(enum filter_return, fret, f1->fret != f2->fret, "%s", filter_return_str(item->fret)); FID_MEMBER(enum filter_return, fret, f1->fret != f2->fret, "%s", filter_return_str(item->fret));
switch (whati->fret) { switch (whati->fret) {
case F_QUITBIRD:
die( "Filter asked me to die" );
case F_ACCEPT: /* Should take care about turning ACCEPT into MODIFY */ case F_ACCEPT: /* Should take care about turning ACCEPT into MODIFY */
case F_ERROR: case F_ERROR:
case F_REJECT: /* Maybe print complete route along with reason to reject route? */ case F_REJECT: /* Maybe print complete route along with reason to reject route? */

View file

@ -24,7 +24,6 @@ enum filter_return {
F_ACCEPT, /* Need to preserve ordering: accepts < rejects! */ F_ACCEPT, /* Need to preserve ordering: accepts < rejects! */
F_REJECT, F_REJECT,
F_ERROR, F_ERROR,
F_QUITBIRD,
}; };
static inline const char *filter_return_str(const enum filter_return fret) { static inline const char *filter_return_str(const enum filter_return fret) {
@ -36,7 +35,6 @@ static inline const char *filter_return_str(const enum filter_return fret) {
FRS(F_ACCEPT); FRS(F_ACCEPT);
FRS(F_REJECT); FRS(F_REJECT);
FRS(F_ERROR); FRS(F_ERROR);
FRS(F_QUITBIRD);
#undef FRS #undef FRS
default: bug("This shall not happen"); default: bug("This shall not happen");
} }

View file

@ -43,7 +43,6 @@ protocol static {
print scope; print scope;
if !(scope ~ [ SCOPE_HOST, SCOPE_SITE ]) then { if !(scope ~ [ SCOPE_HOST, SCOPE_SITE ]) then {
print "Failed in test"; print "Failed in test";
quitbird;
} }
preference = 15; preference = 15;