aboutsummaryrefslogtreecommitdiff
path: root/include/libssh
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2010-09-29 17:45:04 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-10-02 22:51:35 +0200
commit26d40b5354d6760472127f2c16045fbbb2f12fee (patch)
treede30f65d560762a324734d48c70872fdc50fcaaa /include/libssh
parentc4356531f78fdcf2f3b6a9861f6129eac81990f8 (diff)
downloadlibssh-26d40b5354d6760472127f2c16045fbbb2f12fee.tar.gz
libssh-26d40b5354d6760472127f2c16045fbbb2f12fee.tar.xz
libssh-26d40b5354d6760472127f2c16045fbbb2f12fee.zip
Handle global requests and reverse forwarding
Diffstat (limited to 'include/libssh')
-rw-r--r--include/libssh/libssh.h6
-rw-r--r--include/libssh/messages.h9
-rw-r--r--include/libssh/server.h9
3 files changed, 24 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index 22957c38..0471c40c 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -193,6 +193,12 @@ enum ssh_channel_requests_e {
SSH_CHANNEL_REQUEST_WINDOW_CHANGE
};
+enum ssh_global_requests_e {
+ SSH_GLOBAL_REQUEST_UNKNOWN=0,
+ SSH_GLOBAL_REQUEST_TCPIP_FORWARD,
+ SSH_GLOBAL_REQUEST_CANCEL_TCPIP_FORWARD,
+};
+
enum ssh_publickey_state_e {
SSH_PUBLICKEY_STATE_ERROR=-1,
SSH_PUBLICKEY_STATE_NONE=0,
diff --git a/include/libssh/messages.h b/include/libssh/messages.h
index 3029ae88..419c3cbb 100644
--- a/include/libssh/messages.h
+++ b/include/libssh/messages.h
@@ -47,6 +47,13 @@ struct ssh_service_request {
char *service;
};
+struct ssh_global_request {
+ int type;
+ uint8_t want_reply;
+ char *bind_address;
+ uint16_t bind_port;
+};
+
struct ssh_channel_request {
int type;
ssh_channel channel;
@@ -75,11 +82,13 @@ struct ssh_message_struct {
struct ssh_channel_request_open channel_request_open;
struct ssh_channel_request channel_request;
struct ssh_service_request service_request;
+ struct ssh_global_request global_request;
};
SSH_PACKET_CALLBACK(ssh_packet_channel_open);
SSH_PACKET_CALLBACK(ssh_packet_service_request);
SSH_PACKET_CALLBACK(ssh_packet_userauth_request);
+SSH_PACKET_CALLBACK(ssh_packet_global_request);
int ssh_message_handle_channel_request(ssh_session session, ssh_channel channel, ssh_buffer packet,
const char *request, uint8_t want_reply);
diff --git a/include/libssh/server.h b/include/libssh/server.h
index 47a84a6c..b4116dc2 100644
--- a/include/libssh/server.h
+++ b/include/libssh/server.h
@@ -158,6 +158,9 @@ LIBSSH_API int ssh_message_auth_set_methods(ssh_message msg, int methods);
LIBSSH_API int ssh_message_service_reply_success(ssh_message msg);
LIBSSH_API char *ssh_message_service_service(ssh_message msg);
+LIBSSH_API int ssh_message_global_request_reply_success(ssh_message msg,
+ uint16_t bound_port);
+
LIBSSH_API void ssh_set_message_callback(ssh_session session,
int(*ssh_bind_message_callback)(ssh_session session, ssh_message msg, void *data),
void *data);
@@ -183,6 +186,12 @@ LIBSSH_API char *ssh_message_channel_request_command(ssh_message msg);
LIBSSH_API char *ssh_message_channel_request_subsystem(ssh_message msg);
+LIBSSH_API char *ssh_message_global_request_address(ssh_message msg);
+LIBSSH_API int ssh_message_global_request_port(ssh_message msg);
+
+LIBSSH_API int ssh_channel_open_reverse_forward(ssh_channel channel, const char *remotehost,
+ int remoteport, const char *sourcehost, int localport);
+
/* deprecated functions */
SSH_DEPRECATED LIBSSH_API int ssh_accept(ssh_session session);