1998-04-22 12:58:34 +00:00
|
|
|
/*
|
|
|
|
* 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_
|
|
|
|
|
1998-05-20 11:54:33 +00:00
|
|
|
#include "lib/lists.h"
|
1998-04-28 14:39:34 +00:00
|
|
|
#include "lib/resource.h"
|
1998-04-22 12:58:34 +00:00
|
|
|
|
1998-05-20 11:54:33 +00:00
|
|
|
struct iface;
|
|
|
|
struct rte;
|
|
|
|
struct neighbor;
|
|
|
|
struct rtattr;
|
|
|
|
|
1998-04-22 12:58:34 +00:00
|
|
|
/*
|
|
|
|
* 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 {
|
1998-05-20 11:54:33 +00:00
|
|
|
node n;
|
1998-04-22 12:58:34 +00:00
|
|
|
struct protocol *proto; /* Protocol */
|
|
|
|
char *name; /* Name of this instance */
|
|
|
|
unsigned debug; /* Debugging flags */
|
|
|
|
pool *pool; /* Local objects */
|
|
|
|
unsigned preference; /* Default route preference */
|
|
|
|
|
1998-05-20 11:54:33 +00:00
|
|
|
void (*if_notify)(struct proto *, struct iface *new, struct iface *old);
|
|
|
|
void (*rt_notify)(struct proto *, struct rte *new, struct rte *old);
|
1998-05-03 16:42:45 +00:00
|
|
|
void (*neigh_lost_notify)(struct proto *, struct neighbor *neigh);
|
1998-05-20 11:54:33 +00:00
|
|
|
void (*dump)(struct proto *); /* Debugging dump */
|
1998-04-22 12:58:34 +00:00
|
|
|
void (*start)(struct proto *); /* Start the instance */
|
|
|
|
void (*shutdown)(struct proto *, int time); /* Stop the instance */
|
|
|
|
|
1998-05-20 11:54:33 +00:00
|
|
|
int (*rta_same)(struct rtattr *, struct rtattr *);
|
|
|
|
int (*rte_better)(struct rte *, struct rte *);
|
|
|
|
|
1998-04-22 12:58:34 +00:00
|
|
|
/* Reconfigure function? */
|
|
|
|
/* Interface patterns */
|
|
|
|
/* Input/output filters */
|
|
|
|
/* Connection to routing tables? */
|
|
|
|
|
|
|
|
/* Hic sunt protocol-specific data */
|
|
|
|
};
|
|
|
|
|
|
|
|
void *proto_new(struct protocol *, unsigned size);
|
|
|
|
|
1998-05-20 11:54:33 +00:00
|
|
|
extern list proto_list;
|
|
|
|
|
1998-04-22 12:58:34 +00:00
|
|
|
#endif
|