diff options
author | Martin Mares <mj@ucw.cz> | 1998-04-22 14:58:34 +0200 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1998-04-22 14:58:34 +0200 |
commit | 58ef912c6babf1866193ab04674a5866dd761f13 (patch) | |
tree | 244af1a4acb9feac08b45800587a06653a6ff264 /nest/protocol.h | |
parent | b60f7489148d021cb541414b8788f795ec4378fa (diff) | |
download | bird-58ef912c6babf1866193ab04674a5866dd761f13.tar bird-58ef912c6babf1866193ab04674a5866dd761f13.zip |
First look at data structures. More to come tomorrow...
Diffstat (limited to 'nest/protocol.h')
-rw-r--r-- | nest/protocol.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/nest/protocol.h b/nest/protocol.h new file mode 100644 index 0000000..adca114 --- /dev/null +++ b/nest/protocol.h @@ -0,0 +1,66 @@ +/* + * BIRD Internet Routing Daemon -- Protocols + * + * (c) 1998 Martin Mares <mj@ucw.cz> + * + * Can be freely distributed and used under the terms of the GNU GPL. + */ + +#ifndef _BIRD_PROTOCOL_H_ +#define _BIRD_PROTOCOL_H_ + +#include <lib/resource.h> + +/* + * Routing Protocol + */ + +struct protocol { + char *name; + unsigned type; /* ??? List values ??? */ + unsigned debug; /* Default debugging flags */ + + void (*init)(struct protocol *); /* Boot time */ + void (*preconfig)(struct protocol *); /* Just before configuring */ + void (*postconfig)(struct protocol *); /* After configuring */ +}; + +void protos_init(void); +void protos_preconfig(void); +void protos_postconfig(void); + +/* + * Known protocols + */ + +extern struct protocol proto_static; + +/* + * Routing Protocol Instance + */ + +struct proto { + struct proto *next; + struct protocol *proto; /* Protocol */ + char *name; /* Name of this instance */ + unsigned debug; /* Debugging flags */ + pool *pool; /* Local objects */ + unsigned preference; /* Default route preference */ + + void (*if_notify)(struct proto *, struct iface *old, struct iface *new); + void (*rt_notify)(struct proto *, struct rte *old, struct rte *new); + void (*debug)(struct proto *); /* Debugging dump */ + void (*start)(struct proto *); /* Start the instance */ + void (*shutdown)(struct proto *, int time); /* Stop the instance */ + + /* Reconfigure function? */ + /* Interface patterns */ + /* Input/output filters */ + /* Connection to routing tables? */ + + /* Hic sunt protocol-specific data */ +}; + +void *proto_new(struct protocol *, unsigned size); + +#endif |