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/4eb9f4dfa52db009403bf7a0c018cb5d75ed0052 functions.m4, local.m4: Introduce more kinds of hosts. --- diff --git a/functions.m4 b/functions.m4 index 27bacc6..c3609a5 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 357043b..54d0c86 100644 --- a/local.m4 +++ b/local.m4 @@ -71,7 +71,7 @@ defnet housebdry virtual ## House hosts. defhost radius - router + hosttype router iface eth0 dmz unsafe safe iface eth1 dmz unsafe safe iface eth2 safe @@ -86,7 +86,7 @@ defhost artist iface eth0 dmz unsafe iface eth1 dmz unsafe defhost vampire - router + hosttype router iface eth0.0 dmz unsafe safe iface eth0.1 dmz unsafe safe iface eth0.2 safe @@ -100,6 +100,7 @@ defhost ibanez iface br-unsafe unsafe defhost gibson + hosttype client iface eth0 unsafe ## Colocated networks. @@ -120,7 +121,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-vampire housebdry vpn