<function name="rpcf_add_to_ipgroup" id="0x5200"> <input> <integer name="ip_group_id"/> <ip_address name="ip_address"/> <ip_address name="mask" default="255.255.255.255"/> <string name="iptraffic_login" default=""/> <string name="iptraffic_password" default=""/> <string name="mac" default=""/> <string name="iptraffic_allowed_cid" default=""/> </input> <output> <integer name="result"/> <if variable="result" value="0" condition="eq"> <error code="16" comment="unable to add IP-address to ipgroup"/> </if> </output> </function>
function rpcf_add_to_ipgroup($id,$ip,$mask,$login="",$pass="",$mac="",$cid="") { //0x5200 $ret=array(); if (!$this->connection->urfa_call(0x5200)) { print "Error calling function ". __FUNCTION__ ."\n"; return FALSE; } $packet = $this->connection->getPacket(); $packet->DataSetInt($id); $packet->DataSetIPAddress($ip); $packet->DataSetIPAddress($mask); $packet->DataSetString($login); $packet->DataSetString($pass); $packet->DataSetString($mac); $packet->DataSetString($cid); $this->connection->urfa_send_param($packet); if ($x = $this->connection->urfa_get_data()) { $code=$x->DataGetInt(); } // $this->connection->urfa_get_data(); // -1 Error (bug in api.xml - 0) return $code; }