mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Changes OSPF to generate stub networks for non-primary addresses.
Also does some reorganization in RT LSA announcement.
This commit is contained in:
@@ -76,6 +76,9 @@
|
||||
#include <stdlib.h>
|
||||
#include "ospf.h"
|
||||
|
||||
|
||||
static void ospf_rt_notify(struct proto *p, net * n, rte * new, rte * old UNUSED, ea_list * attrs);
|
||||
static void ospf_ifa_notify(struct proto *p, unsigned flags, struct ifa *a);
|
||||
static int ospf_rte_better(struct rte *new, struct rte *old);
|
||||
static int ospf_rte_same(struct rte *new, struct rte *old);
|
||||
static void ospf_disp(timer *timer);
|
||||
@@ -124,6 +127,9 @@ ospf_start(struct proto *p)
|
||||
po->disp_timer->hook = ospf_disp;
|
||||
po->disp_timer->recurrent = po->tick;
|
||||
tm_start(po->disp_timer, 1);
|
||||
po->lsab_size = 256;
|
||||
po->lsab_used = 0;
|
||||
po->lsab = mb_alloc(p->pool, po->lsab_size);
|
||||
init_list(&(po->iface_list));
|
||||
init_list(&(po->area_list));
|
||||
fib_init(&po->rtf, p->pool, sizeof(ort), 16, ospf_rt_initort);
|
||||
@@ -227,6 +233,7 @@ ospf_init(struct proto_config *c)
|
||||
p->accept_ra_types = RA_OPTIMAL;
|
||||
p->rt_notify = ospf_rt_notify;
|
||||
p->if_notify = ospf_iface_notify;
|
||||
p->ifa_notify = ospf_ifa_notify;
|
||||
p->rte_better = ospf_rte_better;
|
||||
p->rte_same = ospf_rte_same;
|
||||
|
||||
@@ -429,7 +436,7 @@ ospf_shutdown(struct proto *p)
|
||||
return PS_DOWN;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
ospf_rt_notify(struct proto *p, net * n, rte * new, rte * old UNUSED,
|
||||
ea_list * attrs)
|
||||
{
|
||||
@@ -473,6 +480,25 @@ ospf_rt_notify(struct proto *p, net * n, rte * new, rte * old UNUSED,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ospf_ifa_notify(struct proto *p, unsigned flags, struct ifa *a)
|
||||
{
|
||||
struct proto_ospf *po = (struct proto_ospf *) p;
|
||||
struct ospf_iface *ifa;
|
||||
|
||||
if ((a->flags & IA_SECONDARY) || (a->flags & IA_UNNUMBERED))
|
||||
return;
|
||||
|
||||
WALK_LIST(ifa, po->iface_list)
|
||||
{
|
||||
if (ifa->iface == a->iface)
|
||||
{
|
||||
schedule_rt_lsa(ifa->oa);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ospf_get_status(struct proto *p, byte * buf)
|
||||
{
|
||||
|
Reference in New Issue
Block a user