ssh_channel.h File Reference

SSH channel management. More...

#include "ssh/ssh.h"

Go to the source code of this file.

Functions

SshChannelsshGetChannel (SshConnection *connection, uint32_t localChannelNum)
 Get the channel that matches the specified channel number. More...
 
uint32_t sshAllocateLocalChannelNum (SshConnection *connection)
 Generate a local channel number. More...
 
bool_t sshCheckRemoteChannelNum (SshConnection *connection, uint32_t remoteChannelNum)
 Check remote channel number. More...
 
void sshRegisterChannelEvents (SshChannel *channel, SocketEventDesc *eventDesc)
 Register channel events. More...
 
error_t sshProcessChannelEvents (SshChannel *channel)
 Channel event handler. More...
 
uint_t sshWaitForChannelEvents (SshChannel *channel, uint_t eventMask, systime_t timeout)
 Wait for a particular SSH channel event. More...
 
void sshUpdateChannelEvents (SshChannel *channel)
 Update SSH channel related events. More...
 
error_t sshProcessChannelData (SshChannel *channel, const uint8_t *data, size_t length)
 Process incoming data. More...
 
error_t sshProcessChannelExtendedData (SshChannel *channel, uint32_t type, const uint8_t *data, size_t length)
 Process incoming extended data. More...
 
error_t sshUpdateChannelWindow (SshChannel *channel, uint32_t windowSizeInc)
 Update channel flow-control window. More...
 

Detailed Description

SSH channel management.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneSSH Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file ssh_channel.h.

Function Documentation

◆ sshAllocateLocalChannelNum()

uint32_t sshAllocateLocalChannelNum ( SshConnection connection)

Generate a local channel number.

Parameters
[in]connectionPointer to the SSH connection
Returns
Channel number

Definition at line 92 of file ssh_channel.c.

◆ sshCheckRemoteChannelNum()

bool_t sshCheckRemoteChannelNum ( SshConnection connection,
uint32_t  remoteChannelNum 
)

Check remote channel number.

Parameters
[in]connectionPointer to the SSH connection
[in]remoteChannelNumRemote channel number
Returns
TRUE if the channel number is valid, else FALSE

Definition at line 141 of file ssh_channel.c.

◆ sshGetChannel()

SshChannel* sshGetChannel ( SshConnection connection,
uint32_t  localChannelNum 
)

Get the channel that matches the specified channel number.

Parameters
[in]connectionPointer to the SSH connection
[in]localChannelNumLocal channel number
Returns
Handle referencing an SSH channel

Definition at line 53 of file ssh_channel.c.

◆ sshProcessChannelData()

error_t sshProcessChannelData ( SshChannel channel,
const uint8_t *  data,
size_t  length 
)

Process incoming data.

Parameters
[in]channelPointer to the SSH channel
[in]dataPointer to the payload data
[in]lengthLength of the payload data, in bytes
Returns
Error code

Definition at line 466 of file ssh_channel.c.

◆ sshProcessChannelEvents()

error_t sshProcessChannelEvents ( SshChannel channel)

Channel event handler.

Parameters
[in]channelHandle referencing an SSH channel
Returns
Error code

Definition at line 232 of file ssh_channel.c.

◆ sshProcessChannelExtendedData()

error_t sshProcessChannelExtendedData ( SshChannel channel,
uint32_t  type,
const uint8_t *  data,
size_t  length 
)

Process incoming extended data.

Parameters
[in]channelPointer to the SSH channel
[in]typeExtended data type
[in]dataPointer to the extended data
[in]lengthLength of the extended data, in bytes
Returns
Error code

Definition at line 541 of file ssh_channel.c.

◆ sshRegisterChannelEvents()

void sshRegisterChannelEvents ( SshChannel channel,
SocketEventDesc eventDesc 
)

Register channel events.

Parameters
[in]channelHandle referencing an SSH channel
[in]eventDescSSH channel events to be registered

Definition at line 185 of file ssh_channel.c.

◆ sshUpdateChannelEvents()

void sshUpdateChannelEvents ( SshChannel channel)

Update SSH channel related events.

Parameters
[in]channelPointer to the SSH channel

Definition at line 386 of file ssh_channel.c.

◆ sshUpdateChannelWindow()

error_t sshUpdateChannelWindow ( SshChannel channel,
uint32_t  windowSizeInc 
)

Update channel flow-control window.

Parameters
[in]channelPointer to the SSH channel
[in]windowSizeIncWindow size increment
Returns
Error code

Definition at line 577 of file ssh_channel.c.

◆ sshWaitForChannelEvents()

uint_t sshWaitForChannelEvents ( SshChannel channel,
uint_t  eventMask,
systime_t  timeout 
)

Wait for a particular SSH channel event.

Parameters
[in]channelPointer to the SSH channel
[in]eventMaskLogic OR of all the events that will complete the wait
[in]timeoutMaximum time to wait
Returns
Logic OR of all the events that satisfied the wait

Definition at line 345 of file ssh_channel.c.