ssh_channel.h
Go to the documentation of this file.
1 /**
2  * @file ssh_channel.h
3  * @brief SSH channel management
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneSSH Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.0
29  **/
30 
31 #ifndef _SSH_CHANNEL_H
32 #define _SSH_CHANNEL_H
33 
34 //Dependencies
35 #include "ssh/ssh.h"
36 
37 //C++ guard
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 //SSH related functions
43 SshChannel *sshGetChannel(SshConnection *connection, uint32_t localChannelNum);
44 
45 uint32_t sshAllocateLocalChannelNum(SshConnection *connection);
46 
48  uint32_t remoteChannelNum);
49 
50 void sshRegisterChannelEvents(SshChannel *channel, SocketEventDesc *eventDesc);
52 
54  systime_t timeout);
55 
56 void sshUpdateChannelEvents(SshChannel *channel);
57 
58 error_t sshProcessChannelData(SshChannel *channel, const uint8_t *data,
59  size_t length);
60 
62  const uint8_t *data, size_t length);
63 
64 error_t sshUpdateChannelWindow(SshChannel *channel, uint32_t windowSizeInc);
65 
66 //C++ guard
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif
uint8_t type
Definition: coap_common.h:176
unsigned int uint_t
Definition: compiler_port.h:50
int bool_t
Definition: compiler_port.h:53
error_t
Error codes.
Definition: error.h:43
uint8_t data[]
Definition: ethernet.h:222
uint32_t systime_t
System time.
Secure Shell (SSH)
#define SshChannel
Definition: ssh.h:887
#define SshConnection
Definition: ssh.h:883
uint32_t sshAllocateLocalChannelNum(SshConnection *connection)
Generate a local channel number.
Definition: ssh_channel.c:92
void sshRegisterChannelEvents(SshChannel *channel, SocketEventDesc *eventDesc)
Register channel events.
Definition: ssh_channel.c:185
error_t sshUpdateChannelWindow(SshChannel *channel, uint32_t windowSizeInc)
Update channel flow-control window.
Definition: ssh_channel.c:577
error_t sshProcessChannelEvents(SshChannel *channel)
Channel event handler.
Definition: ssh_channel.c:232
bool_t sshCheckRemoteChannelNum(SshConnection *connection, uint32_t remoteChannelNum)
Check remote channel number.
Definition: ssh_channel.c:141
void sshUpdateChannelEvents(SshChannel *channel)
Update SSH channel related events.
Definition: ssh_channel.c:386
SshChannel * sshGetChannel(SshConnection *connection, uint32_t localChannelNum)
Get the channel that matches the specified channel number.
Definition: ssh_channel.c:53
uint_t sshWaitForChannelEvents(SshChannel *channel, uint_t eventMask, systime_t timeout)
Wait for a particular SSH channel event.
Definition: ssh_channel.c:345
error_t sshProcessChannelExtendedData(SshChannel *channel, uint32_t type, const uint8_t *data, size_t length)
Process incoming extended data.
Definition: ssh_channel.c:541
error_t sshProcessChannelData(SshChannel *channel, const uint8_t *data, size_t length)
Process incoming data.
Definition: ssh_channel.c:466
Structure describing socket events.
Definition: socket.h:398
uint8_t length
Definition: tcp.h:368