summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
Diffstat (limited to 'proto')
-rw-r--r--proto/bfd/Makefile9
-rw-r--r--proto/bfd/io.h2
-rw-r--r--proto/bgp/Makefile9
-rw-r--r--proto/ospf/Makefile9
-rw-r--r--proto/ospf/ospf.h2
-rw-r--r--proto/ospf/rt.c7
-rw-r--r--proto/pipe/Makefile10
-rw-r--r--proto/pipe/pipe.c5
-rw-r--r--proto/radv/Makefile9
-rw-r--r--proto/radv/radv.h2
-rw-r--r--proto/rip/Makefile9
-rw-r--r--proto/rip/rip.c8
-rw-r--r--proto/rip/rip.h2
-rw-r--r--proto/static/Makefile10
-rw-r--r--proto/static/static.c10
15 files changed, 39 insertions, 64 deletions
diff --git a/proto/bfd/Makefile b/proto/bfd/Makefile
index c28cedec..489216d8 100644
--- a/proto/bfd/Makefile
+++ b/proto/bfd/Makefile
@@ -1,5 +1,4 @@
-source=bfd.c packets.c io.c
-root-rel=../../
-dir-name=proto/bfd
-
-include ../../Rules
+src := bfd.c io.c packets.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/proto/bfd/io.h b/proto/bfd/io.h
index 641ee054..45836f84 100644
--- a/proto/bfd/io.h
+++ b/proto/bfd/io.h
@@ -12,7 +12,7 @@
#include "lib/resource.h"
#include "lib/event.h"
#include "lib/socket.h"
-// #include "lib/timer.h"
+// #include "sysdep/unix/timer.h"
typedef struct timer2
diff --git a/proto/bgp/Makefile b/proto/bgp/Makefile
index a634cf0d..f4958867 100644
--- a/proto/bgp/Makefile
+++ b/proto/bgp/Makefile
@@ -1,5 +1,4 @@
-source=bgp.c attrs.c packets.c
-root-rel=../../
-dir-name=proto/bgp
-
-include ../../Rules
+src := attrs.c bgp.c packets.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/proto/ospf/Makefile b/proto/ospf/Makefile
index f90222cf..fe52ed30 100644
--- a/proto/ospf/Makefile
+++ b/proto/ospf/Makefile
@@ -1,5 +1,4 @@
-source=ospf.c topology.c packet.c hello.c neighbor.c iface.c dbdes.c lsreq.c lsupd.c lsack.c lsalib.c rt.c
-root-rel=../../
-dir-name=proto/ospf
-
-include ../../Rules
+src := dbdes.c hello.c iface.c lsack.c lsalib.c lsreq.c lsupd.c neighbor.c ospf.c packet.c rt.c topology.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index 3d70df7b..4f445f07 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -18,7 +18,7 @@
#include "lib/lists.h"
#include "lib/slists.h"
#include "lib/socket.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
#include "lib/resource.h"
#include "nest/protocol.h"
#include "nest/iface.h"
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 0855f21f..5538f4c8 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -1973,7 +1973,6 @@ again1:
if (reload || ort_changed(nf, &a0))
{
- net *ne = net_get(p->p.main_channel->table, nf->fn.addr);
rta *a = rta_lookup(&a0);
rte *e = rte_get_temp(a);
@@ -1984,11 +1983,10 @@ again1:
e->u.ospf.tag = nf->old_tag = nf->n.tag;
e->u.ospf.router_id = nf->old_rid = nf->n.rid;
e->pflags = 0;
- e->net = ne;
DBG("Mod rte type %d - %N via %I on iface %s, met %d\n",
a0.source, nf->fn.addr, a0.gw, a0.iface ? a0.iface->name : "(none)", nf->n.metric1);
- rte_update(&p->p, ne, e);
+ rte_update(&p->p, nf->fn.addr, e);
}
}
else if (nf->old_rta)
@@ -1997,8 +1995,7 @@ again1:
rta_free(nf->old_rta);
nf->old_rta = NULL;
- net *ne = net_get(p->p.main_channel->table, nf->fn.addr);
- rte_update(&p->p, ne, NULL);
+ rte_update(&p->p, nf->fn.addr, NULL);
}
/* Remove unused rt entry, some special entries are persistent */
diff --git a/proto/pipe/Makefile b/proto/pipe/Makefile
index 77de5b88..c258a3e5 100644
--- a/proto/pipe/Makefile
+++ b/proto/pipe/Makefile
@@ -1,6 +1,4 @@
-source=pipe.c
-root-rel=../../
-dir-name=proto/pipe
-
-include ../../Rules
-
+src := pipe.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c
index f3df3e71..d40b3f91 100644
--- a/proto/pipe/pipe.c
+++ b/proto/pipe/pipe.c
@@ -50,7 +50,6 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
struct channel *dst = (src_ch == p->pri) ? p->sec : p->pri;
struct rte_src *src;
- net *nn;
rte *e;
rta a;
@@ -64,7 +63,6 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
return;
}
- nn = net_get(dst->table, n->n.addr);
if (new)
{
memcpy(&a, new->attrs, sizeof(rta));
@@ -73,7 +71,6 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
a.eattrs = attrs;
a.hostentry = NULL;
e = rte_get_temp(&a);
- e->net = nn;
e->pflags = 0;
/* Copy protocol specific embedded attributes. */
@@ -90,7 +87,7 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
}
src_ch->table->pipe_busy = 1;
- rte_update2(dst, nn, e, src);
+ rte_update2(dst, n->n.addr, e, src);
src_ch->table->pipe_busy = 0;
}
diff --git a/proto/radv/Makefile b/proto/radv/Makefile
index efc4d4af..3584a5f3 100644
--- a/proto/radv/Makefile
+++ b/proto/radv/Makefile
@@ -1,5 +1,4 @@
-source=radv.c packets.c
-root-rel=../../
-dir-name=proto/radv
-
-include ../../Rules
+src := packets.c radv.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/proto/radv/radv.h b/proto/radv/radv.h
index f8aa421d..735aa218 100644
--- a/proto/radv/radv.h
+++ b/proto/radv/radv.h
@@ -13,7 +13,7 @@
#include "lib/ip.h"
#include "lib/lists.h"
#include "lib/socket.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
#include "lib/resource.h"
#include "nest/protocol.h"
#include "nest/iface.h"
diff --git a/proto/rip/Makefile b/proto/rip/Makefile
index d2d3c987..6e645cc2 100644
--- a/proto/rip/Makefile
+++ b/proto/rip/Makefile
@@ -1,5 +1,4 @@
-source=rip.c packets.c
-root-rel=../../
-dir-name=proto/rip
-
-include ../../Rules
+src := packets.c rip.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 22023279..131c09ce 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -143,8 +143,6 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en)
if (rt)
{
/* Update */
- net *n = net_get(p->p.main_channel->table, en->n.addr);
-
rta a0 = {
.src = p->p.main_source,
.source = RTS_RIP,
@@ -204,16 +202,14 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en)
e->u.rip.metric = rt_metric;
e->u.rip.tag = rt_tag;
- e->net = n;
e->pflags = 0;
- rte_update(&p->p, n, e);
+ rte_update(&p->p, en->n.addr, e);
}
else
{
/* Withdraw */
- net *n = net_find(p->p.main_channel->table, en->n.addr);
- rte_update(&p->p, n, NULL);
+ rte_update(&p->p, en->n.addr, NULL);
}
}
diff --git a/proto/rip/rip.h b/proto/rip/rip.h
index d1c9933c..7ec7e24d 100644
--- a/proto/rip/rip.h
+++ b/proto/rip/rip.h
@@ -24,7 +24,7 @@
#include "lib/resource.h"
#include "lib/socket.h"
#include "lib/string.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
#define RIP_V1 1
diff --git a/proto/static/Makefile b/proto/static/Makefile
index 61fadbea..3ace39cf 100644
--- a/proto/static/Makefile
+++ b/proto/static/Makefile
@@ -1,6 +1,4 @@
-source=static.c
-root-rel=../../
-dir-name=proto/static
-
-include ../../Rules
-
+src := static.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/proto/static/static.c b/proto/static/static.c
index 6239fccb..28cb1e77 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -60,7 +60,6 @@ p_igp_table(struct proto *p)
static void
static_install(struct proto *p, struct static_route *r, struct iface *ifa)
{
- net *n;
rta a;
rte *e;
@@ -112,15 +111,13 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa)
/* We skip rta_lookup() here */
- n = net_get(p->main_channel->table, r->net);
e = rte_get_temp(&a);
- e->net = n;
e->pflags = 0;
if (r->cmds)
f_eval_rte(r->cmds, &e, static_lp);
- rte_update(p, n, e);
+ rte_update(p, r->net, e);
r->installed = 1;
if (r->cmds)
@@ -130,14 +127,11 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa)
static void
static_remove(struct proto *p, struct static_route *r)
{
- net *n;
-
if (!r->installed)
return;
DBG("Removing static route %N via %I\n", r->net, r->via);
- n = net_find(p->main_channel->table, r->net);
- rte_update(p, n, NULL);
+ rte_update(p, r->net, NULL);
r->installed = 0;
}