Changeset 888 for trunk/Modules/NetworkConfigRouterOS
- Timestamp:
- Nov 24, 2020, 10:58:56 AM (4 years ago)
- Location:
- trunk/Modules/NetworkConfigRouterOS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Routerboard.php
r887 r888 3 3 class Routerboard 4 4 { 5 var$SSHPath = '/usr/bin/ssh';6 var$Timeout = 3;7 var$HostName;8 var$UserName;9 var$Password;10 var$PrivateKey = '~/.ssh/id_rsa';11 var$MaxBurstLineCount = 100;12 var$Debug = false;5 public string $SSHPath = '/usr/bin/ssh'; 6 public int $Timeout = 3; 7 public string $HostName; 8 public string $UserName; 9 public string $Password; 10 public string $PrivateKey = '~/.ssh/id_rsa'; 11 public int $MaxBurstLineCount = 100; 12 public bool $Debug = false; 13 13 14 14 function __construct($HostName = 'localhost', $UserName = 'admin', $Password = '') … … 19 19 } 20 20 21 function Execute( array$Commands): array21 function Execute($Commands): array 22 22 { 23 23 $Output = array(); … … 75 75 if (count($ResultLineParts) > 1) 76 76 { 77 if ($ResultLineParts[1] {0}== '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes77 if ($ResultLineParts[1][0] == '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes 78 78 $List[substr($ResultLineParts[0], 0, -1)] = $ResultLineParts[1]; 79 79 } else $List[substr($ResultLineParts[0], 0, -1)] = ''; … … 116 116 } 117 117 118 function ListGetPrint( $Path, $Properties,$Conditions = array()): array118 function ListGetPrint(array $Path, array $Properties, array $Conditions = array()): array 119 119 { 120 120 $ConditionList = ''; -
trunk/Modules/NetworkConfigRouterOS/Routerboard2.php
r887 r888 5 5 class Routerboard extends SSH 6 6 { 7 var$Methods = array(7 public array $Methods = array( 8 8 'kex' => 'diffie-hellman-group1-sha1', 9 9 'client_to_server' => array('crypt' => '3des-cbc', 'comp' => 'none'), … … 11 11 ); 12 12 13 function Execute( $Commands): array13 function Execute(array $Commands): array 14 14 { 15 15 if (is_array($Commands)) $Commands = implode(';', $Commands); -
trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php
r887 r888 3 3 class RouterosAPI 4 4 { 5 var$ErrorNo; // Variable for storing connection error number, if any6 var$ErrorStr; // Variable for storing connection error text, if any7 var$Attempts; // Connection attempt count8 var$Connected; // Connection state9 var$Delay; // Delay between connection attempts in seconds10 var$Port; // Port to connect to11 var$Timeout; // Connection attempt timeout and data read timeout12 var$Socket; // Variable for storing socket resource13 var$Debug;14 var$SSL; // If SSL API connection is used. You need also change port to 87295 public int $ErrorNo; // Variable for storing connection error number, if any 6 public string $ErrorStr; // Variable for storing connection error text, if any 7 public int $Attempts; // Connection attempt count 8 public bool $Connected; // Connection state 9 public int $Delay; // Delay between connection attempts in seconds 10 public int $Port; // Port to connect to 11 public int $Timeout; // Connection attempt timeout and data read timeout 12 public int $Socket; // Variable for storing socket resource 13 public bool $Debug; 14 public bool $SSL; // If SSL API connection is used. You need also change port to 8729 15 15 16 16 function __construct() -
trunk/Modules/NetworkConfigRouterOS/SSH.php
r874 r888 3 3 class SSH 4 4 { 5 var$HostName;6 var$UserName;7 var$Password;8 var$Methods;5 public string $HostName; 6 public string $UserName; 7 public string $Password; 8 public array $Methods; 9 9 10 10 function __construct($HostName = 'localhost', $UserName = 'admin', $Password = '') … … 13 13 $this->UserName = $UserName; 14 14 $this->Password = $Password; 15 $this->Methods = array(); 15 16 } 16 17 17 function Execute( $Commands)18 function Execute(array $Commands): array 18 19 { 19 20 echo($Commands);
Note:
See TracChangeset
for help on using the changeset viewer.