|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-11 21:03 UTC] tony2001@php.net
[2005-10-17 15:19 UTC] shane at 71software dot com
[2005-10-17 15:35 UTC] tony2001@php.net
[2005-10-17 15:58 UTC] shane at 71software dot com
[2005-10-17 15:58 UTC] shane at 71software dot com
[2005-10-19 13:36 UTC] franz dot hofbauer at gmail dot com
[2005-10-20 15:36 UTC] shane at 71software dot com
[2005-10-29 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
Description: ------------ I am using sockets to log in to a Cisco router. I need to issues the command "terminal length 0". The 0 must return a FALSE or NULL status to socket_write or maybe socket_read is what is actually returning false I am not sure. But it will not work in Binary, ASCII, OCTAL, HEX anything. Reproduce code: --------------- $IosCmdExec = 'terminal length 0' . "\n"; socket_write($socket, $IosCmdExec, strlen($IosCmdExec)); $makeCaptureFile = 'C:\rtrconfig\config.txt'; $captureFile = fopen($makeCaptureFile,'a'); $out = ''; while ($out = socket_read($socket, 1024)){ ereg_replace("\r", ' ', $out); fwrite($captureFile, $out); } $sep = '***************************************************************************************'; fwrite($captureFile, $sep); socket_shutdown($socket, 2); socket_close($socket); Expected result: ---------------- I expect the writing of 'terminal length 0' to the Cisco CLI. It works fine as long as the digit is not 0. 1-512 etc. xxxxxx#terminal length 512 Building configuration... Current configuration : 26921 bytes ! ! Last configuration change at 07:00:37 CDT Tue Jun 28 2005 by amschultz ! NVRAM config last updated at 06:38:49 CDT Mon Jun 20 ! version 12.2 no service pad service timestamps debug datetime msec localtime show-timezone service timestamps log datetime msec localtime show-timezone service password-encryption service compress-config ! hostname xxxxxx ! logging buffered 512000 debugging aaa new-model aaa authentication login default group tacacs+ local etc...... Actual result: -------------- xxxxxxx#terminal length *************************************************************************************** NOTE: 'xxxxxxx#' being the router prompt