From: Mark Wooding Date: Thu, 15 Mar 2012 02:47:52 +0000 (+0000) Subject: functions.m4, local.m4: Introduce more kinds of hosts. X-Git-Url: https://git.distorted.org.uk/~mdw/firewall/commitdiff_plain/183dccdc8d5a96039eb838f5afe3bcc82c24d781 functions.m4, local.m4: Introduce more kinds of hosts. --- diff --git a/functions.m4 b/functions.m4 index 3de471e..89715a4 100644 --- a/functions.m4 +++ b/functions.m4 @@ -513,14 +513,19 @@ host () { defhost () { host=$1 addword allhosts $host - eval host_type_$host=endsys + eval host_type_$host=server } -## router +## hosttype TYPE ## -## Declare the host to be a router, so it should forward packets and so on. -router () { - eval host_type_$host=router +## Declare the host to have the given type. +hosttype () { + type=$1 + case $type in + router | server | client) ;; + *) echo >&2 "$0: bad host type \`$type'"; exit 1 ;; + esac + eval host_type_$host=$type } ## iface IFACE NET ... diff --git a/local.m4 b/local.m4 index c479ed8..0705fb2 100644 --- a/local.m4 +++ b/local.m4 @@ -76,7 +76,7 @@ defnet housebdry virtual ## House hosts. defhost radius - router + hosttype router iface eth0 dmz unsafe safe iface eth1 dmz unsafe safe iface eth2 safe @@ -91,7 +91,7 @@ defhost artist iface eth0 dmz unsafe iface eth1 dmz unsafe defhost vampire - router + hosttype router iface eth0.0 dmz unsafe safe default iface eth0.1 dmz unsafe safe default iface eth0.2 safe @@ -105,6 +105,7 @@ defhost ibanez iface br-unsafe unsafe defhost gibson + hosttype client iface eth0 unsafe ## Colocated networks. @@ -125,7 +126,7 @@ defhost fender iface br-jump jump colo iface br-colo jump colo defhost precision - router + hosttype router iface eth0 jump colo iface eth1 jump colo iface vpn-+ vpn