File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / bird2 / proto / mrt / config.Y
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 21 16:03:56 2019 UTC (5 years, 5 months ago) by misho
Branches: bird2, MAIN
CVS tags: v2_0_7p0, HEAD
bird2 ver 2.0.7

    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: 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 rtable		{ MRT_CFG->table_cf = $2; }
   36:  | TABLE TEXT		{ MRT_CFG->table_expr = $2; }
   37:  | FILTER filter	{ MRT_CFG->filter = $2; }
   38:  | where_filter		{ MRT_CFG->filter = $1; }
   39:  | FILENAME text	{ MRT_CFG->filename = $2; }
   40:  | PERIOD expr		{ MRT_CFG->period = $2; }
   41:  | ALWAYS ADD PATH bool	{ MRT_CFG->always_add_path = $4; }
   42:  ;
   43: 
   44: mrt_proto_opts:
   45:    /* empty */
   46:  | mrt_proto_opts mrt_proto_item ';'
   47:  ;
   48: 
   49: mrt_proto:
   50:    mrt_proto_start proto_name '{' mrt_proto_opts '}' { mrt_check_config(this_proto); };
   51: 
   52: CF_CLI_HELP(MRT DUMP, [table <name>|\"<pattern>\"] [to \"<file>\"] [filter <filter>|where <where filter>] , [[Save MRT Table Dump into a file]])
   53: 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]])
   54: { mrt_dump_cmd($3); } ;
   55: 
   56: mrt_dump_args:
   57:    /* empty */ { $$ = cfg_allocz(sizeof(struct mrt_dump_data)); }
   58:  | mrt_dump_args TABLE rtable	{ $$ = $1; $$->table_ptr = $3->table; }
   59:  | mrt_dump_args TABLE TEXT	{ $$ = $1; $$->table_expr = $3; }
   60:  | mrt_dump_args FILTER filter	{ $$ = $1; $$->filter = $3; }
   61:  | mrt_dump_args where_filter	{ $$ = $1; $$->filter = $2; }
   62:  | mrt_dump_args TO text 	{ $$ = $1; $$->filename = $3; }
   63:  ;
   64: 
   65: 
   66: CF_CODE
   67: 
   68: CF_END

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>