libssh  0.7
Functions
The SSH message functions

This file contains the message parsing utilities for client and server programs using libssh. More...

Functions

void ssh_message_free (ssh_message msg)
 Free a SSH message. More...
 
ssh_message ssh_message_get (ssh_session session)
 Retrieve a SSH message from a SSH session. More...
 
int ssh_message_subtype (ssh_message msg)
 Get the subtype of the message. More...
 
int ssh_message_type (ssh_message msg)
 Get the type of the message. More...
 

Detailed Description

This file contains the message parsing utilities for client and server programs using libssh.

On the server the the main loop of the program will call ssh_message_get(session) to get messages as they come. They are not 1-1 with the protocol messages. Then, the user will know what kind of a message it is and use the appropriate functions to handle it (or use the default handlers if you don't know what to do).

Function Documentation

void ssh_message_free ( ssh_message  msg)

Free a SSH message.

Parameters
[in]msgThe message to release the memory.

References ssh_key_free().

Referenced by ssh_disconnect(), and ssh_free().

ssh_message ssh_message_get ( ssh_session  session)

Retrieve a SSH message from a SSH session.

Parameters
[in]sessionThe SSH session to get the message.
Returns
The SSH message received, NULL in case of error, or timeout elapsed.
Warning
This function blocks until a message has been received. Betterset up a callback if this behavior is unwanted.
int ssh_message_subtype ( ssh_message  msg)

Get the subtype of the message.

Parameters
[in]msgThe message to get the subtype from.
Returns
The message type or -1 on error.
int ssh_message_type ( ssh_message  msg)

Get the type of the message.

Parameters
[in]msgThe message to get the type from.
Returns
The message type or -1 on error.