]> git.ipfire.org Git - people/ms/network.git/commitdiff
Throw the old GREEN/RED/ORANGE schema over board.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 May 2012 19:36:35 +0000 (19:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 May 2012 19:36:35 +0000 (19:36 +0000)
However, this is not a very good idea at this
level anymore. The colours may confuse and the
difference between them is not very huge at all.

So from now on, there will be lanN and uplN
which represent local networks and uplinks respectively.

functions.constants
functions.zone

index b73b92671cb00e53394dc5844e8098259c1d7bbe..04da262fe4931c64ce28e36b3159384f1e9a8860 100644 (file)
@@ -66,8 +66,11 @@ DISCOVER_OK=0
 DISCOVER_ERROR=1
 DISCOVER_NOT_SUPPORTED=2
 
-# The user is able to create zones that begin with these names
-VALID_ZONES="green orange red grey"
+# The user is able to create zones that begin
+# with these names followed by a number.
+ZONE_LOCAL="lan"
+ZONE_NONLOCAL="upl"
+VALID_ZONES="${ZONE_LOCAL} ${ZONE_NONLOCAL}"
 
 SYS_CLASS_NET="/sys/class/net"
 
index 79c6e0c060804b2fd16ac30b44dbbfb1bab6ca31..defed8dd0333f1a53b425a44cde0a92ce7b6f213 100644 (file)
@@ -57,15 +57,13 @@ function zone_name_is_valid() {
 function zone_is_local() {
        local zone=${1}
 
-       ! zone_is_nonlocal ${zone}
+       [[ "${zone:0:${#ZONE_LOCAL}}" = "${ZONE_LOCAL}" ]]
 }
 
 function zone_is_nonlocal() {
        local zone=${1}
 
-       assert isset zone
-
-       [[ ${zone} =~ ^red[0-9]{1,5} ]]
+       [[ "${zone:0:${#ZONE_NONLOCAL}}" = "${ZONE_NONLOCAL}" ]]
 }
 
 function zone_get_hook() {