Annotation of embedaddon/bird/proto/mrt/config.Y, revision 1.1.1.1
1.1 misho 1: /*
2: * BIRD -- Multi-Threaded Routing Toolkit (MRT) Protocol
3: *
4: * (c) 2017--2018 Ondrej Zajicek <santiago@crfreenet.org>
5: * (c) 2017--2018 CZ.NIC z.s.p.o.
6: *
7: * Can be freely distributed and used under the terms of the GNU GPL.
8: */
9:
10: CF_HDR
11:
12: #include "proto/mrt/mrt.h"
13:
14: CF_DEFINES
15:
16: #define MRT_CFG ((struct mrt_config *) this_proto)
17:
18: CF_DECLS
19:
20: CF_KEYWORDS(MRT, TABLE, FILTER, FILENAME, PERIOD, ALWAYS, ADD, PATH, DUMP, TO)
21:
22: %type <md> mrt_dump_args
23:
24: CF_GRAMMAR
25:
26: CF_ADDTO(proto, mrt_proto)
27:
28: mrt_proto_start: proto_start MRT
29: {
30: this_proto = proto_config_new(&proto_mrt, $1);
31: };
32:
33: mrt_proto_item:
34: proto_item
35: | TABLE TEXT { MRT_CFG->table_expr = $2; }
36: | FILTER filter { MRT_CFG->filter = $2; }
37: | where_filter { MRT_CFG->filter = $1; }
38: | FILENAME text { MRT_CFG->filename = $2; }
39: | PERIOD expr { MRT_CFG->period = $2; }
40: | ALWAYS ADD PATH bool { MRT_CFG->always_add_path = $4; }
41: ;
42:
43: mrt_proto_opts:
44: /* empty */
45: | mrt_proto_opts mrt_proto_item ';'
46: ;
47:
48: mrt_proto:
49: mrt_proto_start proto_name '{' mrt_proto_opts '}' { mrt_check_config(this_proto); };
50:
51: CF_CLI_HELP(MRT DUMP, [table <name>|\"<pattern>\"] [to \"<file>\"] [filter <filter>|where <where filter>] , [[Save MRT Table Dump into a file]])
52: CF_CLI(MRT DUMP, mrt_dump_args, [table <name>|\"<pattern>\"] [to \"<file>\"] [filter <filter>|where <where filter>], [[Save mrt table dump v2 of table name <t> right now]])
53: { mrt_dump_cmd($3); } ;
54:
55: mrt_dump_args:
56: /* empty */ { $$ = cfg_allocz(sizeof(struct mrt_dump_data)); }
57: | mrt_dump_args TABLE rtable { $$ = $1; $$->table_ptr = $3->table; }
58: | mrt_dump_args TABLE TEXT { $$ = $1; $$->table_expr = $3; }
59: | mrt_dump_args FILTER filter { $$ = $1; $$->filter = $3; }
60: | mrt_dump_args where_filter { $$ = $1; $$->filter = $2; }
61: | mrt_dump_args TO text { $$ = $1; $$->filename = $3; }
62: ;
63:
64:
65: CF_CODE
66:
67: CF_END
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>