1998-10-18 19:53:21 +08:00
|
|
|
/*
|
|
|
|
* BIRD -- Unix Routing Table Scanning and Syncing
|
|
|
|
*
|
|
|
|
* (c) 1998 Martin Mares <mj@ucw.cz>
|
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
#define LOCAL_DEBUG
|
|
|
|
|
|
|
|
#include "nest/bird.h"
|
|
|
|
#include "nest/iface.h"
|
|
|
|
#include "nest/route.h"
|
|
|
|
#include "nest/protocol.h"
|
|
|
|
#include "lib/timer.h"
|
|
|
|
|
|
|
|
#include "unix.h"
|
1998-10-18 20:50:43 +08:00
|
|
|
#include "krt.h"
|
1998-10-18 19:53:21 +08:00
|
|
|
|
1998-12-07 01:40:42 +08:00
|
|
|
struct proto *cf_krt_proto;
|
|
|
|
|
1998-10-18 19:53:21 +08:00
|
|
|
void
|
1998-10-18 20:50:43 +08:00
|
|
|
krt_start(struct proto *P)
|
1998-10-18 19:53:21 +08:00
|
|
|
{
|
1998-10-18 20:50:43 +08:00
|
|
|
struct krt_proto *p = (struct krt_proto *) P;
|
|
|
|
krt_scan_start(p);
|
1998-12-09 02:37:58 +08:00
|
|
|
krt_if_start(p);
|
1998-10-18 19:53:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-18 20:50:43 +08:00
|
|
|
krt_shutdown(struct proto *P, int time)
|
1998-10-18 19:53:21 +08:00
|
|
|
{
|
1998-10-18 20:50:43 +08:00
|
|
|
struct krt_proto *p = (struct krt_proto *) P;
|
|
|
|
krt_scan_shutdown(p);
|
1998-12-09 02:37:58 +08:00
|
|
|
krt_if_shutdown(p);
|
1998-10-18 19:53:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-18 20:50:43 +08:00
|
|
|
krt_preconfig(struct protocol *x)
|
1998-10-18 19:53:21 +08:00
|
|
|
{
|
1998-10-18 20:50:43 +08:00
|
|
|
struct krt_proto *p = (struct krt_proto *) proto_new(&proto_unix_kernel, sizeof(struct krt_proto));
|
1998-10-18 19:53:21 +08:00
|
|
|
|
1998-12-07 01:40:42 +08:00
|
|
|
cf_krt_proto = &p->p;
|
1998-10-18 20:50:43 +08:00
|
|
|
p->p.preference = DEF_PREF_UKR;
|
|
|
|
p->p.start = krt_start;
|
|
|
|
p->p.shutdown = krt_shutdown;
|
|
|
|
krt_scan_preconfig(p);
|
|
|
|
krt_set_preconfig(p);
|
1998-12-09 02:37:58 +08:00
|
|
|
krt_if_preconfig(p);
|
1998-10-18 19:53:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
struct protocol proto_unix_kernel = {
|
|
|
|
{ NULL, NULL },
|
|
|
|
"kernel",
|
|
|
|
0,
|
1998-10-18 20:50:43 +08:00
|
|
|
NULL, /* init */
|
|
|
|
krt_preconfig,
|
|
|
|
NULL /* postconfig */
|
1998-10-18 19:53:21 +08:00
|
|
|
};
|