diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-05 09:37:27 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-05 09:46:34 +0200 |
commit | dcd2b0e077ff2995660f15ef28580e8a002c5c5f (patch) | |
tree | a1e67a24467e5c9600fe738994cb7090ba6917d4 /pingu.c | |
parent | aff9e3e9c991544a8ade2b576da3690dc0dbb071 (diff) | |
download | pingu-dcd2b0e077ff2995660f15ef28580e8a002c5c5f.tar.bz2 pingu-dcd2b0e077ff2995660f15ef28580e8a002c5c5f.tar.xz |
pingu: implement new config format
New format allows users to define interfaces and ping hosts separately.
This means we can run pingu in routing-only mode to set up and manage
route tables for multi-isp.
We allow the user config a preferred alternate route table for each
interface. If not configured, pingu will pick one.
Example interface definition looks like:
interface eth0 {
route-table 10
}
Example host definition looks like:
host 192.168.0.1 {
bind-interface eth0
}
Diffstat (limited to 'pingu.c')
-rw-r--r-- | pingu.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -12,13 +12,11 @@ #include <ev.h> -#include "icmp.h" -#include "pingu.h" -#include "xlib.h" #include "log.h" -#include "list.h" +#include "pingu_conf.h" #include "pingu_host.h" +#include "pingu_iface.h" #include "pingu_netlink.h" #ifndef DEFAULT_CONFIG @@ -146,7 +144,16 @@ int main(int argc, char *argv[]) log_init(verbose); loop = ev_default_loop(0); - pingu_host_init(loop, config_file); + + if (pingu_conf_read(config_file) < 0) + return 1; + + if (pingu_iface_init(loop) < 0) + return 1; + + if (pingu_host_init(loop) < 0) + return 1; + kernel_init(loop); if (pingu_daemonize) { |