Revision 10d807d0 sysdep/unix/sync-rt.c

View differences:

sysdep/unix/sync-rt.c
1 1
/*
2 2
 *	BIRD -- Unix Routing Table Scanning and Syncing
3 3
 *
4
 *	(c) 1998 Martin Mares <mj@ucw.cz>
4
 *	(c) 1998--1999 Martin Mares <mj@ucw.cz>
5 5
 *
6 6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7 7
 */
......
23 23
#include "unix.h"
24 24
#include "krt.h"
25 25

  
26
struct proto *cf_krt_proto;
26
struct proto_config *cf_krt;
27 27

  
28
void
29
krt_start(struct proto *P)
28
static int
29
krt_start(struct proto *p)
30 30
{
31
  struct krt_proto *p = (struct krt_proto *) P;
32
  krt_scan_start(p);
33
  krt_if_start(p);
31
  struct krt_proto *k = (struct krt_proto *) p;
32

  
33
  krt_scan_start(k);
34
  krt_set_start(k);
35
  krt_if_start(k);
36
  return PS_UP;
37
}
38

  
39
int
40
krt_shutdown(struct proto *p)
41
{
42
  struct krt_proto *k = (struct krt_proto *) p;
43

  
44
  krt_scan_shutdown(k);
45
  krt_if_shutdown(k);
46
  return PS_DOWN;
34 47
}
35 48

  
36
void
37
krt_shutdown(struct proto *P, int time)
49
static void
50
krt_preconfig(struct protocol *x, struct config *c)
38 51
{
39
  struct krt_proto *p = (struct krt_proto *) P;
40
  krt_scan_shutdown(p);
41
  krt_if_shutdown(p);
52
  struct krt_config *z = proto_config_new(&proto_unix_kernel, sizeof(struct krt_config));
53

  
54
  cf_krt = &z->c;
55
  z->c.preference = DEF_PREF_UKR;
56
  krt_scan_preconfig(z);
57
  krt_set_preconfig(z);
58
  krt_if_preconfig(z);
42 59
}
43 60

  
44
void
45
krt_preconfig(struct protocol *x)
61
static struct proto *
62
krt_init(struct proto_config *c)
46 63
{
47
  struct krt_proto *p = (struct krt_proto *) proto_new(&proto_unix_kernel, sizeof(struct krt_proto));
64
  struct krt_proto *p = proto_new(c, sizeof(struct krt_proto));
48 65

  
49
  cf_krt_proto = &p->p;
50
  p->p.preference = DEF_PREF_UKR;
51
  p->p.start = krt_start;
52
  p->p.shutdown = krt_shutdown;
53
  krt_scan_preconfig(p);
54
  krt_set_preconfig(p);
55
  krt_if_preconfig(p);
66
  return &p->p;
56 67
}
57 68

  
58 69
struct protocol proto_unix_kernel = {
59
  { NULL, NULL },
60
  "kernel",
61
  0,
62
  NULL,					/* init */
63
  krt_preconfig,
64
  NULL					/* postconfig */
70
  name:		"Kernel",
71
  preconfig:	krt_preconfig,
72
  init:		krt_init,
73
  start:	krt_start,
74
  shutdown:	krt_shutdown,
65 75
};

Also available in: Unified diff