_get_channel_packet() public method

Returns the data as a string if it's available and false if not.
public _get_channel_packet ( $client_channel, $skip_extended = false ) : mixed
$client_channel
return mixed
Esempio n. 1
0
 /**
  * Request agent forwarding of remote server
  *
  * @param Net_SSH2 $ssh
  * @return bool
  * @access private
  */
 function _request_forwarding($ssh)
 {
     $request_channel = $ssh->_get_open_channel();
     if ($request_channel === false) {
         return false;
     }
     $packet = pack('CNNa*C', NET_SSH2_MSG_CHANNEL_REQUEST, $ssh->server_channels[$request_channel], strlen('*****@*****.**'), '*****@*****.**', 1);
     $ssh->channel_status[$request_channel] = NET_SSH2_MSG_CHANNEL_REQUEST;
     if (!$ssh->_send_binary_packet($packet)) {
         return false;
     }
     $response = $ssh->_get_channel_packet($request_channel);
     if ($response === false) {
         return false;
     }
     $ssh->channel_status[$request_channel] = NET_SSH2_MSG_CHANNEL_OPEN;
     $this->forward_status = SYSTEM_SSH_AGENT_FORWARD_ACTIVE;
     return true;
 }
Esempio n. 2
0
 public function read()
 {
     return $this->ssh->_get_channel_packet(NET_SSH2_CHANNEL_EXEC);
 }