aboutsummaryrefslogtreecommitdiffstats
path: root/pingu_host.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-07-21 13:03:12 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2011-07-21 13:31:15 +0200
commit4e3d2e3093b9dcbb7d37ee3f18db8d6fa54f0deb (patch)
tree180f87fc5f167469fd66b7188cc611634ca50355 /pingu_host.c
parentb1817e210a434bec5543c574c6846f6e114426a5 (diff)
downloadpingu-4e3d2e3093b9dcbb7d37ee3f18db8d6fa54f0deb.tar.bz2
pingu-4e3d2e3093b9dcbb7d37ee3f18db8d6fa54f0deb.tar.xz
pingu: add initial code to modify routing tables
For now we just create the alternate routing tables from table 10 and +1 for each new interface. First interface is 10, second is 11 etc.
Diffstat (limited to 'pingu_host.c')
-rw-r--r--pingu_host.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pingu_host.c b/pingu_host.c
index 50aa914..da14858 100644
--- a/pingu_host.c
+++ b/pingu_host.c
@@ -22,6 +22,7 @@ int default_required_replies = 2;
char *default_up_action = NULL;
char *default_down_action = NULL;
char *default_route_script = NULL;
+int default_route_table = 10;
/* note: this overwrite the line buffer */
static void parse_line(char *line, char **key, char **value)
@@ -112,6 +113,8 @@ int pingu_host_read_config(const char *file)
default_down_action = xstrdup(value);
} else if (strcmp(key, "route-script") == 0) {
default_route_script = xstrdup(value);
+ } else if (strcmp(key, "route-table") == 0) {
+ default_route_table = atoi(value);
} else
log_error("host not specified");
} else if (strcmp(key, "interface") == 0) {
@@ -136,6 +139,8 @@ int pingu_host_read_config(const char *file)
p->source_ip = xstrdup(value);
} else if (strcmp(key, "interval") == 0) {
p->burst_interval = atof(value);
+ } else if (strcmp(key, "route-table") == 0) {
+ p->iface_route_table = atoi(value);
} else {
log_error("Unknown keyword '%s' on line %i", key,
lineno);