diff options
author | Ermal Luci <eri@pfsense.org> | 2009-01-28 18:13:50 +0000 |
---|---|---|
committer | Ermal Luci <eri@pfsense.org> | 2009-01-28 18:13:50 +0000 |
commit | 41997fbbeb2b5c50507ad18fa4ea2bb6fbea4ee2 (patch) | |
tree | 19bbf8897e0a0c11faf7f9d5c20f912b233c750b /etc/inc/services.inc | |
parent | f668d1597294dd35244cd4dc0d76626b58336b2d (diff) | |
download | pfsense-41997fbbeb2b5c50507ad18fa4ea2bb6fbea4ee2.zip pfsense-41997fbbeb2b5c50507ad18fa4ea2bb6fbea4ee2.tar.gz |
Add the GUI part for IGMPproxy that has been on the snapshots for a while.
Diffstat (limited to 'etc/inc/services.inc')
-rw-r--r-- | etc/inc/services.inc | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index ea7e82f..bd1e75b 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -329,6 +329,61 @@ EOD; return 0; } +function services_igmpproxy_configure() { + global $config, $g; + + $iflist = get_configured_interface_list(); + + /* kill any running igmpproxy */ + killbyname("igmpproxy"); + + if (!is_array($config['igmpproxy']['igmpentry'])) + return 1; + + $igmpconf = <<<EOD + +##------------------------------------------------------ +## Enable Quickleave mode (Sends Leave instantly) +##------------------------------------------------------ +quickleave + +EOD; + + foreach ($config['igmpproxy']['igmpentry'] as $igmpcf) { + unset($iflist[$igmpcf['ifname']]); + $realif = get_real_interface($igmpcf['ifname']); + if (empty($igmpcf['threshold'])) + $threshld = 1; + else + $threshld = $igmpcf['threshold']; + $igmpconf .= "phyint {$realif} {$igmpcf['type']} ratelimit 0 threshold {$threshld}\n"; + + if ($igmpcf['address'] <> "") { + $item = explode(" ", $igmpcf['address']); + foreach($item as $iww) + $igmpconf .= "altnet {$iww}\n"; + } + $igmpconf .= "\n"; + } + foreach ($iflist as $ifn) { + $realif = get_real_interface($ifn); + $igmpconf .= "phyint {$realif} disabled\n"; + } + + $igmpfl = fopen($g['tmp_path'] . "/igmpproxy.conf", "w"); + if (!$igmpfl) { + log_error("Could not write Igmpproxy configuration file!"); + return; + } + fwrite($igmpfl, $igmpconf); + fclose($igmpfl); + + mwexec("/usr/local/sbin/igmpproxy -c " . $g['tmp_path'] . "/igmpproxy.conf"); + log_error("Started Igmpproxy service sucsesfully."); + + return 0; +} + function interfaces_staticarp_configure($if) { global $config, $g; if(isset($config['system']['developerspew'])) { |