summaryrefslogtreecommitdiffstats
path: root/usr/local/pkg/olsrd.xml
blob: 3a4abeb4b8c23376adc98b882a7a96bd52852e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0" encoding="utf-8" ?>
<packagegui>
	<name>olsrd</name>
	<version>1.0</version>
	<title>OLSRD</title>
	<!-- Menu is where this packages menu will appear -->
	<menu>
		<name>OLSRD</name>
		<section>Services</section>
		<configfile>olsrd.xml</configfile>
	</menu>
	<service>
                <name>OLSRD</name>
                <rcfile>/usr/local/sbin/olsrd -f /var/etc/olsr.conf</rcfile>
    </service>
	<tabs>
		<tab>
			<text>OLSRD Settings</text>
			<url>/pkg_edit.php?xml=olsrd.xml&amp;id=0</url>
		</tab>
	</tabs>
	<!-- configpath gets expanded out automatically and config items will be
         stored in that location -->
	<configpath>['installedpackages']['OLSRD']['config']</configpath>
	<aftersaveredirect>pkg_edit.php?xml=olsrd.xml&amp;id=0</aftersaveredirect>
	<!-- fields gets invoked when the user adds or edits a item.   the following items
         will be parsed and rendered for the user as a gui with input, and selectboxes. -->
	<fields>
		<field>
			<fielddescr>Enable OLSR</fielddescr>
			<fieldname>enable</fieldname>
			<description>Enables the dynamic mesh linking daemon</description>
			<type>checkbox</type>
		</field>
		<field>
			<fielddescr>Interfaces</fielddescr>
			<fieldname>interface_array</fieldname>
			<value>lan</value>
			<multiple>true</multiple>
			<size>3</size>
			<type>interfaces_selection</type>
		</field>
		<field>
			<fielddescr>Enable HTTPInfo Plugin</fielddescr>
			<fieldname>enablehttpinfo</fieldname>
			<description>Enables the OLSR stats web server</description>
			<type>checkbox</type>
		</field>
		<field>
			<fielddescr>HTTPInfo Port</fielddescr>
			<fieldname>port</fieldname>
			<description>Port that HTTPInfo will listen on</description>
			<type>input</type>
		</field>			
		<field>
			<fielddescr>Allowed host(s)</fielddescr>
			<fieldname>allowedhttpinfohost</fieldname>
			<description>Hosts that are allowed to access the HTTPInfo web service.</description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Allowed host(s) subnet</fielddescr>
			<fieldname>allowedhttpinfosubnet</fieldname>
			<description>Enter the subnet mask in form 255.255.255.0</description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Enable Dynamic Gateway</fielddescr>
			<fieldname>enabledyngw</fieldname>
			<description>Enables the OLSR Dynamic Gateways feature</description>
			<type>checkbox</type>
		</field>
		<field>
			<fielddescr>Ping</fielddescr>
			<fieldname>ping</fieldname>
			<description>Pings this host to ensure connectivity</description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>Poll</fielddescr>
			<fieldname>polling</fieldname>
			<description>How often to look for a inet gw, in seconds.</description>
			<type>input</type>
		</field>			
		<field>
			<fielddescr>Enable Secure Mode</fielddescr>
			<fieldname>enabledsecure</fieldname>
			<description>Enables the secure mode</description>
			<type>checkbox</type>
		</field>
		<field>
			<fielddescr>Key</fielddescr>
			<fieldname>securekey</fieldname>
			<description>Paste the secure key information here.</description>
			<type>textarea</type>
			<rows>5</rows>
			<cols>50</cols>
		</field>
	</fields>
	<custom_delete_php_command>
	</custom_delete_php_command>
	<custom_php_resync_config_command>
		conf_mount_rw();
		$fd = fopen("/usr/local/etc/olsrkey.txt","w");
		fwrite($fd, $_POST['securekey']);
		fclose($fd);
		foreach($_POST['interface_array'] as $iface) {
				$if = convert_friendly_interface_to_real_interface_name($iface);
				if($if) {
						setup_wireless_olsr($if);
				}
		}
		conf_mount_ro();
	</custom_php_resync_config_command>
	<custom_php_install_command>
	</custom_php_install_command>
	<custom_php_deinstall_command>
	</custom_php_deinstall_command>
</packagegui>
OpenPOWER on IntegriCloud