Revision 758458be conf/confbase.Y

View differences:

conf/confbase.Y
40 40
  struct rt_show_data *ra;
41 41
  void *g;
42 42
  bird_clock_t time;
43
  struct prefix px;
43 44
}
44 45

  
45 46
%token END CLI_MARKER INVALID_TOKEN
......
52 53

  
53 54
%type <i> expr bool pxlen
54 55
%type <time> datetime
56
%type <px> prefix
55 57

  
56 58
%nonassoc '=' '<' '>' '~' '.' GEQ LEQ NEQ
57 59
%left '+' '-'
......
109 111

  
110 112
/* Prefixes and netmasks */
111 113

  
114
prefix:
115
   IPA pxlen {
116
     if (!ip_is_prefix($1, $2)) cf_error("Invalid prefix");
117
     $$.addr = $1; $$.len = $2;
118
   }
119
 ;
120

  
112 121
pxlen:
113 122
   '/' NUM {
114 123
     if ($2 < 0 || $2 > BITS_PER_IP_ADDRESS) cf_error("Invalid prefix length %d", $2);

Also available in: Unified diff