<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
<packagegui>
	<copyright>
<![CDATA[	
/* $Id$ */
/* ========================================================================== */
/*
	freeradiusauthorizedmacs.xml
	part of pfSense (http://www.pfSense.com)
	Copyright (C) 2013 Alexander Wilke <nachtfalkeaw@web.de>
	All rights reserved.

	Based on m0n0wall (http://m0n0.ch/wall)
	Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
	All rights reserved.
									      */
/* ========================================================================== */
/*
	Redistribution and use in source and binary forms, with or without
	modification, are permitted provided that the following conditions are met:

	1. Redistributions of source code must retain the above copyright notice,
	   this list of conditions and the following disclaimer.

	2. Redistributions in binary form must reproduce the above copyright
	   notice, this list of conditions and the following disclaimer in the
	   documentation and/or other materials provided with the distribution.

	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
									      */
/* ========================================================================== */
]]>	</copyright>
	<description><![CDATA[Describe your package here]]></description>
	<requirements>Describe your package requirements here</requirements>
	<faq>Currently there are no FAQ items provided.</faq>
	<name>freeradiusauthorizedmacs</name>
	<version>2.1.12</version>
	<title>FreeRADIUS: MACs</title>
	<include_file>/usr/local/pkg/freeradius.inc</include_file>
	<menu>
		<name>FreeRADIUS</name>
		<tooltiptext>Modify FreeRADIUS macs, clients, and settings.</tooltiptext>
		<section>Services</section>
		<url>/pkg.php?xml=freeradiusauthorizedmacs.xml</url>
	</menu>
	<service>
		<name>radiusd</name>
		<rcfile>radiusd.sh</rcfile>
		<executable>radiusd</executable>
		<description><![CDATA[FreeRADIUS Server]]></description>
	</service>

	<tabs>
		<tab>
			<text>Users</text>
			<url>/pkg.php?xml=freeradius.xml</url>
		</tab>
		<tab>
			<text>MACs</text>
			<url>/pkg.php?xml=freeradiusauthorizedmacs.xml</url>
			<active/>
		</tab>
		<tab>
			<text>NAS / Clients</text>
			<url>/pkg.php?xml=freeradiusclients.xml</url>
		</tab>
		<tab>
			<text>Interfaces</text>
			<url>/pkg.php?xml=freeradiusinterfaces.xml</url>
		</tab>
		<tab>
			<text>Settings</text>
			<url>/pkg_edit.php?xml=freeradiussettings.xml&amp;id=0</url>
		</tab>
		<tab>
			<text>EAP</text>
			<url>/pkg_edit.php?xml=freeradiuseapconf.xml&amp;id=0</url>
		</tab>
		<tab>
			<text>SQL</text>
			<url>/pkg_edit.php?xml=freeradiussqlconf.xml&amp;id=0</url>
		</tab>
		<tab>
			<text>Certificates</text>
			<url>/pkg_edit.php?xml=freeradiuscerts.xml&amp;id=0</url>
		</tab>
		<tab>
			<text>LDAP</text>
			<url>/pkg_edit.php?xml=freeradiusmodulesldap.xml&amp;id=0</url>
		</tab>
		<tab>
			<text>View config</text>
			<url>/freeradius_view_config.php</url>
		</tab>
		<tab>
			<text>XMLRPC Sync</text>
			<url>/pkg_edit.php?xml=freeradiussync.xml&amp;id=0</url>
		</tab>
	</tabs>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradius.inc</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/www/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradius_view_config.php</item>
	</additional_files_needed>	
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiusclients.xml</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiussettings.xml</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiuseapconf.xml</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiussqlconf.xml</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiusinterfaces.xml</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiuscerts.xml</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiussync.xml</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiusmodulesldap.xml</item>
	</additional_files_needed>
	<additional_files_needed>
		<prefix>/usr/local/pkg/</prefix>
		<chmod>0755</chmod>
		<item>http://www.pfsense.org/packages/config/freeradius2/freeradiusauthorizedmacs.xml</item>
	</additional_files_needed>
	<adddeleteeditpagefields>
		<columnitem>
			<fielddescr>MAC Address</fielddescr>
			<fieldname>varmacsaddress</fieldname>
		</columnitem>
		<columnitem>
			<fielddescr>Simult. Connections</fielddescr>
			<fieldname>varmacssimultaneousconnect</fieldname>
		</columnitem>
		<columnitem>
			<fielddescr>IP Address</fielddescr>
			<fieldname>varmacsframedipaddress</fieldname>
		</columnitem>
		<columnitem>
			<fielddescr>Expiration Date</fielddescr>
			<fieldname>varmacsexpiration</fieldname>
		</columnitem>
		<columnitem>
			<fielddescr>Session Timeout</fielddescr>
			<fieldname>varmacssessiontimeout</fieldname>
		</columnitem>
		<columnitem>
			<fielddescr>Possible Login Times</fielddescr>
			<fieldname>varmacslogintime</fieldname>
		</columnitem>
		<columnitem>
			<fielddescr>VLAN ID</fielddescr>
			<fieldname>varmacsvlanid</fieldname>
		</columnitem>
		<columnitem>
			<fielddescr>Description</fielddescr>
			<fieldname>description</fieldname>
		</columnitem>
		<movable>on</movable>
	</adddeleteeditpagefields>
	<fields>
		<field>
			<name>GENERAL CONFIGURATION</name>
			<type>listtopic</type>
		</field>
		<field>
			<fielddescr>sortable</fielddescr>
			<fieldname>sortable</fieldname>
			<display_maximum_rows>0</display_maximum_rows>
			<type>sorting</type>
			<include_filtering_inputbox/>
			<sortablefields>
				<item><name>MAC Address</name><fieldname>varmacsaddress</fieldname><regex>/%FILTERTEXT%/i</regex></item>
				<item><name>Simultaneous Connections</name><fieldname>varmacssimultaneousconnect</fieldname><regex>/%FILTERTEXT%/i</regex></item>
				<item><name>IP Address</name><fieldname>varmacsframedipaddress</fieldname><regex>/%FILTERTEXT%/i</regex></item>
				<item><name>Expiration Date</name><fieldname>varmacsexpiration</fieldname><regex>/%FILTERTEXT%/i</regex></item>
				<item><name>Session Timeout</name><fieldname>varmacssessiontimeout</fieldname><regex>/%FILTERTEXT%/i</regex></item>
				<item><name>Possible Login Times</name><fieldname>varmacslogintime</fieldname><regex>/%FILTERTEXT%/i</regex></item>
				<item><name>VLAN ID</name><fieldname>varmacsvlanid</fieldname><regex>/%FILTERTEXT%/i</regex></item>
				<item><name>Description</name><fieldname>description</fieldname><regex>/%FILTERTEXT%/i</regex></item>
			</sortablefields>
		</field>
		<field>
			<fielddescr>MAC Address</fielddescr>
			<fieldname>varmacsaddress</fieldname>
			<description><![CDATA[Enter the MAC address.Format must be: 0a-1b-2c-4d-5f-fa<br>If you do not want to use MAC address but custom options then leave this field empty.]]></description>
			<type>input</type>
		</field>
		<field>
			<name>MISCELLANEOUS CONFIGURATION</name>
			<type>listtopic</type>
		</field>		
		<field>
			<fielddescr>Redirection URL</fielddescr>
			<fieldname>varmacsswisprredirectionurl</fieldname>			
			<description><![CDATA[Enter the URL the MAC should be redirected to after successfull login. (e.g.: http://www.google.com)]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Number of simultaneous connections</fielddescr>
			<fieldname>varmacssimultaneousconnect</fieldname>
			<description><![CDATA[The maximum of simultaneous connections with this MAC address. If you leave this field empty than there is no limit. If you are using FreeRADIUS with CaptivePortal you should leave this empty. Read the documentation!]]></description>
			<default_value></default_value>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Description</fielddescr>
			<fieldname>description</fieldname>			
			<description><![CDATA[Enter any description for this MAC address you like.]]></description>
			<type>input</type>
		</field>
		<field>
			<name>NETWORK CONFIGURATION</name>
			<type>listtopic</type>
		</field>
		<field>
			<fielddescr>IP Address</fielddescr>
			<fieldname>varmacsframedipaddress</fieldname>
			<description><![CDATA[<b>Framed-IP-Address</b> must be supported by NAS.<br><br>
							If you want this MAC address to be assigned a specific IP address from radius, enter the IP address here.<br>
							Continuous IP address is available with "+" suffix (e.g. 192.168.1.5+). Could be useful for simultaneous connections.<br><br>
							<b>IMPORTANT:</b> You must enter an IP address here if you checked "RADIUS issued IP" on VPN PPTP or VPN PPPoE configuration.]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Subnet Mask</fielddescr>
			<fieldname>varmacsframedipnetmask</fieldname>			
			<description><![CDATA[<b>Framed-IP-Netmask</b> must be supported by NAS. (e.g. 255.255.255.0)]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Gateway</fielddescr>
			<fieldname>varmacsframedroute</fieldname>			
			<description><![CDATA[<b>Framed-Route</b> must be supported by NAS. Format is: Subnet Gateway Metric (e.g. 192.168.10.0 192.168.10.1 1).]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>VLAN ID</fielddescr>
			<fieldname>varmacsvlanid</fieldname>			
			<description><![CDATA[Enter the VLAN ID (integer from 1-4095) or the VLAN name that this MAC address should be assigned to.<br>
								Must be supported by the NAS.<br>
								This setting can be used for a NAS that supports the following RADIUS parameters:<br><br>
								
								Tunnel-Type = VLAN<br>
								Tunnel-Medium-Type = IEEE-802<br>
								Tunnel-Private-Group-ID = "<b>THIS IS YOUR INPUT</b>"]]></description>
			<type>input</type>
		</field>		
		<field>
			<name>TIME CONFIGURATION</name>
			<type>listtopic</type>
		</field>
		<field>
			<fielddescr>Expiration Date</fielddescr>
			<fieldname>varmacsexpiration</fieldname>			
			<description><![CDATA[Enter the date when this account should expire. Format is: Mmm dd yyyy (e.g. Jan 01 2012).]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Session Timeout</fielddescr>
			<fieldname>varmacssessiontimeout</fieldname>			
			<description><![CDATA[Enter the time this MAC address has until relogin in seconds.]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Possible Login Times</fielddescr>
			<fieldname>varmacslogintime</fieldname>			
			<description><![CDATA[Enter the time when this MAC address should have access. If no time is entered it means "always".<br>
							Every time string contains a day (Mo,Tu,We,Th,Fr,Sa,Su) or all weekdays which is from monday till friday (Wk).<br><br>
							<b>Wk0855-2305,Sa,Su2230-0230</b><br><br>
							This means weekdays after 8:55 AM and before 11:05 PM | any time on saturday | sunday after 10:30 PM and before 02:30 AM.]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Amount of Time</fielddescr>
			<fieldname>varmacsamountoftime</fieldname>			
			<description><![CDATA[Enter the amount of time for this MAC address in minutes.]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Time Period</fielddescr>
			<fieldname>varmacspointoftime</fieldname>			
			<description><![CDATA[Select the time period for the amount of time.]]></description>
			<type>select</type>
			<default_value>daily</default_value>
				<options>
					<option><name>Daily</name><value>Daily</value></option>
					<option><name>Weekly</name><value>Weekly</value></option>
					<option><name>Monthly</name><value>Monthly</value></option>
					<option><name>Forever</name><value>Forever</value></option>
				</options>
		</field>
		<field>
			<name>TRAFFIC AND BANDWIDTH</name>
			<type>listtopic</type>
		</field>
		<field>
			<fielddescr>Amount of Download and Upload Traffic</fielddescr>
			<fieldname>varmacsmaxtotaloctets</fieldname>			
			<description><![CDATA[Enter the amount of download and upload traffic (summarized) for this MAC in <b>MegaByte (MB)</b>. There is a bug in CP (pfSense v2.0.x) which counts the real traffic many times faster and incorrect.]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Time Period</fielddescr>
			<fieldname>varmacsmaxtotaloctetstimerange</fieldname>			
			<description><![CDATA[Select the time period for the amount of download and upload traffic. This does not automatically reset the counter. You need to setup a cronjob (with cron package) which will reset the counter. Read the documentation!]]></description>
			<type>select</type>
			<default_value>daily</default_value>
				<options>
					<option><name>Daily</name><value>daily</value></option>
					<option><name>Weekly</name><value>weekly</value></option>
					<option><name>Monthly</name><value>monthly</value></option>
					<option><name>Forever</name><value>forever</value></option>
				</options>
		</field>
		<field>
			<fielddescr>Maximum Bandwidth Down</fielddescr>
			<fieldname>varmacsmaxbandwidthdown</fieldname>			
			<description><![CDATA[Enter the maximum bandwidth for download in <b>KiloBits</b> per second.]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Maximum Bandwidth Up</fielddescr>
			<fieldname>varmacsmaxbandwidthup</fieldname>			
			<description><![CDATA[Enter the maximum bandwidth for upload in <b>KiloBits</b> per second.]]></description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Accounting Interim Interval</fielddescr>
			<fieldname>varmacsacctinteriminterval</fieldname>			
			<description><![CDATA[Enter the seconds which should be between every interim-update. It MUST be more than 60s and SHOULD NOT be less than 600s. (Default: 600)]]></description>
			<type>input</type>
		</field>
		<field>
			<name>ADVANCED CONFIGURATION</name>
			<type>listtopic</type>
		</field>		
		<field>
			<fielddescr>Additional RADIUS Attributes on the TOP of this entry</fielddescr>
			<fieldname>varmacstopadditionaloptions</fieldname>			
			<description><![CDATA[This is for experts only and should be treat with care!<br>
								You may append custom RADIUS options to this MAC address account. If the syntax needs it, you have to set quotes and commas.<br>
								To put a command in a new line use a vertical bar (|).<br><br>
								Example: DEFAULT Auth-Type = System<br><br>
								<b>IMPORTANT:</b> If you don't format this field correctly freeRADIUS will not start because of syntax errors.<br>
								Verify your changes by checking authorized_macs file (View config -> macs).]]></description>
			<type>textarea</type>
			<rows>4</rows>
			<cols>75</cols>
		</field>
		<field>
			<fielddescr>Additional RADIUS Attributes (CHECK-ITEM).</fielddescr>
			<fieldname>varmacscheckitemsadditionaloptions</fieldname>			
			<description><![CDATA[This is for experts only and should be treat with care!<br>
								You may append custom RADIUS options to this MAC address account. If the syntax needs it, you have to set quotes and commas.<br>
								To put a command in a new line use a vertical bar (|).<br><br>
								Example: Max-Daily-Session := 36000<br><br>
								<b>IMPORTANT:</b> If you don't format this field correctly freeRADIUS will not start because of syntax errors.<br>
								Verify your changes by checking authorized_macs file (View config -> macs).]]></description>
			<type>textarea</type>
			<rows>4</rows>
			<cols>75</cols>
		</field>
		<field>
			<fielddescr>Additional RADIUS Attributes (REPLY-ITEM).</fielddescr>
			<fieldname>varmacsreplyitemsadditionaloptions</fieldname>			
			<description><![CDATA[This is for experts only and should be treat with care!<br>
								You may append custom RADIUS options to this MAC address account. If the syntax needs it, you have to set quotes and commas.<br>
								To put a command in a new line use a vertical bar (|).<br><br>
								Example: Service-Type == Login-User,|Login-Service == Telnet,|Login-IP-Host == 192.168.1.2<br><br>
								<b>IMPORTANT:</b> If you don't format this field correctly freeRADIUS will not start because of syntax errors.<br>
								Verify your changes by checking authorized_macs file (View config -> macs).]]></description>
			<type>textarea</type>
			<rows>4</rows>
			<cols>75</cols>
		</field>
	</fields>
	<custom_delete_php_command>
		freeradius_authorizedmacs_resync();
	</custom_delete_php_command>
	<custom_php_resync_config_command>
		freeradius_authorizedmacs_resync();
	</custom_php_resync_config_command>
</packagegui>