mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-22 13:39:06 +01:00
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:
parent
07157df943
commit
4fe788319f
@ -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
|
||||
#
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user