src/socks_parser.h File Reference

Typedefs

typedef struct sxp_transaction_tag sxp_transaction_s
typedef enum sxp_feed_result_tag sxp_feed_result_e

Enumerations

enum  sxp_feed_result_tag {
  SXP_FEED_OKAY = 0, SXP_FEED_CORRUPT, SXP_FEED_NEED_MORE, SXP_FEED_ERROR,
  SXP_FEED_DONE
}

Functions

sxp_transaction_ssxp_transaction_new (void)
 Create a new blank SOCKS transaction, ready for parsing.
void sxp_transaction_free (sxp_transaction_s *transaction)
 Free a transaction allocated with sxp_transaction_new().
sxp_feed_result_e sxp_feed (sxp_transaction_s *transaction, const unsigned char *data, const size_t dataLen, size_t *ate)
bool sxp_has_identify (sxp_transaction_s *transaction)
 Return whether or not we have parsed the "identify" message.
bool sxp_has_request (sxp_transaction_s *transaction)
 Return whether or not we have parsed the "request" message.
const char * sxp_get_error (sxp_transaction_s *transaction)
 Get a description of an error that this transaction had.

Typedef Documentation


Enumeration Type Documentation

Enumerator:
SXP_FEED_OKAY 
SXP_FEED_CORRUPT 
SXP_FEED_NEED_MORE 
SXP_FEED_ERROR 
SXP_FEED_DONE 

Function Documentation

sxp_feed_result_e sxp_feed ( sxp_transaction_s transaction,
const unsigned char *  data,
const size_t  dataLen,
size_t *  ate 
)
const char* sxp_get_error ( sxp_transaction_s transaction  ) 

Get a description of an error that this transaction had.

Parameters:
transaction The transaction to return the error from.
Returns:
A string literal of the error. If there is no error descriptio NULL is returned
bool sxp_has_identify ( sxp_transaction_s transaction  ) 

Return whether or not we have parsed the "identify" message.

Parameters:
transaction The transaction to inspect.
Returns:
true if it's being parsed (and can be accessed). Otherwise, false is returned.
bool sxp_has_request ( sxp_transaction_s transaction  ) 

Return whether or not we have parsed the "request" message.

Parameters:
transaction The transaction to inspect.
Returns:
true if it's being parsed (and can be accessed). Otherwise, false is returned.
void sxp_transaction_free ( sxp_transaction_s transaction  ) 

Free a transaction allocated with sxp_transaction_new().

See also:
sxp_transaction_new()
sxp_transaction_s* sxp_transaction_new ( void   ) 

Create a new blank SOCKS transaction, ready for parsing.

See also:
sxp_transaction_free()
Returns:
A blank transaction on success. On error, NULL is returned.

Generated by  doxygen 1.6.2