00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GSASL_MECH_H
00024 # define GSASL_MECH_H
00025
00026
00027 typedef int (*Gsasl_init_function) (Gsasl * ctx);
00028 typedef void (*Gsasl_done_function) (Gsasl * ctx);
00029 typedef int (*Gsasl_start_function) (Gsasl_session * sctx, void **mech_data);
00030 typedef int (*Gsasl_step_function) (Gsasl_session * sctx, void *mech_data,
00031 const char *input, size_t input_len,
00032 char **output, size_t * output_len);
00033 typedef void (*Gsasl_finish_function) (Gsasl_session * sctx, void *mech_data);
00034 typedef int (*Gsasl_code_function) (Gsasl_session * sctx, void *mech_data,
00035 const char *input, size_t input_len,
00036 char **output, size_t * output_len);
00037
00038
00039 struct Gsasl_mechanism_functions
00040 {
00041 Gsasl_init_function init;
00042 Gsasl_done_function done;
00043 Gsasl_start_function start;
00044 Gsasl_step_function step;
00045 Gsasl_finish_function finish;
00046 Gsasl_code_function encode;
00047 Gsasl_code_function decode;
00048 };
00049 typedef struct Gsasl_mechanism_functions Gsasl_mechanism_functions;
00050
00051
00052 struct Gsasl_mechanism
00053 {
00054 const char *name;
00055
00056 struct Gsasl_mechanism_functions client;
00057 struct Gsasl_mechanism_functions server;
00058 };
00059 typedef struct Gsasl_mechanism Gsasl_mechanism;
00060
00061
00062 extern int gsasl_register (Gsasl * ctx, const Gsasl_mechanism * mech);
00063
00064 #endif