Revision ce1da96e nest/config.Y

View differences:

nest/config.Y
22 22
CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
23 23
CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
24 24
CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
25
CF_KEYWORDS(PRIMARY)
25 26

  
26 27
CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
27 28
	RIP, OSPF, OSPF_EXT, OSPF_IA, OSPF_BOUNDARY, BGP, PIPE)
......
32 33
%type <p> password_list password_begin
33 34
%type <s> optsym
34 35
%type <ra> r_args
35
%type <i> echo_mask echo_size debug_mask debug_list debug_flag
36
%type <i> echo_mask echo_size debug_mask debug_list debug_flag import_or_proto
36 37
%type <t> proto_patt
37 38

  
38 39
CF_GRAMMAR
......
239 240
CF_CLI(SHOW INTERFACES SUMMARY,,, [[Show summary of network interfaces]])
240 241
{ if_show_summary(); } ;
241 242

  
242
CF_CLI(SHOW ROUTE, r_args, [<prefix>] [table <t>] [filter <f>] [all], [[Show routing table]])
243
CF_CLI(SHOW ROUTE, r_args, [<prefix>] [table <t>] [filter <f>] [all] [primary] [(import|protocol) <p>], [[Show routing table]])
243 244
{ rt_show($3); } ;
244 245

  
245 246
r_args:
......
275 276
     $$ = $1;
276 277
     $$->verbose = 1;
277 278
   }
279
 | r_args PRIMARY {
280
     $$ = $1;
281
     $$->primary_only = 1;
282
   }
283
 | r_args import_or_proto SYM {
284
     struct proto_config *c = (struct proto_config *) $3->def;
285
     $$ = $1;
286
     if ($$->import_mode) cf_error("Protocol specified twice");
287
     if ($3->class != SYM_PROTO || !c->proto) cf_error("%s is not a protocol", $3->name);
288
     $$->import_mode = $2;
289
     $$->primary_only = 1;
290
     $$->import_protocol = c->proto;
291
     $$->running_on_config = c->proto->cf->global;
292
   }
293
 ;
294

  
295
import_or_proto:
296
   IMPORT { $$ = 1; }
297
 | PROTOCOL { $$ = 2; }
278 298
 ;
279 299

  
280 300
CF_CLI(SHOW SYMBOLS, optsym, [<symbol>], [[Show all known symbolic names]])

Also available in: Unified diff