libssh_buffer(3)

NAME
libssh_buffer - Functions to handle SSH buffers.

SYNOPSIS

  Functions
void ssh_buffer_free (struct ssh_buffer_struct *buffer)
Deallocate a SSH buffer.
void * ssh_buffer_get_begin (struct ssh_buffer_struct *buffer)
Get a pointer on the head of a buffer.
uint32_t ssh_buffer_get_len (struct ssh_buffer_struct *buffer)
Get the length of the buffer, not counting position.
struct ssh_buffer_struct * ssh_buffer_new (void)
Create a new SSH buffer.
void ssh_buffer_set_secure (ssh_buffer buffer)
Sets the buffer as secure.
int ssh_buffer_validate_length (struct ssh_buffer_struct *buffer, size_t len)
Valdiates that the given length can be obtained from the buffer.

Detailed Description

Functions to handle SSH buffers.

Function Documentation

  void ssh_buffer_free (struct ssh_buffer_struct * buffer)

Deallocate a SSH buffer.

Parameters:
    buffer The buffer to free.

Referenced by sftp_async_read_begin(), sftp_canonicalize_path(), sftp_closedir(), sftp_fstatvfs(), sftp_get_error(), sftp_mkdir(), sftp_open(), sftp_opendir(), sftp_read(), sftp_readlink(), sftp_rename(), sftp_rmdir(), sftp_setstat(), sftp_statvfs(), sftp_symlink(), sftp_unlink(), sftp_write(), and ssh_channel_new().

  void* ssh_buffer_get_begin (struct ssh_buffer_struct * buffer)

Get a pointer on the head of a buffer.

Parameters:
    buffer The buffer to get the head pointer.

Returns:
    A data pointer on the head. It doesn't take the position into account.

Warning:
    Don't expect data to be nul-terminated.

See also:
    buffer_get_rest()

    buffer_get_len()

  uint32_t ssh_buffer_get_len (struct ssh_buffer_struct * buffer)

Get the length of the buffer, not counting position.

Parameters:
    buffer The buffer to get the length from.

Returns:
    The length of the buffer.

See also:
    buffer_get()

  struct ssh_buffer_struct* ssh_buffer_new (void)

Create a new SSH buffer.

Returns:
    A newly initialized SSH buffer, NULL on error.

Referenced by sftp_async_read_begin(), sftp_attributes_free(), sftp_canonicalize_path(), sftp_fstat(), sftp_fstatvfs(), sftp_get_error(), sftp_init(), sftp_mkdir(), sftp_open(), sftp_opendir(), sftp_read(), sftp_readdir(), sftp_readlink(), sftp_rename(), sftp_rmdir(), sftp_setstat(), sftp_statvfs(), sftp_symlink(), sftp_unlink(), sftp_write(), ssh_channel_cancel_forward(), ssh_channel_change_pty_size(), ssh_channel_listen_forward(), ssh_channel_new(), ssh_channel_open_forward(), ssh_channel_open_reverse_forward(), ssh_channel_open_x11(), ssh_channel_request_env(), ssh_channel_request_exec(), ssh_channel_request_pty_size(), ssh_channel_request_send_exit_signal(), ssh_channel_request_send_exit_status(), ssh_channel_request_send_signal(), ssh_channel_request_subsystem(), ssh_channel_request_x11(), and ssh_new().

  void ssh_buffer_set_secure (ssh_buffer buffer)

Sets the buffer as secure. A secure buffer will never leave cleartext data in the heap after being reallocated or freed.

Parameters:
    buffer buffer to set secure.

  int ssh_buffer_validate_length (struct ssh_buffer_struct * buffer, size_t len)

Valdiates that the given length can be obtained from the buffer.

Parameters:
    buffer The buffer to read from.
    len The length to be checked.

Returns:
    SSH_OK if the length is valid, SSH_ERROR otherwise.

Author

Generated automatically by Doxygen for libssh from the source code.