]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
TMP
authorMaria Matejka <mq@ucw.cz>
Sun, 2 Jul 2023 13:10:08 +0000 (15:10 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 26 Sep 2023 08:42:28 +0000 (10:42 +0200)
conf/conf.h
conf/confbase.Y
filter/config.Y

index a4bc1f291d832f55f427853ac9b4d73b1755d469..b6d1598f9a62e43f2d180ca468bcc7e5a230e6c0 100644 (file)
@@ -128,8 +128,7 @@ struct symbol {
     struct ea_class *attribute;                /* For SYM_ATTRIBUTE */
     struct f_val *val;                 /* For SYM_CONSTANT */
     uint offset;                       /* For SYM_VARIABLE */
-    struct channel_config *ch_config;  /* For SYM_COUNTER */
-    struct stats_term_config *term;     /* For SYM_COUNTER_TERM */
+    struct volatile_config *volat;     /* For SYM_VOLATILE */
   };
 
   char name[0];
@@ -164,8 +163,6 @@ struct bytestring {
 #define SYM_FILTER 4
 #define SYM_TABLE 5
 #define SYM_ATTRIBUTE 6
-#define SYM_COUNTER 7
-#define SYM_COUNTER_TERM 8
 
 #define SYM_VARIABLE 0x100     /* 0x100-0x1ff are variable types */
 #define SYM_VARIABLE_RANGE SYM_VARIABLE ... (SYM_VARIABLE | 0xff)
index 8e5da9e3f792e86f5ecea4dbf5ef13808fe5bfdc..293f9f8510d94c1f5094b31c2fd72f1b14f6d38f 100644 (file)
@@ -153,16 +153,6 @@ conf: ';' ;
 
 /* Constant expressions */
 
-conf: definition ;
-
-definition:
-   DEFINE symbol '=' term ';' {
-     struct f_val val;
-     if (f_eval(f_linearize($4, 1), &val) > F_RETURN) cf_error("Runtime error");
-     cf_define_symbol($2, SYM_CONSTANT | val.type, val, lp_val_copy(cfg_mem, &val));
-   }
- ;
-
 expr:
    NUM
  | '(' term ')' { $$ = f_eval_int(f_linearize($2, 1)); }
index 25018a0ba9b8a9454ae35bf4a21840388f0822ce..e590da578b81a3d783414c7b605beac12e1bb104 100644 (file)
@@ -361,6 +361,25 @@ conf: FILTER STACKS expr expr ';' {
  }
  ;
 
+
+conf: definition ;
+definition:
+   DEFINE symbol '=' term ';' {
+     struct f_line *line = f_linearize($4, 1);
+     struct filter_iterator fit;
+     FILTER_ITERATE_INIT(&fit, 
+     if 
+
+     struct f_val val;
+     if (f_eval(, &val) > F_RETURN) cf_error("Runtime error");
+     cf_define_symbol($2, SYM_CONSTANT | val.type, val, lp_val_copy(cfg_mem, &val));
+   }
+ | DEFINE symbol '=' COUNT ROUTE r_args ';' {
+     cf_define_symbol($2, SYM_VOLATILE, volat, f_volatile_counter($6));
+   }
+ ;
+
+
 conf: filter_def ;
 filter_def:
    FILTER symbol { $2 = cf_define_symbol($2, SYM_FILTER, filter, NULL); cf_push_scope( $2 ); }