summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-02-21 04:33:30 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-02-21 04:33:30 +0000
commitac809adb4b893d0f5c877177ca0e495639719b2d (patch)
tree82c72b3d35c515a57034191c5c5f05c6a7a0668c
parent3367ac0263c285a186f5f5724c75937844a27e8b (diff)
downloadpfsense-ac809adb4b893d0f5c877177ca0e495639719b2d.zip
pfsense-ac809adb4b893d0f5c877177ca0e495639719b2d.tar.gz
* Add dynamic gateway polling time
* Fix interfaces * Only edit olsr.conf and use one instance of program
-rw-r--r--etc/inc/services.inc25
-rw-r--r--usr/local/pkg/olsrd.xml11
2 files changed, 19 insertions, 17 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 0fe2a54..f5e9fcd 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -868,21 +868,21 @@ EOD;
return 0;
}
-function setup_wireless_olsr($interface) {
+function setup_wireless_olsr() {
global $config, $g;
if(isset($config['system']['developerspew'])) {
$mt = microtime();
echo "setup_wireless_olsr($interface) being called $mt\n";
}
foreach($config['installedpackages']['OLSRD']['config'] as $olsr) {
- $fd = fopen("{$g['varetc_path']}/{$interface}_olsr.conf", "w");
+ $fd = fopen("{$g['varetc_path']}/olsr.conf", "w");
$olsr .= <<<EODA
#
# olsr.org OLSR daemon config file
#
# Lines starting with a # are discarded
#
-# This file was shipped with olsrd 0.X.X
+# This file was generated by setup_wireless_olsr() in services.inc
#
# This file is an example of a typical
@@ -1072,7 +1072,7 @@ LoadPlugin "/usr/local/lib/olsrd_dyn_gw.so.0.4"
{
# how often to look for a inet gw, in seconds
# defaults to 5 secs, if commented out
- PlParam "Interval" "40"
+ PlParam "Interval" "{$olsr['polling']}"
# if one or more IPv4 addresses are given, do a ping on these in
# descending order to validate that there is not only an entry in
@@ -1081,23 +1081,16 @@ LoadPlugin "/usr/local/lib/olsrd_dyn_gw.so.0.4"
# succesful, i.e. if the ping on the 1st address was successful,the
# 2nd won't be pinged
PlParam "Ping" "{$olsr['ping']}"
- #PlParam "Ping" "194.25.2.129"
- #lParam "HNA" "192.168.80.0 255.255.255.0"
#PlParam "HNA" "192.168.81.0 255.255.255.0"
- #PlParam "Ping" "192.168.81.12"
}
EODE;
}
+foreach($config['installedpackages']['olsrd']['config'] as $config) {
+ foreach($config['interface_array'] as $interface) {
$olsr .= <<<EOD
-# Interfaces and their rules
-# Omitted options will be set to the
-# default values. Multiple interfaces
-# can be specified in the same block
-# and multiple blocks can be set.
-
Interface "{$interface}"
{
@@ -1166,11 +1159,15 @@ Interface "{$interface}"
}
+
EOD;
+
+ }
+}
fwrite($fd, $olsr);
fclose($fd);
}
- mwexec_bg("/usr/local/sbin/olsrd -f {$g['varetc_path']}/{$interface}_olsr.conf");
+ mwexec_bg("/usr/local/sbin/olsrd -f {$g['varetc_path']}/olsr.conf");
}
?> \ No newline at end of file
diff --git a/usr/local/pkg/olsrd.xml b/usr/local/pkg/olsrd.xml
index 6840b46..7150541 100644
--- a/usr/local/pkg/olsrd.xml
+++ b/usr/local/pkg/olsrd.xml
@@ -3,7 +3,6 @@
<name>OLSRD</name>
<version>1.0</version>
<title>OLSRD</title>
- <backup_file>/var/db/OLSRD</backup_file>
<!-- Menu is where this packages menu will appear -->
<menu>
<name>OLSRD</name>
@@ -12,7 +11,7 @@
</menu>
<service>
<name>OLSRD</name>
- <rcfile></rcfile>
+ <rcfile>/usr/local/sbin/olsrd -f /var/etc/olsr.conf</rcfile>
</service>
<tabs>
<tab>
@@ -60,7 +59,7 @@
<field>
<fielddescr>Allowed host(s)</fielddescr>
<fieldname>allowedhttpinfohost</fieldname>
- <description>Enables the OLSR stats web server</description>
+ <description>Hosts that are allowed to access the HTTPInfo web service.</description>
<type>input</type>
</field>
<field>
@@ -82,6 +81,12 @@
<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>
OpenPOWER on IntegriCloud