functions.m4, local.m4: Introduce more kinds of hosts.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 15 Mar 2012 02:47:52 +0000 (02:47 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 20 Apr 2012 21:03:38 +0000 (22:03 +0100)
functions.m4
local.m4

index 27bacc6..c3609a5 100644 (file)
@@ -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 ...
index 357043b..54d0c86 100644 (file)
--- 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