<?xml version="1.0" encoding="utf-8" ?>
<packagegui>
	<title>Services/UPnP &amp; NAT-PMP</title>
	<name>miniupnpd</name>
	<version>20100712</version>
	<include_file>/usr/local/pkg/miniupnpd.inc</include_file>
	<menu>
		<name>UPnP &amp; NAT-PMP</name>
		<tooltiptext>Set UPnP &amp; NAT-PMP settings such as interfaces to listen on.</tooltiptext>
		<section>Services</section>
		<url>/pkg_edit.php?xml=miniupnpd.xml&amp;id=0</url>
	</menu>
	<service>
		<name>miniupnpd</name>
		<rcfile>miniupnpd.sh</rcfile>
		<executable>miniupnpd</executable>
	</service>
	<fields>
		<field>
			<name>UPnP &amp; NAT-PMP Settings</name>
			<type>listtopic</type>
			<enablefields>enable_upnp,enable_natpmp,ext_iface,iface_array,download,upload,overridewanip,upnpqueue,logpackets,sysuptime,permdefault</enablefields>
		</field>
		<field>
			<fielddescr>Enable</fielddescr>
			<fieldname>enable</fieldname>
			<type>checkbox</type>
			<enablefields>enable_upnp,enable_natpmp,ext_iface,iface_array,download,upload,overridewanip,upnpqueue,logpackets,sysuptime,permdefault</enablefields>
			<sethelp>Enable UPnP &amp; NAT-PMP</sethelp>
		</field>
		<field>
			<fielddescr>UPnP Port Mapping</fielddescr>
			<fieldname>enable_upnp</fieldname>
			<type>checkbox</type>
			<description>Allow UPnP Port Mapping</description>
			<sethelp>This protocol is often used by Microsoft-compatible systems.</sethelp>
		</field>
		<field>
			<fielddescr>NAT-PMP Port Mapping</fielddescr>
			<fieldname>enable_natpmp</fieldname>
			<type>checkbox</type>
			<description>Allow NAT-PMP Port Mapping</description>
			<sethelp>This protocol is often used by Apple-compatible systems.</sethelp>
		</field>
		<field>
			<fielddescr>External Interface</fielddescr>
			<fieldname>ext_iface</fieldname>
			<default_value>wan</default_value>
			<type>interfaces_selection</type>
			<hideinterfaceregex>loopback</hideinterfaceregex>
			<description>Select only the primary WAN interface (interface with the default gateway). Only one interface may be chosen.</description>
			<required/>
		</field>
		<field>
			<fielddescr>Interfaces</fielddescr>
			<fieldname>iface_array</fieldname>
			<default_value>lan</default_value>
			<type>interfaces_selection</type>
			<description>Select the internal interfaces, such as LAN, where UPnP/NAT-PMP clients reside. Use the CTRL or COMMAND key to select multiple interfaces.</description>
			<required/>
			<multiple/>
		</field>
		<field>
			<fielddescr>Download Speed</fielddescr>
			<fieldname>download</fieldname>
			<description>Set the Maximum Download Speed in Kbits/second.</description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Upload Speed</fielddescr>
			<fieldname>upload</fieldname>
			<description>Set the Maximum Upload Speed in Kbits/second.</description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Override WAN address</fielddescr>
			<fieldname>overridewanip</fieldname>
			<description>Use an alternate WAN address to accept inbound connections, such as an IP Alias or CARP Virtual IP address.</description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Traffic Shaping</fielddescr>
			<fieldname>upnpqueue</fieldname>
			<description>Enter the ALTQ traffic shaping queue in which the connections should be placed.</description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Log packets</fielddescr>
			<fieldname>logpackets</fieldname>
			<type>checkbox</type>
			<description>Log packets handled by UPnP &amp; NAT-PMP rules.</description>
		</field>
		<field>
			<fielddescr>Uptime</fielddescr>
			<fieldname>sysuptime</fieldname>
			<type>checkbox</type>
			<description>Use system uptime instead of UPnP &amp; NAT-PMP service uptime.</description>
		</field>
		<field>
			<fielddescr>Default Deny</fielddescr>
			<fieldname>permdefault</fieldname>
			<type>checkbox</type>
			<description>Deny access to UPnP &amp; NAT-PMP by default.</description>
		</field>
		<field>
			<name>UPnP Access Control Lists</name>
			<type>listtopic</type>
		</field>
		<field>
			<name>ACL Help</name>
			<type>info</type>
			<description>
			These entries control access to the UPnP service. Client systems may be granted or denied access based on several criteria.
			&lt;br /&gt;&lt;br /&gt;
			Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/CIDR] [int port or range]
			&lt;br /&gt;Example: allow 1024-65535 192.168.0.0/24 1024-65535</description>
		</field>
		<field>
			<fielddescr>ACL Entries</fielddescr>
			<fieldname>none</fieldname>
			<type>rowhelper</type>
			<rowhelper>
				<rowhelperfield>
					<fieldname>permuser</fieldname>
					<type>input</type>
					<size>60</size>
				</rowhelperfield>
			</rowhelper>
		</field>
	</fields>
	<custom_php_command_before_form>
		before_form_miniupnpd($pkg);
	</custom_php_command_before_form>
	<custom_php_validation_command>
		validate_form_miniupnpd($_POST, $input_errors);
	</custom_php_validation_command>
	<custom_php_resync_config_command>
		sync_package_miniupnpd();
	</custom_php_resync_config_command>
</packagegui>
