41 lines
1.6 KiB
C
41 lines
1.6 KiB
C
#ifndef BONGO_SASL_H
|
|
#define BONGO_SASL_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct BongoSaslSession BongoSaslSession;
|
|
typedef int (*BongoSaslVerify)(void *context, const char *user,
|
|
const char *password, size_t password_length);
|
|
|
|
int BongoSaslInitialize(void);
|
|
void BongoSaslShutdown(void);
|
|
int BongoSaslSessionCreate(BongoSaslSession **session, const char *service,
|
|
const char *hostname, const char *local_address,
|
|
const char *remote_address, int tls_active,
|
|
BongoSaslVerify verify, void *context);
|
|
void BongoSaslSessionDestroy(BongoSaslSession **session);
|
|
int BongoSaslMechanisms(BongoSaslSession *session, const char **mechanisms);
|
|
int BongoSaslStart(BongoSaslSession *session, const char *mechanism,
|
|
const void *input, size_t input_length,
|
|
const void **output, size_t *output_length);
|
|
int BongoSaslStep(BongoSaslSession *session, const void *input,
|
|
size_t input_length, const void **output,
|
|
size_t *output_length);
|
|
const char *BongoSaslUsername(BongoSaslSession *session);
|
|
int BongoSaslDecode64(const char *input, size_t input_length, void *output,
|
|
size_t output_capacity, size_t *output_length);
|
|
int BongoSaslEncode64(const void *input, size_t input_length, char *output,
|
|
size_t output_capacity, size_t *output_length);
|
|
|
|
enum { BONGO_SASL_FAIL = -1, BONGO_SASL_COMPLETE = 0,
|
|
BONGO_SASL_CONTINUE = 1 };
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|