コード例 #1
0
 public function ipaddress()
 {
     $connect = new Auth();
     $connect->setHost("172.18.1.254");
     $connect->setUsername("admin");
     $connect->setPassword("1261");
     $connect->setDebug(true);
     $talker = new Talker($connect);
     $id = new Address($talker);
     DebugDumper::dump($id->getAll());
 }
コード例 #2
0
ファイル: Filter.php プロジェクト: CBEPX/laravel-mikrotik
 public function add()
 {
     $connect = new Auth();
     $connect->setHost("172.18.1.254");
     $connect->setUsername("admin");
     $connect->setPassword("1261");
     $connect->setDebug(true);
     if (Request::isMethod('get')) {
         $talker = new Talker($connect);
         $ip = new Address($talker);
         $data = ['ipaddr' => $ip->getAll()];
         return View::make('fitur/f_filter/addfilter', $data);
     } else {
         if (Request::isMethod('post')) {
             $param = Input::all();
             $talker = new Talker($connect);
             $addr = new FirewallFilter($talker);
             $addr->add($param);
             return Redirect::to('ipaddr/filter');
         }
     }
 }
コード例 #3
0
ファイル: IPAddress.php プロジェクト: CBEPX/laravel-mikrotik
 public function detail_Address($id)
 {
     $connect = new Auth();
     $connect->setHost("172.18.1.254");
     $connect->setUsername("admin");
     $connect->setPassword("1261");
     $connect->setDebug(true);
     $talker = new Talker($connect);
     $addr = new Address($talker);
     $data = ['ipaddr' => $addr->detail_address($id)];
     return View::make('vaddress/detail', $data);
 }
コード例 #4
0
ファイル: test.php プロジェクト: beecode/mikrotik-api
<?php

require '../vendor/autoload.php';
use MikrotikAPI\Talker\Talker;
use MikrotikAPI\Entity\Auth;
use MikrotikAPI\Commands\IP\Address;
use MikrotikAPI\Commands\IP\Firewall\FirewallFilter;
$auth = new Auth();
$auth->setHost("172.18.1.254");
$auth->setUsername("admin");
$auth->setPassword("1261");
$auth->setDebug(true);
$talker = new Talker($auth);
//$filter = new FirewallFilter($talker);
//$a = $filter->getAll();
$ipaddr = new Address($talker);
$listIP = $ipaddr->getAll();
MikrotikAPI\Util\DebugDumper::dump($listIP);