
#-----------------------------------------------------------------------
# DESCRIPTION
#-----------------------------------------------------------------------
#
# Description for users installing this module - where and what it does,
# etc. In this case, tc-clients-template is a blank template you can use
# to create your own modules.
#
# After installing the module, the user should execute rcf with the 
# --update-config parameter. The necessary options will be added to the
# configuration file.
#
#-----------------------------------------------------------------------
# MODULE CONFIGURATION
#-----------------------------------------------------------------------
#
#   #m# {mode#} {...}
#       The module should be included in these modes (0=open, 1=relaxed, 
#       2=strict, 3=paranoid). If this line is omited, the module will
#       be included in all modes. Example: '#m# 23'
#
#   #a# {action} {...}
#       Options which should be listed in the configuration file
#       (accept, ignore, deny, etc.). The more "actions" you use, the
#       longer --update-config will take.
#       
#   #i# {value} {...}
#       Optional interface setting. Use "cluster" to include this module
#       in DMZ/MZ clusters. Use "novirtual" to ignore virtual interfaces.
#
#   #n# {name}
#       A simple name for this module (a-zA-Z0-9 only).
#       Example: '#n# telnet'
#
#   #t# {type}
#       The service type (servers, clients, hostports, etc.).
#
#   #v# {action} {value}
#       For each action, you can specify a default value.
#       Example: '#v# ignore any/0'
#
#   #d# {description}
#       A multi-line description/comment for the config file.
#
#m# 123
#a# accept ignore deny
#i# cluster
#n# template
#t# clients
#v# accept any/0
#v# ignore 1.2.3.0/24 4.5.6.7
#
#   |--------------------------------------------------------------------|
#d# A multi-line description/comment used for the configuration files.
#d# Simply add lines as necessary. The rulers (above/bellow) help you keep
#d# your text within 72 columns.
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------
#
# Global Variables:
#
#   INTOPT      Interface Name (i.e. eth0)
#   IPADDR      IP Address
#   NETMASK     Netmask (i.e. 255.255.255.0)
#   NETWORK     Network IP
#   BROADCAST   Broadcast IP
#   INCHAIN     Input Chain (i.e. eth0i)
#   OUTCHAIN    Output Chain (i.e. eth0o)
#
#-----------------------------------------------------------------------
# If you define new variables and/or functions within a module, you
# should always keep them in lower case. This will avoid any conflicts
# with rcf variables and function names.
#-----------------------------------------------------------------------

module_name="template"      # module name used in options
module_type="clients"       # the module type (clients, servers, etc.)
service_name="My Template"  # displayed on-screen
service_port="12345"        # port number for this service

for action in ignore deny accept
do
	for host in `Option_Value $action $INTOPT $module_name $module_type`
	do
		Hostports $action local tcp "$service_name" $host $service_port
	done
done

unset module_name module_type service_name service_port
unset action host

