function interfaces_staticarp_configure($if) {
global $config, $g;
if(isset($config['system']['developerspew'])) {
$mt = microtime();
echo "interfaces_staticarp_configure($if) being called $mt\n";
}
$ifcfg = $config['interfaces'][$if];
/* Enable staticarp, if enabled */
if(isset($config['dhcpd'][$if]['staticarp'])) {
mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " staticarp " );
mwexec("/usr/sbin/arp -ad > /dev/null 2>&1 ");
if (is_array($config['dhcpd'][$if]['staticmap'])) {
foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
}
}
} else {
mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " -staticarp " );
mwexec("/usr/sbin/arp -da > /dev/null 2>&1 ");
}
return 0;
}
is this could be ported from pfsense to m0n0wall?
thanks