]> git.ipfire.org Git - thirdparty/bird.git/blob - nest/config.Y
f889828afc640dd97fc210bdffb629d79a41f959
[thirdparty/bird.git] / nest / config.Y
1 /*
2 * BIRD -- Core Configuration
3 *
4 * (c) 1998--2000 Martin Mares <mj@ucw.cz>
5 * (c) 2004 Ondrej Filip <feela@network.cz>
6 *
7 * Can be freely distributed and used under the terms of the GNU GPL.
8 */
9
10 CF_HDR
11
12 #include "nest/rt-dev.h"
13 #include "nest/password.h"
14 #include "nest/cmds.h"
15 #include "lib/lists.h"
16
17 CF_DEFINES
18
19 static struct proto_config *this_proto;
20 static struct iface_patt *this_ipatt;
21 static struct iface_patt_node *this_ipn;
22 static struct roa_table_config *this_roa_table;
23 static list *this_p_list;
24 static struct password_item *this_p_item;
25 static int password_id;
26
27 static inline void
28 reset_passwords(void)
29 {
30 this_p_list = NULL;
31 }
32
33 static inline list *
34 get_passwords(void)
35 {
36 list *rv = this_p_list;
37 this_p_list = NULL;
38 return rv;
39 }
40
41 #define DIRECT_CFG ((struct rt_dev_config *) this_proto)
42
43 CF_DECLS
44
45 CF_KEYWORDS(ROUTER, ID, PROTOCOL, TEMPLATE, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
46 CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
47 CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
48 CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE, ROA, MAX, FLUSH)
49 CF_KEYWORDS(LISTEN, BGP, V6ONLY, DUAL, ADDRESS, PORT, PASSWORDS, DESCRIPTION)
50 CF_KEYWORDS(RELOAD, IN, OUT, MRTDUMP, MESSAGES, RESTRICT, MEMORY, IGP_METRIC)
51
52 CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
53 RIP, OSPF, OSPF_IA, OSPF_EXT1, OSPF_EXT2, BGP, PIPE)
54 CF_ENUM(T_ENUM_SCOPE, SCOPE_, HOST, LINK, SITE, ORGANIZATION, UNIVERSE, UNDEFINED)
55 CF_ENUM(T_ENUM_RTC, RTC_, UNICAST, BROADCAST, MULTICAST, ANYCAST)
56 CF_ENUM(T_ENUM_RTD, RTD_, ROUTER, DEVICE, BLACKHOLE, UNREACHABLE, PROHIBIT, MULTIPATH)
57 CF_ENUM(T_ENUM_ROA, ROA_, UNKNOWN, VALID, INVALID)
58
59 %type <i32> idval
60 %type <f> imexport
61 %type <r> rtable
62 %type <s> optsym
63 %type <ra> r_args
64 %type <ro> roa_args
65 %type <rot> roa_table_arg
66 %type <sd> sym_args
67 %type <i> proto_start echo_mask echo_size debug_mask debug_list debug_flag mrtdump_mask mrtdump_list mrtdump_flag export_or_preexport roa_mode
68 %type <ps> proto_patt proto_patt2
69
70 CF_GRAMMAR
71
72 /* Setting of router ID */
73
74 CF_ADDTO(conf, rtrid)
75
76 rtrid: ROUTER ID idval ';' {
77 new_config->router_id = $3;
78 }
79 ;
80
81 idval:
82 NUM { $$ = $1; }
83 | RTRID
84 | IPA {
85 #ifndef IPV6
86 $$ = ipa_to_u32($1);
87 #else
88 cf_error("Router IDs must be entered as hexadecimal numbers or IPv4 addresses in IPv6 version");
89 #endif
90 }
91 ;
92
93
94 CF_ADDTO(conf, listen)
95
96 listen: LISTEN BGP listen_opts ';' ;
97
98 listen_opts:
99 /* Nothing */
100 | listen_opts listen_opt
101 ;
102
103 listen_opt:
104 ADDRESS ipa { new_config->listen_bgp_addr = $2; }
105 | PORT expr { new_config->listen_bgp_port = $2; }
106 | V6ONLY { new_config->listen_bgp_flags = 0; }
107 | DUAL { new_config->listen_bgp_flags = 1; }
108 ;
109
110
111 /* Creation of routing tables */
112
113 CF_ADDTO(conf, newtab)
114
115 newtab: TABLE SYM {
116 rt_new_table($2);
117 }
118 ;
119
120 CF_ADDTO(conf, roa_table)
121
122 roa_table_start: ROA TABLE SYM {
123 this_roa_table = roa_new_table_config($3);
124 };
125
126 roa_table_opts:
127 /* empty */
128 | roa_table_opts ROA prefix MAX NUM AS NUM ';' {
129 roa_add_item_config(this_roa_table, $3.addr, $3.len, $5, $7);
130 }
131 ;
132
133 roa_table:
134 roa_table_start
135 | roa_table_start '{' roa_table_opts '}'
136 ;
137
138 /* Definition of protocols */
139
140 CF_ADDTO(conf, proto)
141
142 proto_start:
143 PROTOCOL { $$ = SYM_PROTO; }
144 | TEMPLATE { $$ = SYM_TEMPLATE; }
145 ;
146
147 proto_name:
148 /* EMPTY */ {
149 struct symbol *s = cf_default_name(this_proto->protocol->template, &this_proto->protocol->name_counter);
150 s->class = this_proto->class;
151 s->def = this_proto;
152 this_proto->name = s->name;
153 }
154 | SYM {
155 cf_define_symbol($1, this_proto->class, this_proto);
156 this_proto->name = $1->name;
157 }
158 | SYM FROM SYM {
159 if (($3->class != SYM_TEMPLATE) && ($3->class != SYM_PROTO)) cf_error("Template or protocol name expected");
160
161 cf_define_symbol($1, this_proto->class, this_proto);
162 this_proto->name = $1->name;
163
164 proto_copy_config(this_proto, $3->def);
165 }
166 ;
167
168 proto_item:
169 /* EMPTY */
170 | PREFERENCE expr {
171 if ($2 < 0 || $2 > 0xFFFF) cf_error("Invalid preference");
172 this_proto->preference = $2;
173 }
174 | DISABLED bool { this_proto->disabled = $2; }
175 | DEBUG debug_mask { this_proto->debug = $2; }
176 | MRTDUMP mrtdump_mask { this_proto->mrtdump = $2; }
177 | IMPORT imexport { this_proto->in_filter = $2; }
178 | EXPORT imexport { this_proto->out_filter = $2; }
179 | TABLE rtable { this_proto->table = $2; }
180 | ROUTER ID idval { this_proto->router_id = $3; }
181 | DESCRIPTION TEXT { this_proto->dsc = $2; }
182 ;
183
184 imexport:
185 FILTER filter { $$ = $2; }
186 | where_filter
187 | ALL { $$ = FILTER_ACCEPT; }
188 | NONE { $$ = FILTER_REJECT; }
189 ;
190
191 rtable:
192 SYM {
193 if ($1->class != SYM_TABLE) cf_error("Table name expected");
194 $$ = $1->def;
195 }
196 ;
197
198 CF_ADDTO(conf, debug_default)
199
200 debug_default:
201 DEBUG PROTOCOLS debug_mask { new_config->proto_default_debug = $3; }
202 | DEBUG COMMANDS expr { new_config->cli_debug = $3; }
203 ;
204
205 /* MRTDUMP PROTOCOLS is in systep/unix/config.Y */
206
207 /* Interface patterns */
208
209 iface_patt_node_init:
210 /* EMPTY */ {
211 struct iface_patt_node *ipn = cfg_allocz(sizeof(struct iface_patt_node));
212 add_tail(&this_ipatt->ipn_list, NODE ipn);
213 this_ipn = ipn;
214 }
215 ;
216
217 iface_patt_node_body:
218 TEXT { this_ipn->pattern = $1; this_ipn->prefix = IPA_NONE; this_ipn->pxlen = 0; }
219 | prefix_or_ipa { this_ipn->pattern = NULL; this_ipn->prefix = $1.addr; this_ipn->pxlen = $1.len; }
220 | TEXT prefix_or_ipa { this_ipn->pattern = $1; this_ipn->prefix = $2.addr; this_ipn->pxlen = $2.len; }
221 ;
222
223 iface_negate:
224 { this_ipn->positive = 1; }
225 | '-' { this_ipn->positive = 0; }
226 ;
227
228 iface_patt_node:
229 iface_patt_node_init iface_negate iface_patt_node_body
230 ;
231
232
233 iface_patt_list:
234 iface_patt_node
235 | iface_patt_list ',' iface_patt_node
236 ;
237
238
239 /* Direct device route protocol */
240
241 CF_ADDTO(proto, dev_proto '}')
242
243 dev_proto_start: proto_start DIRECT {
244 this_proto = proto_config_new(&proto_device, sizeof(struct rt_dev_config), $1);
245 init_list(&DIRECT_CFG->iface_list);
246 }
247 ;
248
249 dev_proto:
250 dev_proto_start proto_name '{'
251 | dev_proto proto_item ';'
252 | dev_proto dev_iface_patt ';'
253 ;
254
255 dev_iface_init:
256 /* EMPTY */ {
257 this_ipatt = cfg_allocz(sizeof(struct iface_patt));
258 add_tail(&DIRECT_CFG->iface_list, NODE this_ipatt);
259 init_list(&this_ipatt->ipn_list);
260 }
261 ;
262
263 dev_iface_patt:
264 INTERFACE dev_iface_init iface_patt_list
265 ;
266
267 /* Debug flags */
268
269 debug_mask:
270 ALL { $$ = ~0; }
271 | OFF { $$ = 0; }
272 | '{' debug_list '}' { $$ = $2; }
273 ;
274
275 debug_list:
276 debug_flag
277 | debug_list ',' debug_flag { $$ = $1 | $3; }
278 ;
279
280 debug_flag:
281 STATES { $$ = D_STATES; }
282 | ROUTES { $$ = D_ROUTES; }
283 | FILTERS { $$ = D_FILTERS; }
284 | INTERFACES { $$ = D_IFACES; }
285 | EVENTS { $$ = D_EVENTS; }
286 | PACKETS { $$ = D_PACKETS; }
287 ;
288
289 /* MRTDump flags */
290
291 mrtdump_mask:
292 ALL { $$ = ~0; }
293 | OFF { $$ = 0; }
294 | '{' mrtdump_list '}' { $$ = $2; }
295 ;
296
297 mrtdump_list:
298 mrtdump_flag
299 | mrtdump_list ',' mrtdump_flag { $$ = $1 | $3; }
300 ;
301
302 mrtdump_flag:
303 STATES { $$ = MD_STATES; }
304 | MESSAGES { $$ = MD_MESSAGES; }
305 ;
306
307 /* Password lists */
308
309 password_list:
310 PASSWORDS '{' password_items '}'
311 | password_item
312 ;
313
314 password_items:
315 /* empty */
316 | password_item ';' password_items
317 ;
318
319 password_item:
320 password_item_begin '{' password_item_params '}'
321 | password_item_begin
322 ;
323
324 password_item_begin:
325 PASSWORD TEXT {
326 if (!this_p_list) {
327 this_p_list = cfg_alloc(sizeof(list));
328 init_list(this_p_list);
329 password_id = 1;
330 }
331 this_p_item = cfg_alloc(sizeof (struct password_item));
332 this_p_item->password = $2;
333 this_p_item->genfrom = 0;
334 this_p_item->gento = TIME_INFINITY;
335 this_p_item->accfrom = 0;
336 this_p_item->accto = TIME_INFINITY;
337 this_p_item->id = password_id++;
338 add_tail(this_p_list, &this_p_item->n);
339 }
340 ;
341
342 password_item_params:
343 /* empty */ { }
344 | GENERATE FROM datetime ';' password_item_params { this_p_item->genfrom = $3; }
345 | GENERATE TO datetime ';' password_item_params { this_p_item->gento = $3; }
346 | ACCEPT FROM datetime ';' password_item_params { this_p_item->accfrom = $3; }
347 | ACCEPT TO datetime ';' password_item_params { this_p_item->accto = $3; }
348 | ID expr ';' password_item_params { this_p_item->id = $2; if ($2 <= 0) cf_error("Password ID has to be greated than zero."); }
349 ;
350
351
352
353 /* Core commands */
354 CF_CLI_HELP(SHOW, ..., [[Show status information]])
355
356 CF_CLI(SHOW STATUS,,, [[Show router status]])
357 { cmd_show_status(); } ;
358
359 CF_CLI(SHOW MEMORY,,, [[Show memory usage]])
360 { cmd_show_memory(); } ;
361
362 CF_CLI(SHOW PROTOCOLS, proto_patt2, [<protocol> | \"<pattern>\"], [[Show routing protocols]])
363 { proto_apply_cmd($3, proto_cmd_show, 0, 0); } ;
364
365 CF_CLI(SHOW PROTOCOLS ALL, proto_patt2, [<protocol> | \"<pattern>\"], [[Show routing protocol details]])
366 { proto_apply_cmd($4, proto_cmd_show, 0, 1); } ;
367
368 optsym:
369 SYM
370 | /* empty */ { $$ = NULL; }
371 ;
372
373 CF_CLI(SHOW INTERFACES,,, [[Show network interfaces]])
374 { if_show(); } ;
375
376 CF_CLI(SHOW INTERFACES SUMMARY,,, [[Show summary of network interfaces]])
377 { if_show_summary(); } ;
378
379 CF_CLI_HELP(SHOW ROUTE, ..., [[Show routing table]])
380 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]])
381 { rt_show($3); } ;
382
383 r_args:
384 /* empty */ {
385 $$ = cfg_allocz(sizeof(struct rt_show_data));
386 $$->pxlen = 256;
387 $$->filter = FILTER_ACCEPT;
388 $$->table = config->master_rtc->table;
389 }
390 | r_args prefix {
391 $$ = $1;
392 if ($$->pxlen != 256) cf_error("Only one prefix expected");
393 $$->prefix = $2.addr;
394 $$->pxlen = $2.len;
395 }
396 | r_args FOR prefix_or_ipa {
397 $$ = $1;
398 if ($$->pxlen != 256) cf_error("Only one prefix expected");
399 $$->prefix = $3.addr;
400 $$->pxlen = $3.len;
401 $$->show_for = 1;
402 }
403 | r_args TABLE SYM {
404 $$ = $1;
405 if ($3->class != SYM_TABLE) cf_error("%s is not a table", $3->name);
406 $$->table = ((struct rtable_config *)$3->def)->table;
407 }
408 | r_args FILTER filter {
409 $$ = $1;
410 if ($$->filter != FILTER_ACCEPT) cf_error("Filter specified twice");
411 $$->filter = $3;
412 }
413 | r_args where_filter {
414 $$ = $1;
415 if ($$->filter != FILTER_ACCEPT) cf_error("Filter specified twice");
416 $$->filter = $2;
417 }
418 | r_args ALL {
419 $$ = $1;
420 $$->verbose = 1;
421 }
422 | r_args PRIMARY {
423 $$ = $1;
424 $$->primary_only = 1;
425 }
426 | r_args export_or_preexport SYM {
427 struct proto_config *c = (struct proto_config *) $3->def;
428 $$ = $1;
429 if ($$->export_mode) cf_error("Protocol specified twice");
430 if ($3->class != SYM_PROTO || !c->proto) cf_error("%s is not a protocol", $3->name);
431 $$->export_mode = $2;
432 $$->primary_only = 1;
433 $$->export_protocol = c->proto;
434 $$->running_on_config = c->proto->cf->global;
435 }
436 | r_args PROTOCOL SYM {
437 struct proto_config *c = (struct proto_config *) $3->def;
438 $$ = $1;
439 if ($$->show_protocol) cf_error("Protocol specified twice");
440 if ($3->class != SYM_PROTO || !c->proto) cf_error("%s is not a protocol", $3->name);
441 $$->show_protocol = c->proto;
442 $$->running_on_config = c->proto->cf->global;
443 }
444 | r_args STATS {
445 $$ = $1;
446 $$->stats = 1;
447 }
448 | r_args COUNT {
449 $$ = $1;
450 $$->stats = 2;
451 }
452 ;
453
454 export_or_preexport:
455 PREEXPORT { $$ = 1; }
456 | EXPORT { $$ = 2; }
457 ;
458
459
460 CF_CLI_HELP(SHOW ROA, ..., [[Show ROA table]])
461 CF_CLI(SHOW ROA, roa_args, [<prefix> | in <prefix> | for <prefix>] [as <num>] [table <t>], [[Show ROA table]])
462 { roa_show($3); } ;
463
464 roa_args:
465 /* empty */ {
466 $$ = cfg_allocz(sizeof(struct roa_show_data));
467 $$->mode = ROA_SHOW_ALL;
468 $$->table = roa_table_default;
469 if (roa_table_default == NULL)
470 cf_error("No ROA table defined");
471 }
472 | roa_args roa_mode prefix {
473 $$ = $1;
474 if ($$->mode != ROA_SHOW_ALL) cf_error("Only one prefix expected");
475 $$->prefix = $3.addr;
476 $$->pxlen = $3.len;
477 $$->mode = $2;
478 }
479 | roa_args AS NUM {
480 $$ = $1;
481 $$->asn = $3;
482 }
483 | roa_args TABLE SYM {
484 $$ = $1;
485 if ($3->class != SYM_ROA) cf_error("%s is not a ROA table", $3->name);
486 $$->table = ((struct roa_table_config *)$3->def)->table;
487 }
488 ;
489
490 roa_mode:
491 { $$ = ROA_SHOW_PX; }
492 | IN { $$ = ROA_SHOW_IN; }
493 | FOR { $$ = ROA_SHOW_FOR; }
494 ;
495
496
497 CF_CLI_HELP(SHOW SYMBOLS, ..., [[Show all known symbolic names]])
498 CF_CLI(SHOW SYMBOLS, sym_args, [table|filter|function|protocol|template|roa|<symbol>], [[Show all known symbolic names]])
499 { cmd_show_symbols($3); } ;
500
501 sym_args:
502 /* empty */ {
503 $$ = cfg_allocz(sizeof(struct sym_show_data));
504 }
505 | sym_args TABLE { $$ = $1; $$->type = SYM_TABLE; }
506 | sym_args FUNCTION { $$ = $1; $$->type = SYM_FUNCTION; }
507 | sym_args FILTER { $$ = $1; $$->type = SYM_FILTER; }
508 | sym_args PROTOCOL { $$ = $1; $$->type = SYM_PROTO; }
509 | sym_args TEMPLATE { $$ = $1; $$->type = SYM_TEMPLATE; }
510 | sym_args ROA { $$ = $1; $$->type = SYM_ROA; }
511 | sym_args SYM { $$ = $1; $$->sym = $2; }
512 ;
513
514
515 roa_table_arg:
516 /* empty */ {
517 if (roa_table_default == NULL)
518 cf_error("No ROA table defined");
519 $$ = roa_table_default;
520 }
521 | TABLE SYM {
522 if ($2->class != SYM_ROA)
523 cf_error("%s is not a ROA table", $2->name);
524 $$ = ((struct roa_table_config *)$2->def)->table;
525 }
526 ;
527
528 CF_CLI_HELP(ADD, roa ..., [[Add ROA record]])
529 CF_CLI(ADD ROA, prefix MAX NUM AS NUM roa_table_arg, <prefix> max <num> as <num> [table <name>], [[Add ROA record]])
530 {
531 if (! cli_access_restricted())
532 { roa_add_item($8, $3.addr, $3.len, $5, $7, ROA_SRC_DYNAMIC); cli_msg(0, ""); }
533 };
534
535 CF_CLI_HELP(DELETE, roa ..., [[Delete ROA record]])
536 CF_CLI(DELETE ROA, prefix MAX NUM AS NUM roa_table_arg, <prefix> max <num> as <num> [table <name>], [[Delete ROA record]])
537 {
538 if (! cli_access_restricted())
539 { roa_delete_item($8, $3.addr, $3.len, $5, $7, ROA_SRC_DYNAMIC); cli_msg(0, ""); }
540 };
541
542 CF_CLI_HELP(FLUSH, roa [table <name>], [[Removes all dynamic ROA records]])
543 CF_CLI(FLUSH ROA, roa_table_arg, [table <name>], [[Removes all dynamic ROA records]])
544 {
545 if (! cli_access_restricted())
546 { roa_flush($3, ROA_SRC_DYNAMIC); cli_msg(0, ""); }
547 };
548
549
550 CF_CLI_HELP(DUMP, ..., [[Dump debugging information]])
551 CF_CLI(DUMP RESOURCES,,, [[Dump all allocated resource]])
552 { rdump(&root_pool); cli_msg(0, ""); } ;
553 CF_CLI(DUMP SOCKETS,,, [[Dump open sockets]])
554 { sk_dump_all(); cli_msg(0, ""); } ;
555 CF_CLI(DUMP INTERFACES,,, [[Dump interface information]])
556 { if_dump_all(); cli_msg(0, ""); } ;
557 CF_CLI(DUMP NEIGHBORS,,, [[Dump neighbor cache]])
558 { neigh_dump_all(); cli_msg(0, ""); } ;
559 CF_CLI(DUMP ATTRIBUTES,,, [[Dump attribute cache]])
560 { rta_dump_all(); cli_msg(0, ""); } ;
561 CF_CLI(DUMP ROUTES,,, [[Dump routing table]])
562 { rt_dump_all(); cli_msg(0, ""); } ;
563 CF_CLI(DUMP PROTOCOLS,,, [[Dump protocol information]])
564 { protos_dump_all(); cli_msg(0, ""); } ;
565
566 CF_CLI(ECHO, echo_mask echo_size, [all | off | <mask>] [<buffer-size>], [[Configure echoing of log messages]]) {
567 cli_set_log_echo(this_cli, $2, $3);
568 cli_msg(0, "");
569 } ;
570
571 echo_mask:
572 ALL { $$ = ~0; }
573 | OFF { $$ = 0; }
574 | NUM
575 ;
576
577 echo_size:
578 /* empty */ { $$ = 4096; }
579 | NUM {
580 if ($1 < 256 || $1 > 65536) cf_error("Invalid log buffer size");
581 $$ = $1;
582 }
583 ;
584
585 CF_CLI(DISABLE, proto_patt, <protocol> | \"<pattern>\" | all, [[Disable protocol]])
586 { proto_apply_cmd($2, proto_cmd_disable, 1, 0); } ;
587 CF_CLI(ENABLE, proto_patt, <protocol> | \"<pattern>\" | all, [[Enable protocol]])
588 { proto_apply_cmd($2, proto_cmd_enable, 1, 0); } ;
589 CF_CLI(RESTART, proto_patt, <protocol> | \"<pattern>\" | all, [[Restart protocol]])
590 { proto_apply_cmd($2, proto_cmd_restart, 1, 0); } ;
591 CF_CLI(RELOAD, proto_patt, <protocol> | \"<pattern>\" | all, [[Reload protocol]])
592 { proto_apply_cmd($2, proto_cmd_reload, 1, CMD_RELOAD); } ;
593 CF_CLI(RELOAD IN, proto_patt, <protocol> | \"<pattern>\" | all, [[Reload protocol (just imported routes)]])
594 { proto_apply_cmd($3, proto_cmd_reload, 1, CMD_RELOAD_IN); } ;
595 CF_CLI(RELOAD OUT, proto_patt, <protocol> | \"<pattern>\" | all, [[Reload protocol (just exported routes)]])
596 { proto_apply_cmd($3, proto_cmd_reload, 1, CMD_RELOAD_OUT); } ;
597
598 CF_CLI_HELP(DEBUG, ..., [[Control protocol debugging via BIRD logs]])
599 CF_CLI(DEBUG, proto_patt debug_mask, (<protocol> | <pattern> | all) (all | off | { states | routes | filters | interfaces | events | packets }), [[Control protocol debugging via BIRD logs]])
600 { proto_apply_cmd($2, proto_cmd_debug, 1, $3); } ;
601
602 CF_CLI_HELP(MRTDUMP, ..., [[Control protocol debugging via MRTdump files]])
603 CF_CLI(MRTDUMP, proto_patt mrtdump_mask, (<protocol> | <pattern> | all) (all | off | { states | messages }), [[Control protocol debugging via MRTdump format]])
604 { proto_apply_cmd($2, proto_cmd_mrtdump, 1, $3); } ;
605
606 CF_CLI(RESTRICT,,,[[Restrict current CLI session to safe commands]])
607 { this_cli->restricted = 1; cli_msg(16, "Access restricted"); } ;
608
609 proto_patt:
610 SYM { $$.ptr = $1; $$.patt = 0; }
611 | ALL { $$.ptr = NULL; $$.patt = 1; }
612 | TEXT { $$.ptr = $1; $$.patt = 1; }
613 ;
614
615 proto_patt2:
616 SYM { $$.ptr = $1; $$.patt = 0; }
617 | { $$.ptr = NULL; $$.patt = 1; }
618 | TEXT { $$.ptr = $1; $$.patt = 1; }
619 ;
620
621 CF_ADDTO(dynamic_attr, IGP_METRIC
622 { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_GEN_IGP_METRIC); })
623
624
625 CF_CODE
626
627 CF_END