<?php

class inet {
	
	public function __construct(){
		global $err;
		
		$act=preg_replace('/[^a-z_]/','',$_GET['act']);
		if($act){
			call_user_func(array(&$this,$act));
		} 
	}
	
	
	public function update_mac(){
		global $DB;
		
		$id=intval($_GET[id]);
		$obj["mac"]="";
		$DB->query("UPDATE internet set ?a WHERE id=?d",$obj,$id);
		$ip=$DB->selectCell('SELECT ip from internet WHERE id=?',$id);
		$err=exec("/usr/local/bin/sudo /usr/sbin/arp -d $ip",$output);
		success();
	}
	
}
?>