2 * BIRD -- UNIX Kernel Syncer Configuration
4 * (c) 1998--2000 Martin Mares <mj@ucw.cz>
6 * Can be freely distributed and used under the terms of the GNU GPL.
15 #define THIS_KRT ((struct krt_config *) this_proto)
16 #define THIS_KIF ((struct kif_config *) this_proto)
20 CF_KEYWORDS(KERNEL, PERSIST, SCAN, TIME, LEARN, DEVICE, ROUTES, GRACEFUL, RESTART, KRT_SOURCE, KRT_METRIC)
24 /* Kernel syncer protocol */
26 CF_ADDTO(proto, kern_proto '}')
28 kern_proto_start: proto_start KERNEL { this_proto = krt_init_config($1); }
31 CF_ADDTO(kern_proto, kern_proto_start proto_name '{')
32 CF_ADDTO(kern_proto, kern_proto proto_item ';')
33 CF_ADDTO(kern_proto, kern_proto kern_item ';')
36 PERSIST bool { THIS_KRT->persist = $2; }
38 /* Scan time of 0 means scan on startup only */
39 THIS_KRT->scan_time = $3;
43 #ifndef KRT_ALLOW_LEARN
45 cf_error("Learning of kernel routes not supported in this configuration");
48 | DEVICE ROUTES bool { THIS_KRT->devroutes = $3; }
49 | GRACEFUL RESTART bool { THIS_KRT->graceful_restart = $3; }
52 /* Kernel interface protocol */
54 CF_ADDTO(proto, kif_proto '}')
56 kif_proto_start: proto_start DEVICE { this_proto = kif_init_config($1); }
59 CF_ADDTO(kif_proto, kif_proto_start proto_name '{')
60 CF_ADDTO(kif_proto, kif_proto proto_item ';')
61 CF_ADDTO(kif_proto, kif_proto kif_item ';')
65 /* Scan time of 0 means scan on startup only */
66 THIS_KIF->scan_time = $3;
68 | PRIMARY text_or_none prefix_or_ipa {
69 struct kif_primary_item *kpi = cfg_alloc(sizeof (struct kif_primary_item));
71 kpi->prefix = $3.addr;
73 add_tail(&THIS_KIF->primary, &kpi->n);
77 CF_ADDTO(dynamic_attr, KRT_SOURCE { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_KRT_SOURCE); })
78 CF_ADDTO(dynamic_attr, KRT_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_KRT_METRIC); })