libssh  0.7.3
Functions
The SSH buffer functions.

Functions to handle SSH buffers. More...

Collaboration diagram for The SSH buffer functions.:

Functions

void ssh_buffer_free (struct ssh_buffer_struct *buffer)
 Deallocate a SSH buffer. More...
 
void * ssh_buffer_get_begin (struct ssh_buffer_struct *buffer)
 Get a pointer on the head of a buffer. More...
 
uint32_t ssh_buffer_get_len (struct ssh_buffer_struct *buffer)
 Get the length of the buffer, not counting position. More...
 
struct ssh_buffer_struct * ssh_buffer_new (void)
 Create a new SSH buffer. More...
 
void ssh_buffer_set_secure (ssh_buffer buffer)
 Sets the buffer as secure. More...
 

Detailed Description

Functions to handle SSH buffers.

Function Documentation

void ssh_buffer_free ( struct ssh_buffer_struct *  buffer)
void* ssh_buffer_get_begin ( struct ssh_buffer_struct *  buffer)

Get a pointer on the head of a buffer.

Parameters
[in]bufferThe 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()

Referenced by ssh_gssapi_get_creds(), and ssh_pki_export_pubkey_base64().

uint32_t ssh_buffer_get_len ( struct ssh_buffer_struct *  buffer)

Get the length of the buffer, not counting position.

Parameters
[in]bufferThe buffer to get the length from.
Returns
The length of the buffer.
See also
buffer_get()

References ssh_string_data(), and ssh_string_new().

Referenced by ssh_gssapi_get_creds(), and ssh_pki_export_pubkey_base64().

struct ssh_buffer_struct* ssh_buffer_new ( void  )
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
[in]bufferbuffer to set secure.

References ssh_string_len().

Referenced by ssh_pki_export_pubkey_base64().