Move 'if_match()' from lib.base to lib.config

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5195 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-01-03 18:49:02 +00:00
parent 07157df943
commit 4fe788319f
2 changed files with 19 additions and 19 deletions

View File

@ -612,25 +612,6 @@ chain_exists() # $1 = chain name
qt $IPTABLES -L $1 -n
}
#
# Loosly Match the name of an interface
#
if_match() # $1 = Name in interfaces file - may end in "+"
# $2 = Full interface name - may also end in "+"
{
local pattern=${1%+}
case $1 in
*+)
test "x$(echo $2 | truncate ${#pattern} )" = "x${pattern}"
;;
*)
test "x$1" = "x$2"
;;
esac
}
#
# Find the value 'dev' in the passed arguments then echo the next value
#

View File

@ -956,6 +956,25 @@ both_ip_ranges() # $1 = Source address or range, $2 = dest address or range
echo "$rangeprefix $rangematch $setprefix $setmatch"
}
#
# Loosly Match the name of an interface
#
if_match() # $1 = Name in interfaces file - may end in "+"
# $2 = Full interface name - may also end in "+"
{
local pattern=${1%+}
case $1 in
*+)
test "x$(echo $2 | truncate ${#pattern} )" = "x${pattern}"
;;
*)
test "x$1" = "x$2"
;;
esac
}
#
# We allow hosts to be specified by IP address or by physdev. These two functions
# are used to produce the proper match in a netfilter rule.