summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/Makefile5
-rw-r--r--sysdep/unix/Modules12
-rw-r--r--sysdep/unix/config.Y2
-rw-r--r--sysdep/unix/io.c6
-rw-r--r--sysdep/unix/krt.Y2
-rw-r--r--sysdep/unix/krt.c9
-rw-r--r--sysdep/unix/krt.h5
-rw-r--r--sysdep/unix/log.c2
-rw-r--r--sysdep/unix/main.c6
-rw-r--r--sysdep/unix/unix.h6
10 files changed, 25 insertions, 30 deletions
diff --git a/sysdep/unix/Makefile b/sysdep/unix/Makefile
new file mode 100644
index 00000000..c5d55431
--- /dev/null
+++ b/sysdep/unix/Makefile
@@ -0,0 +1,5 @@
+src := io.c krt.c log.c main.c random.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
+$(conf-y-targets): $(s)krt.Y
diff --git a/sysdep/unix/Modules b/sysdep/unix/Modules
deleted file mode 100644
index 2c6514df..00000000
--- a/sysdep/unix/Modules
+++ /dev/null
@@ -1,12 +0,0 @@
-log.c
-main.c
-timer.h
-io.c
-unix.h
-endian.h
-config.Y
-random.c
-
-krt.c
-krt.h
-krt.Y
diff --git a/sysdep/unix/config.Y b/sysdep/unix/config.Y
index f9a92900..ebadd454 100644
--- a/sysdep/unix/config.Y
+++ b/sysdep/unix/config.Y
@@ -8,7 +8,7 @@
CF_HDR
-#include "lib/unix.h"
+#include "sysdep/unix/unix.h"
#include <stdio.h>
CF_DECLS
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 37e26c9b..4db6abb7 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -32,14 +32,14 @@
#include "nest/bird.h"
#include "lib/lists.h"
#include "lib/resource.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
#include "lib/socket.h"
#include "lib/event.h"
#include "lib/string.h"
#include "nest/iface.h"
-#include "lib/unix.h"
-#include "lib/sysio.h"
+#include "sysdep/unix/unix.h"
+#include CONFIG_INCLUDE_SYSIO_H
/* Maximum number of calls of tx handler for one socket in one
* poll iteration. Should be small enough to not monopolize CPU by
diff --git a/sysdep/unix/krt.Y b/sysdep/unix/krt.Y
index 1cd73502..91317d97 100644
--- a/sysdep/unix/krt.Y
+++ b/sysdep/unix/krt.Y
@@ -8,7 +8,7 @@
CF_HDR
-#include "lib/krt.h"
+#include "sysdep/unix/krt.h"
CF_DEFINES
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index b0a96613..6531bb28 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -56,7 +56,7 @@
#include "nest/route.h"
#include "nest/protocol.h"
#include "filter/filter.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
#include "conf/conf.h"
#include "lib/string.h"
@@ -345,18 +345,15 @@ krt_learn_announce_update(struct krt_proto *p, rte *e)
net *n = e->net;
rta *aa = rta_clone(e->attrs);
rte *ee = rte_get_temp(aa);
- net *nn = net_get(p->p.main_channel->table, n->n.addr);
- ee->net = nn;
ee->pflags = 0;
ee->u.krt = e->u.krt;
- rte_update(&p->p, nn, ee);
+ rte_update(&p->p, n->n.addr, ee);
}
static void
krt_learn_announce_delete(struct krt_proto *p, net *n)
{
- n = net_find(p->p.main_channel->table, n->n.addr);
- rte_update(&p->p, n, NULL);
+ rte_update(&p->p, n->n.addr, NULL);
}
/* Called when alien route is discovered during scan */
diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h
index e968ad57..cb404de3 100644
--- a/sysdep/unix/krt.h
+++ b/sysdep/unix/krt.h
@@ -15,7 +15,8 @@ struct krt_proto;
struct kif_config;
struct kif_proto;
-#include "lib/krt-sys.h"
+#include "sysdep/config.h"
+#include CONFIG_INCLUDE_KRTSYS_H
/* Flags stored in net->n.flags, rest are in nest/route.h */
@@ -111,7 +112,7 @@ struct kif_proto {
struct kif_state sys; /* Sysdep state */
};
-struct kif_proto *kif_proto;
+extern struct kif_proto *kif_proto;
#define KIF_CF ((struct kif_config *)p->p.cf)
diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c
index b90bbbd2..43d98f7b 100644
--- a/sysdep/unix/log.c
+++ b/sysdep/unix/log.c
@@ -26,7 +26,7 @@
#include "nest/mrtdump.h"
#include "lib/string.h"
#include "lib/lists.h"
-#include "lib/unix.h"
+#include "sysdep/unix/unix.h"
static FILE *dbgf;
static list *current_log_list;
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index f95bd968..691fee2d 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -69,7 +69,7 @@ async_dump(void)
*/
#ifdef CONFIG_RESTRICTED_PRIVILEGES
-#include "lib/syspriv.h"
+#include CONFIG_INCLUDE_SYSPRIV_H
#else
static inline void
@@ -569,6 +569,10 @@ sysdep_shutdown_done(void)
* Signals
*/
+volatile int async_config_flag;
+volatile int async_dump_flag;
+volatile int async_shutdown_flag;
+
static void
handle_sighup(int sig UNUSED)
{
diff --git a/sysdep/unix/unix.h b/sysdep/unix/unix.h
index 414b6ca4..80c99350 100644
--- a/sysdep/unix/unix.h
+++ b/sysdep/unix/unix.h
@@ -91,9 +91,9 @@ int sockaddr_read(sockaddr *sa, int af, ip_addr *a, struct iface **ifa, uint *po
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path))
#endif
-volatile int async_config_flag;
-volatile int async_dump_flag;
-volatile int async_shutdown_flag;
+extern volatile int async_config_flag;
+extern volatile int async_dump_flag;
+extern volatile int async_shutdown_flag;
void io_init(void);
void io_loop(void);