Revision fe9f1a6d filter/config.Y

View differences:

filter/config.Y
477 477
 * Complex types, their bison value is struct f_val
478 478
 */
479 479
fipa:
480
   IPA %prec PREFIX_DUMMY { $$.type = T_IP; $$.val.px.ip = $1; }
480
   ipa_raw %prec PREFIX_DUMMY { $$.type = T_IP; $$.val.px.ip = $1; }
481 481
 ;
482 482

  
483 483

  
......
491 491

  
492 492
set_atom:
493 493
   NUM   { $$.type = T_INT; $$.val.i = $1; }
494
 | RTRID { $$.type = T_QUAD; $$.val.i = $1; }
495 494
 | fipa  { $$ = $1; }
496 495
 | ENUM  { $$.type = pair_a($1); $$.val.i = pair_b($1); }
497 496
 | '(' term ')' {
......
508 507
switch_atom:
509 508
   NUM   { $$.type = T_INT; $$.val.i = $1; }
510 509
 | '(' term ')' { $$.type = T_INT; $$.val.i = f_eval_int($2); }
511
 | RTRID { $$.type = T_QUAD; $$.val.i = $1; }
512 510
 | fipa  { $$ = $1; }
513 511
 | ENUM  { $$.type = pair_a($1); $$.val.i = pair_b($1); }
514 512
 ;
......
575 573
 ;
576 574

  
577 575
fprefix_s:
578
   IPA '/' NUM %prec '/' {
576
   ipa_raw '/' NUM %prec '/' {
579 577
     if (($3 < 0) || ($3 > MAX_PREFIX_LENGTH) || !ip_is_prefix($1, $3)) cf_error("Invalid network prefix: %I/%d.", $1, $3);
580 578
     $$.type = T_PREFIX; $$.val.px.ip = $1; $$.val.px.len = $3;
581 579
   }
......
646 644
 | TEXT   { $$ = f_new_inst(); $$->code = 'c'; $$->aux = T_STRING; $$->a2.p = $1; }
647 645
 | fipa	   { NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; $$->a1.p = val; *val = $1; }
648 646
 | fprefix_s {NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; $$->a1.p = val; *val = $1; }
649
 | RTRID  { $$ = f_new_inst(); $$->code = 'c'; $$->aux = T_QUAD;  $$->a2.i = $1; }
650 647
 | '[' set_items ']' { DBG( "We've got a set here..." ); $$ = f_new_inst(); $$->code = 'c'; $$->aux = T_SET; $$->a2.p = build_tree($2); DBG( "ook\n" ); }
651 648
 | '[' fprefix_set ']' { $$ = f_new_inst(); $$->code = 'c'; $$->aux = T_PREFIX_SET;  $$->a2.p = $2; }
652 649
 | ENUM	  { $$ = f_new_inst(); $$->code = 'c'; $$->aux = $1 >> 16; $$->a2.i = $1 & 0xffff; }

Also available in: Unified diff