
#-----------------------------------------------------------------------
# Copyright (C) 2000-2001, Jean-Sebastien Morisset <jsmoriss@mvlan.net>
#-----------------------------------------------------------------------
# $Id: accept_hostports.sh,v 1.5 2001/09/02 22:06:44 jsmoriss Exp $
#-----------------------------------------------------------------------
#  $RCSfile: accept_hostports.sh,v $
#   $Author: jsmoriss $
# $Revision: 1.5 $
#     $Date: 2001/09/02 22:06:44 $
#   $Locker:  $ 
#     $Name:  $
#-----------------------------------------------------------------------
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by 
# the Free Software Foundation <http://www.gnu.org/copyleft/gpl.txt>.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License (LICENSE file in archive) for more details.
#
#-----------------------------------------------------------------------
# README
#-----------------------------------------------------------------------
#
# A bourne shell function used by rcf; a very secure, fast, and complete
# firewall for linux <http://jsmoriss.mvlan.net/linux/rcf.html>.
#
#-----------------------------------------------------------------------
# FUNCTION
#-----------------------------------------------------------------------

Accept_Hostports () {
	#
	# This function expects each host to have an accompanying port number.
	#
	# Syntax:
	#   Accept_Hostports [local|remote] {prot} {description} {hosts and ports}
	#
	# Examples:
	#   Accept_Hostports local tcp "HTTP" any/0 www
	#   Accept_Hostports local tcp "My Game" first.friend.com 1234:1240 1666, second.friend.com 1234

	arg_1="`echo $1|To_Lower`"
	arg_2="$2"
	arg_3="$3"
	shift 3

	case "$arg_1" in
		local|remote)
			Hostports accept "$arg_1" "$arg_2" "$arg_3" $*
			;;
		*)	echo "Accept_Hostports [local|remote] {prot} {description} {hosts and ports}"
			return
			;;
	esac
}

