Annotation of embedaddon/bird2/proto/perf/config.Y, revision 1.1
1.1 ! misho 1: /*
! 2: * BIRD -- Benchmarking Dummy Protocol Configuration
! 3: *
! 4: * (c) 2018 Maria Matejka <mq@jmq.cz>
! 5: *
! 6: * Can be freely distributed and used under the terms of the GNU GPL.
! 7: */
! 8:
! 9: CF_HDR
! 10:
! 11: #include "filter/filter.h"
! 12: #include "proto/perf/perf.h"
! 13:
! 14: CF_DEFINES
! 15:
! 16: #define PERF_CFG ((struct perf_config *) this_proto)
! 17:
! 18: CF_DECLS
! 19:
! 20: CF_KEYWORDS(PERF, EXP, FROM, TO, REPEAT, THRESHOLD, MIN, MAX, KEEP, MODE, IMPORT, EXPORT)
! 21:
! 22: CF_GRAMMAR
! 23:
! 24: proto: perf_proto '}' ;
! 25:
! 26: perf_proto_start: proto_start PERF
! 27: {
! 28: this_proto = proto_config_new(&proto_perf, $1);
! 29: PERF_CFG->from = 10;
! 30: PERF_CFG->to = 20;
! 31: PERF_CFG->repeat = 4;
! 32: PERF_CFG->threshold_max = 500 MS_;
! 33: PERF_CFG->threshold_min = 1 MS_;
! 34: PERF_CFG->attrs_per_rte = 0;
! 35: PERF_CFG->keep = 0;
! 36: PERF_CFG->mode = PERF_MODE_IMPORT;
! 37: };
! 38:
! 39: perf_proto:
! 40: perf_proto_start proto_name '{'
! 41: | perf_proto perf_proto_item ';'
! 42: | perf_proto proto_item ';'
! 43: ;
! 44:
! 45: perf_proto_item:
! 46: proto_channel { this_proto->net_type = $1->net_type; }
! 47: | EXP FROM NUM { PERF_CFG->from = $3; }
! 48: | EXP TO NUM { PERF_CFG->to = $3; }
! 49: | REPEAT NUM { PERF_CFG->repeat = $2; }
! 50: | THRESHOLD MIN expr_us { PERF_CFG->threshold_min = $3; }
! 51: | THRESHOLD MAX expr_us { PERF_CFG->threshold_max = $3; }
! 52: | ATTRIBUTES NUM { PERF_CFG->attrs_per_rte = $2; }
! 53: | KEEP bool { PERF_CFG->keep = $2; }
! 54: | MODE IMPORT { PERF_CFG->mode = PERF_MODE_IMPORT; }
! 55: | MODE EXPORT { PERF_CFG->mode = PERF_MODE_EXPORT; }
! 56: ;
! 57:
! 58:
! 59: CF_CODE
! 60:
! 61: CF_END
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>