Revision b1c9d871 filter/filter.c

View differences:

filter/filter.c
43 43

  
44 44
#define P(a,b) ((a<<8) | b)
45 45

  
46
struct f_inst *startup_func = NULL, *test1_func, *test2_func;
47

  
48 46
#define CMP_ERROR 999
49 47

  
50 48
static int
......
665 663
  return res.val.i;
666 664
}
667 665

  
668
void
669
filters_postconfig(void)
666
int
667
f_eval_int(struct f_inst *expr)
670 668
{
671 669
  struct f_val res;
672 670

  
673
#if 1
674
  if (!i_same(test1_func, test2_func))
675
    bug("i_same does not work");
676
#endif
677
  if (startup_func) {
678
    debug( "Launching startup function...\n" );
679
    f_pool = lp_new(&root_pool, 1024);
680
    res = interpret(startup_func);
681
    if (res.type == F_ERROR)
682
      die( "Startup function resulted in error." );
683
    debug( "done\n" );
684
  }
685
} 
671
  f_flags = 0;
672
  f_tmp_attrs = NULL;
673
  f_rte = NULL;
674
  f_rte_old = NULL;
675
  f_rta_copy = NULL;
676
  f_pool = cfg_mem;
677
  res = interpret(expr);
678
  if (res.type != T_INT)
679
    cf_error("Integer expression expected");
680
  return res.val.i;
681
}
686 682

  
687 683
/**
688 684
 * filter_same - compare two filters

Also available in: Unified diff