summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-02-21 02:32:04 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-02-21 02:32:04 +0000
commitdb5fbdb770b7db34acc2b1e7924318c4d3ba4737 (patch)
treed8df577954da9b87be84fab60c57c5dc49b8d4bf
parentda0ea3522342ea0ba915962eccb9f072206d505b (diff)
downloadpfsense-db5fbdb770b7db34acc2b1e7924318c4d3ba4737.zip
pfsense-db5fbdb770b7db34acc2b1e7924318c4d3ba4737.tar.gz
Add OLSRD package
-rw-r--r--etc/inc/services.inc78
1 files changed, 48 insertions, 30 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index c397e1c..695d06e 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -874,8 +874,9 @@ function setup_wireless_olsr($interface) {
$mt = microtime();
echo "setup_wireless_olsr($interface) being called $mt\n";
}
- $fd = fopen("{$g['varetc_path']}/{$interface}_olsr.conf", "w");
- $olsr .= <<<EOD
+ foreach($config['installedpackages']['OLSRD']['config'] as $olsr) {
+ $fd = fopen("{$g['varetc_path']}/{$interface}_olsr.conf", "w");
+ $olsr .= <<<EODA
#
# olsr.org OLSR daemon config file
#
@@ -1024,7 +1025,6 @@ Pollrate 0.05
TcRedundancy 2
-
#
# MPR coverage
# Specifies how many MPRs a node should
@@ -1036,51 +1036,68 @@ TcRedundancy 2
MprCoverage 3
+# Example plugin entry with parameters:
-# Olsrd plugins to load
-# This must be the absolute path to the file
-# or the loader will use the following scheme:
-# - Try the paths in the LD_LIBRARY_PATH
-# environment variable.
-# - The list of libraries cached in /etc/ld.so.cache
-# - /lib, followed by /usr/lib
+EODA;
-# Example plugin entry with parameters:
+if($olsr['enablehttpinfo']) {
+ $olsr .= <<<EODB
+
+LoadPlugin "/usr/local/lib/olsrd_httpinfo.so.0.1"
+{
+ PlParam "port" "{$olsr['port']}"
+ PlParam "Net" "{$olsr['allowedhttpinfohost']} {$olsr['allowedhttpinfosubnet']}"
+}
-#LoadPlugin "olsrd_dyn_gw.so.0.3"
-#{
- # Here parameters are set to be sent to the
- # plugin. Theese are on the form "key" "value".
- # Parameters ofcause, differs from plugin to plugin.
- # Consult the documentation of your plugin for details.
+EODB;
+
+}
+
+if($olsr['enabledyngw']) {
+ $olsr .= <<<EODC
+
+LoadPlugin "/usr/local/lib/olsrd_secure.so.0.4"
+{
+ PlParam "Keyfile" "/usr/local/etc/olsrkey.txt"
+}
- # Example: dyn_gw params
+EODC;
+
+}
+
+if($olsr['enabledyngw']) {
+ $olsr .= <<<EODE
+
+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"
- # how often to check for Internet connectivity
- # defaults to 5 secs
-# PlParam "Interval" "40"
-
# 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
# routing table, but also a real internet connection. If any of
# these addresses could be pinged successfully, the test was
# succesful, i.e. if the ping on the 1st address was successful,the
# 2nd won't be pinged
-# PlParam "Ping" "141.1.1.1"
-# PlParam "Ping" "194.25.2.129"
-#}
+ 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;
+}
+$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.
-# !!CHANGE THE INTERFACE LABEL(s) TO MATCH YOUR INTERFACE(s)!!
-# (eg. wlan0 or eth1):
-
Interface "{$interface}"
{
@@ -1150,8 +1167,9 @@ Interface "{$interface}"
}
EOD;
- fwrite($fd, $olsr);
- fclose($fd);
+ fwrite($fd, $olsr);
+ fclose($fd);
+ }
mwexec_bg("/usr/local/sbin/olsrd -f {$g['varetc_path']}/{$interface}_olsr.conf");
}
OpenPOWER on IntegriCloud