diff options
author | Pavel Machek <pavel@ucw.cz> | 2000-05-15 14:19:26 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2000-05-15 14:19:26 +0200 |
commit | cbfd671f114a96095f021662ad1cf0eaa6d089c1 (patch) | |
tree | 9995484ebaf0e8d9078e085210802e9477e9f807 | |
parent | cc590a11a7a285463dff89d0bd677d0762dd8e45 (diff) | |
download | bird-cbfd671f114a96095f021662ad1cf0eaa6d089c1.tar bird-cbfd671f114a96095f021662ad1cf0eaa6d089c1.zip |
Allow accessing defined symbols.
-rw-r--r-- | filter/config.Y | 9 | ||||
-rw-r--r-- | filter/test.conf | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/filter/config.Y b/filter/config.Y index 9aa827e..0d1d716 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -348,6 +348,15 @@ term: | SYM { $$ = f_new_inst(); switch ($1->class) { + case SYM_NUMBER: + $$ = f_new_inst(); + $$->code = 'c'; + $$->aux = T_INT; + $$->a2.i = $1->aux; + break; + case SYM_IPA: + { NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; $$->a1.p = val; val->type = T_IP; val->val.px.ip = * (ip_addr *) ($1->def); } + break; case SYM_VARIABLE | T_INT: case SYM_VARIABLE | T_PAIR: case SYM_VARIABLE | T_PREFIX: diff --git a/filter/test.conf b/filter/test.conf index 37cff13..d734d57 100644 --- a/filter/test.conf +++ b/filter/test.conf @@ -65,13 +65,16 @@ function bla() return 15; } +define four=4; +define onetwo=1.2.3.4; + function __startup() int i; prefix px; ip p; { print "Testing filter language:"; - i = 4; + i = four; i = 1230 + i; i = ( i + 0 ); print " arithmetics: 1234 = ", i; @@ -111,6 +114,8 @@ ip p; paths(); + print "1.2.3.4 = ", onetwo; + print "done"; quitbird; # print "*** FAIL: this is unreachable"; |