]> git.ipfire.org Git - thirdparty/bird.git/blame - sysdep/unix/krt.c
Pipe protocol supports reconfiguration.
[thirdparty/bird.git] / sysdep / unix / krt.c
CommitLineData
2d140452
MM
1/*
2 * BIRD -- UNIX Kernel Synchronization
3 *
50fe90ed 4 * (c) 1998--2000 Martin Mares <mj@ucw.cz>
2d140452
MM
5 *
6 * Can be freely distributed and used under the terms of the GNU GPL.
7 */
8
9#define LOCAL_DEBUG
10
11#include "nest/bird.h"
12#include "nest/iface.h"
13#include "nest/route.h"
14#include "nest/protocol.h"
15#include "lib/timer.h"
7de45ba4 16#include "conf/conf.h"
2d140452
MM
17
18#include "unix.h"
19#include "krt.h"
20
7de45ba4
MM
21/*
22 * The whole kernel synchronization is a bit messy and touches some internals
23 * of the routing table engine, because routing table maintenance is a typical
24 * example of the proverbial compatibility between different Unices and we want
25 * to keep the overhead of our krt business as low as possible and avoid maintaining
26 * a local routing table copy.
27 *
28 * The kernel syncer can work in three different modes (according to system config header):
29 * o Single routing table, single krt protocol. [traditional Unix]
30 * o Many routing tables, separate krt protocols for all of them.
31 * o Many routing tables, but every scan includes all tables, so we start
32 * separate krt protocols which cooperate with each other. [Linux 2.2]
33 * In this case, we keep only a single scan timer.
34 *
35 * The hacky bits:
36 * o We use FIB node flags to keep track of route synchronization status.
37 * o When starting up, we cheat by looking if there is another kernel
38 * krt instance to be initialized later and performing table scan
39 * only once for all the instances.
40 * o We attach temporary rte's to routing tables.
41 *
42 * If you are brave enough, continue now. You cannot say you haven't been warned.
43 */
44
c10421d3
MM
45static int krt_uptodate(rte *k, rte *e);
46
7e5f5ffd
MM
47/*
48 * Global resources
49 */
50
7de45ba4
MM
51pool *krt_pool;
52
7e5f5ffd
MM
53void
54krt_io_init(void)
55{
7de45ba4 56 krt_pool = rp_new(&root_pool, "Kernel Syncer");
7e5f5ffd
MM
57 krt_if_io_init();
58}
59
60/*
61 * Interfaces
62 */
63
64struct proto_config *cf_kif;
65
66static struct kif_proto *kif_proto;
67static timer *kif_scan_timer;
68static bird_clock_t kif_last_shot;
69
50fe90ed
MM
70static void
71kif_preconfig(struct protocol *P, struct config *c)
72{
73 cf_kif = NULL;
74}
75
7e5f5ffd
MM
76static void
77kif_scan(timer *t)
78{
79 struct kif_proto *p = t->data;
80
81 DBG("KIF: It's interface scan time...\n");
82 kif_last_shot = now;
83 krt_if_scan(p);
84}
85
86static void
87kif_force_scan(void)
88{
89 if (kif_proto && kif_last_shot + 2 < now)
90 {
91 kif_scan(kif_scan_timer);
92 tm_start(kif_scan_timer, ((struct kif_config *) kif_proto->p.cf)->scan_time);
93 }
94}
95
96static struct proto *
97kif_init(struct proto_config *c)
98{
99 struct kif_proto *p = proto_new(c, sizeof(struct kif_proto));
100 return &p->p;
101}
102
103static int
104kif_start(struct proto *P)
105{
106 struct kif_proto *p = (struct kif_proto *) P;
107
108 kif_proto = p;
109 krt_if_start(p);
110
111 /* Start periodic interface scanning */
112 kif_scan_timer = tm_new(P->pool);
113 kif_scan_timer->hook = kif_scan;
114 kif_scan_timer->data = p;
115 kif_scan_timer->recurrent = KIF_CF->scan_time;
116 kif_scan(kif_scan_timer);
117 tm_start(kif_scan_timer, KIF_CF->scan_time);
118
119 return PS_UP;
120}
121
122static int
123kif_shutdown(struct proto *P)
124{
125 struct kif_proto *p = (struct kif_proto *) P;
126
127 tm_stop(kif_scan_timer);
128 krt_if_shutdown(p);
129 kif_proto = NULL;
130
131 if_start_update(); /* Remove all interfaces */
132 if_end_update();
7de45ba4
MM
133 /*
134 * FIXME: Is it really a good idea? It causes routes to be flushed,
135 * but at the same time it avoids sending of these deletions to the kernel,
136 * because krt thinks the kernel itself has already removed the route
137 * when downing the interface. Sad.
138 */
7e5f5ffd
MM
139
140 return PS_DOWN;
141}
142
143struct protocol proto_unix_iface = {
144 name: "Device",
145 priority: 100,
50fe90ed 146 preconfig: kif_preconfig,
7e5f5ffd
MM
147 init: kif_init,
148 start: kif_start,
149 shutdown: kif_shutdown,
150};
2d140452 151
c10421d3
MM
152/*
153 * Inherited Routes
154 */
155
156#ifdef KRT_ALLOW_LEARN
157
158static inline int
159krt_same_key(rte *a, rte *b)
160{
161 return a->u.krt.proto == b->u.krt.proto &&
162 a->u.krt.metric == b->u.krt.metric &&
163 a->u.krt.type == b->u.krt.type;
164}
165
166static void
167krt_learn_announce_update(struct krt_proto *p, rte *e)
168{
169 net *n = e->net;
170 rta *aa = rta_clone(e->attrs);
171 rte *ee = rte_get_temp(aa);
08e2d625 172 net *nn = net_get(p->p.table, n->n.prefix, n->n.pxlen);
c10421d3
MM
173 ee->net = nn;
174 ee->pflags = 0;
175 ee->u.krt = e->u.krt;
4f1a6d27 176 rte_update(p->p.table, nn, &p->p, ee);
c10421d3
MM
177}
178
179static void
180krt_learn_announce_delete(struct krt_proto *p, net *n)
181{
08e2d625 182 n = net_find(p->p.table, n->n.prefix, n->n.pxlen);
c10421d3 183 if (n)
4f1a6d27 184 rte_update(p->p.table, n, &p->p, NULL);
c10421d3
MM
185}
186
187static void
188krt_learn_scan(struct krt_proto *p, rte *e)
189{
190 net *n0 = e->net;
08e2d625 191 net *n = net_get(&p->krt_table, n0->n.prefix, n0->n.pxlen);
c10421d3
MM
192 rte *m, **mm;
193
194 e->attrs->source = RTS_INHERIT;
195
196 for(mm=&n->routes; m = *mm; mm=&m->next)
197 if (krt_same_key(m, e))
198 break;
199 if (m)
200 {
201 if (krt_uptodate(m, e))
202 {
203 DBG("krt_learn_scan: SEEN\n");
204 rte_free(e);
205 m->u.krt.seen = 1;
206 }
207 else
208 {
209 DBG("krt_learn_scan: OVERRIDE\n");
210 *mm = m->next;
211 rte_free(m);
212 m = NULL;
213 }
214 }
215 else
216 DBG("krt_learn_scan: CREATE\n");
217 if (!m)
218 {
219 e->attrs = rta_lookup(e->attrs);
220 e->next = n->routes;
221 n->routes = e;
222 e->u.krt.seen = 1;
223 }
224}
225
c10421d3
MM
226static void
227krt_learn_prune(struct krt_proto *p)
228{
229 struct fib *fib = &p->krt_table.fib;
230 struct fib_iterator fit;
231
232 DBG("Pruning inheritance data...\n");
233
234 FIB_ITERATE_INIT(&fit, fib);
235again:
236 FIB_ITERATE_START(fib, &fit, f)
237 {
238 net *n = (net *) f;
239 rte *e, **ee, *best, **pbest, *old_best;
240
241 old_best = n->routes;
242 best = NULL;
243 pbest = NULL;
244 ee = &n->routes;
245 while (e = *ee)
246 {
247 if (!e->u.krt.seen)
248 {
249 *ee = e->next;
250 rte_free(e);
251 continue;
252 }
253 if (!best || best->u.krt.metric > e->u.krt.metric)
254 {
255 best = e;
256 pbest = ee;
257 }
258 e->u.krt.seen = 0;
259 ee = &e->next;
260 }
261 if (!n->routes)
262 {
263 DBG("%I/%d: deleting\n", n->n.prefix, n->n.pxlen);
264 if (old_best)
265 {
266 krt_learn_announce_delete(p, n);
267 n->n.flags &= ~KRF_INSTALLED;
268 }
269 FIB_ITERATE_PUT(&fit, f);
270 fib_delete(fib, f);
271 goto again;
272 }
273 *pbest = best->next;
274 best->next = n->routes;
275 n->routes = best;
276 if (best != old_best || !(n->n.flags & KRF_INSTALLED))
277 {
278 DBG("%I/%d: announcing (metric=%d)\n", n->n.prefix, n->n.pxlen, best->u.krt.metric);
279 krt_learn_announce_update(p, best);
280 n->n.flags |= KRF_INSTALLED;
281 }
282 else
283 DBG("%I/%d: uptodate (metric=%d)\n", n->n.prefix, n->n.pxlen, best->u.krt.metric);
284 }
285 FIB_ITERATE_END(f);
286}
287
288static void
289krt_learn_async(struct krt_proto *p, rte *e, int new)
290{
291 net *n0 = e->net;
08e2d625 292 net *n = net_get(&p->krt_table, n0->n.prefix, n0->n.pxlen);
c10421d3
MM
293 rte *g, **gg, *best, **bestp, *old_best;
294
295 e->attrs->source = RTS_INHERIT;
296
297 old_best = n->routes;
298 for(gg=&n->routes; g = *gg; gg = &g->next)
299 if (krt_same_key(g, e))
300 break;
301 if (new)
302 {
303 if (g)
304 {
305 if (krt_uptodate(g, e))
306 {
307 DBG("krt_learn_async: same\n");
308 rte_free(e);
309 return;
310 }
311 DBG("krt_learn_async: update\n");
312 *gg = g->next;
313 rte_free(g);
314 }
315 else
316 DBG("krt_learn_async: create\n");
317 e->attrs = rta_lookup(e->attrs);
318 e->next = n->routes;
319 n->routes = e;
320 }
321 else if (!g)
322 {
323 DBG("krt_learn_async: not found\n");
324 rte_free(e);
325 return;
326 }
327 else
328 {
329 DBG("krt_learn_async: delete\n");
330 *gg = g->next;
331 rte_free(e);
332 rte_free(g);
333 }
334 best = n->routes;
335 bestp = &n->routes;
336 for(gg=&n->routes; g=*gg; gg=&g->next)
337 if (best->u.krt.metric > g->u.krt.metric)
338 {
339 best = g;
340 bestp = gg;
341 }
342 if (best)
343 {
344 *bestp = best->next;
345 best->next = n->routes;
346 n->routes = best;
347 }
348 if (best != old_best)
349 {
350 DBG("krt_learn_async: distributing change\n");
351 if (best)
352 {
353 krt_learn_announce_update(p, best);
354 n->n.flags |= KRF_INSTALLED;
355 }
356 else
357 {
358 n->routes = NULL;
359 krt_learn_announce_delete(p, n);
360 n->n.flags &= ~KRF_INSTALLED;
361 }
362 }
363}
364
365static void
366krt_learn_init(struct krt_proto *p)
367{
368 if (KRT_CF->learn)
369 rt_setup(p->p.pool, &p->krt_table, "Inherited");
370}
371
372static void
373krt_dump(struct proto *P)
374{
375 struct krt_proto *p = (struct krt_proto *) P;
376
377 if (!KRT_CF->learn)
378 return;
379 debug("KRT: Table of inheritable routes\n");
380 rt_dump(&p->krt_table);
381}
382
383static void
384krt_dump_attrs(rte *e)
385{
386 debug(" [m=%d,p=%d,t=%d]", e->u.krt.metric, e->u.krt.proto, e->u.krt.type);
387}
388
389#endif
390
2d140452
MM
391/*
392 * Routes
393 */
394
7de45ba4
MM
395#ifdef CONFIG_ALL_TABLES_AT_ONCE
396static timer *krt_scan_timer;
397static int krt_instance_count;
398static list krt_instance_list;
399#endif
400
2d140452
MM
401static void
402krt_flush_routes(struct krt_proto *p)
403{
4f1a6d27 404 struct rtable *t = p->p.table;
2d140452
MM
405
406 DBG("Flushing kernel routes...\n");
2d140452
MM
407 FIB_WALK(&t->fib, f)
408 {
409 net *n = (net *) f;
410 rte *e = n->routes;
411 if (e)
412 {
413 rta *a = e->attrs;
414 if (a->source != RTS_DEVICE && a->source != RTS_INHERIT)
c10421d3 415 krt_set_notify(p, e->net, NULL, e);
2d140452
MM
416 }
417 }
418 FIB_WALK_END;
419}
420
2d140452
MM
421static int
422krt_uptodate(rte *k, rte *e)
423{
424 rta *ka = k->attrs, *ea = e->attrs;
425
426 if (ka->dest != ea->dest)
427 return 0;
428 switch (ka->dest)
429 {
430 case RTD_ROUTER:
431 return ipa_equal(ka->gw, ea->gw);
432 case RTD_DEVICE:
433 return !strcmp(ka->iface->name, ea->iface->name);
434 default:
435 return 1;
436 }
437}
438
439/*
440 * This gets called back when the low-level scanning code discovers a route.
441 * We expect that the route is a temporary rte and its attributes are uncached.
442 */
443
444void
445krt_got_route(struct krt_proto *p, rte *e)
446{
447 rte *old;
448 net *net = e->net;
c10421d3 449 int src = e->u.krt.src;
2d140452
MM
450 int verdict;
451
c10421d3
MM
452#ifdef CONFIG_AUTO_ROUTES
453 if (e->attrs->dest == RTD_DEVICE)
454 {
455 /* It's a device route. Probably a kernel-generated one. */
456 verdict = KRF_IGNORE;
457 goto sentenced;
458 }
459#endif
460
461#ifdef KRT_ALLOW_LEARN
462 if (src == KRT_SRC_ALIEN)
463 {
464 if (KRT_CF->learn)
465 krt_learn_scan(p, e);
466 else
467 DBG("krt_parse_entry: Alien route, ignoring\n");
468 return;
469 }
470#endif
471
472 if (net->n.flags & KRF_VERDICT_MASK)
2d140452
MM
473 {
474 /* Route to this destination was already seen. Strange, but it happens... */
475 DBG("Already seen.\n");
476 return;
477 }
478
c10421d3 479 if (net->n.flags & KRF_INSTALLED)
2d140452 480 {
c10421d3
MM
481 old = net->routes;
482 ASSERT(old);
483 if (krt_uptodate(e, old))
2d140452
MM
484 verdict = KRF_SEEN;
485 else
486 verdict = KRF_UPDATE;
487 }
2d140452
MM
488 else
489 verdict = KRF_DELETE;
490
c10421d3
MM
491sentenced:
492 DBG("krt_parse_entry: verdict=%s\n", ((char *[]) { "CREATE", "SEEN", "UPDATE", "DELETE", "IGNORE" }) [verdict]);
2d140452 493
c10421d3
MM
494 net->n.flags = (net->n.flags & ~KRF_VERDICT_MASK) | verdict;
495 if (verdict == KRF_UPDATE || verdict == KRF_DELETE)
2d140452
MM
496 {
497 /* Get a cached copy of attributes and link the route */
498 rta *a = e->attrs;
499 a->source = RTS_DUMMY;
500 e->attrs = rta_lookup(a);
501 e->next = net->routes;
502 net->routes = e;
503 }
504 else
505 rte_free(e);
506}
507
508static void
509krt_prune(struct krt_proto *p)
510{
511 struct proto *pp = &p->p;
4f1a6d27 512 struct rtable *t = p->p.table;
2d140452
MM
513 struct fib_node *f;
514
7de45ba4 515 DBG("Pruning routes in table %s...\n", t->name);
2d140452
MM
516 FIB_WALK(&t->fib, f)
517 {
518 net *n = (net *) f;
c10421d3 519 int verdict = f->flags & KRF_VERDICT_MASK;
2d140452
MM
520 rte *new, *old;
521
c10421d3 522 if (verdict != KRF_CREATE && verdict != KRF_SEEN && verdict != KRF_IGNORE)
2d140452
MM
523 {
524 old = n->routes;
525 n->routes = old->next;
526 }
527 else
528 old = NULL;
529 new = n->routes;
530
531 switch (verdict)
532 {
533 case KRF_CREATE:
c10421d3 534 if (new && (f->flags & KRF_INSTALLED))
2d140452 535 {
c10421d3
MM
536 DBG("krt_prune: reinstalling %I/%d\n", n->n.prefix, n->n.pxlen);
537 krt_set_notify(p, n, new, NULL);
2d140452
MM
538 }
539 break;
540 case KRF_SEEN:
c10421d3 541 case KRF_IGNORE:
2d140452
MM
542 /* Nothing happens */
543 break;
544 case KRF_UPDATE:
545 DBG("krt_prune: updating %I/%d\n", n->n.prefix, n->n.pxlen);
c10421d3 546 krt_set_notify(p, n, new, old);
2d140452
MM
547 break;
548 case KRF_DELETE:
549 DBG("krt_prune: deleting %I/%d\n", n->n.prefix, n->n.pxlen);
c10421d3 550 krt_set_notify(p, n, NULL, old);
2d140452
MM
551 break;
552 default:
553 bug("krt_prune: invalid route status");
554 }
2d140452
MM
555 if (old)
556 rte_free(old);
c10421d3 557 f->flags &= ~KRF_VERDICT_MASK;
2d140452
MM
558 }
559 FIB_WALK_END;
c10421d3
MM
560
561#ifdef KRT_ALLOW_LEARN
562 if (KRT_CF->learn)
563 krt_learn_prune(p);
564#endif
2d140452
MM
565}
566
e16155ae
MM
567void
568krt_got_route_async(struct krt_proto *p, rte *e, int new)
569{
570 net *net = e->net;
571 rte *old = net->routes;
c10421d3 572 int src = e->u.krt.src;
e16155ae
MM
573
574 switch (src)
575 {
576 case KRT_SRC_BIRD:
577 ASSERT(0);
578 case KRT_SRC_REDIRECT:
579 DBG("It's a redirect, kill him! Kill! Kill!\n");
c10421d3 580 krt_set_notify(p, net, NULL, e);
e16155ae 581 break;
c10421d3
MM
582 case KRT_SRC_ALIEN:
583#ifdef KRT_ALLOW_LEARN
584 if (KRT_CF->learn)
e16155ae 585 {
c10421d3
MM
586 krt_learn_async(p, e, new);
587 return;
e16155ae 588 }
c10421d3
MM
589#endif
590 /* Fall-thru */
591 default:
592 DBG("Discarding\n");
4f1a6d27 593 rte_update(p->p.table, net, &p->p, NULL);
e16155ae 594 }
c10421d3 595 rte_free(e);
e16155ae
MM
596}
597
2d140452
MM
598/*
599 * Periodic scanning
600 */
601
2d140452
MM
602static void
603krt_scan(timer *t)
604{
7de45ba4 605 struct krt_proto *p;
2d140452 606
7e5f5ffd 607 kif_force_scan();
7de45ba4
MM
608#ifdef CONFIG_ALL_TABLES_AT_ONCE
609 {
610 void *q;
611 DBG("KRT: It's route scan time...\n");
612 krt_scan_fire(NULL);
613 WALK_LIST(q, krt_instance_list)
614 {
615 p = SKIP_BACK(struct krt_proto, instance_node, q);
616 krt_prune(p);
617 }
618 }
619#else
620 p = t->data;
621 DBG("KRT: It's route scan time for %s...\n", p->p.name);
7e5f5ffd
MM
622 krt_scan_fire(p);
623 krt_prune(p);
7de45ba4 624#endif
2d140452
MM
625}
626
c10421d3
MM
627/*
628 * Updates
629 */
630
631static void
bb027be1 632krt_notify(struct proto *P, net *net, rte *new, rte *old, struct ea_list *tmpa)
c10421d3
MM
633{
634 struct krt_proto *p = (struct krt_proto *) P;
635
636 if (new && (!krt_capable(new) || new->attrs->source == RTS_INHERIT))
637 new = NULL;
638 if (!(net->n.flags & KRF_INSTALLED))
639 old = NULL;
640 if (new)
641 net->n.flags |= KRF_INSTALLED;
642 else
643 net->n.flags &= ~KRF_INSTALLED;
644 krt_set_notify(p, net, new, old);
645}
646
2d140452
MM
647/*
648 * Protocol glue
649 */
650
7e5f5ffd
MM
651struct proto_config *cf_krt;
652
7de45ba4
MM
653static void
654krt_preconfig(struct protocol *P, struct config *c)
655{
50fe90ed 656 cf_krt = NULL;
7de45ba4
MM
657 krt_scan_preconfig(c);
658}
659
660static void
661krt_postconfig(struct proto_config *C)
662{
663 struct krt_config *c = (struct krt_config *) C;
664
665#ifdef CONFIG_ALL_TABLES_AT_ONCE
666 struct krt_config *first = (struct krt_config *) cf_krt;
667 if (first->scan_time != c->scan_time)
668 cf_error("All kernel syncers must use the same table scan interval");
669#endif
670
671 if (C->table->krt_attached)
672 cf_error("Kernel syncer (%s) already attached to table %s", C->table->krt_attached->name, C->table->name);
673 C->table->krt_attached = C;
674 krt_scan_postconfig(c);
675}
676
677static timer *
678krt_start_timer(struct krt_proto *p)
679{
680 timer *t;
681
682 t = tm_new(p->krt_pool);
683 t->hook = krt_scan;
684 t->data = p;
685 t->recurrent = KRT_CF->scan_time;
686 tm_start(t, KRT_CF->scan_time);
687 return t;
688}
689
2d140452
MM
690static int
691krt_start(struct proto *P)
692{
693 struct krt_proto *p = (struct krt_proto *) P;
7de45ba4
MM
694 int first = 1;
695
696#ifdef CONFIG_ALL_TABLES_AT_ONCE
697 if (!krt_instance_count++)
698 init_list(&krt_instance_list);
699 else
700 first = 0;
701 p->krt_pool = krt_pool;
702 add_tail(&krt_instance_list, &p->instance_node);
703#else
704 p->krt_pool = P->pool;
705#endif
2d140452 706
c10421d3
MM
707#ifdef KRT_ALLOW_LEARN
708 krt_learn_init(p);
709#endif
710
7de45ba4
MM
711 krt_scan_start(p, first);
712 krt_set_start(p, first);
2d140452 713
7e5f5ffd 714 /* Start periodic routing table scanning */
7de45ba4
MM
715#ifdef CONFIG_ALL_TABLES_AT_ONCE
716 if (first)
717 krt_scan_timer = krt_start_timer(p);
718 p->scan_timer = krt_scan_timer;
719 /* If this is the last instance to be initialized, kick the timer */
720 if (!P->proto->startup_counter)
721 krt_scan(p->scan_timer);
722#else
723 p->scan_timer = krt_start_timer(p);
724 krt_scan(p->scan_timer);
725#endif
2d140452
MM
726
727 return PS_UP;
728}
729
7de45ba4 730static int
2d140452
MM
731krt_shutdown(struct proto *P)
732{
733 struct krt_proto *p = (struct krt_proto *) P;
7de45ba4 734 int last = 1;
2d140452 735
7de45ba4
MM
736#ifdef CONFIG_ALL_TABLES_AT_ONCE
737 rem_node(&p->instance_node);
738 if (--krt_instance_count)
739 last = 0;
740 else
741#endif
742 tm_stop(p->scan_timer);
7e5f5ffd 743
2d140452
MM
744 if (!KRT_CF->persist)
745 krt_flush_routes(p);
746
7de45ba4
MM
747 krt_set_shutdown(p, last);
748 krt_scan_shutdown(p, last);
749
750#ifdef CONFIG_ALL_TABLES_AT_ONCE
751 if (last)
752 rfree(krt_scan_timer);
753#endif
2d140452 754
2d140452
MM
755 return PS_DOWN;
756}
757
2d140452
MM
758static struct proto *
759krt_init(struct proto_config *c)
760{
761 struct krt_proto *p = proto_new(c, sizeof(struct krt_proto));
762
c10421d3 763 p->p.rt_notify = krt_notify;
0da472d7 764 p->p.min_scope = SCOPE_HOST;
2d140452
MM
765 return &p->p;
766}
767
768struct protocol proto_unix_kernel = {
769 name: "Kernel",
7e5f5ffd 770 priority: 80,
7de45ba4
MM
771 preconfig: krt_preconfig,
772 postconfig: krt_postconfig,
2d140452
MM
773 init: krt_init,
774 start: krt_start,
775 shutdown: krt_shutdown,
c10421d3
MM
776#ifdef KRT_ALLOW_LEARN
777 dump: krt_dump,
778 dump_attrs: krt_dump_attrs,
779#endif
2d140452 780};