#!/usr/local/bin/php "") { if($status == true) { $carp_counter=find_number_of_created_carp_interfaces(); mwexec("/sbin/sysctl net.inet.carp.allow=0"); for($x=0; $x<$carp_counter; $x++) { mwexec("/sbin/ifconfig carp{$x} down"); mwexec("/sbin/ifconfig carp{$x} destroy"); } $savemsg = "{$carp_counter} ip's have been disabled."; } else { $savemsg = "Carp has been enabled."; mwexec("/sbin/sysctl net.inet.carp.allow=1"); mwexec("/usr/local/pkg/pf/carp.sh"); } } $status = get_carp_status(); ?> <?=gentitle_pkg($title);?>

"; } else { echo ""; } ?>

"") foreach($config['installedpackages']['carp']['config'] as $carp) { $ipaddress = $carp['ipaddress']; $premption = $carp['premption']; $password = $carp['password']; $netmask = $carp['netmask']; $vhid = $carp['vhid']; $advskew = $carp['advskew']; $pfsync = $carp['pfsync']; $synciface = $carp['synciface']; $carp_int = find_carp_interface($ipaddress); // XXX - billm - should really 'ifconfig -a |grep carp:' and assign each interface found to an array // using vhid as identifier and pull from that instead of hitting ifconfig every time through this loop $status = get_carp_interface_status($carp_int); if(isset($carp['balancing'])) $balancing = "true"; else $balancing = "false"; if(isset($carp['premption'])) $premption = "true"; else $premption = "false"; // if($synciface <> "") $sync_status = get_pfsync_interface_status($synciface); echo ""; echo ""; echo ""; echo ""; echo ""; } ?>
Carp Interface
Virtual IP
Status
" . $carp_int . "
" . $ipaddress . "
" . $status . "
Nodes syncing:
"; echo "
";
  system("/sbin/pfctl -vvss | /usr/bin/grep creator | /usr/bin/cut -d\" \" -f7 | /usr/bin/sort -u");
  echo "
"; ?>