aboutsummaryrefslogtreecommitdiff
path: root/src/channels1.c
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2015-09-17 09:43:33 +0200
committerFabiano FidĂȘncio <fidencio@redhat.com>2016-01-19 11:31:07 +0100
commitadc8c20ac17b39e32e6ac9e8913ebeeb1c5b8081 (patch)
tree1bcd7318e12a316d4908b7eee4914bad7e2db80b /src/channels1.c
parent63e52afd5b9a378918ea3591e2da8fe78c201407 (diff)
downloadlibssh-adc8c20ac17b39e32e6ac9e8913ebeeb1c5b8081.tar.gz
libssh-adc8c20ac17b39e32e6ac9e8913ebeeb1c5b8081.tar.xz
libssh-adc8c20ac17b39e32e6ac9e8913ebeeb1c5b8081.zip
cleanup: use ssh_ prefix in the buffer (non-static) functions
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/channels1.c')
-rw-r--r--src/channels1.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/channels1.c b/src/channels1.c
index 4b7d2687..c3e7b92d 100644
--- a/src/channels1.c
+++ b/src/channels1.c
@@ -112,18 +112,18 @@ int channel_request_pty_size1(ssh_channel channel, const char *terminal, int col
return -1;
}
- if (buffer_add_u8(session->out_buffer, SSH_CMSG_REQUEST_PTY) < 0 ||
- buffer_add_ssh_string(session->out_buffer, str) < 0) {
+ if (ssh_buffer_add_u8(session->out_buffer, SSH_CMSG_REQUEST_PTY) < 0 ||
+ ssh_buffer_add_ssh_string(session->out_buffer, str) < 0) {
ssh_string_free(str);
return -1;
}
ssh_string_free(str);
- if (buffer_add_u32(session->out_buffer, ntohl(row)) < 0 ||
- buffer_add_u32(session->out_buffer, ntohl(col)) < 0 ||
- buffer_add_u32(session->out_buffer, 0) < 0 || /* x */
- buffer_add_u32(session->out_buffer, 0) < 0 || /* y */
- buffer_add_u8(session->out_buffer, 0) < 0) { /* tty things */
+ if (ssh_buffer_add_u32(session->out_buffer, ntohl(row)) < 0 ||
+ ssh_buffer_add_u32(session->out_buffer, ntohl(col)) < 0 ||
+ ssh_buffer_add_u32(session->out_buffer, 0) < 0 || /* x */
+ ssh_buffer_add_u32(session->out_buffer, 0) < 0 || /* y */
+ ssh_buffer_add_u8(session->out_buffer, 0) < 0) { /* tty things */
return -1;
}
@@ -170,11 +170,11 @@ int channel_change_pty_size1(ssh_channel channel, int cols, int rows) {
ssh_set_error(session,SSH_REQUEST_DENIED,"Wrong request state");
return SSH_ERROR;
}
- if (buffer_add_u8(session->out_buffer, SSH_CMSG_WINDOW_SIZE) < 0 ||
- buffer_add_u32(session->out_buffer, ntohl(rows)) < 0 ||
- buffer_add_u32(session->out_buffer, ntohl(cols)) < 0 ||
- buffer_add_u32(session->out_buffer, 0) < 0 ||
- buffer_add_u32(session->out_buffer, 0) < 0) {
+ if (ssh_buffer_add_u8(session->out_buffer, SSH_CMSG_WINDOW_SIZE) < 0 ||
+ ssh_buffer_add_u32(session->out_buffer, ntohl(rows)) < 0 ||
+ ssh_buffer_add_u32(session->out_buffer, ntohl(cols)) < 0 ||
+ ssh_buffer_add_u32(session->out_buffer, 0) < 0 ||
+ ssh_buffer_add_u32(session->out_buffer, 0) < 0) {
return SSH_ERROR;
}
channel->request_state=SSH_CHANNEL_REQ_STATE_PENDING;
@@ -215,7 +215,7 @@ int channel_request_shell1(ssh_channel channel) {
}
session = channel->session;
- if (buffer_add_u8(session->out_buffer,SSH_CMSG_EXEC_SHELL) < 0) {
+ if (ssh_buffer_add_u8(session->out_buffer,SSH_CMSG_EXEC_SHELL) < 0) {
return -1;
}
@@ -242,8 +242,8 @@ int channel_request_exec1(ssh_channel channel, const char *cmd) {
return -1;
}
- if (buffer_add_u8(session->out_buffer, SSH_CMSG_EXEC_CMD) < 0 ||
- buffer_add_ssh_string(session->out_buffer, command) < 0) {
+ if (ssh_buffer_add_u8(session->out_buffer, SSH_CMSG_EXEC_CMD) < 0 ||
+ ssh_buffer_add_ssh_string(session->out_buffer, command) < 0) {
ssh_string_free(command);
return -1;
}
@@ -268,7 +268,7 @@ SSH_PACKET_CALLBACK(ssh_packet_data1){
return SSH_PACKET_NOT_USED;
}
- str = buffer_get_ssh_string(packet);
+ str = ssh_buffer_get_ssh_string(packet);
if (str == NULL) {
SSH_LOG(SSH_LOG_FUNCTIONS, "Invalid data packet !\n");
return SSH_PACKET_USED;
@@ -300,7 +300,7 @@ SSH_PACKET_CALLBACK(ssh_packet_close1){
return SSH_PACKET_NOT_USED;
}
- buffer_get_u32(packet, &status);
+ ssh_buffer_get_u32(packet, &status);
/*
* It's much more than a channel closing. spec says it's the last
* message sent by server (strange)
@@ -310,7 +310,7 @@ SSH_PACKET_CALLBACK(ssh_packet_close1){
channel->state = SSH_CHANNEL_STATE_CLOSED;
channel->remote_eof = 1;
- rc = buffer_add_u8(session->out_buffer, SSH_CMSG_EXIT_CONFIRMATION);
+ rc = ssh_buffer_add_u8(session->out_buffer, SSH_CMSG_EXIT_CONFIRMATION);
if (rc < 0) {
return SSH_PACKET_NOT_USED;
}
@@ -329,7 +329,7 @@ SSH_PACKET_CALLBACK(ssh_packet_exist_status1){
return SSH_PACKET_NOT_USED;
}
- buffer_get_u32(packet, &status);
+ ssh_buffer_get_u32(packet, &status);
channel->state = SSH_CHANNEL_STATE_CLOSED;
channel->remote_eof = 1;
channel->exit_status = ntohl(status);
@@ -350,13 +350,13 @@ int channel_write1(ssh_channel channel, const void *data, int len) {
session = channel->session;
while (len > 0) {
- if (buffer_add_u8(session->out_buffer, SSH_CMSG_STDIN_DATA) < 0) {
+ if (ssh_buffer_add_u8(session->out_buffer, SSH_CMSG_STDIN_DATA) < 0) {
return -1;
}
effectivelen = len > 32000 ? 32000 : len;
- if (buffer_add_u32(session->out_buffer, htonl(effectivelen)) < 0 ||
+ if (ssh_buffer_add_u32(session->out_buffer, htonl(effectivelen)) < 0 ||
ssh_buffer_add_data(session->out_buffer, ptr, effectivelen) < 0) {
return -1;
}