Revision fe9f1a6d nest/config.Y

View differences:

nest/config.Y
55 55

  
56 56
CF_KEYWORDS(ROUTER, ID, PROTOCOL, TEMPLATE, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
57 57
CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
58
CF_KEYWORDS(IPV4, IPVX, VPN4, VPN6)
58 59
CF_KEYWORDS(RECEIVE, LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE, KEEP, FILTERED)
59 60
CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
60 61
CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, NOEXPORT, GENERATE, ROA)
......
77 78
%type <ro> roa_args
78 79
%type <rot> roa_table_arg
79 80
%type <sd> sym_args
80
%type <i> proto_start echo_mask echo_size debug_mask debug_list debug_flag mrtdump_mask mrtdump_list mrtdump_flag export_mode roa_mode limit_action tab_sorted tos
81
%type <i> proto_start echo_mask echo_size debug_mask debug_list debug_flag mrtdump_mask mrtdump_list mrtdump_flag export_mode roa_mode limit_action table_type table_sorted tos
81 82
%type <ps> proto_patt proto_patt2
82 83
%type <g> limit_spec
83 84

  
......
95 96
idval:
96 97
   NUM { $$ = $1; }
97 98
 | '(' term ')' { $$ = f_eval_int($2); }
98
 | RTRID
99
 | IPA {
100
#ifndef IPV6
101
     $$ = ipa_to_u32($1);
102
#else
103
     cf_error("Router IDs must be entered as hexadecimal numbers or IPv4 addresses in IPv6 version");
104
#endif
105
   }
99
 | IP4 { $$ = ip4_to_u32($1); }
106 100
 | SYM {
107 101
     if ($1->class == (SYM_CONSTANT | T_INT) || $1->class == (SYM_CONSTANT | T_QUAD))
108 102
       $$ = SYM_VAL($1).i;
......
140 134

  
141 135
/* Creation of routing tables */
142 136

  
143
tab_sorted:
137
CF_ADDTO(conf, table)
138

  
139
table_type:
140
   /* empty */ { $$ = NET_IP4; }
141
 | IPV4 { $$ = NET_IP4; }
142
 | IPVX { $$ = NET_IP6; } /* XXXX */
143
 | VPN4 { $$ = NET_VPN4; }
144
 | VPN6 { $$ = NET_VPN6; }
145
 ;
146

  
147
table_sorted:
144 148
          { $$ = 0; }
145 149
 | SORTED { $$ = 1; }
146 150
 ;
147 151

  
148
CF_ADDTO(conf, newtab)
149

  
150
newtab: TABLE SYM tab_sorted {
152
table: table_type TABLE SYM table_sorted {
151 153
   struct rtable_config *cf;
152
   cf = rt_new_table($2);
153
   cf->sorted = $3;
154
   cf = rt_new_table($3, $1);
155
   cf->sorted = $4;
154 156
   }
155 157
 ;
156 158

  

Also available in: Unified diff