#!/usr/bin/perl -wT
# vim: ft=xml ts=4 sw=4 et:
#----------------------------------------------------------------------
# heading     : Security
# description : Port forwarding
# navigation  : 5000 5400
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# copyright (C) 2002 Mitel Networks Corporation
#
# 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; either version 2 of the License, or
# (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
# Technical support for this program is available from Mitel Networks
# Please visit our web site www.mitel.com/sme/ for details.
#----------------------------------------------------------------------

use strict;
use esmith::FormMagick::Panel::portforwarding;
my $form = esmith::FormMagick::Panel::portforwarding->new();
# Uncomment the next line for debugging purposes.
#$form->debug(1);
$form->display();


__DATA__
<form 
    title="FORM_TITLE" 
    header="/etc/e-smith/web/common/head.tmpl"
    footer="/etc/e-smith/web/common/foot.tmpl">

    <!-- page 0 -->
    <page 
        name="Front"
        pre-event="print_status_message()">
        <description>FIRST_PAGE_DESCRIPTION</description>

        <subroutine src="show_port_forwards()" />
    </page>

    <!-- page 1 -->
    <page
        name="Create"
        pre-event="print_status_message()">
        <description>CREATE_PAGE_DESCRIPTION</description>

        <field
            id="protocol"
            type="select"
            options="'TCP','UDP'">
            <label>LABEL_PROTOCOL</label>
        </field>
        <field
            id="source_port"
            type="text"
            size="11"
            validation="validate_source_port()">
            <label>LABEL_SOURCE_PORT</label>
        </field>
        <field
            id="destination_host"
            type="text"
            size="15"
            validation="validate_destination_host()">
            <label>LABEL_DESTINATION_HOST</label>
        </field>
        <field
            id="destination_port"
            type="text"
            size="11"
            validation="validate_destination_port()">
            <label>LABEL_DESTINATION_PORT</label>
        </field>

        <subroutine src="print_button('NEXT')" />

    </page>

    <!-- page 2 -->
    <page
        name="ShowSummary"
        pre-event="turn_off_buttons()"
        post-event="create_new()">

        <subroutine src="display_summary_create" />
    </page>

    <!-- page 3 
        Note: This page is not used. It's a kludge to permit the next page
        to work properly from a link on the front page. FormMagick needs
        work. 
    -->
    <page
        name="Dummy">
    </page>

    <!-- page 4 -->
    <page
        name="Remove"
        pre-event="turn_off_buttons()"
        post-event="remove_rule()">

        <subroutine src="display_summary_remove" />
    </page>
   
</form>
