Revision ea2ae6dd nest/config.Y

View differences:

nest/config.Y
43 43
CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
44 44
CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
45 45
CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
46
CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREIMPORT, GENERATE)
46
CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE)
47 47

  
48 48
CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
49 49
	RIP, OSPF, OSPF_IA, OSPF_EXT1, OSPF_EXT2, BGP, PIPE)
......
56 56
%type <r> rtable
57 57
%type <s> optsym
58 58
%type <ra> r_args
59
%type <i> echo_mask echo_size debug_mask debug_list debug_flag import_or_preimport
59
%type <i> echo_mask echo_size debug_mask debug_list debug_flag export_or_preexport
60 60
%type <t> proto_patt
61 61

  
62 62
CF_GRAMMAR
......
298 298
CF_CLI(SHOW INTERFACES SUMMARY,,, [[Show summary of network interfaces]])
299 299
{ if_show_summary(); } ;
300 300

  
301
CF_CLI(SHOW ROUTE, r_args, [[[<prefix>|for <prefix>|for <ip>] [table <t>] [filter <f>|where <cond>] [all] [primary] [(import|preimport) <p>] [protocol <p>] [stats|count]]], [[Show routing table]])
301
CF_CLI(SHOW ROUTE, r_args, [[[<prefix>|for <prefix>|for <ip>] [table <t>] [filter <f>|where <cond>] [all] [primary] [(export|preexport) <p>] [protocol <p>] [stats|count]]], [[Show routing table]])
302 302
{ rt_show($3); } ;
303 303

  
304 304
r_args:
......
344 344
     $$ = $1;
345 345
     $$->primary_only = 1;
346 346
   }
347
 | r_args import_or_preimport SYM {
347
 | r_args export_or_preexport SYM {
348 348
     struct proto_config *c = (struct proto_config *) $3->def;
349 349
     $$ = $1;
350
     if ($$->import_mode) cf_error("Protocol specified twice");
350
     if ($$->export_mode) cf_error("Protocol specified twice");
351 351
     if ($3->class != SYM_PROTO || !c->proto) cf_error("%s is not a protocol", $3->name);
352
     $$->import_mode = $2;
352
     $$->export_mode = $2;
353 353
     $$->primary_only = 1;
354
     $$->import_protocol = c->proto;
354
     $$->export_protocol = c->proto;
355 355
     $$->running_on_config = c->proto->cf->global;
356 356
   }
357 357
 | r_args PROTOCOL SYM {
......
372 372
   }
373 373
 ;
374 374

  
375
import_or_preimport:
376
   PREIMPORT { $$ = 1; }
377
 | IMPORT { $$ = 2; }
375
export_or_preexport:
376
   PREEXPORT { $$ = 1; }
377
 | EXPORT { $$ = 2; }
378 378
 ;
379 379

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

Also available in: Unified diff