Ne7sshError Class Reference

#include <ne7ssh_error.h>

Collaboration diagram for Ne7sshError:

Collaboration graph
[legend]

List of all members.

Classes

struct  Error

Public Member Functions

 Ne7sshError ()
 ~Ne7sshError ()
bool push (int32 channel, const char *format,...)
const char * pop ()
const char * pop (int32 channel)
bool deleteCoreMsgs ()
bool deleteChannel (int32 channel)

Private Member Functions

bool deleteRecord (uint16 recID)

Static Private Member Functions

static bool lock ()
static bool unlock ()

Private Attributes

uint16 memberCount
char popedErr [MAX_ERROR_LEN+1]
struct Ne7sshError::Error ** ErrorBuffer

Static Private Attributes

static Ne7ssh_Mutex mut


Detailed Description

Author:
Andrew Useckas <andrew@netsieben.com>

Constructor & Destructor Documentation

Ne7sshError::Ne7sshError (  ) 

Ne7sshError constructor.

Ne7sshError::~Ne7sshError (  ) 

Ne7sshError destructor.

References ErrorBuffer.


Member Function Documentation

bool Ne7sshError::deleteChannel ( int32  channel  ) 

Removes all error messages within Channel context from the stack.

Parameters:
channel Specifies the channel error message was bound to. This is ne7ssh library channel, not the receive or send channels used by the transport layer.
Returns:
True on succes, false on failure.

References ErrorBuffer, lock(), and unlock().

Referenced by ne7ssh::close(), and deleteCoreMsgs().

bool Ne7sshError::deleteCoreMsgs (  ) 

Removes all error messages within Core context from the stack.

Returns:
True on success, false on failure.

References deleteChannel().

bool Ne7sshError::deleteRecord ( uint16  recID  )  [private]

Delete a single error message.

Parameters:
recID Position within the array.
Returns:
True on success, false on failure.

References ErrorBuffer.

Referenced by pop().

bool Ne7sshError::lock (  )  [static, private]

Lock the mutex.

Returns:
True if lock aquired. Oterwise false.

FIXME possible infinite loop

References ne7ssh::errors(), and push().

Referenced by deleteChannel(), pop(), and push().

const char * Ne7sshError::pop ( int32  channel  ) 

Pops an error message from the Channel context.

Parameters:
channel Specifies the channel error message was bound to. This is ne7ssh library channel, not the receive or send channels used by the transport layer.
Returns:
The last error message in the Channel context. The message is removed from the stack. Returns null if no there are no erros in the Channel context.

References deleteRecord(), ErrorBuffer, lock(), and unlock().

const char * Ne7sshError::pop (  ) 

Pops an error message from the Core context.

Returns:
The last error message in the Core context. The message is removed from the stack.

bool Ne7sshError::push ( int32  channel,
const char *  format,
  ... 
)

Pushes a new error message into the stack.

Parameters:
channel Specifies the channel to bind the error message to. This is ne7ssh library channel, not the receive or send channels used by the transport layer.
format Specifies the error message followed by argument in printf format. The following formatting characters are supported: s,d,i,l,x. Modifier u can be used together with decimal to specify an unsigned variable. Returns null if no there are no erros in the Core context.
Returns:
True on success, false on failure.

References ErrorBuffer, lock(), and unlock().

Referenced by ne7ssh_string::addFile(), ne7ssh_connection::authWithKey(), ne7ssh_connection::authWithPassword(), Ne7sshSftp::cd(), ne7ssh_connection::checkRemoteVersion(), Ne7sshSftp::chmod(), Ne7sshSftp::chown(), ne7ssh::close(), Ne7sshSftp::closeFile(), ne7ssh_crypt::compute_key(), ne7ssh_crypt::computeH(), ne7ssh::connectWithKey(), ne7ssh::connectWithPassword(), Ne7SftpSubsystem::errorNotInited(), ne7ssh_transport::establish(), ne7ssh_channel::execCmd(), ne7ssh_keys::generateDSAKeys(), ne7ssh_keys::generateDSASignature(), ne7ssh::generateKeyPair(), ne7ssh_keys::generateRSAKeys(), ne7ssh_keys::generateRSASignature(), Ne7sshSftp::get(), ne7ssh::getChannelNo(), ne7ssh_crypt::getCryptAlgo(), ne7ssh_keys::getDSAKeys(), Ne7sshSftp::getFileAttrs(), Ne7sshSftp::getFileHandle(), Ne7sshSftp::getFileSize(), Ne7sshSftp::getFileStats(), Ne7sshSftp::getFStat(), ne7ssh_crypt::getHashAlgo(), ne7ssh_crypt::getHmacAlgo(), ne7ssh_crypt::getKexPublic(), ne7ssh_keys::getKeyPairFromFile(), ne7ssh_crypt::getMacKeyLen(), ne7ssh_keys::getRSAKeys(), Ne7sshSftp::handleData(), ne7ssh_channel::handleData(), ne7ssh_channel::handleDisconnect(), ne7ssh_channel::handleEof(), ne7ssh_channel::handleExtendedData(), ne7ssh_kex::handleInit(), ne7ssh_channel::handleReceived(), ne7ssh_channel::handleRequest(), Ne7sshSftp::handleSftpData(), Ne7sshSftp::handleStatus(), Ne7sshSftp::handleVersion(), ne7ssh::initSftp(), Ne7sshSftp::isType(), lock(), ne7ssh::lock(), Ne7sshSftp::ls(), Ne7sshSftp::mkdir(), Ne7sshSftp::mv(), ne7ssh::ne7ssh(), ne7ssh_crypt::negotiatedCmprsC2s(), ne7ssh_crypt::negotiatedCmprsS2c(), ne7ssh_crypt::negotiatedCryptoC2s(), ne7ssh_crypt::negotiatedCryptoS2c(), ne7ssh_crypt::negotiatedHostkey(), ne7ssh_crypt::negotiatedKex(), ne7ssh_crypt::negotiatedMacC2s(), ne7ssh_crypt::negotiatedMacS2c(), ne7ssh_transport::NoBlock(), ne7ssh_channel::open(), Ne7sshSftp::openDir(), Ne7sshSftp::openFile(), Ne7sshSftp::put(), ne7ssh::read(), ne7ssh::readBinary(), Ne7sshSftp::readFile(), ne7ssh_transport::receive(), Ne7sshSftp::receiveWindowAdjust(), ne7ssh_connection::requestService(), Ne7sshSftp::rm(), Ne7sshSftp::rmdir(), ne7ssh::selectThread(), ne7ssh_transport::send(), ne7ssh::send(), ne7ssh::sendCmd(), ne7ssh_kex::sendInit(), ne7ssh_kex::sendKexDHInit(), ne7ssh_kex::sendKexNewKeys(), ne7ssh_transport::sendPacket(), ne7ssh_connection::startSftp(), unlock(), ne7ssh::unlock(), ne7ssh_crypt::verifySig(), ne7ssh::waitFor(), ne7ssh_transport::waitForPacket(), and Ne7sshSftp::writeFile().

bool Ne7sshError::unlock (  )  [static, private]

Unlock the mutext.

Returns:
True if the mutext successfully unlocked. Otherwise false.

References ne7ssh::errors(), and push().

Referenced by deleteChannel(), pop(), and push().


Member Data Documentation

Structure for storing error messages.

Referenced by deleteChannel(), deleteRecord(), pop(), push(), and ~Ne7sshError().


The documentation for this class was generated from the following files:

Generated on Tue May 5 14:10:43 2009 for ne7ssh.kdevelop by  doxygen 1.5.9